Bio::OntologyIO(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Bio::OntologyIO πŸ’–

okay bestie, gather round, because we're talking about Bio::OntologyIO β€” the parser factory for Ontology formats ✨ (that's the module's whole thing, no cap).


🌸 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 πŸ¦‹

So this is the parser factory for all the different ontology sources and formats out there. Conceptually it's giving major Bio::SeqIO energy β€” like, they're cousins fr fr β€” but here's the plot twist: the chunk of data you get back as an object is an entire ontology. yeah. the whole thing. iconic behavior honestly πŸ‘‘


πŸ’Œ FEEDBACK πŸ’Œ

πŸ“¬ Mailing Lists

User feedback is literally an integral part of the evolution of this and other Bioperl modules, bestie β€” it's how things grow 🫢. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated, like genuinely πŸ’•.

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

πŸ«‚ Support

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly, okay? Because 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 β€” the more detail the better, fr fr πŸ”.

πŸ› 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
not me asking you to file an issue... but like, please do πŸ™ˆ

πŸ‘‘ 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 _ (iykyk πŸ’…).

✨ new ✨

  • Title : new
  • Usage : my $parser = Bio::OntologyIO->new(-format => 'go', @args);
  • Function: Returns a stream of ontologies opened on the specified input for the specified format.
  • Returns : An ontology parser (an instance of Bio::OntologyIO) initialized for the specified format.
  • Args : Named parameters. Common parameters are
-format    - the format of the input; the following are
             presently supported:
    goflat: DAG-Edit Gene Ontology flat files
    go    : synonymous to goflat
    soflat: DAG-Edit Sequence Ontology flat files
    so    : synonymous to soflat
    simplehierarchy: text format with one term per line
            and indentation giving the hierarchy
    evoc  : synonymous to simplehierarchy
    interpro: InterPro XML
    interprosax: InterPro XML - this is actually not a
            Bio::OntologyIO compliant parser; instead it
            persists 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 are
            mutually exclusive)
-ontology_name - the name of the ontology
-engine    - the L<Bio::Ontology::OntologyEngineI> object
            to be reused (will be created otherwise); note
            that every L<Bio::Ontology::OntologyI> will
            qualify as well since that one inherits from the
            former.
-term_factory - the ontology term factory to use. Provide a
            value only if you know what you are doing.

DAG-Edit flat file parsers will usually also accept the following parameters.

-defs_file - the name of the file holding the term
            definitions
-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 : format
  • Usage : $format = $parser->format()
  • Function: Get the ontology format
  • Returns : ontology format
  • Args : none

🌈 next_ontology 🌈

  • Title : next_ontology
  • Usage : $ont = $stream->next_ontology()
  • Function: Reads the next ontology object from the stream and returns it.
  • Returns : a Bio::Ontology::OntologyI compliant object, or undef at the end of the stream (so like, when it's done, it's done πŸ’€)
  • Args : none

πŸŽ€ term_factory πŸŽ€

  • Title : term_factory
  • Usage : $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 this method as there will be default. In order to change the default, the easiest way is to instantiate Bio::Ontology::TermFactory with the proper -type argument. Most if not all parsers will actually use this very implementation, so even easier than the aforementioned way 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 you may or will want to utilize them in a derived ontology parser, but you should not call them from outside 🚫 (boundaries, bestie, we love them).

🧚 _load_format_module 🧚

  • Title : _load_format_module
  • Usage : *INTERNAL OntologyIO stuff*
  • Function: Loads up (like use) a module at run time on demand
  • Example :
  • Returns :
  • Args :

and that's the whole page, you ate it, no crumbs πŸ’…βœ¨

this lil' beauty is perl v5.32.1, dated 2021-08-15, and it's part of the Bio::OntologyIO(3pm) situation β€” mwah, go write some ontologies bestie πŸ¦‹πŸ’–

πŸ“¦ where this page comes from