@@ -65,14 +65,14 @@ function run(){
6565 }
6666
6767 //download file
68- $ rfile = $ rdir .strtoupper ($ file )."/ " .$ basefile . " .gz " ;
68+ $ rfile = $ rdir .strtoupper ($ file )."/goa_ " .$ file . " .gaf .gz " ;
6969 if ($ download == true ) {
70- echo "downloading $ file" . " .gz ... " ;
70+ echo "downloading $ file ... " ;
7171 utils::DownloadSingle ($ rfile ,$ lfile );
7272 }
7373
7474 $ gz = (strstr (parent ::getParameterValue ('output_format ' ),".gz " ) === FALSE )?false :true ;
75- $ ofile = $ basefile .". " .parent ::getParameterValue ('output_format ' );
75+ $ ofile = " bio2rdf-goa- " . $ file .". " .parent ::getParameterValue ('output_format ' );
7676
7777 parent ::setReadFile ($ lfile , TRUE );
7878 parent ::setWriteFile ($ odir .$ ofile , $ gz );
@@ -144,7 +144,7 @@ function process($file){
144144 trigger_error ("Expected 17 columns, but found " .count ($ fields ),E_USER_ERROR );
145145 return false ;
146146 }
147-
147+ #print_r($fields); exit;
148148 //get the Go id
149149 $ db = $ fields [0 ];
150150 $ id = $ fields [1 ];
@@ -165,10 +165,6 @@ function process($file){
165165
166166 //entity id
167167 $ eid = $ this ->getdbURI ($ db ,$ id );
168- if (!$ eid ) {
169- print_r ($ fields );
170- continue ;
171- }
172168 parent ::addRDF (
173169 parent ::describeIndividual ($ eid ,$ label ,parent ::getVoc ()."GO-Annotation " ).
174170 parent ::describeClass (parent ::getVoc ()."GO-Annotation " ,"GO Annotation " ).
@@ -198,12 +194,10 @@ function process($file){
198194 parent ::triplify ($ eid , parent ::getVoc ().$ rel , "go: " .$ goid )
199195 );
200196
201- $ type = key ($ eco );
202197 $ aid = parent ::getRes ().$ file ."_ " .($ z ++);
203198 parent ::addRDF (
204199 parent ::describeObjectProperty (parent ::getVoc ()."go-annotation " ,"GO annotation " ).
205200 parent ::triplify ($ eid , parent ::getVoc ()."go-annotation " , $ aid )
206-
207201 );
208202
209203 $ cat = parent ::getRes ().md5 ($ aspect );
@@ -212,7 +206,7 @@ function process($file){
212206 parent ::describeIndividual ($ aid , "$ id-go: $ goid association " , parent ::getVoc ()."GO-Annotation " ).
213207 parent ::triplify ($ aid , parent ::getVoc ()."target " , $ eid ).
214208 parent ::triplify ($ aid , parent ::getVoc ()."go-term " , "go: " .$ goid ).
215- parent ::triplify ($ aid , parent ::getVoc ()."evidence " , "eco: " .$ eco [$ type ][ 1 ]).
209+ parent ::triplify ($ aid , parent ::getVoc ()."evidence " , "eco: " .$ eco [1 ]).
216210 parent ::triplify ($ aid , parent ::getVoc ()."go-category " , $ cat ).
217211 parent ::describeClass ($ cat ,$ aspect ).
218212 parent ::triplifyString ($ aid , parent ::getVoc ()."assigned-by " , $ assignedBy )
@@ -278,28 +272,15 @@ function getdbURI($db_id, $db_object_id){
278272 * ["Experimental Evidence Code" => ["Inferred from Experiment", "0000006"]]
279273 * See: http://www.geneontology.org/GO.evidence.shtml
280274 **/
281- function getEvidenceCodeLabelArr ($ aec )
282- {
275+ function getEvidenceCodeLabelArr ($ aec ){
283276 //experimental code
284277 $ ec = array (
285278 "EXP " => array ("Inferred from Experiment " ,"0000006 " ),
286279 "IDA " => array ("Inferred from Direct Assay " ,"0000314 " ),
287280 "IPI " => array ("Inferred from Physical Interaction " ,"0000021 " ),
288281 "IMP " => array ("Inferred from Mutant Phenotype " , "0000315 " ),
289282 "IGI " => array ("Inferred from Genetic Interaction " ,"0000316 " ),
290- "IEP " => array ("Inferred from Expression Pattern " , "0000008 " )
291- );
292-
293- $ htp = array (
294- "HTP " => array ("Inferred from High Throughput Experiment " ,"" ),
295- "HDA " => array ("Inferred from High Throughput Direct Assay " ,"" ),
296- "HMP " => array ("Inferred from Hight Throughput Mutant Phenotype " ,"" ),
297- "HGI " => array ("Inferred from High Throughput Genetic Interaction " ,"" ),
298- "HEP " => array ("Inferred from High Throughput Expression Pattern " ,"" )
299- );
300-
301- //computational analysis codes
302- $ cac = array (
283+ "IEP " => array ("Inferred from Expression Pattern " , "0000008 " ),
303284 "ISS " => array ("Inferred from Sequence or Structural Similarity " ,"0000027 " ),
304285 "ISO " => array ("Inferred from Sequence Orthology " , "0000201 " ),
305286 "ISA " => array ("Inferred from Sequence Alignment " , "0000200 " ),
@@ -309,38 +290,22 @@ function getEvidenceCodeLabelArr($aec)
309290 "IBD " => array ("Inferred from Biological aspect of Desendant " , "0000319 " ),
310291 "IKR " => array ("Inferred from Key Residues " ,"0000320 " ),
311292 "IRD " => array ("Inferred from Rapid Divergence " ,"0000321 " ),
312- "RCA " => array ("Inferred from Reviewed Computational Analysis " ,"0000245 " )
313- );
314-
315- //author statement codes
316- $ asc = array (
293+ "RCA " => array ("Inferred from Reviewed Computational Analysis " ,"0000245 " ),
317294 "TAS " => array ("Traceable Author Statement " ,"0000304 " ),
318- "NAS " => array ("Non-Traceable Author Statement " ,"0000303 " )
319- );
320- //curator statement codes
321- $ csc = array (
295+ "NAS " => array ("Non-Traceable Author Statement " ,"0000303 " ),
322296 "IC " => array ("Inferred by Curator " ,"0000001 " ),
323- "ND " => array ("No biological Data available " ,"0000035 " )
324- );
325- //automatically assigned codes
326- $ aac = array (
327- "IEA " =>array ("Inferred from Electronic Annotation " , "0000203 " )
328- );
329-
330- if (array_key_exists ($ aec , $ ec )){
331- return array ("experimental evidence code " =>$ ec [$ aec ]);
332- }elseif (array_key_exists ($ aec , $ htp )){
333- return array ("high throughput code " =>$ htp [$ aec ]);
334- }elseif (array_key_exists ($ aec , $ cac )){
335- return array ("computational analysis code " =>$ cac [$ aec ]);
336- }elseif (array_key_exists ($ aec , $ asc )){
337- return array ("author statement code " =>$ asc [$ aec ]);
338- }elseif (array_key_exists ($ aec , $ csc )){
339- return array ("curator statement code " =>$ csc [$ aec ]);
340- }elseif (array_key_exists ($ aec , $ aac )){
341- return array ("automatically assigned code " =>$ aac [$ aec ]);
342- }else {
343- return array ("unmapped evidence code " => $ aec );
297+ "ND " => array ("No biological Data available " ,"0000035 " ),
298+ "IEA " =>array ("Inferred from Electronic Annotation " , "0000203 " ),
299+ "HTP " => array ("Inferred from High Throughput Experiment " ,"" ),
300+ "HDA " => array ("Inferred from High Throughput Direct Assay " ,"" ),
301+ "HMP " => array ("Inferred from Hight Throughput Mutant Phenotype " ,"" ),
302+ "HGI " => array ("Inferred from High Throughput Genetic Interaction " ,"" ),
303+ "HEP " => array ("Inferred from High Throughput Expression Pattern " ,"" )
304+ );
305+ if (isset ($ ec [$ aec ])) return $ ec [$ aec ];
306+ else {
307+ trigger_error ("No code for $ aec " );
308+ return null ;
344309 }
345310
346311 return null ;
0 commit comments