[Bioperl-l] Problems with clustalw

Luba Pardo lubapardo at gmail.com
Mon Mar 5 08:40:51 EST 2007

I am learning how to use the module of Bio::Tools::Run::Alignment::Clustalw.
I started to run the example provided at the module documentation, but it
does not work with my input file. the script is

use warnings;
BEGIN { $ENV{CLUSTALDIR} = '/home/luba/bin/clustalx1.82.linux/';}

use Bio::Tools::Run::Alignment::Clustalw;
#use Bio::Root::Root::Run::WrapperBase;

 #  Build a clustalw alignment factory
  my @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
 my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);

  #  Pass the factory a list of sequences to be aligned.
  my $inputfilename = 'cysprot.fa';
  my $aln = $factory->align($inputfilename); # $aln is a SimpleAlign object.
  # or
  my $seq_array_ref = \@seq_array;
  # where @seq_array is an array of Bio::Seq objects
  my $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.:
  my $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:
 my  $aln = $factory->profile_align($aln1,$seq); # $seq is a Bio::Seq

  # Get a tree of the sequences
  my $tree = $factory->tree(\@seq_array);

  # Get both an alignment and a tree
  my ($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";

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Bad input data (sequences need an id ) or less than 2 sequences in
ARRAY(0x8861280) !
STACK: Error::throw
STACK: Bio::Root::Root::throw
STACK: Bio::Tools::Run::Alignment::Clustalw::align
STACK: clustal1.pl:17
The input file is OK as I run the program clustalw with my input file of
fasta sequences and it worked. Also if I leave the sentence # $aln =
$factory->align($seq_array_ref); as a comment I get another error:

EXCEPTION: Bio::Root::NotImplemented -------------
MSG: Abstract method "Bio::Tools::Run::WrapperBase::run" is not implemented
by package Bio::Tools::Run::Alignment::Clustalw.
This is not your fault - author of Bio::Tools::Run::Alignment::Clustalw
should be blamed!

STACK: Error::throw
STACK: Bio::Root::Root::throw
STACK: Bio::Root::RootI::throw_not_implemented
STACK: Bio::Tools::Run::WrapperBase::run
STACK: clustal1.pl:32
I know I must ber doing a very simple erro, but I can not run the example.
Can anybody give an advice/

Thanks in advance,

L. Pardo

More information about the Bioperl-l mailing list