From 0385626fd9ce1014ad35b7e16973b55d1f484378 Mon Sep 17 00:00:00 2001 From: ianlongden Date: Fri, 1 Nov 2024 12:10:11 -0400 Subject: [PATCH] new chemicals to test renames with no chembi, already set --- Load/chemical.py | 25 +++++++++++++++++++++++++ data/cv_cvterm.yaml | 1 - data/db_dbxref.yaml | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Load/chemical.py b/Load/chemical.py index 3da46ad..0c6ced1 100644 --- a/Load/chemical.py +++ b/Load/chemical.py @@ -203,3 +203,28 @@ def add_chemical_data(cursor, cvterm_id, organism_id, dbxref_id, pub_id, db_id, cursor.execute(dbxref_sql, (db_id['CHEBI'], chem[2])) dbxref_id = cursor.fetchone()[0] cursor.execute(f_dbx, (chem_id, dbxref_id)) + + # create pubchem only chemicals for renaming tests + chems = (['p-carbon dioxide', '116526'], + ['p-hydrogen peroxide', '116240']) + obsolete = False + for chem in chems: + cursor.execute(dbxref_sql, (db_id['FlyBase'], f"FBch00{chem[1]}")) + dbxref_id = cursor.fetchone()[0] + cursor.execute(chemical_sql, (chem[0], 'FBch0{}'.format(chem[1]), + organism_id['Dmel'], cvterm_id['chemical entity'], dbxref_id, obsolete)) + chem_id = cursor.fetchone()[0] + + cursor.execute(syn_sql, ("PUBCHEM:{}".format(chem[1]), cvterm_id['symbol'], "PUBCHEM:{}".format(chem[1]))) + syn_id = cursor.fetchone()[0] + cursor.execute(fs_sql, (syn_id, chem_id, pub_id, True)) + + cursor.execute(syn_sql, ("PUBCHEM:{}".format(chem[1]), cvterm_id['fullname'], "PUBCHEM:{}".format(chem[1]))) + syn_id = cursor.fetchone()[0] + cursor.execute(fs_sql, (syn_id, chem_id, pub_id, True)) + + cursor.execute(dbxref_sql, (db_id['PubChem'], chem[1])) + dbxref_id = cursor.fetchone()[0] + # Add feature_dbxref. + cursor.execute(f_dbx, (chem_id, dbxref_id)) + cursor.execute(feat_pub_sql, (chem_id, pubchem_pub_id)) diff --git a/data/cv_cvterm.yaml b/data/cv_cvterm.yaml index d916024..b624de0 100644 --- a/data/cv_cvterm.yaml +++ b/data/cv_cvterm.yaml @@ -13,7 +13,6 @@ cell_lineprop type: ['internalnotes', 'lab_of_origin', 'comment', 'source_genoty 'source_strain', 'source_cross', 'karyotype'] cell_line_libraryprop type: ['member_of_reagent_collection', 'experimental_attribute'] cell_line_relationship: ['targeted_mutant_from'] -CHEBI: [] DOID: [] disease_ontology: ['hh-1'] diff --git a/data/db_dbxref.yaml b/data/db_dbxref.yaml index 9b9f419..cbe571d 100644 --- a/data/db_dbxref.yaml +++ b/data/db_dbxref.yaml @@ -1,5 +1,6 @@ testdb: ['hh-1'] testdb2: [] +CHEBI: [] EMBL-EBI Single Cell Expression Atlas Datasets: [] FBbt: ['dissociated larval fat cell', 'CP1 lineage neuron', 'eye'] FBcv: ['maternal effect', 'eye', 'visible']