.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Tools::Phylo::PAML::Codeml 3pm" .TH Bio::Tools::Phylo::PAML::Codeml 3pm "2020-11-10" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Tools::Phylo::PAML::Codeml \- Parses output from the PAML program codeml .SH "VERSION" .IX Header "VERSION" version 1.7.3 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& #!/usr/bin/perl \-Tw \& use strict; \& \& use Bio::Tools::Phylo::PAML::Codeml; \& \& # need to specify the output file name (or a fh) (defaults to \& # \-file => "codeml.mlc"); also, optionally, the directory in which \& # the other result files (rst, 2ML.dS, etc) may be found (defaults \& # to "./") \& my $parser = new Bio::Tools::Phylo::PAML::Codeml::Parser \& (\-file => "./results/mlc", \-dir => "./results/"); \& \& # get the first/next result; a Bio::[...]::Codeml::Result object \& my $result = $parser\->next_result(); \& \& # get the sequences used in the analysis; returns Bio::PrimarySeq \& # objects (OTU = Operational Taxonomic Unit). \& my @otus = $result\->get_seqs(); \& \& # codon summary: codon usage of each sequence [ arrayref of { \& # hashref of counts for each codon } for each sequence and the \& # overall sum ], and positional nucleotide distribution [ arrayref \& # of { hashref of frequencies for each nucleotide } for each \& # sequence and overall frequencies ]. \& \& my ($codonusage, $ntdist) = $result\->get_codon_summary(); \& \& # example manipulations of $codonusage and $ntdist: \& printf "There were %d \*(Aq%s\*(Aq codons in the first seq (%s)\en", \& $codonusage\->[0]\->{AAA}, \*(AqAAA\*(Aq, $otus[0]\->id(); \& printf "There were %d \*(Aq%s\*(Aq codons used in all the sequences\en", \& $codonusage\->[$#{$codonusage}]\->{AAA}, \*(AqAAA\*(Aq; \& printf "Nucleotide \*(Aq%c\*(Aq was present %g of the time in seq %s\en", \& \*(AqA\*(Aq, $ntdist\->[1]\->{A}, $otus[1]\->id(); \& \& # get Nei & Gojobori dN/dS matrix: \& my $NGmatrix = $result\->get_NGmatrix(); \& \& # get ML\-estimated dN/dS matrix, if calculated; this corresponds to \& # the runmode = \-2, pairwise comparison usage of codeml \& my $MLmatrix = $result\->get_MLmatrix(); \& \& # These matrices are length(@otu) x length(@otu) "strict lower \& # triangle" 2D\-matrices, which means that the diagonal and \& # everything above it is undefined. Each of the defined cells is a \& # hashref of estimates for "dN", "dS", "omega" (dN/dS ratio), "t", \& # "S" and "N". If a ML matrix, "lnL" will also be defined. Any \& # additional ML parameters estimated by the model will be in an \& # array ref under "params"; it\*(Aqs up to the user to know which \& # position corresponds to which parameter (since PAML doesn\*(Aqt label \& # them, and we can\*(Aqt guess very well yet (a TODO I guess). \& \& printf "The omega ratio for sequences %s vs %s was: %g\en", \& $otus[0]\->id, $otus[1]\->id, $MLmatrix\->[0]\->[1]\->{omega}; \& \& # with a little work, these matrices could also be passed to \& # Bio::Tools::Run::Phylip::Neighbor, or other similar tree\-building \& # method that accepts a matrix of "distances" (using the LOWTRI \& # option): \& my $distmat = [ map { [ map { $$_{omega} } @$_ ] } @$MLmatrix ]; \& \& # for runmode\*(Aqs other than \-2, get tree topology with estimated \& # branch lengths; returns a Bio::Tree::TreeI\-based tree object with \& # added PAML parameters at each node \& my $tree = $result\->get_tree(); \& for my $node ($tree\->get_nodes()) { \& # inspect the tree: the "t" (time) parameter is available via \& # $node\->branch_length(); all other branch\-specific parameters \& # ("omega", "dN", etc.) are available via $node\->param(\*(Aqomega\*(Aq); \& } \& \& # get any general model parameters: kappa (the \& # transition/transversion ratio), NSsites model parameters ("p0", \& # "p1", "w0", "w1", etc.), etc. \& my $params = $result\->get_model_params(); \& printf "M1 params: p0 = %g\etp1 = %g\en", $params\->{p0}, $params\->{p1}; \& \& # for NSsites models, obtain posterior probabilities for membership \& # in each class for every position; probabilities correspond to \& # classes w0, w1, ... etc. \& my @probs = $result\->get_posteriors(); \& \& # find, say, positively selected sites! \& if ($params\->{w2} > 1) { \& for (my $i = 0; $i < @probs ; $i++) { \& if ($probs[$i]\->[2] > 0.5) { \& # assumes model M1: three w\*(Aqs, w0, w1 and w2 (positive selection) \& printf "position %d: (%g prob, %g omega, %g mean w)\en", \& $i, $probs[$i]\->[2], $params\->{w2}, $probs[$i]\->[3]; \& } \& } \& } else { print "No positive selection found!\en"; } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used to parse the output from the \s-1PAML\s0 program codeml. You can use the Bio::Tools::Run::Phylo::Phylo::PAML::Codeml module to actually run codeml; this module is only useful to parse the output. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 5 \& Title : new \& Usage : my $obj = new Bio::Tools::Phylo::PAML::Codeml(); \& Function: Builds a new Bio::Tools::Phylo::PAML::Codeml object \& Returns : Bio::Tools::Phylo::PAML::Codeml \& Args : .Ve .SS "get_trees" .IX Subsection "get_trees" .Vb 5 \& Title : get_trees \& Usage : my @trees = $codemlparser\->get_trees(); \& Function: Returns a list of trees (if any) are in the output file \& Returns : List of L objects \& Args : none .Ve .SS "get_statistics" .IX Subsection "get_statistics" .Vb 5 \& Title : get_statistics \& Usage : my $data = $codemlparser\->get_statistics \& Function: Retrieves the set of pairwise comparisons \& Returns : Hash Reference keyed as \*(Aqseqname\*(Aq \-> \*(Aqseqname\*(Aq \-> \*(Aqdatatype\*(Aq \& Args : none .Ve .SH "TODO" .IX Header "TODO" This module should also be able to handle \*(L"codemlsites\*(R" batch output... .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing lists" .IX Subsection "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. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/Support.html \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: \&\fIbioperl\-l@bioperl.org\fR .PP 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. .SS "Reporting bugs" .IX Subsection "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: .PP .Vb 1 \& https://github.com/bioperl/bio\-tools\-phylo\-paml/issues .Ve .SH "AUTHORS" .IX Header "AUTHORS" Jason Stajich .PP Aaron Mackey .SH "COPYRIGHT" .IX Header "COPYRIGHT" This software is copyright (c) by Jason Stajich , and by Aaron Mackey . .PP This software is available under the same terms as the perl 5 programming language system itself.