@@ -65,14 +65,14 @@ function run(){
65
65
}
66
66
67
67
//download file
68
- $ rfile = $ rdir .strtoupper ($ file )."/ " .$ basefile . " .gz " ;
68
+ $ rfile = $ rdir .strtoupper ($ file )."/goa_ " .$ file . " .gaf .gz " ;
69
69
if ($ download == true ) {
70
- echo "downloading $ file" . " .gz ... " ;
70
+ echo "downloading $ file ... " ;
71
71
utils::DownloadSingle ($ rfile ,$ lfile );
72
72
}
73
73
74
74
$ 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 ' );
76
76
77
77
parent ::setReadFile ($ lfile , TRUE );
78
78
parent ::setWriteFile ($ odir .$ ofile , $ gz );
@@ -144,7 +144,7 @@ function process($file){
144
144
trigger_error ("Expected 17 columns, but found " .count ($ fields ),E_USER_ERROR );
145
145
return false ;
146
146
}
147
-
147
+ #print_r($fields); exit;
148
148
//get the Go id
149
149
$ db = $ fields [0 ];
150
150
$ id = $ fields [1 ];
@@ -165,10 +165,6 @@ function process($file){
165
165
166
166
//entity id
167
167
$ eid = $ this ->getdbURI ($ db ,$ id );
168
- if (!$ eid ) {
169
- print_r ($ fields );
170
- continue ;
171
- }
172
168
parent ::addRDF (
173
169
parent ::describeIndividual ($ eid ,$ label ,parent ::getVoc ()."GO-Annotation " ).
174
170
parent ::describeClass (parent ::getVoc ()."GO-Annotation " ,"GO Annotation " ).
@@ -198,12 +194,10 @@ function process($file){
198
194
parent ::triplify ($ eid , parent ::getVoc ().$ rel , "go: " .$ goid )
199
195
);
200
196
201
- $ type = key ($ eco );
202
197
$ aid = parent ::getRes ().$ file ."_ " .($ z ++);
203
198
parent ::addRDF (
204
199
parent ::describeObjectProperty (parent ::getVoc ()."go-annotation " ,"GO annotation " ).
205
200
parent ::triplify ($ eid , parent ::getVoc ()."go-annotation " , $ aid )
206
-
207
201
);
208
202
209
203
$ cat = parent ::getRes ().md5 ($ aspect );
@@ -212,7 +206,7 @@ function process($file){
212
206
parent ::describeIndividual ($ aid , "$ id-go: $ goid association " , parent ::getVoc ()."GO-Annotation " ).
213
207
parent ::triplify ($ aid , parent ::getVoc ()."target " , $ eid ).
214
208
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 ]).
216
210
parent ::triplify ($ aid , parent ::getVoc ()."go-category " , $ cat ).
217
211
parent ::describeClass ($ cat ,$ aspect ).
218
212
parent ::triplifyString ($ aid , parent ::getVoc ()."assigned-by " , $ assignedBy )
@@ -278,28 +272,15 @@ function getdbURI($db_id, $db_object_id){
278
272
* ["Experimental Evidence Code" => ["Inferred from Experiment", "0000006"]]
279
273
* See: http://www.geneontology.org/GO.evidence.shtml
280
274
**/
281
- function getEvidenceCodeLabelArr ($ aec )
282
- {
275
+ function getEvidenceCodeLabelArr ($ aec ){
283
276
//experimental code
284
277
$ ec = array (
285
278
"EXP " => array ("Inferred from Experiment " ,"0000006 " ),
286
279
"IDA " => array ("Inferred from Direct Assay " ,"0000314 " ),
287
280
"IPI " => array ("Inferred from Physical Interaction " ,"0000021 " ),
288
281
"IMP " => array ("Inferred from Mutant Phenotype " , "0000315 " ),
289
282
"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 " ),
303
284
"ISS " => array ("Inferred from Sequence or Structural Similarity " ,"0000027 " ),
304
285
"ISO " => array ("Inferred from Sequence Orthology " , "0000201 " ),
305
286
"ISA " => array ("Inferred from Sequence Alignment " , "0000200 " ),
@@ -309,38 +290,22 @@ function getEvidenceCodeLabelArr($aec)
309
290
"IBD " => array ("Inferred from Biological aspect of Desendant " , "0000319 " ),
310
291
"IKR " => array ("Inferred from Key Residues " ,"0000320 " ),
311
292
"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 " ),
317
294
"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 " ),
322
296
"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 ;
344
309
}
345
310
346
311
return null ;
0 commit comments