Hi, I would like to align separately several 1000 pairs of protein sequences using bioperl's clustal.pm - I place each file in a directory and would like to write code to feed each file into clustal.pm and output a separate alignment for each file. The code below works when using Bio::SeqIO but isn't working for alignments - any help greatly appreciated
#!/usr/bin/perl -w
use Bio::Tools::Run::Alignment::Clustalw;
use warnings;
my $dir = './genes';
foreach my $fp (glob("$dir/*.fa")) {
open my $fh, "<", $fp or die;
}
@params = ('ktuple' => 2, 'matrix' => 'BLOSUM', 'outfile' => '$fp.pep');
$factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
$inputfilename = '$fp.fasta.fa';
$aln = $factory->align($inputfilename);