Skip to content

Commit

Permalink
new chemicals to test renames with no chembi, already set
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlongden committed Nov 1, 2024
1 parent 6098d09 commit 0385626
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Load/chemical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
1 change: 0 additions & 1 deletion data/cv_cvterm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
1 change: 1 addition & 0 deletions data/db_dbxref.yaml
Original file line number Diff line number Diff line change
@@ -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']
Expand Down

0 comments on commit 0385626

Please sign in to comment.