NAME
Bio::Tools::Phylo::PAML::Result - A PAML result set object
VERSION
version 1.7.3
SYNOPSIS
# see Bio::Tools::Phylo::PAML for example usageuse 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 Matrixmy $NGmatrix = $result->get_NGmatrix; # get Nei-Gojoburi Matrix# for AAML runsmy $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 sequencesmy @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 nodemy @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 probabilitiesmy $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 3print $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
This is a container object for PAML Results.
METHODS
new
Title : newUsage : my $obj = Bio::Tools::Phylo::PAML::Result->new(%data);Function: Builds a new Bio::Tools::Phylo::PAML::Result objectReturns : Bio::Tools::Phylo::PAML::ResultArgs : -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 objectsof 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_treeUsage : my $tree = $factory->next_tree;Function: Get the next tree from the factoryReturns : L<Bio::Tree::TreeI>Args : none
get_trees
Title : get_treesUsage : my @trees = $result->get_trees;Function: Get all the parsed trees as an arrayReturns : Array of treesArgs : none
rewind_tree_iterator
Title : rewind_tree_iteratorUsage : $result->rewind_tree_iterator()Function: Rewinds the tree iterator so that next_tree can becalled again from the beginningReturns : noneArgs : none
add_tree
Title : add_treeUsage : $result->add_tree($tree);Function: Adds a treeReturns : integer which is the number of trees storedArgs : L<Bio::Tree::TreeI>
set_MLmatrix
Title : set_MLmatrixUsage : $result->set_MLmatrix($mat)Function: Set the ML MatrixReturns : noneArgs : Arrayref to MLmatrix (must be arrayref to 2D matrix whic islower triangle pairwise)
get_MLmatrix
Title : get_MLmatrixUsage : my $mat = $result->get_MLmatrix()Function: Get the ML matrixReturns : 2D Array referenceArgs : none
set_NGmatrix
Title : set_NGmatrixUsage : $result->set_NGmatrix($mat)Function: Set the Nei & Gojobori MatrixReturns : noneArgs : Arrayref to NGmatrix (must be arrayref to 2D matrix whic islower triangle pairwise)
get_NGmatrix
Title : get_NGmatrixUsage : my $mat = $result->get_NGmatrix()Function: Get the Nei & Gojobori matrixReturns : 2D Array referenceArgs : none
add_seq
Title : add_seqUsage : $obj->add_seq($seq)Function: Add a Bio::PrimarySeq to the ResultReturns : noneArgs : Bio::PrimarySeqISee also : L<Bio::PrimarySeqI>
reset_seqs
Title : reset_seqsUsage : $result->reset_seqsFunction: Reset the OTU seqs storedReturns : noneArgs : none
get_seqs
Title : get_seqsUsage : my @otus = $result->get_seqsFunction: Get the seqs Bio::PrimarySeq (OTU = Operational Taxonomic Unit)Returns : Array of Bio::PrimarySeqArgs : NoneSee also : L<Bio::PrimarySeq>
set_codon_pos_basefreq
Title : set_codon_pos_basefreqUsage : $result->set_codon_pos_basefreq(@freqs)Function: Set the codon position base frequenciesReturns : noneArgs : Array of length 3 where each slot has a hashrefkeyed on DNA base
get_codon_pos_basefreq
Title : get_codon_pos_basefreqUsage : my @basepos = $result->get_codon_pos_basefreq;Function: Get the codon position base frequenciesReturns : Array of length 3 (each codon position), eachslot is a hashref keyed on DNA bases, the values arethe frequency of the base at that position for all sequencesArgs : noneNote : The array starts at 0 so position '1' is in position '0'of the array
version
Title : versionUsage : $obj->version($newval)Function: Get/Set versionReturns : value of versionArgs : newvalue (optional)
seqfile
Title : seqfileUsage : $obj->seqfile($newval)Function: Get/Set seqfileReturns : value of seqfileArgs : newvalue (optional)
model
Title : modelUsage : $obj->model($newval)Function: Get/Set modelReturns : value of modelArgs : on set, new value (a scalar or undef, optional)
patterns
Title : patternsUsage : $obj->patterns($newval)Function: Get/Set Patterns hashReturns : Hashref of pattern dataArgs : [optional] Hashref of patterns: The hashref is typically: { -patterns => \@arrayref: -ns => $ns: -ls => $ls: }
set_AAFreqs
Title : set_AAFreqsUsage : $result->set_AAFreqs(\%aafreqs);Function: Get/Set AA freqsReturns : noneArgs : Hashref, keys are the sequence names, each points to a hashrefwhich in turn has keys which are the amino acids
get_AAFreqs
Title : get_AAFreqsUsage : my %all_aa_freqs = $result->get_AAFreqs()ORmy %seq_aa_freqs = $result->get_AAFreqs($seqname)Function: Get the AA freqs, either for every sequence or justfor a specific sequenceThe average aa freqs for the entire set are also availablefor the sequence named 'Average'Returns : HashrefArgs : (optional) sequence name to retrieve aa freqs for
set_NTFreqs
Title : set_NTFreqsUsage : $result->set_NTFreqs(\%aafreqs);Function: Get/Set NT freqsReturns : noneArgs : Hashref, keys are the sequence names, each points to a hashrefwhich in turn has keys which are the amino acids
get_NTFreqs
Title : get_NTFreqsUsage : my %all_nt_freqs = $result->get_NTFreqs()ORmy %seq_nt_freqs = $result->get_NTFreqs($seqname)Function: Get the NT freqs, either for every sequence or justfor a specific sequenceThe average nt freqs for the entire set are also availablefor the sequence named 'Average'Returns : HashrefArgs : (optional) sequence name to retrieve nt freqs for
add_stat
Title : add_statUsage : $result->add_stat($stat,$value);Function: Add some misc stat valuess (key/value pairs)Returns : noneArgs : $stat stat name$value stat value
get_stat
Title : get_statUsage : my $value = $result->get_stat($name);Function: Get the value for a stat of a given nameReturns : scalar valueArgs : name of the stat
get_stat_names
Title : get_stat_namesUsage : my @names = $result->get_stat_names;Function: Get the stat names stored for the resultReturns : array of namesArgs : none
get_AADistMatrix
Title : get_AADistMatrixUsage : my $mat = $obj->get_AADistMatrix()Function: Get AADistance MatrixReturns : value of AADistMatrix (Bio::Matrix::PhylipDist)Args : none
set_AADistMatrix
Title : set_AADistMatrixUsage : $obj->set_AADistMatrix($mat);Function: Set the AADistrance Matrix (Bio::Matrix::PhylipDist)Returns : noneArgs : AADistrance Matrix (Bio::Matrix::PhylipDist)
get_AAMLDistMatrix
Title : get_AAMLDistMatrixUsage : my $mat = $obj->get_AAMLDistMatrix()Function: Get AAMLDistance MatrixReturns : value of AAMLDistMatrix (Bio::Matrix::PhylipDist)Args : none
set_AAMLDistMatrix
Title : set_AAMLDistMatrixUsage : $obj->set_AAMLDistMatrix($mat);Function: Set the AA ML Distrance Matrix (Bio::Matrix::PhylipDist)Returns : noneArgs : AAMLDistrance Matrix (Bio::Matrix::PhylipDist)
add_NSSite_result
Title : add_NSSite_resultUsage : $result->add_NSSite_result($model)Function: Add a NSsite result (PAML::ModelResult)Returns : noneArgs : Bio::Tools::Phylo::PAML::ModelResult
get_NSSite_results
Title : get_NSSite_resultsUsage : my @results = @{$self->get_NSSite_results};Function: Get the reference to the array of NSSite_resultsReturns : Array of PAML::ModelResult resultsArgs : none
set_CodonFreqs
Title : set_CodonFreqsUsage : $obj->set_CodonFreqs($newval)Function: Get/Set the Codon Frequence tableReturns : value of set_CodonFreqs (a scalar)Args : on set, new value (a scalar or undef, optional)
get_CodonFreqs
Title : get_CodonFreqsUsage : my @codon_freqs = $result->get_CodonFreqs()Function: Get the Codon freqsReturns : ArrayArgs : none
get_KappaMatrix
Title : get_KappaMatrixUsage : my $mat = $obj->get_KappaMatrix()Function: Get KappaDistance MatrixReturns : value of KappaMatrix (Bio::Matrix::PhylipDist)Args : none
set_KappaMatrix
Title : set_KappaMatrixUsage : $obj->set_KappaMatrix($mat);Function: Set the KappaDistrance Matrix (Bio::Matrix::PhylipDist)Returns : noneArgs : KappaDistrance Matrix (Bio::Matrix::PhylipDist)
get_AlphaMatrix
Title : get_AlphaMatrixUsage : my $mat = $obj->get_AlphaMatrix()Function: Get AlphaDistance MatrixReturns : value of AlphaMatrix (Bio::Matrix::PhylipDist)Args : none
set_AlphaMatrix
Title : set_AlphaMatrixUsage : $obj->set_AlphaMatrix($mat);Function: Set the AlphaDistrance Matrix (Bio::Matrix::PhylipDist)Returns : noneArgs : AlphaDistrance Matrix (Bio::Matrix::PhylipDist)
set_input_parameter
Title : set_input_parameterUsage : $obj->set_input_parameter($p,$vl);Function: Set an Input ParameterReturns : noneArgs : $parameter and $value
get_input_parameters
Title : get_input_parametersUsage : $obj->get_input_parameters;Function: Get Input ParametersReturns : Hash of key/value pairsArgs : none
reset_input_parameters
Title : reset_input_parametersUsage : $obj->reset_input_parameters;Function: Reset the Input Parameters hashReturns : noneArgs : none
add_rst_seq
Title : add_rst_seqUsage : $obj->add_rst_seq($seq)Function: Add a Bio::PrimarySeq to the RST ResultReturns : noneArgs : Bio::PrimarySeqISee also : L<Bio::PrimarySeqI>
reset_rst_seqs
Title : reset_rst_seqsUsage : $result->reset_rst_seqsFunction: Reset the RST seqs storedReturns : noneArgs : none
get_rst_seqs
Title : get_rst_seqsUsage : my @otus = $result->get_rst_seqsFunction: Get the seqs Bio::PrimarySeqReturns : Array of Bio::PrimarySeqI objectsArgs : NoneSee also : L<Bio::PrimarySeq>
add_rst_tree
Title : add_rst_treeUsage : $obj->add_rst_tree($tree)Function: Add a Bio::Tree::TreeI to the RST ResultReturns : noneArgs : Bio::Tree::TreeISee also : L<Bio::Tree::TreeI>
reset_rst_trees
Title : reset_rst_treesUsage : $result->reset_rst_treesFunction: Reset the RST trees storedReturns : noneArgs : none
get_rst_trees
Title : get_rst_treesUsage : my @otus = $result->get_rst_treesFunction: Get the trees Bio::Tree::TreeIReturns : Array of Bio::Tree::TreeI objectsArgs : NoneSee also : L<Bio::Tree::TreeI>
set_rst_persite
Title : set_rst_persiteUsage : $obj->set_rst_persite($newval)Function: Get/Set the per-site RST valuesReturns : value of set_rst_persite (a scalar)Args : on set, new value (a scalar or undef, optional)
get_rst_persite
Title : get_rst_persiteUsage : my @rst_persite = @{$result->get_rst_persite()}Function: Get the per-site RST valuesReturns : ArrayArgs : none
Reconstructed Ancestral State relevant options
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.
[email protected] - General discussionhttp://bioperl.org/Support.html - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list: [email protected]
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.
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/bio-tools-phylo-paml/issues
AUTHORS
Jason Stajich <[email protected]>
Aaron Mackey <[email protected]>
Albert Vilella <[email protected]>
COPYRIGHT
This software is copyright (c) by Jason Stajich <[email protected]>, and by Aaron Mackey <[email protected]>.
This software is available under the same terms as the perl 5 programming language system itself.