Bio::T...:Result(3pm)
๐ธ NAME ๐ธ
okay so bestie, this is the manual page for Bio::Tools::Phylo::PAML::Result(3pm) ๐
Bio::Tools::Phylo::PAML::Result โ it's a PAML result set object, no cap ๐งฌโจ
๐ VERSION ๐
version 1.7.3 ๐ซถ
โจ SYNOPSIS โจ
like, here's the vibe in code form, fr fr:
# see Bio::Tools::Phylo::PAML for example usage
use Bio::Tools::Phylo::PAML;
my $parser = Bio::Tools::Phylo::PAML->new
(-file => "./results/mlc", -dir => "./results/");
# get the first/next result; a Bio::Tools::Phylo::PAML::Result object,
# which isa Bio::SeqAnalysisResultI object.
my $result = $parser->next_result();
my @seqs = $result->get_seqs;
my %input_params = $result->get_input_parameters;
my @basfreq = $result->get_codon_pos_basefreq;
my $MLmatrix = $result->get_MLmatrix; # get MaxLikelihood Matrix
my $NGmatrix = $result->get_NGmatrix; # get Nei-Gojoburi Matrix
# for AAML runs
my $AAmatrix = $result->get_AADistMatrix;
my $AAMLmatrix = $result->get_AAMLDistMatrix;
# if -dir contains an rst file get list of
# Bio::PrimarySeq ancestral state reconstructions of the sequences
my @rsts = $result->get_rst_seqs;
# if you want to print the changes on the tree
# this will print out the
# anc_aa => ANCESTRAL AMINO ACID
# anc_prob => ANCESTRAL AA PROBABILITY
# derived_aa => DERIVED AA
# derived_prob => DERIVE AA PROBABILITY (where appropriate - NA for extant/tip taxas)
# site => which codon site this in the alignment
@trees = $result->get_rst_trees;
for my $t ( @trees ) {
for my $node ( $t->get_nodes ) {
next unless $node->ancestor; # skip root node
my @changes = $node->get_tag_values('changes');
my $chgstr = '';
for my $c ( @changes ) {
for my $k ( sort keys %$c ) {
$chgstr .= "$k => $c->{$k} ";
}
$chgstr .= "\n\t";
}
printf "node:%s n=%s s=%s\n\t%s\n",
$node->id,
$node->get_tag_values('n'),
$node->get_tag_values('s'),
$chgstr;
}
}
# Persite probabilities
my $persite = $result->get_rst_persite;
# let's score site 1
$site = $persite->[2];
# so site 2, node 2 (extant node, node 2)
print $site->[2]->{'codon'}, ' ',$site->[2]->{'aa'},"\n";
# site 2, node 3
print $site->[3]->{'codon'}, ' ',$site->[3]->{'aa'}, "\n";
# ancestral node 9, codon, aa, marginal probabilities; Yang95 is listed as
# (eqn. 4 in Yang et al. 1995 Genetics 141:1641-1650) in PAML rst file.
print $site->[9]->{'codon'}, ' ',$site->[9]->{'aa'}, ' ', $site->[9]->{'prob'}, ' ',
$site->[9]->{'Yang95_aa'},' ', $site->[9]->{'Yang95_aa_prob'},"\n";
๐ DESCRIPTION ๐
okay so basically? This is a container object for PAML Results ๐ซโจ It just holds all the lil result goodies for you so you don't have to go digging around in files yourself. iconic behaviour honestly.
๐ METHODS ๐
๐ง new
- Title โ
new - Usage โ
my $obj = Bio::Tools::Phylo::PAML::Result->new(%data); - Function โ builds a brand new
Bio::Tools::Phylo::PAML::Resultobject, slay ๐ - Returns โ
Bio::Tools::Phylo::PAML::Result - Args โ here's the whole menu, no skips:
-trees=> array reference ofBio::Tree::TreeIobjects ๐ณ-MLmatrix=> ML matrix-seqs=> array reference ofBio::PrimarySeqIobjects ๐งฌ-codonpos=> array reference of codon positions-codonfreq=> array reference of codon frequencies-version=> version string-model=> model string-patterns=> hashref with the fields-patterns,-ns,-ls-stats=> array ref of misc stats (optional) ๐-aafreq=> Hashref of AA frequencies (only for AAML)-aadistmat=>Bio::Matrix::PhylipDist(only for AAML)-aamldistmat=>Bio::Matrix::PhylipDist(only for pairwise AAML)-ntfreq=> array ref of NT frequencies (only for BASEML)-seqfile=> seqfile used-kappa_mat=>Bio::Matrix::PhylipDistof kappa values (only for BASEML)-alpha_mat=>Bio::Matrix::PhylipDistof alpha values (only for BASEML)-NSSitesresult=> arrayref ofPAML::ModelResult-input_params=> input params from.ctlfile-rst=> array reference ofBio::PrimarySeqIobjects of ancestral state reconstruction-rst_persite=> arrayref of persite data, this is a complicated set of AoH ๐ญ-rst_trees=> rst trees with changes coded on the tree
See Also: Bio::Tree::TreeI, Bio::PrimarySeqI, Bio::Matrix::PhylipDist, Bio::Tools::Phylo::PAML
๐ next_tree
- Title โ
next_tree - Usage โ
my $tree = $factory->next_tree; - Function โ grabs the next tree off the factory, one at a time bestie
- Returns โ
Bio::Tree::TreeI - Args โ none
๐ณ get_trees
- Title โ
get_trees - Usage โ
my @trees = $result->get_trees; - Function โ get every single parsed tree, as an array ๐ซถ
- Returns โ Array of trees
- Args โ none
๐ซ rewind_tree_iterator
- Title โ
rewind_tree_iterator - Usage โ
$result->rewind_tree_iterator() - Function โ rewinds the tree iterator so you can call
next_treeall over again from the very beginning, like a rewatch ๐ - Returns โ none
- Args โ none
๐ add_tree
- Title โ
add_tree - Usage โ
$result->add_tree($tree); - Function โ adds a tree, one more for the collection
- Returns โ integer, which is literally the number of trees stored
- Args โ
Bio::Tree::TreeI
๐ set_MLmatrix
- Title โ
set_MLmatrix - Usage โ
$result->set_MLmatrix($mat) - Function โ sets the ML Matrix
- Returns โ none
- Args โ Arrayref to MLmatrix (must be arrayref to 2D matrix whic is lower triangle pairwise)
ngl the original says "whic" and I'm keeping it, I don't make the rules ๐
โจ get_MLmatrix
- Title โ
get_MLmatrix - Usage โ
my $mat = $result->get_MLmatrix() - Function โ gets the ML matrix
- Returns โ 2D Array reference
- Args โ none
๐ set_NGmatrix
- Title โ
set_NGmatrix - Usage โ
$result->set_NGmatrix($mat) - Function โ sets the Nei & Gojobori Matrix
- Returns โ none
- Args โ Arrayref to NGmatrix (must be arrayref to 2D matrix whic is lower triangle pairwise)
๐ฆ get_NGmatrix
- Title โ
get_NGmatrix - Usage โ
my $mat = $result->get_NGmatrix() - Function โ gets the Nei & Gojobori matrix
- Returns โ 2D Array reference
- Args โ none
๐งฌ add_seq
- Title โ
add_seq - Usage โ
$obj->add_seq($seq) - Function โ adds a
Bio::PrimarySeqto the Result - Returns โ none
- Args โ
Bio::PrimarySeqI - See also โ
Bio::PrimarySeqI
๐ reset_seqs
- Title โ
reset_seqs - Usage โ
$result->reset_seqs - Function โ resets all the OTU seqs that were stored, clean slate energy โจ
- Returns โ none
- Args โ none
๐ธ get_seqs
- Title โ
get_seqs - Usage โ
my @otus = $result->get_seqs - Function โ gets the seqs
Bio::PrimarySeq(OTU = Operational Taxonomic Unit) โ yep, that's what OTU means, iykyk - Returns โ Array of
Bio::PrimarySeq - Args โ None
- See also โ
Bio::PrimarySeq
๐ set_codon_pos_basefreq
- Title โ
set_codon_pos_basefreq - Usage โ
$result->set_codon_pos_basefreq(@freqs) - Function โ sets the codon position base frequencies
- Returns โ none
- Args โ Array of length 3 where each slot has a hashref keyed on DNA base
โญ get_codon_pos_basefreq
- Title โ
get_codon_pos_basefreq - Usage โ
my @basepos = $result->get_codon_pos_basefreq; - Function โ gets the codon position base frequencies
- Returns โ Array of length 3 (each codon position), each slot is a hashref keyed on DNA bases, the values are the frequency of the base at that position for all sequences
- Args โ none
- Note โ the array starts at 0 so position
'1'is in position'0'of the array. yes this is off-by-one, yes you have to deal with it ๐
๐ซถ version
- Title โ
version - Usage โ
$obj->version($newval) - Function โ get/set version
- Returns โ value of version
- Args โ newvalue (optional)
๐ง seqfile
- Title โ
seqfile - Usage โ
$obj->seqfile($newval) - Function โ get/set seqfile
- Returns โ value of seqfile
- Args โ newvalue (optional)
๐ฅ model
- Title โ
model - Usage โ
$obj->model($newval) - Function โ get/set model
- Returns โ value of model
- Args โ on set, new value (a scalar or undef, optional)
๐ฎ patterns
- Title โ
patterns - Usage โ
$obj->patterns($newval) - Function โ get/set Patterns hash
- Returns โ Hashref of pattern data
- Args โ [optional] Hashref of patterns. The hashref is typically:
{ -patterns => \@arrayref
-ns => $ns
-ls => $ls
}
๐ set_AAFreqs
- Title โ
set_AAFreqs - Usage โ
$result->set_AAFreqs(\%aafreqs); - Function โ get/set AA freqs
- Returns โ none
- Args โ Hashref, keys are the sequence names, each points to a hashref which in turn has keys which are the amino acids
๐ get_AAFreqs
- Title โ
get_AAFreqs - Usage โ
my %all_aa_freqs = $result->get_AAFreqs()
OR
my %seq_aa_freqs = $result->get_AAFreqs($seqname)
- Function โ gets the AA freqs, either for every single sequence or just for one specific sequence ๐
The average aa freqs for the entire set are also available, under the sequence named
'Average'โ cute right? - Returns โ Hashref
- Args โ (optional) sequence name to retrieve aa freqs for
๐ set_NTFreqs
- Title โ
set_NTFreqs - Usage โ
$result->set_NTFreqs(\%aafreqs); - Function โ get/set NT freqs
- Returns โ none
- Args โ Hashref, keys are the sequence names, each points to a hashref which in turn has keys which are the amino acids
๐ get_NTFreqs
- Title โ
get_NTFreqs - Usage โ
my %all_nt_freqs = $result->get_NTFreqs()
OR
my %seq_nt_freqs = $result->get_NTFreqs($seqname)
- Function โ gets the NT freqs, either for every single sequence or just for one specific one โจ The average nt freqs for the entire set are also available under the sequence named
'Average' - Returns โ Hashref
- Args โ (optional) sequence name to retrieve nt freqs for
๐ง add_stat
- Title โ
add_stat - Usage โ
$result->add_stat($stat,$value); - Function โ adds some misc stat valuess (key/value pairs)
bestie the original really did spell it "valuess" and I'm not about to gaslight you about it ๐ญ
- Returns โ none
- Args โ
$stat= stat name,$value= stat value
โญ get_stat
- Title โ
get_stat - Usage โ
my $value = $result->get_stat($name); - Function โ gets the value for a stat of a given name
- Returns โ scalar value
- Args โ name of the stat
๐ฆ get_stat_names
- Title โ
get_stat_names - Usage โ
my @names = $result->get_stat_names; - Function โ gets all the stat names that got stored for the result
- Returns โ array of names
- Args โ none
๐ซ get_AADistMatrix
- Title โ
get_AADistMatrix - Usage โ
my $mat = $obj->get_AADistMatrix() - Function โ gets the AADistance Matrix
- Returns โ value of AADistMatrix (
Bio::Matrix::PhylipDist) - Args โ none
set_AADistMatrix โจ
- Title:
set_AADistMatrix - Usage:
$obj->set_AADistMatrix($mat); - Function: plugs in the AADistrance Matrix (
Bio::Matrix::PhylipDist) - Returns: nothing, babes โ it's a setter
- Args: AADistrance Matrix (
Bio::Matrix::PhylipDist)
get_AAMLDistMatrix ๐
- Title:
get_AAMLDistMatrix - Usage:
my $mat = $obj->get_AAMLDistMatrix() - Function: hands you the AAML Distance Matrix
- Returns: the value of
AAMLDistMatrix(Bio::Matrix::PhylipDist) - Args: none
set_AAMLDistMatrix ๐
- Title:
set_AAMLDistMatrix - Usage:
$obj->set_AAMLDistMatrix($mat); - Function: sets the AA ML Distrance Matrix (
Bio::Matrix::PhylipDist) - Returns: none
- Args: AAML Distrance Matrix (
Bio::Matrix::PhylipDist)
add_NSSite_result ๐ฆ
- Title:
add_NSSite_result - Usage:
$result->add_NSSite_result($model) - Function: adds one NSsite result (
PAML::ModelResult) - Returns: none
- Args:
Bio::Tools::Phylo::PAML::ModelResult
get_NSSite_results ๐ธ
- Title:
get_NSSite_results - Usage:
my @results = @{$self->get_NSSite_results}; - Function: gives you back the reference to the array of NSSite_results
- Returns: an Array of
PAML::ModelResultresults - Args: none
set_CodonFreqs ๐
- Title:
set_CodonFreqs - Usage:
$obj->set_CodonFreqs($newval) - Function: get/set the Codon Frequence table (that's literally how the doc spells it, and honestly? iconic)
- Returns: the value of
set_CodonFreqs(a scalar) - Args: on set, the new value (a scalar or
undef, optional)
get_CodonFreqs ๐
- Title:
get_CodonFreqs - Usage:
my @codon_freqs = $result->get_CodonFreqs() - Function: grabs the Codon freqs
- Returns: Array
- Args: none
get_KappaMatrix ๐ฅ
- Title:
get_KappaMatrix - Usage:
my $mat = $obj->get_KappaMatrix() - Function: gets you the KappaDistance Matrix
- Returns: the value of
KappaMatrix(Bio::Matrix::PhylipDist) - Args: none
set_KappaMatrix ๐
- Title:
set_KappaMatrix - Usage:
$obj->set_KappaMatrix($mat); - Function: sets the KappaDistrance Matrix (
Bio::Matrix::PhylipDist) - Returns: none
- Args: KappaDistrance Matrix (
Bio::Matrix::PhylipDist)
get_AlphaMatrix ๐
- Title:
get_AlphaMatrix - Usage:
my $mat = $obj->get_AlphaMatrix() - Function: gets you the AlphaDistance Matrix
- Returns: the value of
AlphaMatrix(Bio::Matrix::PhylipDist) - Args: none
set_AlphaMatrix โญ
- Title:
set_AlphaMatrix - Usage:
$obj->set_AlphaMatrix($mat); - Function: sets the AlphaDistrance Matrix (
Bio::Matrix::PhylipDist) - Returns: none
- Args: AlphaDistrance Matrix (
Bio::Matrix::PhylipDist)
set_input_parameter ๐ซถ
- Title:
set_input_parameter - Usage:
$obj->set_input_parameter($p,$vl); - Function: sets one input parameter
- Returns: none
- Args:
$parameterand$value
get_input_parameters ๐
- Title:
get_input_parameters - Usage:
$obj->get_input_parameters; - Function: gets the input parameters
- Returns: a Hash of key/value pairs
- Args: none
reset_input_parameters ๐ง
- Title:
reset_input_parameters - Usage:
$obj->reset_input_parameters; - Function: wipes the input parameters hash clean, fresh start energy
- Returns: none
- Args: none
add_rst_seq ๐ธ
- Title:
add_rst_seq - Usage:
$obj->add_rst_seq($seq) - Function: adds a
Bio::PrimarySeqto the RST Result - Returns: none
- Args:
Bio::PrimarySeqI - See also:
L<Bio::PrimarySeqI>
reset_rst_seqs ๐
- Title:
reset_rst_seqs - Usage:
$result->reset_rst_seqs - Function: resets the RST seqs that were being stored
- Returns: none
- Args: none
get_rst_seqs ๐ฆ
- Title:
get_rst_seqs - Usage:
my @otus = $result->get_rst_seqs - Function: gets the seqs,
Bio::PrimarySeq - Returns: an Array of
Bio::PrimarySeqIobjects - Args: None
- See also:
L<Bio::PrimarySeq>
add_rst_tree ๐ณ
- Title:
add_rst_tree - Usage:
$obj->add_rst_tree($tree) - Function: adds a
Bio::Tree::TreeIto the RST Result - Returns: none
- Args:
Bio::Tree::TreeI - See also:
L<Bio::Tree::TreeI>
reset_rst_trees ๐
- Title:
reset_rst_trees - Usage:
$result->reset_rst_trees - Function: resets the RST trees that were hanging around in there
- Returns: none
- Args: none
get_rst_trees ๐
- Title:
get_rst_trees - Usage:
my @otus = $result->get_rst_trees - Function: gets the trees,
Bio::Tree::TreeI - Returns: an Array of
Bio::Tree::TreeIobjects - Args: None
- See also:
L<Bio::Tree::TreeI>
set_rst_persite โจ
- Title:
set_rst_persite - Usage:
$obj->set_rst_persite($newval) - Function: get/set the per-site RST values
- Returns: the value of
set_rst_persite(a scalar) - Args: on set, the new value (a scalar or
undef, optional)
get_rst_persite ๐
- Title:
get_rst_persite - Usage:
my @rst_persite = @{$result->get_rst_persite()} - Function: gets the per-site RST values
- Returns: Array
- Args: none
๐ฟ Reconstructed Ancestral State relevant options ๐ฟ
Just dropping it here, no notes.
๐ฌ FEEDBACK ๐ฌ
Mailing lists ๐ฌ
Your feedback is like, genuinely load-bearing for the evolution of this module and every other Bioperl module out there. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is so appreciated, fr fr.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/Support.html - About the mailing lists
Support ๐ซถ
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
โฆrather than going straight to the module maintainer, bestie. There are lots of experienced and responsive experts who'll look at the problem and get back to you quickly. And if it's at all possible, include a thorough description of the problem with code and data examples. No vibes-only bug reports, please and thank you.
Reporting bugs ๐
Report bugs to the Bioperl bug tracking system so we can actually keep track of the bugs and their resolutions โ very demure, very mindful of us.
Bug reports can be submitted via the web:
https://github.com/bioperl/bio-tools-phylo-paml/issues
๐ AUTHORS ๐
- Jason Stajich <jason@bioperl.org>
- Aaron Mackey <amackey@virginia.edu>
- Albert Vilella <avilella@gmail.com>
๐ COPYRIGHT ๐
This software is copyright (c) by Jason Stajich <jason@bioperl.org>, and by Aaron Mackey <amackey@virginia.edu>.
This software is available under the same terms as the perl 5 programming language system itself.
And that's the whole page, bestie โ perl v5.34.0, dated 2022-10-14, straight from the Bio::T...:Result(3pm) manpage. Go read the source, it's giving main character energy ๐
โจ
๐ฆ where this page comes from
- debian bookworm: libbio-tools-phylo-paml-perl 1.7.3-4 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-tools-phylo-paml-perl 1.7.3-4 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms