Bio::T...actory(3pm)
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::RandomFactoryobject - Returns:
Bio::Tree::RandomFactory - Args:
-nodetype=> Type of Nodes to create [defaultBio::Tree::Node]-maxcount=> [optional] Maximum num trees to create-randtype=> Type of random trees so far supportyule/backward_yule/BY[default]forward_yule/FYbirthdeath_forward/BDFbirthdeath_backwards/BDB
ONE of the following must be specified:
-taxa=>$arrayrefof 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
maxcountis not specified on initialization or set to a valid integer, subsequent calls tonext_treewill continue to return random trees and never return undef. so like, watch out for that. π
- NOTE: if
- Returns:
Bio::Tree::TreeIobject - 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:
$maximumsize 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
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms