Bio-Tools-Run-Alignment-Clustalw
view release on metacpan or search on metacpan
lib/Bio/Tools/Run/Alignment/Clustalw.pm view on Meta::CPAN
# or
$seq_array_ref = \@seq_array;
# where @seq_array is an array of Bio::Seq objects
$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.:
$aln = $factory->profile_align($aln1,$aln2);
# where $aln1 and $aln2 are Bio::SimpleAlign objects.
# Or one can pass the factory an alignment and one or more unaligned
# sequences to be added to the alignment. For example:
$aln = $factory->profile_align($aln1,$seq); # $seq is a Bio::Seq object.
# Get a tree of the sequences
$tree = $factory->tree(\@seq_array);
# Get both an alignment and a tree
($aln, $tree) = $factory->run(\@seq_array);
# Do a footprinting analysis on the supplied sequences, getting back the
# most conserved sub-alignments
my @results = $factory->footprint(\@seq_array);
foreach my $result (@results) {
print $result->consensus_string, "\n";
}
# There are various additional options and input formats available.
# See the DESCRIPTION section that follows for additional details.
=head1 DESCRIPTION
Note: this DESCRIPTION only documents the Bioperl interface to
Clustalw. Clustalw, itself, is a large & complex program - for more
information regarding clustalw, please see the clustalw documentation
which accompanies the clustalw distribution. Clustalw is available
from (among others) ftp://ftp.ebi.ac.uk/pub/software/. Clustalw.pm has
only been tested using version 1.8 of clustalw. Compatibility with
earlier versions of the clustalw program is currently unknown. Before
running Clustalw successfully it will be necessary: to install clustalw
on your system, and to ensure that users have execute privileges for
the clustalw program.
=head2 Helping the module find your executable
You will need to enable Clustalw to find the clustalw program. This
can be done in (at least) three ways:
1. Make sure the clustalw executable is in your path so that
which clustalw
returns a clustalw executable on your system.
2. Define an environmental variable CLUSTALDIR which is a
directory which contains the 'clustalw' application:
In bash:
export CLUSTALDIR=/home/username/clustalw1.8
In csh/tcsh:
setenv CLUSTALDIR /home/username/clustalw1.8
3. Include a definition of an environmental variable CLUSTALDIR in
every script that will use this Clustalw wrapper module, e.g.:
BEGIN { $ENV{CLUSTALDIR} = '/home/username/clustalw1.8/' }
use Bio::Tools::Run::Alignment::Clustalw;
If you are running an application on a webserver make sure the
webserver environment has the proper PATH set or use the options 2 or
3 to set the variables.
=head2 How it works
Bio::Tools::Run::Alignment::Clustalw is an object for performing a
multiple sequence alignment from a set of unaligned sequences and/or
sub-alignments by means of the clustalw program.
Initially, a clustalw "factory object" is created. Optionally, the
factory may be passed most of the parameters or switches of the
clustalw program, e.g.:
@params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
$factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
Any parameters not explicitly set will remain as the defaults of the
clustalw program. Additional parameters and switches (not available
in clustalw) may also be set. Currently, the only such parameter is
"quiet", which when set to a non-zero value, suppresses clustalw
terminal output. Not all clustalw parameters are supported at this
stage.
By default, Clustalw output is returned solely in a the form of a
Bio::SimpleAlign object which can then be printed and/or saved
in multiple formats using the AlignIO.pm module. Optionally the raw
clustalw output file can be saved if the calling script specifies an
output file (with the clustalw parameter OUTFILE). Currently only the
GCG-MSF output file formats is supported.
Not all parameters and features have been implemented yet in Perl format.
Alignment parameters can be changed and/or examined at any time after
the factory has been created. The program checks that any
parameter/switch being set/read is valid. However, currently no
additional checks are included to check that parameters are of the
proper type (eg string or numeric) or that their values are within the
proper range. As an example, to change the value of the clustalw
parameter ktuple to 3 and subsequently to check its value one would
write:
$ktuple = 3;
$factory->ktuple($ktuple);
$get_ktuple = $factory->ktuple();
Once the factory has been created and the appropriate parameters set,
one can call the method align() to align a set of unaligned sequences,
or call profile_align() to add one or more sequences or a second
alignment to an initial alignment.
Input to align() may consist of a set of unaligned sequences in the
form of the name of file containing the sequences. For example,
( run in 2.151 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )