Bio::T...otDist(3pm)
π Bio::T...otDist(3pm) π
okay so bestie, welcome to the User Contributed Perl Documentation page for Bio::T...otDist(3pm). pull up a chair, grab a boba, we're doing protein distance matrices today and honestly? it's giving iconic. π§¬β¨
β¨ NAME β¨
Bio::Tools::Run::Phylo::Phylip::ProtDist β it's the wrapper for the phylip program protdist, no cap. π
π¦ SYNOPSIS π¦
#Create a SimpleAlign object
@params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
$factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
$inputfilename = 't/data/cysprot.fa';
$aln = $factory->run($inputfilename); # $aln is a SimpleAlign object.
# Create the Distance Matrix using a default PAM matrix and id name
# lengths limit of 30 note to use id name length greater than the
# standard 10 in protdist, you will need to modify the protdist source
# code
@params = ('MODEL' => 'PAM');
$protdist_factory = Bio::Tools::Run::Phylo::Phylip::ProtDist->new(@params);
my ($matrix) = $protdist_factory->run($aln); # an array of Bio::Matrix::PhylipDist matrix
#finding the distance between two sequences
my $distance = $matrix->get_entry('protein_name_1','protein_name_2');
my @column = $matrix->get_column('protein_name_1');
my @row = $martrix->get_row('protein_name_1');
my @diag = $matrix->get_diagonal();
print $matrix->print_matrix;
#Alternatively, one can create the matrix by passing in a file
#name containing a multiple alignment in phylip format
$protdist_factory = Bio::Tools::Run::Phylo::Phylip::ProtDist->new(@params);
my ($matrix) = $protdist_factory->run('/home/shawnh/prot.phy');
# To prevent PHYLIP from truncating sequence names:
# Step 1. Shelf the original names:
my ($aln_safe, $ref_name)= # $aln_safe has serial names
$aln->set_displayname_safe(); # $ref_name holds original names
# Step 2. Run ProtDist and Neighbor:
($matrix) = $protdist_factory->
create_distance_matrix($aln_safe); # Use $aln_safe instead of $aln
($tree) = $neighbor_factory->run($matrix);
# Step 3. Retrieve orgininal OTU names:
use Bio::Tree::Tree;
my @nodes=$tree->get_nodes();
foreach my $nd (@nodes){
$nd->id($ref_name->{$nd->id_output}) if $nd->is_Leaf;
}
πΈ DESCRIPTION πΈ
It's a wrapper for protdist (Joseph Felsentein's baby π«) that builds a distance matrix comparing protein sequences β from either a multiple alignment file or a Bio::SimpleAlign object β and hands you back a Bio::Matrix::PhylipDist object. periodt. π«Ά
VERSION Support
This wrapper currently supports v3.5 of phylip. There is also support for v3.6. slay.
π PARAMETERS FOR PROTDIST COMPUTATION π
MODEL
- Title β MODEL
- Description β (optional)
This sets the model of amino acid substitution used in the calculation of the distances. 3 different models are supported:
PAMβ Dayhoff PAM Matrix (default)KIMURAβ Kimura's DistanceCATβ Categories Distance
Usage:
@params = ('model'=>'X');#where X is one of the values above
Defaults to PAM. For more information on the usage of the different models, please refer to the documentation defaults to Equal (0.25,0.25,0.25,0.25) found in the phylip package.
Additional models in PHYLIP 3.6:
PMBβ Henikoff/Tillier PMB matrixJTTβ Jones/Taylor/Thornton
MULTIPLE
- Title β MULTIPLE
- Description β (optional)
This allows multiple distance matrices to be generated from multiple MSA. π
Usage: @params = ('MULTIPLE'=>100) where the value specifyies the number of aligments given.
ALL SUBSEQUENT PARAMETERS WILL ONLY WORK IN CONJUNCTION WITH
THE Categories Distance MODEL*
bestie read this twice. everything below this line only does anything when you're on the Categories Distance model. no exceptions, fr fr. π
GENCODE
- Title β GENCODE
- Description β (optional)
This option allows the user to select among various nuclear and mitochondrial genetic codes.
Acceptable Values:
Uβ UniversalMβ MitochondrialVβ Vertebrate mitochondrialFβ Fly mitochondrialYβ Yeast mitochondrial
Usage: @params = ('gencode'=>'X'); where X is one of the letters above Defaults to U
CATEGORY
- Title β CATEGORY
- Description β (optional)
This option sets the categorization of amino acids β all have groups: (Glu Gln Asp Asn), (Lys Arg His), (Phe Tyr Trp) plus:
Gβ George/Hunt/Barker:(Cys),(Met Val Leu Ileu),(Gly Ala Ser Thr Pro)
Cβ Chemical:(Cys Met),(Val Leu Ileu Gly Ala Ser Thr),(Pro)
Hβ Hall:(Cys),(Met Val Leu Ileu),(Gly Ala Ser Thr),(Pro)
Usage: @params = ('category'=>'X'); where X is one of the letters above Defaults to G
PROBCHANGE
- Title β PROBCHANGE
- Description β (optional)
This option sets the ease of changing category of amino acid. (1.0 if no difficulty of changing, less if less easy. Can't be negative)
Usage: @params = ('probchange'=>X) where 0<=X<=1 Defaults to 0.4570
TRANS
- Title β TRANS
- Description β (optional)
This option sets transition/transversion ratio β can be any positive number.
Usage: @params = ('trans'=>X) where X >= 0 Defaults to 2
FREQ
- Title β FREQ
- Description β (optional)
This option sets the frequency of each base (A,C,G,T). The sum of the frequency must sum to 1. For example A,C,G,T = (0.25,0.5,0.125,0.125)
Usage: @params = ('freq'=>('W','X','Y','Z') where W + X + Y + Z = 1 Defaults to Equal (0.25,0.25,0.25,0.25)
π«Ά 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 one of the Bioperl mailing lists. Your participation is much appreciated. (we literally love you for it π₯Ή)
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
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 the bugs and their resolution. Bug reports can be submitted via the web:
http://redmine.open-bio.org/projects/bioperl/
π AUTHOR - Shawn Hoon π
Email shawnh@fugu-sg.org
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
program_name
- Title β
program_name - Usage β
>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 β
idlength
- Title β
idlength - Usage β
$obj->idlength ($newval) - Function β
- Returns β value of
idlength - Args β newvalue (optional)
run
- Title β
run - Usage β
$inputfilename = 't/data/prot.phy';
$matrix= $prodistfactory->run($inputfilename);
or
$seq_array_ref = \@seq_array; @seq_array is array of Seq objs
$aln = $protdistfactory->align($seq_array_ref);
$matrix = $protdistfactory->run($aln);
- Function β Create a distance matrix from a
SimpleAlignobject or a multiple alignment file - Example β
- Returns β
Bio::Matrix::PhylipDist - Args β Name of a file containing a multiple alignment in Phylip format or an
SimpleAlignobject
Throws an exception if argument is not either a string (eg a filename) or a Bio::SimpleAlign object. If argument is string, throws exception if file corresponding to string name can not be found. π¨
_run
- Title β
_run - Usage β Internal function, not to be called directly
- Function β makes actual system call to
protdistprogram - Example β
- Returns β
Bio::Treeobject - Args β Name of a file containing a set of multiple alignments in Phylip format and a parameter string to be passed to
protdist
create_distance_matrix
- Title β
create_distance_matrix - Usage β
my $file = $app->create_distance_matrix($treefile); - Function β This method is deprecated. Please use
runmethod. (bestie it's old news, move on π ) - Returns β
Bio::Matrix::PhylipDist - Args β Name of a file containing a multiple alignment in Phylip format or an
SimpleAlignobject
Throws an exception if argument is not either a string (eg a filename) or a Bio::SimpleAlign object. If argument is string, throws exception if file corresponding to string name can not be found. π¨
_setinput()
- Title β
_setinput - Usage β Internal function, not to be called directly
- Function β Create input file for
protdistprogram - Example β
- Returns β name of file containing a multiple alignment in Phylip format
- Args β
SimpleAlignobject reference or input file name
_setparams()
- Title β
_setparams - Usage β Internal function, not to be called directly
- Function β Create parameter inputs for
protdistprogram - Example β
- Returns β parameter string to be passed to
protdist - Args β name of calling object
β¨ Bio::Tools::Run::Wrapper methods β¨
okay so before we get into the actual ProtDist stuff, here's the lil' housekeeping squad π
β every single one of these comes from Bio::Tools::Run::Wrapper, the parent class doing the behind-the-scenes admin so you don't have to. They're inherited, they're handy, and they keep your run from turning into a hot mess. Let's go π¦
π no_param_checks
- Title:
no_param_checks - Usage:
$obj->no_param_checks($newval) - Function: a boolean flag deciding whether we should trust the sanity checks for parameter values or just... vibe π
- Returns: the value of
no_param_checks - Args:
newvalue(optional, so you can set it if you want)
tl;dr it's the "do we double-check ur params or nah" switch, bestie.
π save_tempfiles
- Title:
save_tempfiles - Usage:
$obj->save_tempfiles($newval) - Function: the docs literally leave this one blank π β not me inventing behaviour, i would never, i'm just telling you what's on the page
- Returns: the value of
save_tempfiles - Args:
newvalue(optional)
π outfile_name
- Title:
outfile_name - Usage:
my $outfile = $protdist->outfile_name();
- Function: get/set the name of the output file for this run β for when you wanna do something special with it β¨
- Returns: string
- Args:
[optional]string to set the value to
π tempdir
- Title:
tempdir - Usage:
my $tmpdir = $self->tempdir();
- Function: grab a temporary directory name (and it actually gets created, no cap β it's not just a name floating in the void)
- Returns: string, which is the name of that temporary directory
- Args: none
π cleanup
- Title:
cleanup - Usage:
$codeml->cleanup();
- Function: will cleanup the
tempdirdirectory after a ProtDist run π§Ή (yes the example says$codemland yes we're keeping it exactly like that, copy-paste fidelity is the whole point π) - Returns: none
- Args: none
don't skip this one if you care about your disk, bestie. temp dirs pile up like unread notifications π
π io
- Title:
io - Usage:
$obj->io($newval) - Function: gets a
Bio::Root::IOobject - Returns:
Bio::Root::IO - Args: none
and that's the whole wrapper gang π«Ά every one of them inherited, every one of them doing its little job so your ProtDist run stays iconic. go forth and compute, main character π
this page is from the Perl v5.36.0 docs, dated 2023-01-22, and the page itself is Bio::T...otDist(3pm) β mwah, take care of her ππ
π¦ 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