Bio::T...lo::SLR(3pm)
π Bio::Tools::Run::Phylo::SLR β User Contributed Perl Documentation π
okay so bestie, welcome to Bio::T...lo::SLR(3pm), a page from the User Contributed Perl Documentation, and it's giving extremely useful. Let's get into it π
β¨ NAME β¨
Bio::Tools::Run::Phylo::SLR β a wrapper around the SLR program π§
π¦ SYNOPSIS π¦
use Bio::Tools::Run::Phylo::SLR;
use Bio::AlignIO;
use Bio::TreeIO;
use Bio::SimpleAlign;
my $alignio = Bio::AlignIO->new
(-format => 'fasta',
-file => 't/data/219877.cdna.fasta');
my $aln = $alignio->next_aln;
my $treeio = Bio::TreeIO->new
(-format => 'newick', -file => 't/data/219877.tree');
my $tree = $treeio->next_tree;
my $slr = Bio::Tools::Run::Phylo::SLR->new();
$slr->alignment($aln);
$slr->tree($tree);
# $rc = 1 for success, 0 for errors
my ($rc,$results) = $slr->run();
my $positive_sites = $results->{'positive'};
print "# Site\tNeutral\tOptimal\tOmega\t",
"lower\tupper\tLRT_Stat\tPval\tAdj.Pval\tResult\tNote\n";
foreach my $positive_site (@$positive_sites) {
print
$positive_site->[0], "\t",
$positive_site->[1], "\t",
$positive_site->[2], "\t",
$positive_site->[3], "\t",
$positive_site->[4], "\t",
$positive_site->[5], "\t",
$positive_site->[6], "\t",
$positive_site->[7], "\t",
$positive_site->[8], "\t",
"positive\n";
}
π DESCRIPTION π
So basically this is a wrapper around the SLR program π«Ά β hit up http://www.ebi.ac.uk/goldman/SLR/ if you want the full lore.
The way this module actually works: it's mostly about generating the proper ctl file for you, and then it runs the program inside its own separate temporary directory so it doesn't go dropping temp files all over the place like some kind of menace π iconic behaviour honestly.
π¬ FEEDBACK π¬
Mailing Lists
User feedback is literally an integral part of the evolution of this and other Bioperl modules, no cap. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated π
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
okay bestie, please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. So many experienced and responsive experts will be able to 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 so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:
http://redmine.open-bio.org/projects/bioperl/
π AUTHOR - Albert Vilella π
Email avilella-at-gmail-dot-com
πΈ CONTRIBUTORS πΈ
Additional contributors names and emails here
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ π¦
π« Default Values π«
INCOMPLETE DOCUMENTATION OF ALL METHODS
(yeah, that's a direct quote, we're being honest about it π)
π seqfile [incodon]
File from which to read alignment of codon sequences. The file should be in PAML format.
π treefile [intree]
File from which tree should be read. The tree should be in Nexus format.
π outfile [slr.res]
File to which results are written. Heads up bestie β if the file already exists, it will be overwritten π
π reoptimise [1]
Should the branch lengths, omega and kappa be reoptimized?
0β no1β yes.
π kappa [2.0]
Value for kappa. If reoptimise is specified, the value given will be used as an initial estimate.
π omega [0.1]
Value for omega (dN/dS). If reoptimise is specified, the value given will be used as an initial estimate.
π codonf [0]
How codon frequencies are estimated:
0: F61/F60 β Estimates used are the empirical frequencies from the data.1: F3x4 β The frequencies of nucleotides at each codon position are estimated from the data and then multiplied together to get the frequency of observing a given codon. The frequency of stop codons is set to zero, and all other frequencies scaled appropriately.2: F1x4 β Nucleotide frequencies are estimated from the data (not taking into account at which position in the codon it occurs). The nucleotide frequencies are multiplied together to get the frequency of observing and then corrected for stop codons.
π freqtype [0]
How codon frequencies are incorporated into the substitution matrix.
0:q_{ij} = pi_{j} s_{ij}1:q_{ij} = \sqrt(pi_j/pi_i) s_{ij}2:q_{ij} = \pi_{n} s_{ij}, wherenis the nucleotide that the subsitution is to.3:q_{ij} = s_{ij} / pi_i
Option 0 is the tradition method of incorporating equilibrium frequencies into subsitution matrices (Felsenstein 1981; Goldman and Yang, 1994).
Option 1 is described by Goldman and Whelan (2002), in this case with the additional parameter set to 0.5.
Option 2 was suggested by Muse and Gaut (1994).
Option 3 is included as an experiment, originally suggested by Bret Larget. it does not appear to describe evolution very successfully and should not be used for analyses. like, fr fr, don't do it π
Kosakovsky-Pond has repeatedly stated that he finds incorporating codon frequencies in the manner of option 2 to be superior to option 0. We find that option 1 tends to perform better than either of these options.
π positive_only [0]
If only positively selected sites are of interest, set this to "1". Calculation will be slightly faster, but information about sites under purifying selection is lost π
π gencode [universal]
Which genetic code to use when determining whether a given mutation is synonymous or nonsynonymous. Currently only "universal" and "mammalian" mitochondrial are supported.
π nucleof [0]
Allow for empirical exchangabilities for nucleotide substitution.
0: No adjustment. All nucleotides treated the same, modulo transition / transversion.1: The rate at which a substitution caused a mutation from nucleotideato nucleotidebis adjust by a constantN_{ab}. This adjustment is in addition to other adjustments (e.g. transition / transversion or base frequencies).
π aminof [0]
Incorporate amino acid similarity parameters into substitution matrix, adjusting omega for a change between amino acid i and amino acid j. A_{ij} is a symmetric matrix of constants representing amino acid similarities.
0: Constant omega for all amino acid changes1:omega_{ij} = omega^{A_{ij}}2:omega_{ij} = a_{ij} log(omega) / [ 1 - exp(-a_{ij} log(omega)) ]
Option 1 has the same form as the original codon subsitution model proposed by Goldman and Yang (but with potentially different constants).
Option 2 has a more population genetic derivtion, with omega being interpreted as the ratio of fixation probabilities.
π nucfile [nuc.dat]
If nucleof is non-zero, read nucleotide substitution constants from nucfile. If this file does not exist, hard coded constants are used.
π aminofile [amino.dat]
If aminof is non-zero, read amino acid similarity constants from aminofile. If this file does not exist, hard coded constants are used.
π timemem [0]
Print summary of real time and CPU time used. Will eventually print summary of memory use as well.
π ldiff [3.841459]
Twice log-likelihood difference used as a threshold for calculating support (confidence) intervals for sitewise omega estimates. This value should be the quantile from a chi-square distribution with one degree of freedom corresponding to the support required.
E.g. qchisq(0.95,1) = 3.841459
0.4549364 = 50% support
1.323304 = 75% support
2.705543 = 90% support
3.841459 = 95% support
6.634897 = 99% support
7.879439 = 99.5% support
10.82757 = 99.9% support
π paramin []
If not blank, read in parameters from file given by the argument.
π paramout []
If not blank, write out parameter estimates to file given.
π skipsitewise [0]
Skip sitewise estimation of omega. Depending on other options given, either calculate maximum likelihood or likelihood fixed at parameter values given.
π seed [0]
Seed for random number generator. If seed is 0, then previously produced seed file (~/.rng64) is used. If this does not exist, the random number generator is initialised using the clock.
π saveseed [1]
If non-zero, save finial seed in file (~/.rng64) to be used as initial seed in future runs of program.
π Results Format π
Results file (default: slr.res) ------------ Results are presented in nine columns β¨
β Site
Number of sites in alignment
β Neutral
(minus) Log-probability of observing site given that it was evolving neutrally (omega=1)
β Optimal
(minus) Log-probability of observing site given that it was evolving at the optimal value of omega.
β Omega
The value of omega which maximizes the log-probability of observing
β LRT_Stat
Log-likelihood ratio statistic for non-neutral selection (or positive selection if the positive_only option is set to 1).
LRT_Stat = 2 * (Neutral-Optimal)
β Pval
P-value for non-neutral (or positive) selection at a site, unadjusted for multiple comparisons.
β Adj. Pval
P-value for non-neutral (or positive) selection at a site, after adjusting for multiple comparisons using the Hochberg procedure (see the file "MultipleComparisons.txt" in the doc directory).
β Result
A simple visual guide to the result. Sites detected as having been under positive selection are marked with a '+', sites under purifying selection are marked with a '-'. The number of symbols:
- Number symbols
1β Threshold95% - Number symbols
2β Threshold99% - Number symbols
3β Threshold95%after adjustment - Number symbols
4β Threshold99%after adjustment
Occasionally the result may also contain an exclamation mark. This indicates that the observation at a site is not significantly different from random (equivalent to infinitely strong positive selection). This may indicate that the alignment at that site is bad π
β Note
The following events are flagged:
- Synonymous β All codons at a site code for the same amino acid.
- Single character β Only one sequence at the site is ungapped, the result of a recent insertion for example.
- All gaps β All sequences at a site contain a gap character.
Sites marked "Single character" or "All gaps" are not counted towards the number of sites for the purposes of correcting for multiple comparisons since it is not possible to detect selection from none or one observation under the assumptions made by the sitewise likelihood ratio test. π
πΈ program_name
- Title:
program_name - Usage:
$factory->program_name() - Function: holds the program name π
- Returns: string
- Args: None
πΈ program_dir
- Title:
program_dir - Usage:
->program_dir() - Function: returns the program directory, obtained from ENV variable.
- Returns: string
- Args:
πΈ new
- Title:
new - Usage:
my $obj = Bio::Tools::Run::Phylo::SLR->new(); - Function: Builds a new Bio::Tools::Run::Phylo::SLR object β¨
- Returns: Bio::Tools::Run::Phylo::SLR
- Args: the whole menu, bestie π
-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
-params => a hashref of SLR parameters (all passed to set_parameter)
-executable => where the SLR executable resides
See also: Bio::Tree::TreeI, Bio::Align::AlignI
πΈ prepare
- Title:
prepare - Usage:
my $rundir = $slr->prepare($aln); - Function: prepare the SLR analysis using the default or updated parameters β the alignment parameter must have been set (no skipping this step, fr fr)
- Returns: value of rundir
- Args:
Bio::Align::AlignIobject,Bio::Tree::TreeIobject
πΈ run
- Title:
run - Usage:
my ($rc,$parser) = $slr->run($aln,$tree); - Function: run the SLR analysis using the default or updated parameters β the alignment parameter must have been set
- Returns: Return code,
Bio::Tools::Phylo::SLR - Args:
Bio::Align::AlignIobject,Bio::Tree::TreeIobject
πΈ error_string
- Title:
error_string - Usage:
$obj->error_string($newval) - Function: Where the output from the last analysus run is stored. (yes, "analysus", we keep the typo, it's iconic π )
- Returns: value of error_string
- Args: newvalue (optional)
πΈ alignment
- Title:
alignment - Usage:
$slr->align($aln); - Function: Get/Set the
Bio::Align::AlignIobject - Returns:
Bio::Align::AlignIobject - Args: [optional]
Bio::Align::AlignI - Comment: We could potentially add support for running directly on a file but we shall keep it simple π«Ά
- See also:
Bio::SimpleAlign
πΈ tree
- Title:
tree - Usage:
$slr->tree($tree, %params); - Function: Get/Set the
Bio::Tree::TreeIobject - Returns:
Bio::Tree::TreeI - Args: [optional]
$tree=>Bio::Tree::TreeI, - Comment: We could potentially add support for running directly on a file but we shall keep it simple π«Ά
- See also:
Bio::Tree::Tree
πΈ get_parameters
- 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
πΈ set_parameter
- Title:
set_parameter - Usage:
$slr->set_parameter($param,$val); - Function: Sets a SLR parameter, will be validated against the valid values as set in the
%VALIDVALUESclass variable. The checks can be ignored if one turns off param checks like this:
$slr->no_param_checks(1)
- Returns: boolean if set was success, if verbose is set to
-1then no warning will be reported - Args:
$param=> name of the parameter,$value=> value to set the parameter to - See also:
no_param_checks()
πΈ set_default_parameters
- Title:
set_default_parameters - Usage:
$slr->set_default_parameters(0); - Function: (Re)set the default parameters from the defaults (the first value in each array in the
%VALIDVALUESclass variable) - Returns: none
- Args: boolean: keep existing parameter values
π Bio::Tools::Run::WrapperBase methods π
π¦ no_param_checks
- 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)
π¦ save_tempfiles
- Title:
save_tempfiles - Usage:
$obj->save_tempfiles($newval) - Function:
- Returns: value of save_tempfiles
- Args: newvalue (optional)
π¦ outfile_name
- Title:
outfile_name - Usage:
my $outfile = $slr->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
π¦ tempdir
- 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
π¦ cleanup
- Title:
cleanup - Usage:
$slr->cleanup(); - Function: Will cleanup the tempdir directory after an SLR run
- Returns: none
- Args: none
π¦ io
- Title:
io - Usage:
$obj->io($newval) - Function: Gets a
Bio::Root::IOobject - Returns:
Bio::Root::IO - Args: none
and that's the whole thing, bestie β every last method documented, no crumbs left behind πβ¨ this page shipped with perl v5.36.0 and was dated 2023-01-22, and it lives on as Bio::T...lo::SLR(3pm) in the perl man pages π go forth and run your SLR, you absolute icon π
π¦ where this page comes from
- debian bookworm: libbio-perl-run-perl 1.7.3-9 Β· Perl
- ubuntu noble: libbio-perl-run-perl 1.7.3-9 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms