@@ -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 )
@@ -238,17 +232,13 @@ function process($file){
238
232
239
233
240
234
function getAspect ($ anAspect ){
241
- if (count ($ anAspect )){
242
- if ($ anAspect == "F " ){
243
- return "function " ;
244
- }elseif ($ anAspect == "P " ){
245
- return "process " ;
246
- }elseif ($ anAspect == "C " ){
247
- return "component " ;
248
- }
249
235
250
- }else {
251
- return null ;
236
+ if ($ anAspect == "F " ){
237
+ return "function " ;
238
+ }elseif ($ anAspect == "P " ){
239
+ return "process " ;
240
+ }elseif ($ anAspect == "C " ){
241
+ return "component " ;
252
242
}
253
243
}
254
244
@@ -284,70 +274,38 @@ function getdbURI($db_id, $db_object_id){
284
274
* See: http://www.geneontology.org/GO.evidence.shtml
285
275
**/
286
276
function getEvidenceCodeLabelArr ($ aec ){
287
- if (count ($ aec )){
288
- //experimental code
289
- $ ec = array (
290
- "EXP " => array ("Inferred from Experiment " ,"0000006 " ),
291
- "IDA " => array ("Inferred from Direct Assay " ,"0000314 " ),
292
- "IPI " => array ("Inferred from Physical Interaction " ,"0000021 " ),
293
- "IMP " => array ("Inferred from Mutant Phenotype " , "0000315 " ),
294
- "IGI " => array ("Inferred from Genetic Interaction " ,"0000316 " ),
295
- "IEP " => array ("Inferred from Expression Pattern " , "0000008 " )
296
- );
297
-
298
- $ htp = array (
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
-
306
- //computational analysis codes
307
- $ cac = array (
308
- "ISS " => array ("Inferred from Sequence or Structural Similarity " ,"0000027 " ),
309
- "ISO " => array ("Inferred from Sequence Orthology " , "0000201 " ),
310
- "ISA " => array ("Inferred from Sequence Alignment " , "0000200 " ),
311
- "ISM " => array ("Inferred from Sequence Model " , "0000202 " ),
312
- "IGC " => array ("Inferred from Genomic Context " , "0000317 " ),
313
- "IBA " => array ("Inferred from Biological aspect of Ancestor " ,"0000318 " ),
314
- "IBD " => array ("Inferred from Biological aspect of Desendant " , "0000319 " ),
315
- "IKR " => array ("Inferred from Key Residues " ,"0000320 " ),
316
- "IRD " => array ("Inferred from Rapid Divergence " ,"0000321 " ),
317
- "RCA " => array ("Inferred from Reviewed Computational Analysis " ,"0000245 " )
318
- );
319
-
320
- //author statement codes
321
- $ asc = array (
322
- "TAS " => array ("Traceable Author Statement " ,"0000304 " ),
323
- "NAS " => array ("Non-Traceable Author Statement " ,"0000303 " )
324
- );
325
- //curator statement codes
326
- $ csc = array (
327
- "IC " => array ("Inferred by Curator " ,"0000001 " ),
328
- "ND " => array ("No biological Data available " ,"0000035 " )
329
- );
330
- //automatically assigned codes
331
- $ aac = array (
332
- "IEA " =>array ("Inferred from Electronic Annotation " , "0000203 " )
333
- );
334
-
335
- if (array_key_exists ($ aec , $ ec )){
336
- return array ("experimental evidence code " =>$ ec [$ aec ]);
337
- }elseif (array_key_exists ($ aec , $ htp )){
338
- return array ("high throughput code " =>$ htp [$ aec ]);
339
- }elseif (array_key_exists ($ aec , $ cac )){
340
- return array ("computational analysis code " =>$ cac [$ aec ]);
341
- }elseif (array_key_exists ($ aec , $ asc )){
342
- return array ("author statement code " =>$ asc [$ aec ]);
343
- }elseif (array_key_exists ($ aec , $ csc )){
344
- return array ("curator statement code " =>$ csc [$ aec ]);
345
- }elseif (array_key_exists ($ aec , $ aac )){
346
- return array ("automatically assigned code " =>$ aac [$ aec ]);
347
- }else {
348
- return array ("unmapped evidence code " => $ aec );
349
- }
350
- } else {
277
+ //experimental code
278
+ $ ec = array (
279
+ "EXP " => array ("Inferred from Experiment " ,"0000006 " ),
280
+ "IDA " => array ("Inferred from Direct Assay " ,"0000314 " ),
281
+ "IPI " => array ("Inferred from Physical Interaction " ,"0000021 " ),
282
+ "IMP " => array ("Inferred from Mutant Phenotype " , "0000315 " ),
283
+ "IGI " => array ("Inferred from Genetic Interaction " ,"0000316 " ),
284
+ "IEP " => array ("Inferred from Expression Pattern " , "0000008 " ),
285
+ "ISS " => array ("Inferred from Sequence or Structural Similarity " ,"0000027 " ),
286
+ "ISO " => array ("Inferred from Sequence Orthology " , "0000201 " ),
287
+ "ISA " => array ("Inferred from Sequence Alignment " , "0000200 " ),
288
+ "ISM " => array ("Inferred from Sequence Model " , "0000202 " ),
289
+ "IGC " => array ("Inferred from Genomic Context " , "0000317 " ),
290
+ "IBA " => array ("Inferred from Biological aspect of Ancestor " ,"0000318 " ),
291
+ "IBD " => array ("Inferred from Biological aspect of Desendant " , "0000319 " ),
292
+ "IKR " => array ("Inferred from Key Residues " ,"0000320 " ),
293
+ "IRD " => array ("Inferred from Rapid Divergence " ,"0000321 " ),
294
+ "RCA " => array ("Inferred from Reviewed Computational Analysis " ,"0000245 " ),
295
+ "TAS " => array ("Traceable Author Statement " ,"0000304 " ),
296
+ "NAS " => array ("Non-Traceable Author Statement " ,"0000303 " ),
297
+ "IC " => array ("Inferred by Curator " ,"0000001 " ),
298
+ "ND " => array ("No biological Data available " ,"0000035 " ),
299
+ "IEA " =>array ("Inferred from Electronic Annotation " , "0000203 " ),
300
+ "HTP " => array ("Inferred from High Throughput Experiment " ,"" ),
301
+ "HDA " => array ("Inferred from High Throughput Direct Assay " ,"" ),
302
+ "HMP " => array ("Inferred from Hight Throughput Mutant Phenotype " ,"" ),
303
+ "HGI " => array ("Inferred from High Throughput Genetic Interaction " ,"" ),
304
+ "HEP " => array ("Inferred from High Throughput Expression Pattern " ,"" )
305
+ );
306
+ if (isset ($ ec [$ aec ])) return $ ec [$ aec ];
307
+ else {
308
+ trigger_error ("No code for $ aec " );
351
309
return null ;
352
310
}
353
311
}
0 commit comments