Bio::T...TCoffee(3pm)
π NAME π
Bio::Tools::Run::Alignment::TCoffee β the object that runs the TCoffee program for you and hands back a multiple sequence alignment built from a pile of unaligned sequences or alignments. It's giving "wrapper module, but make it serve". π
This one lives in the Bio::T...TCoffee(3pm) manual page, under User Contributed Perl Documentation, bestie. β¨
πΈ VERSION πΈ
version 1.7.4
π SYNOPSIS π
# Build a tcoffee alignment factory
@params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
$factory = Bio::Tools::Run::Alignment::TCoffee->new(@params);
# Pass the factory a list of sequences to be aligned.
$inputfilename = 't/cysprot.fa';
# $aln is a SimpleAlign object.
$aln = $factory->align($inputfilename);
# or where @seq_array is an array of Bio::Seq objects
$seq_array_ref = \@seq_array;
$aln = $factory->align($seq_array_ref);
# Or one can pass the factory a pair of (sub)alignments
#to be aligned against each other, e.g.:
# where $aln1 and $aln2 are Bio::SimpleAlign objects.
$aln = $factory->profile_align($aln1,$aln2);
# Or one can pass the factory an alignment and one or more
# unaligned sequences to be added to the alignment. For example:
# $seq is a Bio::Seq object.
$aln = $factory->profile_align($aln1,$seq);
#There are various additional options and input formats available.
#See the DESCRIPTION section that follows for additional details.
π¦ DESCRIPTION π¦
Quick note bestie: this DESCRIPTION only documents the (Bio)perl interface to TCoffee. That's it, that's the scope. π
π Helping the module find your executable
Okay so real talk β you gotta let TCoffee actually find the t_coffee program. There's (at least) three ways to make that happen, pick your fighter:
- Make sure the
t_coffeeexecutable is in your path so thatwhich t_coffeereturns at_coffeeexecutable on your system. Easiest of the easy. β¨ - Define an environmental variable
TCOFFEEDIRwhich is a dir which contains the't_coffee'app.
In bash:
export TCOFFEEDIR=/home/username/progs/T-COFFEE_distribution_Version_1.37/bin
In csh/tcsh:
setenv TCOFFEEDIR /home/username/progs/T-COFFEE_distribution_Version_1.37/bin
- Include a definition of an environmental variable
TCOFFEEDIRin every script that will use this TCoffee wrapper module.
BEGIN { $ENV{TCOFFEDIR} = '/home/username/progs/T-COFFEE_distribution_Version_1.37/bin' }
use Bio::Tools::Run::Alignment::TCoffee;
π¨ If you are running an application on a webserver make sure the webserver environment has the proper PATH set, or use options 2 or 3 to set the variables. No cap, webserver envs be forgetting things. π
π INTERNAL METHODS π
π _numeric_version
Version "numbers" are not numeric values, bestie. π In the case of T-Coffee, they have a hash component at their end. This was not the case in older releases. We use the first two numeric parts to do different things though. See also issue #1.
β¨ _run
- Title :
_run - Usage : Internal function, not to be called directly
- Function : makes actual system call to tcoffee program
- Example :
- Returns : nothing; tcoffee output is written to a temporary file OR specified output file
- Args : Name of a file containing a set of unaligned fasta sequences and hash of parameters to be passed to tcoffee
π _setinput
- Title :
_setinput - Usage : Internal function, not to be called directly
- Function : Create input file for tcoffee program
- Example :
- Returns : name of file containing tcoffee data input AND type of file (if known,
Sfor sequence,Lfor sequence library,Afor sequence alignment) - Args : Seq or Align object reference or input file name
π«Ά _setparams
- Title :
_setparams - Usage : Internal function, not to be called directly
- Function : Create parameter inputs for tcoffee program
- Example :
- Returns : parameter string to be passed to tcoffee during align or profile_align
- Args : name of calling object
π PARAMETERS FOR ALIGNMENT COMPUTATION π
okay bestie, so likeβ¦ there are a lot of params you can throw at T-Coffee, and honestly the real tea is in the online manual, go read that for the full β¨whyβ¨. Peep this:
http://igs-server.cnrs-mrs.fr/~cnotred/Documentation/t_coffee/t_coffee_doc.html
You can pass these in two ways: literally hand them over when you instantiate a new TCoffee object, or poke at them through the get/set methods that share the exact same name (lowercase, bestie, lowercase).
πΈ IN
- Title:
IN - Description: (optional) input filename. Ngl this one gets set when you
align, so don't go touching it directly unless you truly understand the TCoffee program very well. like, in your bones.
π TYPE
- Title:
TYPE - Args: [string]
DNA,PROTEIN - Description: (optional) sets the sequence type. It's guessed automatically anyway, so again β don't use this directly, she doesn't need your help.
π¦ PARAMETERS
- Title:
PARAMETERS - Description: (optional) points at a file that's holding extra parameters. very "bring snacks to the function" energy.
π₯ EXTEND
- Title:
EXTEND - Args:
0,1, or any positive value - Default:
1 - Description: flag that says whether library extension should happen while doing multiple alignments.
- set it to
0β no extension, periodt. - set it to
1β extension happens on all pairs in the library. - set it to literally any other positive value β extension only happens on pairs whose weight value is superior to that limit you specified.
- set it to
β¨ DP_NORMALISE β¨
- Title:
DP_NORMALISE - Args:
0or any positive value - Default:
1000 - Description: when you use anything other than
0, this flag sets the score of the highest scoring pair to1000. iconic behaviour, honestly.
π DP_MODE π
- Title:
DP_MODE - Args: [string]
gotoh_pair_wise,myers_miller_pair_wise,fasta_pair_wise cfasta_pair_wise - Default:
cfast_fair_wise - Description: tells the program which flavour of dynamic programming it should be running. the options:
gotoh_pair_wise: the gotoh algorithm implementation. quadratic in memory and time, so she's a little hungry.myers_miller_pair_wise: the Myers and Miller dynamic programming algorithm β quadratic in time but linear in space. This one is recommended for very long sequences. It's about2time slower than gotoh. Heads up: it only acceptstg_mode=1.fasta_pair_wise: the fasta algorithm implementation. The sequence gets hashed, looking for ktuples words. Dynamic programming only runs on thendiagbest scoring diagonals. Much faster, but less accurate than the two previous ones. trade-off queen.cfasta_pair_wise: thecstands for checked. Same algorithm, but the dynamic programming is made on thendiagbest diagonals, and then on the2*ndiags, and so on until the scores converge. Complexity depends on how divergent your sequences are, but will usually beL*log(L), with accuracy comparable to the two first modes (this was checked on BaliBase, so likeβ¦ receipts π ).
π§ KTUPLE π§
- Title:
KTUPLE - Args: numeric value
- Default:
1or2(1for protein,2for DNA) - Description: indicates the ktuple size for
cfasta_pair_wisedp_modeandfasta_pair_wise. It's set to1for proteins and2for DNA. The alphabet used for protein is not the 20 letter code β it's a mildly degenerated version where some residues get grouped under one letter based on physicochemical properties:rk,de,qh,vilm,fy(the other residues are not degenerated). cute little clusters.
β NDIAGS β
- Title:
NDIAGS - Args: numeric value
- Default:
0 - Description: indicates the number of diagonals used by the
fasta_pair_wisealgorithm. When it's set to0,n_diag=Log (length of the smallest sequence). math is doing its thing, we respect her.
π DIAG_MODE π
- Title:
DIAG_MODE - Args: numeric value
- Default:
0 - Description: indicates the manner in which diagonals are scored during the fasta hashing.
0β the score of a diagonal equals the sum of the scores of the exact matches it contains.1β this score is set equal to the score of the best uninterrupted segment.
1 can be useful when you're dealing with fragments of sequences. lowkey a niche fave.
π SIM_MATRIX π
- Title:
SIM_MATRIX - Args: string
- Default:
vasiliky - Description: indicates the manner in which the amino acid gets degenerated when hashing. All the substitution matrices are acceptable, no gatekeeping. Categories get defined as sub-groups of residues that all have a positive substitution score (they can overlap, it's giving polycule).
If you wish to keep the non degenerated amino acid alphabet, use 'idmat'.
π MATRIX π
- Title:
MATRIX - Args:
- Default:
- Description: this flag exists purely for compatibility with ClustalW, bestie. Setting
matrix = 'blosum'is equivalent to-in=Xblosum62mt, and-matrix=pamis equivalent toin=Xpam250mt. Apart from this, the rules are similar to those applying when declaring a matrix with the-in=X fl
π GAPOPEN π
- Title:
GAPOPEN - Args: numeric
- Default:
0 - Description: indicates the penalty applied for opening a gap. The penalty must be negative. If you hand it a positive value, it will automatically be turned into a negative number (it does not trust your judgement, and honestly, fair). We recommend a value of
10with pam matrices, and a value of0when a library is used.
π«Ά GAPEXT π«Ά
- Title:
GAPEXT - Args: numeric
- Default:
0 - Description: indicates the penalty applied for extending a gap. that's it, that's the tweet.
π COSMETIC_PENALTY π
- Title:
COSMETIC_PENALTY - Args: numeric
- Default:
100 - Description: indicates the penalty applied for opening a gap. This penalty is set to a very low value. It will only have an influence on the portions of the alignment that are unalignable. It will not make them more correct β it only makes them more pleasing to the eye (i.e. avoid stretches of lonely residues). it's doing makeup, not surgery, okay?
The cosmetic penalty is automatically turned off if a substitution matrix is used rather than a library.
π₯ TG_MODE π₯
- Title:
TG_MODE - Args:
0,1,2 - Default:
1 - Description: (Terminal Gaps)
0: indicates that terminal gaps must be panelized with agapopenand agapextpenalty.1: indicates that terminal gaps must be penalized only with agapextpenalty.2: indicates that terminal gaps must not be penalized. zero consequences, free real estate.
β¨ WEIGHT β¨
- Title:
WEIGHT - Args:
simorsim_<matrix_name or matrix_file>or integer value - Default:
sim - Description:
Weightdefines the way alignments are weighted when turned into a library.simindicates that the weight equals the average identity within the match residues.sim_matrix_nameindicates the average identity with two residues regarded as identical when their substitution value is positive. The valid matrices names are inmatrices.h(pam250mt). Matrices not found in this header are considered to be filenames β see the format section for matrices. For instance,-weight=sim_pam250mtindicates that the grouping used for similarity will be the set of classes with positive substitutions. Other groups includesim_clustalw_col( categories of clustalw marked with:)sim_clustalw_dot( categories of clustalw marked with.)
- Value indicates that all the pairs found in the alignments must be given the same weight equal to value. This is useful when the alignment one wishes to turn into a library must be given a pre-specified score (for instance if they come from a structure super-imposition program). Value is an integer:
-weight=1000
- Note:
Weightonly affects methods that return an alignment to T-Coffee, such as ClustalW. On the contrary, the version of Lalign we use here returns a library where weights have already been applied and are therefore insensitive to the-weightflag. so like, don't @ her about it.
π SEQ_TO_ALIGN π
- Title:
SEQ_TO_ALIGN - Args: filename
- Default: no file β align all the sequences
- Description: maybe you don't wanna align all the sequences that got brought in by the
-inflag? totally valid. Supplying theseq_to_alignflag allows for this β the file is simply a list of names in Fasta format.
However, note that library extension will be carried out on all the sequences. yes, all of them. no sneaky exemptions. π
π³ PARAMETERS FOR TREE COMPUTATION AND OUTPUT π³
okay bestie, this is the tree-computing part. let's get into it π
π± NEWTREE π±
- Title:
NEWTREE - Args:
treefile - Default: no file
- Description: bestie, this tells you the name of the new tree to compute. if you don't pick one, the default will be
<sequence_name>.dnd, or<run_name.dnd>. Format is Phylip/Newick tree format. periodt π
π² USETREE π²
- Title:
USETREE - Args:
treefile - Default: no file specified
- Description: this flag is giving "instead of computing a new dendrogram,
t_coffeecan use a pre-computed one." the tree files are inphylipsformat and compatible with ClustalW. lowkey, in most cases, using a pre-computed tree will halve the computation time required byt_coffee. it is also possible to use trees output by ClustalW orPhylips. Format isPhylipstree format. slay π¦
π³ TREE_MODE π³
- Title:
TREE_MODE - Args:
slow,fast,very_fast - Default:
very_fast - Description: this flag says which method is used for computing the dendrogram:
slow: the chosendp_modeusing the extended library,fast: The fastadp_modeusing the extended library.very_fast: The fastadp_modeusingpam250mt.
β‘ QUICKTREE β‘
- Title:
QUICKTREE - Args:
- Default:
- Description: this flag is kept for compatibility with ClustalW. it indicates that:
-tree_mode=very_fastπ₯
π PARAMETERS FOR ALIGNMENT OUTPUT π
π OUTFILE π
- Title:
OUTFILE - Args:
out_aln file,default,no - Default:
default ( yourseqfile.aln) - Description: indicates name of output alignment file. yes bestie, that's the whole vibe π
π€ OUTPUT π€
- Title:
OUTPUT - Args:
format1,format2 - Default:
clustalw - Description: Indicated format for outputting outputfile. Supported formats are:
clustalw_aln,clustalw: ClustalW format.gcg,msf_aln: Msf alignment.pir_aln: pir alignment.fasta_aln: fasta alignment.phylip: Phylip format.pir_seq: pir sequences (no gap).fasta_seq: fasta sequences (no gap).
As well as:
score_html: causes the output to be a reliability plot in HTMLscore_pdf: idem in PDF.score_ps: idem in postscript.
More than one format can be indicated:
-output=clustalw,gcg, score_html
π CASE π
- Title:
CASE - Args:
upper,lower - Default:
upper - Description: triggers choice of the case for output. iconic π«Ά
β±οΈ CPU β±οΈ
- Title:
CPU - Args:
value - Default:
0 - Description: Indicates the cpu time (micro seconds) that must be added to the
t_coffeecomputation time.
π OUT_LIB π
- Title:
OUT_LIB - Args:
name of library,default,no - Default:
default - Description: Sets the name of the library output. Default implies
<run_name>.tc_lib
π OUTORDER π
- Title:
OUTORDER - Args:
inputoraligned - Default:
input - Description: Sets the name of the library output. Default implies
<run_name>.tc_lib
π’ SEQNOS π’
- Title:
SEQNOS - Args:
onoroff - Default:
off - Description: Causes the output alignment to contain residue numbers at the end of each line:
β¨ PARAMETERS FOR GENERIC OUTPUT β¨
π·οΈ RUN_NAME π·οΈ
- Title:
RUN_NAME - Args:
your run name - Default:
- Description: this flag causes the prefix
<your sequences>to be replaced by<your run name>when renaming the default files.
β ALIGN β
- Title:
ALIGN - Args:
- Default:
- Description: Indicates that the program must produce the alignment. This flag is here for compatibility with ClustalW
π€« QUIET π€«
- Title:
QUIET - Args:
stderr,stdout, orfilename, or nothing - Default:
stderr - Description: Redirects the standard output to either a file.
-quieton its own redirect the output to/dev/null.
π CONVERT π
- Title:
CONVERT - Args:
- Default:
- Description: Indicates that the program must not compute the alignment but simply convert all the sequences, alignments and libraries into the format indicated with
-output. This flag can also be used if you simply want to compute a library ( i.e. You have an alignment and you want to turn it into a library).
𧬠program_name π§¬
- Title:
program_name - Usage:
$factory->program_name() - Function: holds the program name
- Returns:
string - Args:
None
π program_dir π
- Title:
program_dir - Usage:
$factory->program_dir(@params) - Function: returns the program directory, obtained from ENV variable.
- Returns:
string - Args:
π¨ error_string π¨
- 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)
π’ version π’
- Title:
version - Usage:
$prog->version() - Function: Determine the version number of the program
- Example:
- Returns:
string - Args:
none
π run π
- Title:
run - Usage:
my $output = $application->run(-seq => $seq,
-profile => $profile,
-type => 'profile-aln');
- Function: Generic run of an application
- Returns:
Bio::SimpleAlignobject - Args: key-value parameters allowed for TCoffee runs AND
-type=>profile-alnoralignmentfor profile alignments or just multiple sequence alignment-seq=> eitherBio::PrimarySeqIobject OR array ref ofBio::PrimarySeqIobjects OR filename of sequences to run with-profile=> profile to align to, if this is an array ref will specify the first two entries as the two profiles to align to each other
𧬠align π§¬
- Title:
align - Usage:
$inputfilename = 't/data/cysprot.fa';
$aln = $factory->align($inputfilename);
or
$seq_array_ref = \@seq_array;
# @seq_array is array of Seq objs
$aln = $factory->align($seq_array_ref);
- Function: Perform a multiple sequence alignment
- Returns: Reference to a
SimpleAlignobject containing the sequence alignment. - Args: Name of a file containing a set of unaligned fasta sequences or else an array of references to
Bio::Seqobjects.
Throws an exception if argument is not either a string (eg a filename) or a reference to an array of Bio::Seq objects. If argument is string, throws exception if file corresponding to string name can not be found. If argument is Bio::Seq array, throws exception if less than two sequence objects are in array.
𧬠profile_align π§¬
- Title:
profile_align - Usage:
- Function: Perform an alignment of 2 (sub)alignments
- Example:
- Returns: Reference to a
SimpleAlignobject containing the (super)alignment. - Args: Names of 2 files containing the subalignments or references to 2
Bio::SimpleAlignobjects. - Note: Needs to be updated to run with newer TCoffee code, which allows more than two profile alignments.
Throws an exception if arguments are not either strings (eg filenames) or references to SimpleAlign objects.
π¨ aformat π¨
- Title:
aformat - Usage:
my $alignmentformat = $self->aformat(); - Function: Get/Set alignment format
- Returns:
string - Args:
string
π οΈ methods π οΈ
- Title:
methods - Usage:
my @methods = $self->methods() - Function: Get/Set Alignment methods - NOT VALIDATED
- Returns: array of strings
- Args: arrayref of strings
𧬠Bio::Tools::Run::BaseWrapper 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 = $tcoffee->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:
stringwhich is the name of the temporary directory - Args:
none
π§Ή cleanup π§Ή
- Title:
cleanup - Usage:
$tcoffee->cleanup(); - Function: Will cleanup the tempdir directory
- Returns:
none - Args:
none
π io π
- Title:
io - Usage:
$obj->io($newval) - Function: Gets a
L<Bio::Root::IO>object - Returns:
L<Bio::Root::IO> - Args:
none
π 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 the Bioperl mailing list. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/Support.html - 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 of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bio-tools-run-alignment-tcoffee/issues
π AUTHORS π
Jason Stajich <jason@bioperl.org>Peter Schattner <schattner@alum.mit.edu>
π COPYRIGHT π
This software is copyright (c) by Jason Stajich <jason@bioperl.org>, and by Peter Schattner <schattner@alum.mit.edu>.
This software is available under the same terms as the perl 5 programming language system itself.
π okay bestie, that's the whole page, and you ate. source/version: perl v5.34.0, date: 2022-10-14, from Bio::T...TCoffee(3pm) β periodt. πβ¨
π¦ where this page comes from
- debian bookworm: libbio-tools-run-alignment-tcoffee-perl 1.7.4-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-tools-run-alignment-tcoffee-perl 1.7.4-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms