[BioPython] OBO File Format Parser?

Chris Fields cjfields at uiuc.edu
Fri Dec 15 17:28:51 UTC 2006


On Dec 15, 2006, at 3:29 AM, Dave Clements wrote:

> Hello,
>
> I have searched through Biopython and have not been able to find an  
> OBO
> file format parser (see http://www.geneontology.org/GO.format.shtml).
> Does anyone know if such a parser exists.
>
> I apologise if this issues has been previously raised.  The Biopython
> mail list search facility is currently down.
>
> Thanks,
>
> Dave C.

BioPerl has a relatively new one:

=head1 NAME

Bio::OntologyIO::obo - a parser for OBO flat-file format from Gene  
Ontology Consortium

=head1 SYNOPSIS

   use Bio::OntologyIO;

   # do not use directly -- use via Bio::OntologyIO
   my $parser = Bio::OntologyIO->new
         ( -format       => "obo",
           -file        =>  "gene_ontology.obo");

   while(my $ont = $parser->next_ontology()) {
   print "read ontology ",$ont->name()," with ",
                scalar($ont->get_root_terms)," root terms, and ",
                scalar($ont->get_all_terms)," total terms, and ",
                scalar($ont->get_leaf_terms)," leaf terms\n";
   }


chris




More information about the Biopython mailing list