Bio::TreeIO(3pm)

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

πŸ’– Bio::TreeIO β€” the tree parser bestie πŸ’–

Perl manual page Β· Bio::TreeIO(3pm) Β· User Contributed Perl Documentation

okay so literally welcome to Bio::TreeIO, the driver module that reads Trees 🌳 out of data streams and flatfiles, and it's whole goal in life is to build Bio::Tree::TreeI objects for you. no cap. πŸŽ€


✨ SYNOPSIS ✨

{
    use Bio::TreeIO;
    my $treeio = Bio::TreeIO->new(-format => 'newick',
                                  -file   => 'globin.dnd');
    while( my $tree = $treeio->next_tree ) {
              print "Tree is ", $tree->number_nodes, "\n";
    }
}

look at her go πŸ¦‹ loop over the trees, print the node count, iconic behavior honestly.


🌸 DESCRIPTION 🌸

So this is the driver module for Tree reading from data streams and flatfiles. The whole point, the main character mission, is that it's intended to be able to create Bio::Tree::TreeI objects. periodt. πŸ’…


πŸ’Œ FEEDBACK πŸ’Œ

πŸ“¬ Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules, fr fr. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated 🫢

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. Many experienced and reponsive experts will be able look at the problem and quickly address it (yes that's their spelling, we keep 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 - Jason Stajich πŸ‘‘

Email jason-at-bioperl-dot-org


🌈 CONTRIBUTORS 🌈

Allen Day <allenday@ucla.edu>


πŸ“– APPENDIX πŸ“–

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk, underscore means it's private business πŸ™ˆ).

🌱 new

Title   : new
Usage   : my $obj = Bio::TreeIO->new();
Function: Builds a new Bio::TreeIO object
Returns : Bio::TreeIO
Args    : a hash.  useful keys:
  -format : Specify the format of the file.  Supported formats:

    newick             Newick tree format
    nexus              Nexus tree format
    nhx                NHX tree format
    svggraph           SVG graphical representation of tree
    tabtree            ASCII text representation of tree
    lintree            lintree output format

bestie you literally just hand it a hash and it builds you a fresh Bio::TreeIO object and hands it right back πŸ’– the useful keys: -format lets you pick what format the file is in, and the supported formats are newick, nexus, nhx, svggraph, tabtree, and lintree. slay.

πŸŽ€ format

Title   : format
Usage   : $format = $obj->format()
Function: Get the tree format
Returns : tree format
Args    : none

gets you the tree format. no args needed, she just tells you. ✨

🌳 next_tree

Title   : next_tree
Usage   : my $tree = $treeio->next_tree;
Function: Gets the next tree off the stream
Returns : Bio::Tree::TreeI or undef if no more trees
Args    : none

grabs the next tree off the stream πŸ”₯ returns a Bio::Tree::TreeI, or undef if there are no more trees (sad but true, all good things end 😭).

πŸ–ŠοΈ write_tree

Title   : write_tree
Usage   : $treeio->write_tree($tree);
Function: Writes a tree onto the stream
Returns : none
Args    : Bio::Tree::TreeI

writes a tree onto the stream. takes a Bio::Tree::TreeI, returns none β€” she gives, she doesn't take πŸ’…

🎧 attach_EventHandler

Title   : attach_EventHandler
Usage   : $parser->attatch_EventHandler($handler)
Function: Adds an event handler to listen for events
Returns : none
Args    : Bio::Event::EventHandlerI

adds an event handler to listen for events 🫢 takes a Bio::Event::EventHandlerI, returns none. (yes the usage line says attatch with two t's, we're keeping it exactly as it is, no editing the vibes πŸ’€)

πŸ”’ _eventHandler

Title   : _eventHandler
Usage   : private
Function: Get the EventHandler
Returns : Bio::Event::EventHandlerI
Args    : none

private, bestie, don't touch πŸ™ˆ gets you the EventHandler as a Bio::Event::EventHandlerI.

πŸ“¦ _load_format_module

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

internal TreeIO stuff only ⭐ loads up (like use) a module at run time on demand. that's it, that's the function.

πŸ” _guess_format

Title   : _guess_format
Usage   : $obj->_guess_format($filename)
Function:
Example :
Returns : guessed format of filename (lower case)
Args    :

takes a filename, returns the guessed format of that filename (lower case) πŸ‘‘ detective energy fr.


and that's the whole page bestie, go parse some trees πŸŒ³πŸ’œ

this was perl v5.32.1, dated 2021-08-15, Bio::TreeIO(3pm) β€” mwah, take care of her πŸŽ€βœ¨

πŸ“¦ where this page comes from