Skip to content

Commit b3550ce

Browse files
merge changes for goa
1 parent 3c7e162 commit b3550ce

File tree

1 file changed

+43
-85
lines changed

1 file changed

+43
-85
lines changed

goa/goa.php

Lines changed: 43 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -238,17 +232,13 @@ function process($file){
238232

239233

240234
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-
}
249235

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";
252242
}
253243
}
254244

@@ -284,70 +274,38 @@ function getdbURI($db_id, $db_object_id){
284274
* See: http://www.geneontology.org/GO.evidence.shtml
285275
**/
286276
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");
351309
return null;
352310
}
353311
}

0 commit comments

Comments
 (0)