Skip to content

Commit 1b5bdd3

Browse files
2 parents 776165c + 2a31ccc commit 1b5bdd3

38 files changed

+12036
-97151
lines changed

.gitignore

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@
22
.DS_Store
33
*.lock
44
*.log
5-
linkedSPLs/LinkedSPLs-activeMoiety/activeMoietySub-in-rdf.xml
5+
6+
linkedSPLs/LinkedSPLs-activeMoiety/mergedActiveMoiety.csv
7+
linkedSPLs/LinkedSPLs-clinicalDrug/mergedClinicalDrug.tsv
8+
linkedSPLs/LinkedSPLs-activeMoiety/activeMoietySub-in-rdf.xml
9+
linkedSPLs/LinkedSPLs-clinicalDrug/clinicalDrugSub-in-rdf.xml
10+
11+
linkedSPLs/LinkedSPLs-activeMoiety/mappings/
12+
linkedSPLs/LinkedSPLs-clinicalDrug/mappings/
13+
14+
linkedSPLs/LinkedSPLs-activeMoiety/PT-RXCUI-UNII-DB.csv
15+
16+
linkedSPLs/LinkedSPLs-update/data/
17+
linkedSPLs/LinkedSPLs-update/load-dailymed-spls/problematic-spls/
18+
linkedSPLs/LinkedSPLs-update/mappings/FDA-pharmacogenetic-info-mapping/cached-table-downloads/
19+
linkedSPLs/LinkedSPLs-update/mappings/PT-UNII-ChEBI-mapping/ChEBIJavaClient/bin/

clinicaltrials/clinicaltrials.php

+12-9
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ function parse_dir(){
238238
function process_file($infile) {
239239
$indir = parent::getParameterValue('indir');
240240
$xml = new CXML($infile);
241+
241242
$this->setCheckPoint('file');
242243
while($xml->Parse("clinical_study") == TRUE) {
243244
$this->setCheckPoint('record');
@@ -364,16 +365,18 @@ function process_file($infile) {
364365
######################################################################################
365366
try {
366367
$oversight = @array_shift($root->xpath('//oversight_info'));
367-
$oversight_id = parent::getRes().md5($oversight->asXML());
368+
if($oversight !== null) {
369+
$oversight_id = parent::getRes().md5($oversight->asXML());
368370

369-
$authority = $this->getString('//authority', $oversight);
370-
$authority_id = parent::getRes().md5($authority);
371-
parent::addRDF(
372-
parent::describeIndividual($oversight_id,$authority,parent::getVoc()."Organization").
373-
parent::triplify($study_id,$this->getVoc()."oversight",$oversight_id).
374-
parent::triplify($study_id,$this->getVoc()."authority",$authority_id).
375-
parent::triplifyString($oversight_id, parent::getVoc()."has-dmc", $this->getString('//has_dmc', $oversight))
376-
);
371+
$authority = $this->getString('//authority', $oversight);
372+
$authority_id = parent::getRes().md5($authority);
373+
parent::addRDF(
374+
parent::describeIndividual($oversight_id,$authority,parent::getVoc()."Organization").
375+
parent::triplify($study_id,$this->getVoc()."oversight",$oversight_id).
376+
parent::triplify($study_id,$this->getVoc()."authority",$authority_id).
377+
parent::triplifyString($oversight_id, parent::getVoc()."has-dmc", $this->getString('//has_dmc', $oversight))
378+
);
379+
}
377380
} catch(Exception $e){
378381
echo "There was an error in the oversight info element: $e\n";
379382

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"semsol/arc2": "2.3.*"
4+
}
5+
}

drugbank/drugbank.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function parseDrugEntry(&$xml)
455455
foreach($x->mixtures->mixture AS $item) {
456456
if(isset($item)) {
457457
$o = $item;
458-
$mid = parent::getRes().str_replace(" ","-",$o->name[0]);
458+
$mid = parent::getRes().md5(str_replace(" ","-",$o->name[0]));
459459

460460
parent::addRDF(
461461
parent::triplify($did,parent::getVoc()."mixture",$mid).

linkedSPLs/LinkedSPLs-activeMoiety/README

+32-35
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,64 @@ OVERVIEW
44

55
This folder will hold a graph that maps the active moiety components of an SPL to other drug resources
66

7-
Inputs are original mappings listed as belows:
8-
9-
(1) PT to UNII
10-
(2) UNII to RxNORM
11-
(3) PT to Drugbank
12-
(4) PT to ChEBI
13-
(5) RxNORM to OMOP
14-
(6) RxNORM to DrOn
15-
(7) RxNORM to NDFRT (EPC)
16-
177
Outputs is a RDF/XML graph that represents all active moiety with linked resouces.
188

199

2010
################################################################################
21-
Procedures to get active moieties RDF graph
11+
PRE-CONDITIONS:
2212
################################################################################
2313

24-
<1>: query to get omopid mapping and put in mapping folder
14+
------------------------------------------------------------------------
15+
python libraries:
16+
------------------------------------------------------------------------
17+
18+
(1) Bio from "http://biopython.org/wiki/Download"
19+
(2) rdflib
20+
(3) rdflib#jsonld from "https://github.com/RDFLib/rdflib-jsonld"
21+
(4) pandas
22+
23+
------------------------------------------------------------------------
24+
Mappings from linkedSPLs core update
25+
------------------------------------------------------------------------
26+
27+
Please ensure following mappings are available at specified path. They are should be automatically generated when core graph updated (refers to LinkedSPLs-update/README)
2528

26-
mappings/active-ingredient-omopid-rxcui.dsv
29+
(1) PT (preferred term) to UNII: LinkedSPLs-update/data/FDA/FDAPreferredSubstanceToUNII.txt
30+
(2) UNII to RxNORM: LinkedSPLs-update/data/UMLS/UNIIs-Rxcuis-from-UMLS.txt
31+
(3) PT to Drugbank: LinkedSPLs-update/mappings/ChEBI-DrugBank-bio2rdf-mapping/fda-substance-preferred-name-to-drugbank.txt
32+
(4) PT to ChEBI: LinkedSPLs-update/mappings/PT-UNII-ChEBI-mapping/UNIIToChEBI.txt
33+
(5) RxNORM to DrOn: LinkedSPLs-update/mappings/DrOn-to-RxNorm/cleaned-dron-chebi-rxcui-ingredient.txt
34+
(6) RxNORM to NDFRT (EPC): LinkedSPLs-update/mappings/pharmacologic_class_indexing/EPC_extraction_most_recent.txt
35+
36+
(7) OMOP concept Id from OHDSI or query OMOP CDM V5 (GeriOMOP) by SQL query
2737

28-
2938
query OMOP CDM V5 (GeriOMOP) by SQL query below:
3039
SELECT cpt.CONCEPT_ID as omopid, cpt.CONCEPT_CODE as rxcui FROM
3140
CONCEPT cpt
3241
WHERE
3342
cpt.CONCEPT_CLASS = 'Ingredient';
3443

35-
09/04/2015: 17049 results
36-
3744
right click result table and export to csv ('|' delimited)
45+
save name as: active-ingredient-omopid-rxcui-<DATE>.dsv
46+
to dir: LinkedSPLs-activeMoiety/mappings/active-ingredient-omopid-rxcui.dsv
3847

48+
01/18/2017: 17049 results
3949

40-
<STEP 2>: run python script to merge those mappings together
50+
################################################################################
51+
Procedures to get active moieties RDF graph
52+
################################################################################
53+
54+
(1) run python script to merge those mappings together
4155

4256
$ python mergeToActiveMoiety.py
4357

4458
outputs: mergedActiveMoiety.csv contains all joined mappings
4559

4660
columns: pt, unii, db_uri1, db_uri2, rxcui, omopid, chebi, dron, nui, nameAndRole
4761

48-
<STEP 3>: run python script to create RDF graph for all active moieties
62+
(2) run python script to create RDF graph for all active moieties
4963

5064
$ python createActiveMoietySubInRDF.py
5165

5266
outputs: activeMoietySub-in-rdf.xml
5367

54-
55-
################################################################################
56-
PRE-REQUISITES:
57-
################################################################################
58-
59-
python libraries:
60-
61-
(1) Bio
62-
from "http://biopython.org/wiki/Download"
63-
64-
(2) rdflib
65-
66-
(3) rdflib#jsonld
67-
from "https://github.com/RDFLib/rdflib-jsonld"
68-
69-
(4) pandas
70-

0 commit comments

Comments
 (0)