Skip to content

Commit eca8f65

Browse files
Merge branch 'release3' of github.com:micheldumontier/bio2rdf-scripts into goa_hotfix
2 parents 701bce7 + 83acc78 commit eca8f65

File tree

13 files changed

+1221
-870
lines changed

13 files changed

+1221
-870
lines changed

affymetrix/affymetrix.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function Run()
152152
$bVersion = parent::getParameterValue('bio2rdf_release');
153153
$date = date ("Y-m-d\TG:i:s\Z");
154154
$output_file = (new DataResource($this))
155-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$outfile")
155+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$outfile")
156156
->setTitle("Bio2RDF v$bVersion RDF version of $prefix (generated at $date)")
157157
->setSource($source_file->getURI())
158158
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/affymetrix/affymetrix.php")

clinicaltrials/clinicaltrials.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function parse_dir(){
205205
closedir($handle);
206206

207207
$output_file = (new DataResource($this))
208-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$outfile")
208+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$outfile")
209209
->setTitle("Bio2RDF v$bVersion RDF version of $prefix v$source_version")
210210
->setSource($source_file->getURI())
211211
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/clinicaltrials/clinicaltrials.php")

drugbank/drugbank.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function Run()
121121
->setDataset("http://identifiers.org/drugbank/");
122122

123123
$output_file = (new DataResource($this))
124-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$cfile")
124+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$cfile")
125125
->setTitle("Bio2RDF v$bVersion RDF version of $prefix v$source_version")
126126
->setSource($source_file->getURI())
127127
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/drugbank/drugbank.php")

goa/goa.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function run(){
103103
$bVersion = parent::getParameterValue('bio2rdf_release');
104104
$date = date ("Y-m-d\TG:i:s\Z");
105105
$output_file = (new DataResource($this))
106-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$ofile")
106+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$ofile")
107107
->setTitle("Bio2RDF v$bVersion RDF version of $prefix (generated at $date)")
108108
->setSource($source_file->getURI())
109109
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/irefindex/irefindex.php")

hgnc/hgnc.php

+11-21
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ function Run(){
4444
$ldir = parent::getParameterValue('indir');
4545
$odir = parent::getParameterValue('outdir');
4646
$rdir = parent::getParameterValue('download_url');
47-
//make sure directories end with slash
48-
if(substr($ldir, -1) !== "/"){
49-
$ldir = $ldir."/";
50-
}
51-
if(substr($odir, -1) !== "/"){
52-
$odir = $odir."/";
53-
}
5447
$lfile = $ldir.$file;
5548
if(!file_exists($lfile) && parent::getParameterValue('download') == false) {
5649
trigger_error($lfile." not found. Will attempt to download.", E_USER_NOTICE);
@@ -64,12 +57,9 @@ function Run(){
6457
Utils::DownloadSingle($rfile, $lfile);
6558
}
6659

67-
$ofile = $odir.$file.'.nt';
60+
$ofile = $odir.basename($file,".txt.gz").".".parent::getParameterValue('output_format');
6861
$gz=false;
69-
if(strstr(parent::getParameterValue('output_format'), "gz")){
70-
$ofile .= '.gz';
71-
$gz = true;
72-
}
62+
if(strstr(parent::getParameterValue('output_format'), "gz")){$gz = true;}
7363

7464
parent::setWriteFile($ofile, $gz);
7565
parent::setReadFile($lfile, true);
@@ -130,7 +120,7 @@ function process(){
130120
if (count($header_arr) != 40)
131121
{
132122
echo PHP_EOL;
133-
trigger_error ("Header format is different than expected, please update the script");
123+
trigger_error ("Header format is different than expected, please update the script",E_USER_ERROR);
134124
exit;
135125
}
136126

@@ -177,24 +167,24 @@ function process(){
177167
$mouse_genome_database_id_mappeddatasuppliedbyMGI = $fields[38];
178168
$rat_genome_database_id_mappeddatasuppliedbyRGD = $fields[39];
179169

180-
$id_res = $this->getNamespace().$id;
170+
$id_res = $id;
181171
$id_label = "Gene Symbol for ".$approved_symbol;
182-
$id_label_class = "hgnc identifier: ".$id;
183172
parent::AddRDF(
173+
parent::triplify($id_res, "rdf:type", $this->getVoc()."Gene-Symbol").
184174
parent::describeIndividual($id_res, $id_label, $this->getVoc()."Gene-Symbol").
185-
parent::describeClass($this->getVoc()."Gene-Symbol", $id_label_class)
175+
parent::describeClass($this->getVoc()."Gene-Symbol", "Official Gene Symbol")
186176
);
187177
if(!empty($approved_symbol)){
188178
parent::AddRDF(
189179
parent::triplifyString($id_res, $this->getVoc()."approved_symbol",utf8_encode(htmlspecialchars($approved_symbol))).
190-
parent::describeProperty($this->getVoc()."approved_symbol", " The official gene symbol that has been approved by the HGNC and is publicly available. Symbols are approved based on specific HGNC nomenclature guidelines. In the HTML results page this ID links to the HGNC Symbol Report for that gene")
180+
parent::describeProperty($this->getVoc()."approved_symbol", "The official gene symbol that has been approved by the HGNC and is publicly available. Symbols are approved based on specific HGNC nomenclature guidelines. In the HTML results page this ID links to the HGNC Symbol Report for that gene")
191181
);
192182

193183
}
194184
if(!empty($approved_name)){
195185
parent::AddRDF(
196186
parent::triplifyString($id_res, $this->getVoc()."approved_name",utf8_encode(htmlspecialchars($approved_name))).
197-
parent::describeProperty($this->getVoc()."approved_name", " The official gene name that has been approved by the HGNC and is publicly available. Names are approved based on specific HGNC nomenclature guidelines.")
187+
parent::describeProperty($this->getVoc()."approved_name", "The official gene name that has been approved by the HGNC and is publicly available. Names are approved based on specific HGNC nomenclature guidelines.")
198188
);
199189
}
200190
if(!empty($status)){
@@ -396,8 +386,8 @@ function process(){
396386
$ccd_ids = explode(", ", $ccd_ids);
397387
foreach ($ccd_ids as $ccd_id) {
398388
parent::AddRDF(
399-
parent::triplify($id_res, $this->getVoc()."x-ccd", "refseq:".trim($ccd_id)).
400-
parent::describeProperty($this->getVoc()."x-ccd", "The Consensus CDS (CCDS) project is a collaborative effort to identify a core set of human and mouse protein coding regions that are consistently annotated and of high quality. The long term goal is to support convergence towards a standard set of gene annotations.")
389+
parent::triplify($id_res, $this->getVoc()."x-ccds", "ccds:".trim($ccd_id)).
390+
parent::describeProperty($this->getVoc()."x-ccds", "The Consensus CDS (CCDS) project is a collaborative effort to identify a core set of human and mouse protein coding regions that are consistently annotated and of high quality. The long term goal is to support convergence towards a standard set of gene annotations.")
401391
);
402392
}
403393
}
@@ -497,7 +487,7 @@ function process(){
497487
$rgd_id = trim($rgd_id);
498488
if(!empty($rgd_id)){
499489
parent::AddRDF(
500-
parent::triplify($id_res, $this->getVoc()."x-rgd", "rgd:".trim($rgd_id)).
490+
parent::triplify($id_res, $this->getVoc()."x-rgd", trim($rgd_id)).
501491
parent::describeProperty($this->getVoc()."x-rgd", " RGD identifier. In the HTML results page this ID links to the RGD Report for that gene.")
502492
);
503493
}

interpro/interpro.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function Run()
9797
$bVersion = parent::getParameterValue('bio2rdf_release');
9898
$date = date ("Y-m-d\TG:i:s\Z");
9999
$output_file = (new DataResource($this))
100-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$outfile")
100+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$outfile")
101101
->setTitle("Bio2RDF v$bVersion RDF version of $prefix v$source_version")
102102
->setSource($source_file->getURI())
103103
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/interpro/interpro.php")
@@ -136,7 +136,7 @@ function Parse($xml)
136136
}
137137
}
138138
// get a potential id list
139-
$id_list = explode(",",parent::getParameterValue("id_list"));
139+
if(parent::getParameterValue("id_list") != '') $id_list = explode(",",parent::getParameterValue("id_list"));
140140

141141
// now interate over the entries
142142
foreach($xml->interpro AS $o) {

irefindex/irefindex.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function Run()
123123
$bVersion = parent::getParameterValue('bio2rdf_release');
124124
$date = date ("Y-m-d\TG:i:s\Z");
125125
$output_file = (new DataResource($this))
126-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$ofile")
126+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$ofile")
127127
->setTitle("Bio2RDF v$bVersion RDF version of $prefix (generated at $date)")
128128
->setSource($source_file->getURI())
129129
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/irefindex/irefindex.php")

omim/omim.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function Run()
129129
$bVersion = parent::getParameterValue('bio2rdf_release');
130130
$date = date ("Y-m-d\TG:i:s\Z");
131131
$output_file = (new DataResource($this))
132-
->setURI("http://download.bio2df.org/release/$bVersion/$prefix/$outfile")
132+
->setURI("http://download.bio2rdf.org/release/$bVersion/$prefix/$outfile")
133133
->setTitle("Bio2RDF v$bVersion RDF version of $prefix (generated at $date)")
134134
->setSource($source_file->getURI())
135135
->setCreator("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/omim/omim.php")

0 commit comments

Comments
 (0)