Bio::Tree::TreeI(3pm)

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

πŸ’– Bio::Tree::TreeI πŸ’–

okay bestie, so this is Bio::Tree::TreeI, straight out of the User Contributed Perl Documentation section of the perl manpages. It's a Tree object that's good for, like, lots of stuff β€” but it was originally designed for Phylogenetic Trees. 🌳✨


🌸 NAME 🌸

Bio::Tree::TreeI β€” a Tree object suitable for lots of things, designed originally for Phylogenetic Trees. πŸ’…


✨ SYNOPSIS ✨

# get a Bio::Tree::TreeI somehow
# like from a TreeIO
my $treeio = Bio::TreeIO->new(-format => 'newick', -file => 'treefile.dnd');
my $tree   = $treeio->next_tree;
my @nodes  = $tree->get_nodes;
my @leaves = $tree->get_leaf_nodes;
my $root   = $tree->get_root_node;

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this object just holds a pointer to the Root of a Tree, and that Root is a Bio::Tree::NodeI. That's it, that's the whole vibe. 🫢


πŸ’Œ 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. πŸ₯Ή

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. 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@bioperl.org


🌈 CONTRIBUTORS 🌈

Aaron Mackey, amackey@virginia.edu Elia Stupka, elia@fugu-sg.org Sendu Bala, bix@sendu.me.uk


⭐ APPENDIX ⭐

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk πŸ‘€).


πŸ“ get_nodes

  • Title β€” get_nodes
  • Usage β€” my @nodes = $tree->get_nodes()
  • Function β€” Return list of Tree::NodeI objects
  • Returns β€” array of Tree::NodeI objects
  • Args β€” (named values) hash with one value
order => 'b|breadth' first order or 'd|depth' first order

🧚 get_root_node

  • Title β€” get_root_node
  • Usage β€” my $node = $tree->get_root_node();
  • Function β€” Get the Top Node in the tree, in this implementation Trees only have one top node.
  • Returns β€” Bio::Tree::NodeI object
  • Args β€” none

πŸ’œ number_nodes

  • Title β€” number_nodes
  • Usage β€” my $size = $tree->number_nodes
  • Function β€” Find the number of nodes in the tree.
  • Returns β€” int
  • Args β€” none

🌸 total_branch_length

  • Title β€” total_branch_length
  • Usage β€” my $size = $tree->total_branch_length
  • Function β€” Returns the sum of the length of all branches
  • Returns β€” integer
  • Args β€” none

πŸ”₯ height

  • Title β€” height
  • Usage β€” my $height = $tree->height
  • Function β€” Gets the height of tree - this LOG_2($number_nodes)
WARNING: this is only true for strict binary trees. The TreeIO system is capable of building non-binary trees, for which this method will currently return an incorrect value!! πŸ’€
  • Returns β€” integer
  • Args β€” none

πŸŽ€ id

  • Title β€” id
  • Usage β€” my $id = $tree->id();
  • Function β€” An id value for the tree
  • Returns β€” scalar
  • Args β€”

⭐ score

  • Title β€” score
  • Usage β€” $obj->score($newval)
  • Function β€” Sets the associated score with this tree. This is a generic slot which is probably best used for log likelihood or other overall tree score
  • Returns β€” value of score
  • Args β€” newvalue (optional)

πŸ¦‹ get_leaf_nodes

  • Title β€” get_leaf_nodes
  • Usage β€” my @leaves = $tree->get_leaf_nodes()
  • Function β€” Returns the leaves (tips) of the tree
  • Returns β€” Array of Bio::Tree::NodeI objects
  • Args β€” none

πŸ’– Methods for associating Tag/Values with a Tree πŸ’–

These methods associate tag/value pairs with a Tree. periodt. ✨


🩷 set_tag_value

  • Title β€” set_tag_value
  • Usage β€” $tree->set_tag_value($tag,$value) / $tree->set_tag_value($tag,@values)
  • Function β€” Sets a tag value(s) to a tree. Replaces old values.
  • Returns β€” number of values stored for this tag
  • Args β€” $tag - tag name; $value - value to store for the tag

🌈 add_tag_value

  • Title β€” add_tag_value
  • Usage β€” $tree->add_tag_value($tag,$value)
  • Function β€” Adds a tag value to a tree
  • Returns β€” number of values stored for this tag
  • Args β€” $tag - tag name; $value - value to store for the tag

πŸ› remove_tag

  • Title β€” remove_tag
  • Usage β€” $tree->remove_tag($tag)
  • Function β€” Remove the tag and all values for this tag
  • Returns β€” boolean representing success (0 if tag does not exist)
  • Args β€” $tag - tagname to remove

🧚 remove_all_tags

  • Title β€” remove_all_tags
  • Usage β€” $tree->remove_all_tags()
  • Function β€” Removes all tags
  • Returns β€” None
  • Args β€” None

πŸ‘‘ get_all_tags

  • Title β€” get_all_tags
  • Usage β€” my @tags = $tree->get_all_tags()
  • Function β€” Gets all the tag names for this Tree
  • Returns β€” Array of tagnames
  • Args β€” None

πŸ“ get_tag_values

  • Title β€” get_tag_values
  • Usage β€” my @values = $tree->get_tag_values($tag)
  • Function β€” Gets the values for given tag ($tag)
  • Returns β€” Array of values or empty list if tag does not exist
  • Args β€” $tag - tag name

πŸ’… has_tag

  • Title β€” has_tag
  • Usage β€” $tree->has_tag($tag)
  • Function β€” Boolean test if tag exists in the Tree
  • Returns β€” Boolean
  • Args β€” $tag - tagname

and that's the whole page bestie!! this one came from perl v5.32.1, dated 2021-08-15, filed under Bio::Tree::TreeI(3pm). no cap, go build some trees πŸŒ³πŸ’œβœ¨
πŸ“¦ where this page comes from