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

๐Ÿ“ฆ
version 1.7.3 ยท 3 versions
, in debian bookworm, debian trixie

๐ŸŒธ 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::Result object, slay ๐Ÿ’…
  • Returns โ€” Bio::Tools::Phylo::PAML::Result
  • Args โ€” here's the whole menu, no skips:
    • -trees => array reference of Bio::Tree::TreeI objects ๐ŸŒณ
    • -MLmatrix => ML matrix
    • -seqs => array reference of Bio::PrimarySeqI objects ๐Ÿงฌ
    • -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::PhylipDist of kappa values (only for BASEML)
    • -alpha_mat => Bio::Matrix::PhylipDist of alpha values (only for BASEML)
    • -NSSitesresult => arrayref of PAML::ModelResult
    • -input_params => input params from .ctl file
    • -rst => array reference of Bio::PrimarySeqI objects 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_tree all 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::PrimarySeq to 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::ModelResult results
  • 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: $parameter and $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::PrimarySeq to 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::PrimarySeqI objects
  • 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::TreeI to 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::TreeI objects
  • 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>

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