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

πŸ“¦
version 1.7.3 Β· 3 versions
, in debian bookworm, ubuntu noble

🌸 NAME 🌸

Bio::Tools::Run::Phylo::Phyml β€” the wrapper that lets you do rapid reconstruction of phylogenies using Phyml. Yes bestie, this is the Bio::T...::Phyml(3pm) page, and we're reading it together πŸ’–


✨ SYNOPSIS ✨

Okay so here's the whole vibe in code form, no notes:

use Bio::Tools::Run::Phylo::Phyml;

#  Make a Phyml factory
$factory = Bio::Tools::Run::Phylo::Phyml->new(-verbose => 2);
# it defaults to protein alignment
# change parameters
$factory->model('Dayhoff');
#  Pass the factory an alignment and run
$inputfilename = 't/data/protpars.phy';
$tree = $factory->run($inputfilename); # $tree is a Bio::Tree::Tree object.

# or set parameters at object creation
my %args = (
    -data_type => 'dna',
    -model => 'HKY',
    -kappa => 4,
    -invar => 'e',
    -category_number => 4,
    -alpha => 'e',
    -tree => 'BIONJ',
    -opt_topology => '0',
    -opt_lengths => '1',
    );
$factory = Bio::Tools::Run::Phylo::Phyml->new(%args);
# if you need the output files do
$factory->save_tempfiles(1);
$factory->tempdir($workdir);

# and get a Bio::Align::AlignI (SimpleAlign) object from somewhere
$tree = $factory->run($aln);

Periodt. That's the whole thing. 🫢


πŸ’« DESCRIPTION πŸ’«

So basically this is a wrapper for running the phyml application by Stephane Guindon and Olivier Gascuel. You can download it from:

http://atgc.lirmm.fr/phyml/

πŸŽ€ Installing πŸŽ€

After downloading, you need to rename the copy of the program that runs under your operating system. I.e. phyml_linux into phyml.

You will need to help this Phyml wrapper find the phyml program. This can be done in (at least) three ways:

  1. Make sure the Phyml executable is in your path. Copy it to, or create a symbolic link from a directory that is in your path.
  2. Define an environmental variable PHYMLDIR which is a directory which contains the 'phyml' application. In bash:
export PHYMLDIR=/home/username/phyml_v2.4.4/exe

In csh/tcsh:

setenv PHYMLDIR /home/username/phyml_v2.4.4/exe
  1. Include a definition of an environmental variable PHYMLDIR in every script that will use this Phyml wrapper module, e.g.:
BEGIN { $ENV{PHYMLDIR} = '/home/username/phyml_v2.4.4/exe' }
use Bio::Tools::Run::Phylo::Phyml;

🌈 Running 🌈

This wrapper has been tested with PHYML v2.4.4 and v.3.0. It may work with recent Phyml releases using a date format for the format, but the wrapper hasn't been extensively tested in these cases, so for the moment only the simpler numbered versions are supported. Lowkey important, bestie.

In its current state, the wrapper supports only input of one MSA and output of one tree. It can easily be extended to support more advanced capabilities of phyml.

Two convienience methods have been added on top of the standard BioPerl WrapperBase ones: stats() and tree_string(). You can call them to after running the phyml program to retrieve into a string the statistics and the tree in Newick format. Obsessed, honestly. ✨


πŸ’Œ 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. (fr fr, the more context the better πŸ’…)

πŸ› 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:

http://bugzilla.open-bio.org/


πŸ‘‘ AUTHOR - Heikki Lehvaslaiho πŸ‘‘

heikki at bioperl dot org


more coming, bestie β€” don't go anywhere πŸ’œ

✨ APPENDIX ✨

okay bestie, here's the deep lore πŸ’… the rest of the docs walk through every single object method one by one. and psst β€” the internal ones (the ones with a lil underscore _ in front) are private, so don't go poking them from outside the class, mkay?


🌸 new

  • Title β€” new
  • Usage β€” $factory = Bio::Tools::Run::Phylo::Phyml->new(@params)
  • Function β€” spins up a brand new Phyml factory, iconic behaviour ✨
  • Returns β€” Bio::Tools::Run::Phylo::Phyml
  • Args β€” optional, but you can hand it any of these (defaults are in the square brackets):
-data_type       => 'dna' or 'protein',   [protein]
-dataset_count   => integer,             [1]
-model           => 'HKY'... ,            [HKY|JTT]
-kappa           => 'e' or float,         [e]
-invar           => 'e' or float,         [e]
-category_number => integer,              [1]
-alpha           => 'e' or float (int v3),[e]
-tree            => 'BIONJ' or your own,  [BION]
-bootstrap       => integer               [123]
-opt_topology    => boolean               [1]
-opt_lengths     => boolean               [1]
-no_memory_check => boolean               [1]
-program_name    => string

🧚 program_name

  • Title β€” program_name
  • Usage β€” $factory>program_name()
  • Function β€” holds the program name
  • Returns β€” string
  • Args β€” None

🧚 program_dir

  • Title β€” program_dir
  • Usage β€” $factory->program_dir(@params)
  • Function β€” returns the program directory, grabbed straight from an ENV variable
  • Returns β€” string
  • Args β€” None

🧚 version

  • Title β€” version
  • Usage β€” exit if $prog->version < 1.8
  • Function β€” figures out the version number of the program
  • Example β€”
  • Returns β€” float or undef
  • Args β€” none
heads up: Phyml before 3.0 did not display the version. Assume 2.44 when can not determine it.
also: some releases do not state version number, only date, so the version might have to be inferred from this date. 😭 detective work fr fr

🌈 run

  • Title β€” run
  • Usage β€”
$factory->run($aln_file);
$factory->run($align_object);
  • Function β€” runs Phyml to generate a tree 🌳
  • Returns β€” Bio::Tree::Tree object
  • Args β€” file name for your input alignment in a format recognised by AlignIO, OR a Bio::Align::AlignI compliant object (eg. Bio::SimpleAlign).

πŸ“ stats

  • Title β€” stats
  • Usage β€” $factory->stats;
  • Function β€” returns the contents of the phyml '_phyml_stat.txt' output file
  • Returns β€” string with statistics about the run, undef before run()
  • Args β€” none

πŸ“ tree_string

  • Title β€” tree_string
  • Usage β€”
$factory->tree_string;
$factory->run($align_object);
  • Function β€” returns the contents of the phyml '_phyml_tree.txt' output file
  • Returns β€” string with tree in Newick format, undef before run()
  • Args β€” none

πŸ’… Getsetters

these methods are used to set and get program parameters before running. get it? get + set. getsetters. the way that naming ate 😌

πŸ¦‹ data_type

  • Title β€” data_type
  • Usage β€” $phyml->data_type('nt');
  • Function β€” sets the sequence alphabet to 'dna' (nt in v3) or 'aa'. If leaved unset, will be set automatically
  • Returns β€” set value, defaults to 'protein'
  • Args β€” None to get, 'dna' ('nt') or 'aa' to set.

πŸ¦‹ data_format

  • Title β€” data_format
  • Usage β€” $phyml->data_format('s');
  • Function β€” sets PHYLIP format to 'i' interleaved or 's' sequential
  • Returns β€” set value, defaults to 'i'
  • Args β€” None to get, 'i' or 's' to set.

πŸ¦‹ dataset_count

  • Title β€” dataset_count
  • Usage β€” $phyml->dataset_count(3);
  • Function β€” sets the dataset number to deal with
  • Returns β€” set value, defaults to 1
  • Args β€” None to get, positive integer to set.

πŸ‘‘ model

  • Title β€” model
  • Usage β€” $phyml->model('HKY');
  • Function β€” choose the substitution model to use. one of:
JC69 | K2P | F81 | HKY | F84 | TN93 | GTR (DNA)
JTT | MtREV | Dayhoff | WAG (amino acids)

v3.0:

HKY85 (default) | JC69 | K80 | F81 | F84 |
TN93 | GTR (DNA)
LG (default) | WAG | JTT | MtREV | Dayhoff | DCMut |
RtREV | CpREV | VT | Blosum62 | MtMam | MtArt |
HIVw |  HIVb (amino acids)
  • Returns β€” name of the model, v2.4.4 defaults to {HKY|JTT}
  • Args β€” None to get, string to set.

πŸ¦‹ kappa

  • Title β€” kappa
  • Usage β€” $phyml->kappa(4);
  • Function β€” sets the transition/transversion ratio, leave unset to estimate
  • Returns β€” set value, defaults to 'e'
  • Args β€” None to get, float or integer to set.

πŸ¦‹ invar

  • Title β€” invar
  • Usage β€” $phyml->invar(.3);
  • Function β€” sets the proportion of invariable sites, leave unset to estimate
  • Returns β€” set value, defaults to 'e'
  • Args β€” None to get, float or integer to set.

πŸ¦‹ category_number

  • Title β€” category_number
  • Usage β€” $phyml->category_number(4);
  • Function β€” sets the number of relative substitution rate categories
  • Returns β€” set value, defaults to 1
  • Args β€” None to get, integer to set.

πŸ¦‹ alpha

  • Title β€” alpha
  • Usage β€” $phyml->alpha(1.0);
  • Function β€” sets the gamma distribution parameter, leave unset to estimate
  • Returns β€” set value, defaults to 'e'
  • Args β€” None to get, float or integer to set.

🌳 tree

  • Title β€” tree
  • Usage β€” $phyml->tree('/tmp/tree.nwk');
  • Function β€” sets the starting tree, leave unset to estimate a distance tree
  • Returns β€” set value, defaults to 'BIONJ'
  • Args β€” None to get, newick tree file name to set.

🫢 v2 options

these methods can be used with PhyML v2* only. vintage era, we respect it πŸ’œ

πŸŽ€ opt_topology

  • Title β€” opt_topology
  • Usage β€” $factory->opt_topology(1);
  • Function β€” choose to optimise the tree topology
  • Returns β€” 1 or 0. Default is 1.
  • Args β€” None to get, boolean to set.
v2.* only

πŸŽ€ opt_lengths

  • Title β€” opt_lengths
  • Usage β€” $factory->opt_lengths(0);
  • Function β€” choose to optimise branch lengths and rate parameters
  • Returns β€” 1 or 0. Default is 1.
  • Args β€” None to get, boolean to set.
v2.* only

πŸ”₯ v3 options

these methods can be used with PhyML v3* only. the glow-up era, no cap ✨

⭐ freq

  • Title β€” freq
  • Usage β€” $phyml->freq(e); $phyml->freq("0.2, 0.6, 0.6, 0.2");
  • Function β€” sets nucleotide frequences or asks residue to be estimated according to two models: e or d
  • Returns β€” set value,
  • Args β€” None to get, string to set.
v3 only.

⭐ opt

  • Title β€” opt
  • Usage β€” $factory->opt(1);
  • Function β€” optimise tree parameters: tlr|tl|tr|l|n
  • Returns β€” {value|n} (default n)
  • Args β€” None to get, string to set.
v3.* only
  • Title β€” search
  • Usage β€” $factory->search(SPR);
  • Function β€” tree topology search operation algorithm: NNI|SPR|BEST
  • Returns β€” string (defaults to NNI)
  • Args β€” None to get, string to set.
v3.* only

⭐ rand_start

  • Title β€” rand_start
  • Usage β€” $factory->rand_start(1);
  • Function β€” sets the initial SPR tree to random.
  • Returns β€” boolean (defaults to false)
  • Args β€” None to get, boolean to set.
v3.* only; only meaningful if $prog->search is 'SPR'

⭐ rand_starts

  • Title β€” rand_starts
  • Usage β€” $factory->rand_starts(10);
  • Function β€” sets the number of initial random SPR trees
  • Returns β€” integer (defaults to 1)
  • Args β€” None to get, integer to set.
v3.* only; only valid if $prog->search is 'SPR'

⭐ rand_seed

  • Title β€” rand_seed
  • Usage β€” $factory->rand_seed(1769876);
  • Function β€” seeds the random number generator
  • Returns β€” random integer
  • Args β€” None to get, integer to set.
v3.* only; only valid if $prog->search is 'SPR'
Uses perl rand() to initialize if not explicitely set.

🧁 no_memory_check

  • Title β€” no_memory_check
  • Usage β€” $factory->no_memory_check(1);
  • Function β€”
  • Returns β€” boolean (defaults to false)
  • Args β€” None to get, integer to set.

🧁 bootstrap

  • Title β€” bootstrap
  • Usage β€” $factory->bootstrap(100);
  • Function β€” set number of bootstraps
  • Returns β€”
  • Args β€” None to get, integer to set.

🧁 command

  • Title β€” command
  • Usage β€” $factory->command(...);
  • Function β€”
  • Returns β€” string
  • Args β€” None to get, integer to set.

πŸ™ˆ Internal methods

these methods are private and should not be called outside this class. bestie i'm serious, stay out of the group chat that isn't yours πŸ’€

πŸ’œ _setparams

  • Title β€” _setparams
  • Usage β€” Internal function, not to be called directly
  • Function β€” creates a string of params to be used in the command string
  • Returns β€” string of params
  • Args β€” none

πŸ’œ _write_phylip_align_file

  • Title β€” _write_phylip_align_file
  • Usage β€” obj->__write_phylip_align_file($aln)
  • Function β€” Internal (not to be used directly)

writes the alignment into the tmp directory in PHYLIP interlieved format

  • Returns β€” filename
  • Args β€” Bio::Align::AlignI

and that's the whole page, bestie, you made it to the end πŸŽ€πŸ«Ά this was perl v5.36.0, dated 2023-01-22, from the Bio::T...::Phyml(3pm) manual β€” go build some iconic trees, you absolute legend πŸ’–

πŸ“¦ where this page comes from