.\" 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::Run::Phylo::PAML::Codeml 3pm" .TH Bio::Tools::Run::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::Run::Phylo::PAML::Codeml \- Wrapper aroud the PAML program codeml .SH "VERSION" .IX Header "VERSION" version 1.7.3 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Bio::Tools::Run::Phylo::PAML::Codeml; \& use Bio::AlignIO; \& \& my $alignio = Bio::AlignIO\->new(\-format => \*(Aqphylip\*(Aq, \& \-file => \*(Aqt/data/gf\-s85.phylip\*(Aq); \& \& my $aln = $alignio\->next_aln; \& \& my $codeml = Bio::Tools::Run::Phylo::PAML::Codeml\->new(); \& $codeml\->alignment($aln); \& my ($rc,$parser) = $codeml\->run(); \& my $result = $parser\->next_result; \& my $MLmatrix = $result\->get_MLmatrix(); \& print "Ka = ", $MLmatrix\->[0]\->[1]\->{\*(AqdN\*(Aq},"\en"; \& print "Ks = ", $MLmatrix\->[0]\->[1]\->{\*(AqdS\*(Aq},"\en"; \& print "Ka/Ks = ", $MLmatrix\->[0]\->[1]\->{\*(Aqomega\*(Aq},"\en"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a wrapper around the codeml program of \s-1PAML\s0 (Phylogenetic Analysis by Maximum Likelihood) package of Ziheng Yang. See http://abacus.gene.ucl.ac.uk/software/paml.html for more information. .PP This module is more about generating the properl codeml.ctl file and will run the program in a separate temporary directory to avoid creating temp files all over the place. .SS "Default Values" .IX Subsection "Default Values" Valid and default values for codeml programs are listed below. The default values are always the first one listed. These descriptions are essentially lifted from the example codeml.ctl file and pamlDOC documentation provided by the author. .PP \&\fBCodonFreq\fR specifies the equilibrium codon frequencies in codon substitution model. These frequencies can be assumed to be equal (1/61 each for the standard genetic code, \fBCodonFreq\fR = 0), calculated from the average nucleotide frequencies (\fBCodonFreq\fR = 1), from the average nucleotide frequencies at the three codon positions (\fBCodonFreq\fR = 2), or used as free parameters (\fBCodonFreq\fR = 3). The number of parameters involved in those models of codon frequencies is 0, 3, 9, and 60 (under the universal code), for \fBCodonFreq\fR = 0, 1, 2, and 3 respectively. .PP \&\fBaaDist\fR specifies whether equal amino acid distances are assumed (= 0) or Grantham's matrix is used (= 1) (Yang et al. 1998). .PP \&\fBrunmode\fR = \-2 performs \s-1ML\s0 estimation of dS and dN in pairwise comparisons. The program will collect estimates of dS and dN into the files 2ML.dS and 2ML.dN. Since many users seem interested in looking at dN /dS ratios among lineages, examination of the tree shapes indicated by branch lengths calculated from the two rates may be interesting although the analysis is ad hoc. If your species names have no more than 10 characters, you can use the output distance matrices as input to Phylip programs such as neighbor without change. Otherwise you need to edit the files to cut the names short. .PP \&\fBmodel\fR concerns assumptions about the dN/dS rate ratios among branches (Yang 1998; Yang and Nielsen 1998). \fBmodel\fR =0 means a single dN/dS ratio for all lineages (branches), 1 means one ratio for each branch (free ratio model), and 2 means arbitrary number of rations (such as the 2\-ratios or 3\-ratios models. with \fBmodel\fR =2, you may specify the omega ratios for the branches using branch labels (read about the tree structure file in the document). This option seems rather easy to use. Otherwise, the program will ask the user to input a branch mark for the dN/dS ratio assumed for each branch. This should be an integral number between 0 to k \- 1 if k different dN/dS ratios (omega_0 \- omega_k \- 1) are assumed for the branches of the tree. \fBBioperl\fR note basically, doing this interactively is not going to work very well, so this module is really focused around using the 0 or 1 parameters. Read the program documentation if you'd like some more detailed instructions. .PP \&\fBNSsites\fR specifies models that allow the dN/dS ratio (omega) to vary among sites (Nielsen and Yang 1998, Yang et al. 2000) \fBNssites\fR = m corresponds to model Mm in Yang et al (2000). The variable \fBncatG\fR is used to specify the number of categories in the omega distribution under some models. The values of \fBncatG()\fR used to perform our analyses are 3 for M3 (discrete), 5 for M4 (freq), 10 for the continuous distributions (M5: gamma, M6: 2gamma, M7: beta, M8:beta&w, M9:beta&gamma, M10: beta&gamma+1, M11:beta&normal>1, and M12:0&2normal>1, M13:3normal>0). This means M8 will have 11 site classes (10 from the beta distribution plus 1 additional class). The posterior probabilities for site classes as well as the expected omega values for sites are listed in the file rst, which may be useful to pinpoint sites under positive selection, if they exist. .PP To make it easy to run several \fBNssites\fR models in one go, the executable Bio::Tools::Run::Phylo::PAML::Codemlsites can be used, which asks you how many and which models to run at the start of the program. The number of categories used will then match those used in Yang et al(2000). .PP As noted in that paper, some of the models are hard to use, in particular, M12 and M13. Recommended models are 0 (one-ratio), 1 (neutral), 2 (selection), 3 (discrete), 7 (beta), and 8 (beta&omega ). Some of the models like M2 and M8 are noted to be prone to the problem of multiple local optima. You are advised to run the program at least twice, once with a starting omega value <1 and a second time with a value >1, and use the results corresponding to the highest likelihood. The continuous neutral and selection models of Nielsen and Yang (1998) are not implemented in the program. .PP \&\fBicode\fR for genetic code and these correspond to 1\-11 in the genbank transl table. 0:universal code 1:mamalian mt 2:yeast mt 3:mold mt, 4:invertebrate mt 5:ciliate nuclear 6:echinoderm mt 7:euplotid mt 8:alternative yeast nu. 9:ascidian mt 10:blepharisma nu .PP \&\fBRateAncestor\fR For codon sequences, ancestral reconstruction is not implemented for the models of variable dN/dS ratios among sites. The output under codon-based models usually shows the encoded amino acid for each codon. The output under \*(L"Prob of best character at each node, listed by site\*(R" has two posterior probabilities for each node at each codon (amino acid) site. The first is for the best codon. The second, in parentheses, is for the most likely amino acid under the codon substitution model. This is a sum of posterior probabilities across synonymous codons. In theory it is possible although rare for the most likely amino acid not to match the most likely codon. .PP \&\fBOutput\fR for codon sequences (seqtype = 1): The codon frequencies in each sequence are counted and listed in a genetic code table, together with their sums across species. Each table contains six or fewer species. For data of multiple genes (option G in the sequence file), codon frequencies in each gene (summed over species) are also listed. The nucleotide distributions at the three codon positions are also listed. The method of Nei and Gojobori (1986) is used to calculate the number of synonymous substitutions per synonymous site (dS ) and the number of nonsynonymous substitutions per nonsynonymous site (dN ) and their ratio (dN /dS ). These are used to construct initial estimates of branch lengths for the likelihood analysis but are not MLEs themselves. Note that the estimates of these quantities for the a\- and b\-globin genes shown in Table 2 of Goldman and Yang (1994), calculated using the \s-1MEGA\s0 package (Kumar et al., 1993), are not accurate. .PP Results of ancestral reconstructions (\fBRateAncestor\fR = 1) are collected in the file rst. Under models of variable dN/dS ratios among sites (NSsites models), the posterior probabilities for site classes as well as positively selected sites are listed in rst. .PP \&\s-1INCOMPLETE DOCUMENTATION OF ALL METHODS\s0 .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "program_name" .IX Subsection "program_name" .Vb 5 \& Title : program_name \& Usage : $factory\->program_name() \& Function: holds the program name \& Returns: string \& Args : None .Ve .SS "program_dir" .IX Subsection "program_dir" .Vb 5 \& Title : program_dir \& Usage : \->program_dir() \& Function: returns the program directory, obtained from ENV variable. \& Returns: string \& Args : .Ve .SS "error_string" .IX Subsection "error_string" .Vb 5 \& Title : error_string \& Usage : $obj\->error_string($newval) \& Function: Where the output from the last analysus run is stored. \& Returns : value of error_string \& Args : newvalue (optional) .Ve .SS "alignment" .IX Subsection "alignment" .Vb 8 \& Title : alignment \& Usage : $codeml\->align($aln); \& Function: Get/Set the L object \& Returns : L object \& Args : [optional] L \& Comment : We could potentially add support for running directly on a file \& but we shall keep it simple \& See also: L .Ve .SS "tree" .IX Subsection "tree" .Vb 8 \& Title : tree \& Usage : $codeml\->tree($tree, %params); \& Function: Get/Set the L object \& Returns : L \& Args : [optional] $tree => L, \& [optional] %parameters => hash of tree\-specific parameters: \& branchLengths: 0, 1 or 2 \& out \& \& Comment : We could potentially add support for running directly on a file \& but we shall keep it simple \& See also: L .Ve .SS "no_param_checks" .IX Subsection "no_param_checks" .Vb 6 \& Title : no_param_checks \& Usage : $obj\->no_param_checks($newval) \& Function: Boolean flag as to whether or not we should \& trust the sanity checks for parameter values \& Returns : value of no_param_checks \& Args : newvalue (optional) .Ve .SS "save_tempfiles" .IX Subsection "save_tempfiles" .Vb 5 \& Title : save_tempfiles \& Usage : $obj\->save_tempfiles($newval) \& Function: \& Returns : value of save_tempfiles \& Args : newvalue (optional) .Ve .SS "outfile_name" .IX Subsection "outfile_name" .Vb 6 \& Title : outfile_name \& Usage : my $outfile = $codeml\->outfile_name(); \& Function: Get/Set the name of the output file for this run \& (if you wanted to do something special) \& Returns : string \& Args : [optional] string to set value to .Ve .SS "tempdir" .IX Subsection "tempdir" .Vb 5 \& Title : tempdir \& Usage : my $tmpdir = $self\->tempdir(); \& Function: Retrieve a temporary directory name (which is created) \& Returns : string which is the name of the temporary directory \& Args : none .Ve .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 10 \& Title : new \& Usage : my $obj = Bio::Tools::Run::Phylo::PAML::Codeml\->new(); \& Function: Builds a new Bio::Tools::Run::Phylo::PAML::Codeml object \& Returns : Bio::Tools::Run::Phylo::PAML::Codeml \& Args : \-alignment => the Bio::Align::AlignI object \& \-save_tempfiles => boolean to save the generated tempfiles and \& NOT cleanup after onesself (default FALSE) \& \-tree => the Bio::Tree::TreeI object \& \-branchlengths => 0: ignore any branch lengths found on the tree \& 1: use as initial values \& 2: fix branch lengths \& \-params => a hashref of PAML parameters (all passed to set_parameter) \& \-executable => where the codeml executable resides .Ve .PP See also: Bio::Tree::TreeI, Bio::Align::AlignI .SS "prepare" .IX Subsection "prepare" .Vb 7 \& Title : prepare \& Usage : my $rundir = $codeml\->prepare($aln); \& Function: prepare the codeml analysis using the default or updated parameters \& the alignment parameter must have been set \& Returns : value of rundir \& Args : L object, \& L object [optional] .Ve .SS "run" .IX Subsection "run" .Vb 7 \& Title : run \& Usage : my ($rc,$parser) = $codeml\->run($aln,$tree); \& Function: run the codeml analysis using the default or updated parameters \& the alignment parameter must have been set \& Returns : Return code, L \& Args : L object, \& L object [optional] .Ve .SS "get_parameters" .IX Subsection "get_parameters" .Vb 5 \& Title : get_parameters \& Usage : my %params = $self\->get_parameters(); \& Function: returns the list of parameters as a hash \& Returns : associative array keyed on parameter names \& Args : none .Ve .SS "set_parameter" .IX Subsection "set_parameter" .Vb 11 \& Title : set_parameter \& Usage : $codeml\->set_parameter($param,$val); \& Function: Sets a codeml parameter, will be validated against \& the valid values as set in the %VALIDVALUES class variable. \& The checks can be ignored if one turns off param checks like this: \& $codeml\->no_param_checks(1) \& Returns : boolean if set was success, if verbose is set to \-1 \& then no warning will be reported \& Args : $param => name of the parameter \& $value => value to set the parameter to \& See also: L .Ve .SS "set_default_parameters" .IX Subsection "set_default_parameters" .Vb 7 \& Title : set_default_parameters \& Usage : $codeml\->set_default_parameters(0); \& Function: (Re)set the default parameters from the defaults \& (the first value in each array in the \& %VALIDVALUES class variable) \& Returns : none \& Args : boolean: keep existing parameter values .Ve .SS "cleanup" .IX Subsection "cleanup" .Vb 5 \& Title : cleanup \& Usage : $codeml\->cleanup(); \& Function: Will cleanup the tempdir directory after a PAML run \& Returns : none \& Args : none .Ve .SS "io" .IX Subsection "io" .Vb 5 \& Title : io \& Usage : $obj\->io($newval) \& Function: Gets a L object \& Returns : L \& Args : none .Ve .SH "Bio::Tools::Run::WrapperBase methods" .IX Header "Bio::Tools::Run::WrapperBase methods" .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 "AUTHOR" .IX Header "AUTHOR" Jason Stajich .SH "COPYRIGHT" .IX Header "COPYRIGHT" This software is copyright (c) by Jason Stajich . .PP This software is available under the same terms as the perl 5 programming language system itself.