Bio::T...actory(3pm)

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

Bio::Tree::RandomFactory πŸ’– (aka the Bio::T...actory(3pm) page, bestie)

okay so hi!! you found the manual page for Bio::Tree::RandomFactory β€” it lives in the Bio::T...actory(3pm) corner of the perl docs (User Contributed Perl Documentation, to be exact). pull up a chair, grab a boba, we're learning this together πŸ§‹βœ¨


✨ NAME ✨

Bio::Tree::RandomFactory β€” it's a TreeFactory for generating Random Trees. that's the whole job. iconic. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

use Bio::Tree::RandomFactory
my @taxonnames;
my $factory = Bio::Tree::RandomFactory->new( -taxa => \@taxonnames,
                                            -maxcount => 10);

# or for anonymous samples

my $factory = Bio::Tree::RandomFactory->new( -num_taxa => 6,
                                            -maxcount => 50);

my $tree = $factory->next_tree;

🌸 DESCRIPTION 🌸

so like, it builds a random tree every single time next_tree gets called β€” or up to -maxcount times, whichever comes first. slay.

this module was originally written for Coalescent simulations (go look at Bio::PopGen::Simulation::Coalescent if that's your vibe). the author kept the next_tree method intact even though it is not generating random trees in the phylogenetic sense. they said they'd be happy for someone to provide alternative implementations which can be used here. ngl, as written it will generate random topologies but the branch lengths are built from assumptions in the coalescent and are not appropriate for phylogenetic analyses. important!! don't come for me, it's in the docs.

this algorithm is based on the make_tree algorithm from Richard Hudson 1990. 🫢

Hudson, R. R. 1990. Gene genealogies and the coalescent process. Pp. 1-44 in D. Futuyma and J. Antonovics, eds. Oxford surveys in evolutionary biology. Vol. 7. Oxford University Press, New York

Sanderson, M ...


πŸ’¬ FEEDBACK πŸ’¬

🌈 Mailing Lists 🌈

user feedback is an integral part of the evolution of this and other Bioperl modules β€” genuinely, they want to hear from you. 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. the reason? many experienced and reponsive experts will be able look at the problem and quickly address it. so like, the group chat is faster than the DM, fr fr. 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.org


🫢 CONTRIBUTORS 🫢

Matthew Hahn, <matthew.hahn@duke.edu> β€” Mike Sanderson


⭐ 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 $factory = Bio::Tree::RandomFactory->new(-samples => \@samples, -maxcount=> $N);
  • Function: Initializes a Bio::Tree::RandomFactory object
  • Returns: Bio::Tree::RandomFactory
  • Args:
    • -nodetype => Type of Nodes to create [default Bio::Tree::Node]
    • -maxcount => [optional] Maximum num trees to create
    • -randtype => Type of random trees so far support
      • yule/backward_yule/BY [default]
      • forward_yule/FY
      • birthdeath_forward/BDF
      • birthdeath_backwards/BDB
ONE of the following must be specified:
  • -taxa => $arrayref of taxa names
  • -num_taxa => integer indicating number of taxa in the tree

πŸ¦‹ next_tree

  • Title: next_tree
  • Usage: my $tree = $factory->next_tree
  • Function: Returns a random tree based on the initialized number of nodes
    • NOTE: if maxcount is not specified on initialization or set to a valid integer, subsequent calls to next_tree will continue to return random trees and never return undef. so like, watch out for that. πŸ’€
  • Returns: Bio::Tree::TreeI object
  • Args: none

πŸ’… maxcount

  • Title: maxcount
  • Usage: $obj->maxcount($newval)
  • Function: (no description given in the original β€” it just vibes)
  • Returns: Maxcount value
  • Args: newvalue (optional)

πŸ“ reset_tree_count

  • Title: reset_tree_count
  • Usage: $factory->reset_tree_count;
  • Function: Reset the tree counter
  • Returns: none
  • Args: none

🌈 taxa

  • Title: taxa
  • Usage: $obj->taxa($newval)
  • Function: Set the leaf node names
  • Returns: value of taxa
  • Args: Arrayref of Taxon names

✨ num_taxa

  • Title: num_taxa
  • Usage: $obj->num_taxa($newval)
  • Function: Get the number of Taxa
  • Returns: value of num_taxa
  • Args: none

🎲 random

  • Title: random
  • Usage: my $rfloat = $node->random($size)
  • Function: Generates a random number between 0 and $size. this is abstracted so that someone can override and provide their own special RNG. this is expected to be a uniform RNG.
  • Returns: Floating point random
  • Args: $maximum size for random number (defaults to 1)

🌸 random_tree_method

  • Title: random_tree_method
  • Usage: $obj->random_tree_method($newval)
  • Function: (no description given in the original)
  • Example: (none given)
  • Returns: value of random_tree_method (a scalar)
  • Args: on set, new value (a scalar or undef, optional)

🧊 nodetype

  • Title: nodetype
  • Usage: $obj->nodetype($newval)
  • Function: (no description given in the original)
  • Example: (none given)
  • Returns: value of nodetype (a scalar)
  • Args: on set, new value (a scalar or undef, optional)

and that's the whole page bestie!! πŸ’œ this doc is perl v5.32.1 and it's dated 2021-08-15 β€” the Bio::T...actory(3pm) header and footer, folded in all cute for you. go forth and generate those random trees. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from