dimitris852 has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone.I m trying to run the script below. but I get the error:

------------- EXCEPTION ------------- MSG: Cannot find executable for clustalw. path="clustalw.exe" STACK Bio::Tools::Run::WrapperBase::executable C:/Perl64/site/lib/Bio/Tools/Run/ WrapperBase.pm:340 STACK Bio::Tools::Run::Alignment::Clustalw::_run C:/Perl64/site/lib/Bio/Tools/Ru n/Alignment/Clustalw.pm:752 STACK Bio::Tools::Run::Alignment::Clustalw::align C:/Perl64/site/lib/Bio/Tools/R un/Alignment/Clustalw.pm:515 STACK toplevel a.pl:29

#!/usr/bin/perl $ENV{CLUSTALDIR} = 'C:\Program Files (x86)\ClustalW2'; use warnings; use strict; use Bio::AlignIO; use Bio::SeqIO; use Bio::Tools::Run::Alignment::Clustalw; my $file = <>; # Get file name from command prompt. my $factory = Bio::Tools::Run::Alignment::Clustalw->new(-matrix => + 'BLOSUM'); my $ktuple = 3; $factory->ktuple($ktuple); my $inseq = Bio::SeqIO->new( -file => "<$file", -format => "fasta" ); my $seq; my @seq_array; while ($seq = $inseq->next_seq) { push(@seq_array, $seq); } # Now we do the actual alignment. my $seq_array_ref = \@seq_array; my $aln = $factory->align($seq_array_ref);

How to make perl find my clustalw.exe???? I think that already did that by setting at the beginning the environmental variable $ENV{CLUSTALDIR}. Any help will be much appreciated!!!!

Replies are listed 'Best First'.
Re: Can't run Clustalw through Bioperl
by 1nickt (Canon) on Mar 14, 2016 at 01:58 UTC

    The documentation for Bio::Tools::Run::Alignment::Clustalw says that the environment variable needs to be set in a BEGIN block, so that the module can find the executable. Did you try that?

    BEGIN { $ENV{CLUSTALDIR} = 'C:\Program Files (x86)\ClustalW2'; } use warnings; use strict; use Bio::AlignIO; use Bio::SeqIO; use Bio::Tools::Run::Alignment::Clustalw; ...

    Hope this helps!


    The way forward always starts with a minimal test.
      I ve tried it so far. Same error again!

        Are you sure the program is installed in the path you are specifying, and it's executable? What is the output of:

        C:\> where clustalw.exe
        ? What happens if you try to run it by hand in its folder?

        ( Disclaimer: I don't use MS Windows, but I believe that's the command... )


        The way forward always starts with a minimal test.