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

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

πŸŽ€ Bio::Tools::RandomDistFunctions πŸŽ€

okay bestie, welcome to the perl side of the terminal πŸ’… this one lives in the perl manual pages (that's the 3pm energy, third section, module docs, iykyk) and it's genuinely so fun β€” it's a whole lil toolbox for making up random numbers that follow specific distributions. no cap.


✨ NAME ✨

Bio::Tools::RandomDistFunctions β€” a whole set of routines that are lowkey perfect for generating random data across different distributions 🎲✨


πŸ¦‹ SYNOPSIS πŸ¦‹

use Bio::Tools::RandomDistFunctions;
my $dist = Bio::Tools::RandomDistFunctions->new();
for my $v ( 1..1000 ) {
  my $birth_dist = $dist->rand_birth_distribution($lambda);
  # ... do something with the variable
}

literally make an object, loop a thousand times, pull a random variable out each time, do your thing with it. that's the whole vibe 🫢


🌸 DESCRIPTION 🌸

most of this code is based on the C implementation of these routines over in Mike Sanderson's r8s package 🧚 if you wanna know more about his software, go look at http://loco.biosci.arizona.edu/r8s/ β€” that's the link, that's the source of the inspo.


πŸ’– FEEDBACK πŸ’–

πŸ“¬ Mailing Lists

user feedback is integral to the evolution of this and every other Bioperl module β€” like, the whole thing grows because y'all talk to us 🫢 send your comments and suggestions preferably to the Bioperl mailing list. your participation is much appreciated, fr fr.

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

πŸ«‚ Support

please direct your usage questions and support issues to the mailing list:

bioperl-l@bioperl.org

...rather than sliding into the module maintainer's DMs directly πŸ™ˆ so many experienced and responsive experts are on that list and they'll be able to look at your problem and address it quickly. and bestie, please include a thorough description of the problem, with code and data examples if at all possible β€” it's giving "help us help you" energy πŸ’…

πŸ› Reporting Bugs

report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolutions β€” it's the whole point. bug reports can be submitted via the web at:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR - Jason Stajich πŸ‘‘

Email jason-at-bioperl.org πŸ“§


🌈 CONTRIBUTORS 🌈

big thank you to Mike Sanderson for the assistance in getting this implementation together 🫢 iconic behavior honestly.


⭐ APPENDIX ⭐

the rest of the documentation breaks down each of the object methods one by one, no skips, no skimming πŸ” internal methods are usually preceded with a _ (iykyk, that underscore is the "do not touch, this is private" signal πŸ’€).

🍼 birth_distribution 🍼

  • Title β€” rand_birth_distribution
  • Usage β€” my $randvar = $dist->rand_birth_distribution($lambda);
  • Function β€” returns a random number from a birth process waiting time with a fixed interval 1.0. times are measured from 0=present, 1=root.
  • Returns β€” floating point number
  • Args β€” $lambda ( > 0 )
  • References β€” this is based on code by Mike Sanders in r8s. Ross, Stochastic Processes, p. 145 for the density.

🎲 rand_geometric_distribution 🎲

  • Title β€” rand_geometric_distribution
  • Usage β€” my $randvar = $dist->rand_geometric_distribution($param);
  • Function β€” returns a random geometric variate distributed with parameter $param, according to the c.d.f. 1 - ( 1- param) ^ n
  • Returns β€” integer
  • Args β€” $param ( 0 > $param < 1 )
heads up bestie, that's the arg range written exactly how the original says it β€” copy it as-is, don't go "fixing" it ✨

πŸ“ˆ rand_exponentional_distribution πŸ“ˆ

(yes, that spelling, keep it, it's the actual method name πŸ’…)

  • Title β€” rand_exponentional_distribution
  • Usage β€” my $var = $dist->rand_exponentional_distribution($param);
  • Function β€” returns a random exponential variate distributed with parameter $param, according to c.d.f 1 - e^(-param * x)
  • Returns β€” floating point number
  • Args β€” $param ( > 0 )

πŸ”” rand_normal_distribution πŸ””

  • Title β€” rand_normal_distribution
  • Usage β€” my $var = $dist->rand_normal_distribution()
  • Function β€” returns a random normal (gaussian) variate distributed
  • Returns β€” floating point number
  • Args β€” none

and that's the whole page, bestie, you ate it up πŸ’… this was the perl documentation, perl v5.32.1, dated 2021-08-15 β€” go forth and generate some beautifully distributed random numbers, periodt πŸŒŸπŸ¦‹

πŸ“¦ where this page comes from