.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::Tools::Phylo::PAML 3pm" .TH Bio::Tools::Phylo::PAML 3pm "2017-08-30" "perl v5.26.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 \- Parses output from the PAML programs codeml, baseml, basemlg, codemlsites and yn00 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& #!/usr/bin/perl \-Tw \& use strict; \& \& use Bio::Tools::Phylo::PAML; \& \& # 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 = 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(); \& \& # 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 %s codons in the first seq (%s)\en", \& $codonusage\->[0]\->{AAA}, \*(AqAAA\*(Aq, $otus[0]\->id(); \& printf "There were %d %s codons used in all the sequences\en", \& $codonusage\->[$#{$codonusage}]\->{AAA}, \*(AqAAA\*(Aq; \& printf "Nucleotide %c 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" and "kappa" will also be defined. \& 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_trees(); \& 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 \& # ($omega) = $node\->get_tag_values(\*(Aqomega\*(Aq); \& } \& \& # if you are using model based Codeml then trees are stored in each \& # modelresult object \& for my $modelresult ( $result\->get_NSSite_results ) { \& # model M0, M1, etc \& print "model is ", $modelresult\->model_num, "\en"; \& my ($tree) = $modelresult\->get_trees(); \& 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 \& # ($omega) = $node\->get_tag_values(\*(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}; \& \& # parse AAML result files \& my $aamat = $result\->get_AADistMatrix(); \& my $aaMLmat = $result\->get_AAMLDistMatrix(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used to parse the output from the \s-1PAML\s0 programs codeml, baseml, basemlg, codemlsites and yn00. You can use the Bio::Tools::Run::Phylo::PAML::* modules to actually run some of the \&\s-1PAML\s0 programs, but this module is only useful to parse the output. .PP This module has fledgling support for \s-1PAML\s0 version 4.3a (October 2009). Please report any problems to the mailing list (see \s-1FEEDBACK\s0 below). .SH "TO DO" .IX Header "TO DO" Implement \fIget_posteriors()\fR. For NSsites models, obtain arrayrefs of posterior probabilities for membership in each class for every position; probabilities correspond to classes w0, w1, ... etc. .PP .Vb 1 \& 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 "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/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\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/bioperl\-live/issues .Ve .SH "AUTHOR \- Jason Stajich, Aaron Mackey" .IX Header "AUTHOR - Jason Stajich, Aaron Mackey" Email jason\-at\-bioperl.org Email amackey\-at\-virginia.edu .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Albert Vilella avilella-AT-gmail-DOT-com Sendu Bala bix@sendu.me.uk Dave Messina dmessina@cpan.org .SH "TODO" .IX Header "TODO" \&\s-1RST\s0 parsing \*(-- done, Avilella contributions bug#1506, added by jason 1.29 \*(-- still need to parse in joint probability and non-syn changes at site table .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 10 \& Title : new \& Usage : my $obj = Bio::Tools::Phylo::PAML\->new(%args); \& Function: Builds a new Bio::Tools::Phylo::PAML object \& Returns : Bio::Tools::Phylo::PAML \& Args : Hash of options: \-file, \-fh, \-dir \& \-file (or \-fh) should contain the contents of the PAML \& outfile; \& \-dir is the (optional) name of the directory in \& which the PAML program was run (and includes other \& PAML\-generated files from which we can try to gather data) .Ve .SS "Implement Bio::AnalysisParserI interface" .IX Subsection "Implement Bio::AnalysisParserI interface" .SS "next_result" .IX Subsection "next_result" .Vb 7 \& Title : next_result \& Usage : $result = $obj\->next_result(); \& Function: Returns the next result available from the input, or \& undef if there are no more results. \& Example : \& Returns : a Bio::Tools::Phylo::PAML::Result object \& Args : none .Ve