Skip to content

Commit

Permalink
WIP #50
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed May 13, 2024
1 parent 65657f9 commit e0749b4
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 2 deletions.
99 changes: 99 additions & 0 deletions update/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,51 @@
"output_file": "structures_ids_csd.csv",
},
),
Task(
name="structures_ids_drugbank",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_drugbank.rq",
"output_file": "structures_ids_drugbank.csv",
},
),
Task(
name="structures_ids_dsstox_compound",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_dsstox_compound.rq",
"output_file": "structures_ids_dsstox_compound.csv",
},
),
Task(
name="structures_ids_dsstox_substance",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_dsstox_substance.rq",
"output_file": "structures_ids_dsstox_substance.csv",
},
),
Task(
name="structures_ids_ec",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_ec.rq",
"output_file": "structures_ids_ec.csv",
},
),
Task(
name="structures_ids_echa",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_echa.rq",
"output_file": "structures_ids_echa.csv",
},
),
Task(
name="structures_ids_hmdb",
f=download_query_as_csv.run,
Expand Down Expand Up @@ -164,6 +209,15 @@
"output_file": "structures_ids_knapsack.csv",
},
),
Task(
name="structures_ids_lipidmaps",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_lipidmaps.rq",
"output_file": "structures_ids_lipidmaps.csv",
},
),
Task(
name="structures_ids_massbank",
f=download_query_as_csv.run,
Expand Down Expand Up @@ -191,6 +245,15 @@
"output_file": "structures_ids_npatlas.csv",
},
),
Task(
name="structures_ids_nsc",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_nsc.rq",
"output_file": "structures_ids_nsc.csv",
},
),
Task(
name="structures_ids_pdb_ligand",
f=download_query_as_csv.run,
Expand All @@ -209,6 +272,15 @@
"output_file": "structures_ids_pdb_structure.csv",
},
),
Task(
name="structures_ids_probes_and_drugs",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_probes_and_drugs.rq",
"output_file": "structures_ids_probes_and_drugs.csv",
},
),
Task(
name="structures_ids_pubchem",
f=download_query_as_csv.run,
Expand Down Expand Up @@ -236,6 +308,33 @@
"output_file": "structures_ids_surechembl.csv",
},
),
Task(
name="structures_ids_swisslipids",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_swisslipids.rq",
"output_file": "structures_ids_swisslipids.csv",
},
),
Task(
name="structures_ids_unichem",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_unichem.rq",
"output_file": "structures_ids_unichem.csv",
},
),
Task(
name="structures_ids_unii",
f=download_query_as_csv.run,
group=DownloadGroup,
params={
"query_file": "update/queries/structures_ids_unii.rq",
"output_file": "structures_ids_unii.csv",
},
),
Task(
name="structures_ids_zinc",
f=download_query_as_csv.run,
Expand Down
2 changes: 1 addition & 1 deletion update/queries/structures_ids_cas.rq
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_cas WHERE {
?structure wdt:P231 ?structure_id_cas. hint:Prior hint:rangeSafe TRUE. # int
?structure wdt:P231 ?structure_id_cas. hint:Prior hint:rangeSafe TRUE. # str
}
# LIMIT 2000000
6 changes: 6 additions & 0 deletions update/queries/structures_ids_drugbank.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_drugbank WHERE {
?structure wdt:P715 ?structure_id_drugbank. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_dsstox_compound.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_dsstox_compound WHERE {
?structure wdt:P8494 ?structure_id_dsstox_compound. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_dsstox_substance.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_dsstox_substance WHERE {
?structure wdt:P231 ?structure_id_dsstox_substance. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_ec.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_ec WHERE {
?structure wdt:P232 ?structure_id_ec. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_echa.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_echa WHERE {
?structure wdt:P2566 ?structure_id_echa. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_lipidmaps.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_lipidmaps WHERE {
?structure wdt:P2063 ?structure_id_lipidmaps. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_nsc.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_nsc WHERE {
?structure wdt:P2840 ?structure_id_nsc. hint:Prior hint:rangeSafe TRUE. # int
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_probes_and_drugs.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_probes_and_drugs WHERE {
?structure wdt:P11199 ?structure_id_probes_and_drugs. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_swisslipids.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_swisslipids WHERE {
?structure wdt:P8691 ?structure_id_swisslipids. hint:Prior hint:rangeSafe TRUE. # str
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_unichem.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_unichem WHERE {
?structure wdt:P11089 ?structure_id_unichem. hint:Prior hint:rangeSafe TRUE. # int
}
6 changes: 6 additions & 0 deletions update/queries/structures_ids_unii.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?structure ?structure_id_unii WHERE {
?structure wdt:P652 ?structure_id_unii. hint:Prior hint:rangeSafe TRUE. # str
}
13 changes: 12 additions & 1 deletion update/queries/urls_formatters.rq
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ SELECT * WHERE {
# All properties we use with a formatter URL
VALUES ?property {
wd:P231 # STRUCTURE CAS
wd:P232 # STRUCTURE EC number
wd:P233 # STRUCTURE SMILES (canonical)
wd:P234 # STRUCTURE InChI
wd:P235 # STRUCTURE InChIKey
wd:P356 # REFERENCE DOI
wd:P592 # STRUCTURE ChEMBL
wd:P638 # STRUCTURE PDB structure
wd:P652 # STRUCTURE UNII
wd:P661 # STRUCTURE ChemSpider
wd:P662 # STRUCTURE PubChem CID
wd:P683 # STRUCTURE ChEBI
wd:P665 # STRUCTURE KEGG
wd:P683 # STRUCTURE ChEBI
wd:P685 # TAXON NCBI
wd:P715 # STRUCTURE DrugBank
wd:P815 # TAXON ITIS
wd:P830 # TAXON EOL
wd:P846 # TAXON GBIF
Expand All @@ -25,9 +28,13 @@ SELECT * WHERE {
wd:P961 # TAXON IPNI
wd:P2017 # STRUCTURE SMILES (isomeric)
wd:P2057 # STRUCTURE HMDB
wd:P2063 # STRUCTURE LIPID MAPS
wd:P2064 # STRUCTURE KNApSAcK
wd:P2084 # STRUCTURE ZINC
wd:P2566 # STRUCTURE ECHA
wd:P2840 # STRUCTURE NSC
wd:P2877 # STRUCTURE SureChEMBL
wd:P3117 # STRUCTURE DSSTox substance
wd:P3151 # TAXON iNat
wd:P3636 # STRUCTURE PDB ligand
wd:P4964 # STRUCTURE SPLASH
Expand All @@ -36,10 +43,14 @@ SELECT * WHERE {
wd:P6689 # STRUCTURE MassBank
wd:P7715 # TAXON WFO
wd:P7746 # STRUCTURE NPAtlas
wd:P8494 # STRUCTURE DSSTox compound
wd:P8533 # STRUCTURE SMARTS
wd:P8691 # STRUCTURE SwissLipids
wd:P9157 # TAXON OTL
wd:P9405 # STRUCTURE NMRShiftDB
wd:P10718 # STRUCTURE CXSMILES
wd:P11089 # STRUCTURE UniChem
wd:P11199 # STRUCTURE Probes And Drugs
wd:P11375 # STRUCTURE CSD
}
?property wdt:P1630 ?formatter. hint:Prior hint:rangeSafe TRUE.
Expand Down

0 comments on commit e0749b4

Please sign in to comment.