From 9750395e545bded13a3adda3b846cf2c59633761 Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Sun, 9 Sep 2012 20:06:00 -0400 Subject: [PATCH 1/6] added group identifier to the label --- homologene/homologene.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homologene/homologene.php b/homologene/homologene.php index 23d37bb..c7bc50e 100644 --- a/homologene/homologene.php +++ b/homologene/homologene.php @@ -41,8 +41,8 @@ function __construct($argv){ //set and print the application options $this->AddParameter('download',false,'true|false','false','set true to download files'); - $this->AddParameter('indir',false,null,'/media/twotb/bio2rdf/data/homologene','directory to download files'); - $this->AddParameter('outdir',false,null,'/media/twotb/bio2rdf/n3/gene/','directory to place rdfized files'); + $this->AddParameter('indir',false,null,'/data/download/homologene','directory to download files'); + $this->AddParameter('outdir',false,null,'/data/rdf/homologene/','directory to place rdfized files'); $this->AddParameter('graph_uri',false,null,null,'provide the graph uri to generate n-quads instead of n-triples'); $this->AddParameter('gzip',false,'true|false','true','gzip the output'); $this->AddParameter('force',false,'true|false','true','remove old files and copy over'); @@ -138,7 +138,7 @@ function process(){ $refseq = "refseq:".$parsed_line["refseq"]; $this->AddRDF($this->QQuad($hid, "homologene_vocabulary:has_taxid", $taxid)); $this->AddRDF($this->QQuad($hid, "rdf:type", "homologene_vocabulary:HomoloGene_Group")); - $this->AddRDF($this->QQuadL($hid, "rdfs:label", "HomoloGene Group [".$hid."]")); + $this->AddRDF($this->QQuadL($hid, "rdfs:label", "HomoloGene Group $hid [".$hid."]")); $this->AddRDF($this->QQuad($hid, "homologene_vocabulary:has_gene", $geneid)); $this->AddRDF($this->QQuadL($hid, "homologene_vocabulary:has_gene_symbol", $genesymbol)); $this->AddRDF($this->QQuad($hid, "homologene_vocabulary:has_gi", $gi)); @@ -164,4 +164,4 @@ function parse_homologene_tab_line($aLine){ $parser = new HomologeneParser($argv); $parser->Run(); -?> \ No newline at end of file +?> From 708518b2e4ed6e164aff639d1f35076db4c662bc Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Mon, 10 Sep 2012 12:30:50 -0400 Subject: [PATCH 2/6] added direct links to gene, go term and category from annotation --- gene/entrez_gene.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gene/entrez_gene.php b/gene/entrez_gene.php index 630d999..fd24357 100644 --- a/gene/entrez_gene.php +++ b/gene/entrez_gene.php @@ -502,7 +502,9 @@ private function gene2go(){ $this->AddRDF($this->QQuad($eid,"rdf:type", "geneid_vocabulary:Gene-$goCategory-Association")); $this->AddRDF($this->QQuad($eid,"void:inDataset",$this->GetDatasetURI())); $this->AddRDF($this->QQuad($eid,"geneid_vocabulary:evidence","eco:$evidenceCode")); - $this->AddRDF($this->QQuad($eid,"geneid_vocabulary:term",$goid)); + $this->AddRDF($this->QQuad($eid,"geneid_vocabulary:gene",$geneid)); + $this->AddRDF($this->QQuadL($eid,"geneid_vocabulary:go_category",$goCategory)); + $this->AddRDF($this->QQuad($eid,"geneid_vocabulary:go_term",$goid)); foreach ($pmids as $pmid){ if($pmid != '-') $this->AddRDF($this->QQuad($eid,"geneid_vocabulary:publication","pubmed:$pmid")); From fb26d5454d3f778650912364ae09d63bd5143dd9 Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Mon, 10 Sep 2012 12:32:02 -0400 Subject: [PATCH 3/6] removed mandatory dir arguments, fixed infile & suffix --- iproclass/iproclass.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iproclass/iproclass.php b/iproclass/iproclass.php index 3391807..f83b3be 100644 --- a/iproclass/iproclass.php +++ b/iproclass/iproclass.php @@ -38,8 +38,8 @@ function __construct($argv) { $this->SetDefaultNamespace("iproclass"); // set and print application parameters - $this->AddParameter('indir',true,null,'/data/download/iproclass/','directory to download into and parse from'); - $this->AddParameter('outdir',true,null,'/data/rdf/iproclass/','directory to place rdfized files'); + $this->AddParameter('indir',false,null,'/data/download/iproclass/','directory to download into and parse from'); + $this->AddParameter('outdir',false,null,'/data/rdf/iproclass/','directory to place rdfized files'); $this->AddParameter('graph_uri',false,null,null,'provide the graph uri to generate n-quads instead of n-triples'); $this->AddParameter('gzip',false,'true|false','true','gzip the output'); $this->AddParameter('download',false,'true|false','false','set true to download files'); @@ -58,7 +58,7 @@ function __construct($argv) { function Run(){ - $file = "iproclass.tb"; + $file = "iproclass.tb.gz"; $ldir = $this->GetParameterValue('indir'); $odir = $this->GetParameterValue('outdir'); @@ -87,7 +87,7 @@ function Run(){ file_put_contents($lfile,file_get_contents($rfile)); } - $ofile = $odir.$file.'.ttl'; + $ofile = $odir.'iproclass.nt'; $gz = false; if($this->GetParameterValue('gzip')) { @@ -95,7 +95,7 @@ function Run(){ $gz = true; } - $this->SetReadFile($lfile, FALSE); + $this->SetReadFile($lfile, true); $this->SetWriteFile($ofile, $gz); echo "processing $file... "; @@ -306,4 +306,4 @@ function process(){ $parser = new IProClassParser($argv); $parser->Run(); -?> \ No newline at end of file +?> From 21803b2ceca9ab45cde6476f0a00aa9f0f2e2b97 Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Mon, 10 Sep 2012 12:32:34 -0400 Subject: [PATCH 4/6] added required graph_uri argument --- pubchem/pubchem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubchem/pubchem.php b/pubchem/pubchem.php index ff62ad6..3b30aa5 100644 --- a/pubchem/pubchem.php +++ b/pubchem/pubchem.php @@ -58,6 +58,7 @@ function __construct($argv){ $this->AddParameter('files',true,'all|compounds|substances|bioactivity','all','files to process'); $this->AddParameter('indir',false,null,'../../download/pubchem/','directory to download into and parse from'); $this->AddParameter('outdir',false,null,'../../data/pubchem','directory to place rdfized files'); + $this->AddParameter('graph_uri',false,null,null,'provide a graph uri to generate n-quads'); $this->AddParameter('workspace',false,null,'../../workspace/pubchem/','directory to mount pubchem FTP server'); $this->AddParameter('gzip',false,'true|false','true','gzip the output'); $this->AddParameter('remote_server',false,null,'ftp.ncbi.nlm.nih.gov/pubchem/'); @@ -695,4 +696,4 @@ function parse_substance_record(&$xml){ set_error_handler('error_handler'); $dbparser = new PubChemParser($argv); $dbparser->Run(); -?> \ No newline at end of file +?> From a8656e695ef4d074860ad159ee768767a79a5f5a Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Mon, 10 Sep 2012 12:33:14 -0400 Subject: [PATCH 5/6] added death for not opening outputfile --- goa/goa2ntriple.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/goa/goa2ntriple.php b/goa/goa2ntriple.php index 8f085f3..bb60787 100644 --- a/goa/goa2ntriple.php +++ b/goa/goa2ntriple.php @@ -39,8 +39,8 @@ $files = array(); -@mkdir($options['indir']['value'],null,true); -@mkdir($options['outdir']['value'],null,true); +@mkdir($options['indir']['value'],0777,true); +@mkdir($options['outdir']['value'],0777,true); if($options['files']['value'] == 'all') { $files = explode("|",$options['files']['list']); @@ -66,7 +66,7 @@ function parse_goa_file($inpath, $outpath){ $buf = ''; $infh = gzopen($inpath,'r') or die("Cannot open $inpath !\n"); - $outfh = fopen($outpath, 'w'); + $outfh = fopen($outpath, 'w') or die("Can't open $outpath"); if($infh){ while(!gzeof($infh)){ $aLine = gzgets($infh, 4096); From b5188eaa3b61c3280fe75c98a082a7719412b689 Mon Sep 17 00:00:00 2001 From: Michel Dumontier Date: Mon, 10 Sep 2012 12:38:11 -0400 Subject: [PATCH 6/6] changed default file path for ncbo dir --- sgd/sgd.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sgd/sgd.php b/sgd/sgd.php index 11b9551..13b19cb 100644 --- a/sgd/sgd.php +++ b/sgd/sgd.php @@ -47,7 +47,7 @@ function __construct($argv) { $this->AddParameter('download',false,'true|false','false','set true to download files'); $this->AddParameter('download_url',false,null,'http://downloads.yeastgenome.org/'); $this->AddParameter('ncbo_api_key', false, null, '24e19c82-54e0-11e0-9d7b-005056aa3316'); - $this->AddParameter('ncbo_download_dir', false, null, '/bio2rdf/data/ncbo', 'directory of ncbo ontologies'); + $this->AddParameter('ncbo_download_dir', false, null, '/data/download/ncbo', 'directory of ncbo ontologies'); if($this->SetParameters($argv) == FALSE) { $this->PrintParameters($argv); exit; @@ -580,7 +580,7 @@ function goa(){ // now for the GO annotation $goa = "sgd_resource:goa_".$id."_".$term; - $this->AddRDF($this->QQuad($goa,"rdf:type","sgd_vocabulary:GOAnnotation")); + $this->AddRDF($this->QQuad($goa,"rdf:type","sgd_vocabulary:GO-Annotation")); $this->AddRDF($this->QQuad($goa, "void:inDataset", $this->GetDatasetURI())); $this->AddRDF($this->QQuad($goa,"rdf:subject",$subject)); $this->AddRDF($this->QQuad($goa,"rdf:predicate",$predicate)); @@ -737,9 +737,8 @@ function phenotype(){ BuildNamespaceSearchList($terms,$searchlist); while($l = $this->GetReadFile()->Read(96000)) { - if(trim($l) == '') continue; + if(trim($l) == '') continue; $a = explode("\t",$l); - $eid = md5($a[3].$a[5].$a[6].$a[9]); $label = "$a[0] - $a[5] experiment with $a[6] resulting in phenotype of $a[9]";