NAME
Bio::OntologyIO - Parser factory for Ontology formats
SYNOPSIS
use Bio::OntologyIO;my $parser = Bio::OntologyIO->new(-format => "go",-file=> $file);while(my $ont = $parser->next_ontology()) {print "read ontology ",$ont->name()," with ",scalar($ont->get_root_terms)," root terms, and ",scalar($ont->get_leaf_terms)," leaf terms\n";}
DESCRIPTION
This is the parser factory for different ontology sources and formats. Conceptually, it is very similar to Bio::SeqIO, but the difference is that the chunk of data returned as an object is an entire ontology.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Hilmar Lapp
Email hlapp at gmx.net
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : my $parser = Bio::OntologyIO->new(-format => 'go', @args);Function: Returns a stream of ontologies opened on the specified inputfor the specified format.Returns : An ontology parser (an instance of Bio::OntologyIO) initializedfor the specified format.Args : Named parameters. Common parameters are-format - the format of the input; the following arepresently supported:goflat: DAG-Edit Gene Ontology flat filesgo : synonymous to goflatsoflat: DAG-Edit Sequence Ontology flat filesso : synonymous to soflatsimplehierarchy: text format with one term per lineand indentation giving the hierarchyevoc : synonymous to simplehierarchyinterpro: InterPro XMLinterprosax: InterPro XML - this is actually not aBio::OntologyIO compliant parser; instead itpersists terms as they are encountered.L<Bio::OntologyIO::Handlers::InterPro_BioSQL_Handler>obo : OBO format style from Gene Ontology Consortium-file - the file holding the data-fh - the stream providing the data (-file and -fh aremutually exclusive)-ontology_name - the name of the ontology-engine - the L<Bio::Ontology::OntologyEngineI> objectto be reused (will be created otherwise); notethat every L<Bio::Ontology::OntologyI> willqualify as well since that one inherits from theformer.-term_factory - the ontology term factory to use. Provide avalue only if you know what you are doing.DAG-Edit flat file parsers will usually also accept thefollowing parameters.-defs_file - the name of the file holding the termdefinitions-files - an array ref holding the file names (for GO,there will usually be 3 files: component.ontology,function.ontology, process.ontology)Other parameters are specific to the parsers.
format
Title : formatUsage : $format = $parser->format()Function: Get the ontology formatReturns : ontology formatArgs : none
next_ontology
Title : next_ontologyUsage : $ont = $stream->next_ontology()Function: Reads the next ontology object from the stream and returns it.Returns : a L<Bio::Ontology::OntologyI> compliant object, or undef at theend of the streamArgs : none
term_factory
Title : term_factoryUsage : $obj->term_factory($newval)Function: Get/set the ontology term factory to use.As a user of this module it is not necessary to call thismethod as there will be default. In order to change thedefault, the easiest way is to instantiateL<Bio::Ontology::TermFactory> with the proper -typeargument. Most if not all parsers will actually use thisvery implementation, so even easier than the aforementionedway is to simply call$ontio->term_factory->type("Bio::Ontology::MyTerm").Example :Returns : value of term_factory (a Bio::Factory::ObjectFactoryI object)Args : on set, new value (a Bio::Factory::ObjectFactoryI object, optional)
Private Methods
Some of these are actually 'protected' in OO speak, which means youmay or will want to utilize them in a derived ontology parser, butyou should not call them from outside.
_load_format_module
Title : _load_format_moduleUsage : *INTERNAL OntologyIO stuff*Function: Loads up (like use) a module at run time on demandExample :Returns :Args :