[Bioperl-guts-l] bioperl commit

Allen Day allenday at pub.open-bio.org
Mon Oct 4 16:23:14 EDT 2004


allenday
Mon Oct  4 16:23:14 EDT 2004
Update of /home/repository/bioperl/bioperl-live/Bio/FeatureIO
In directory pub.open-bio.org:/tmp/cvs-serv25975/Bio/FeatureIO

Modified Files:
	gff.pm 
Log Message:
modifications to allow url fetch of gene ontology.  this was not easy
b/c of the multiple .ontology files for each aspect.

Bio::SeqFeature::Annotated objects now instantiate Ontology_term tags
as Bio::Annotation::OntologyTerm objects, not Bio::Annotation::SimpleValue
objects (Scott!)


bioperl-live/Bio/FeatureIO gff.pm,1.10,1.11
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/FeatureIO/gff.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- /home/repository/bioperl/bioperl-live/Bio/FeatureIO/gff.pm	2004/09/25 11:41:29	1.10
+++ /home/repository/bioperl/bioperl-live/Bio/FeatureIO/gff.pm	2004/10/04 20:23:14	1.11
@@ -316,9 +316,17 @@
   }
 
   #Handle Ontology_term attributes
-#  if($attr{Ontology_term}){
-#    $self->warn("Warning for line:\n$feature_string\nOntology_term attribute handling not yet implemented, skipping it");
-#  }
+  if($attr{Ontology_term}){
+
+    foreach my $id (@{ $attr{Ontology_term} }){
+      my $ont_name = Bio::Ontology::OntologyStore->guess_ontology($id);
+      my $ont = Bio::Ontology::OntologyStore->get_ontology($ont_name);
+      my($term) = $ont->find_terms(-identifier => $id);
+      my $a = Bio::Annotation::OntologyTerm->new();
+      $a->term($term);
+      $ac->add_Annotation('ontology_term',$a);
+    }
+  }
 
   #Handle Gap attributes
   if($attr{Gap}){
@@ -352,7 +360,7 @@
     $ac->add_Annotation('Name',$a);
   }
 
-  foreach my $other_canonical (qw(Alias Parent Note Ontology_term)){
+  foreach my $other_canonical (qw(Alias Parent Note)){
     if($attr{$other_canonical}){
       foreach my $value (@{ $attr{$other_canonical} }){
         my $a = Bio::Annotation::SimpleValue->new();



More information about the Bioperl-guts-l mailing list