Question: Cant find Clustalw.exe through Bioperl
0
gravatar for Andrea
3.2 years ago by
Andrea40
Sweden
Andrea40 wrote:

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

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!!!!

    #!/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);

Just a simple fasta file :

>seq0
FQTWEEFSRAAEKLYLADPMKVRVVLKYRHVDGNLCIKVTDDLVCLVYRTDQAQDVKKIEKF
>seq1
KYRTWEEFTRAAEKLYQADPMKVRVVLKYRHCDGNLCIKVTDDVVCLLYRTDQAQDVKKIEKFHSQLMRLME 
>seq2
EEYQTWEEFARAAEKLYLTDPMKVRVVLKYRHCDGNLCMKVTDDAVCLQYKTDQAQDVKKVEKLHGK
>seq3
MYQVWEEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVCLQYKTDQAQDVK
>seq4
EEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVVSYEMRLFGVQKDNFALEHSLL
>seq5
SWEEFAKAAEVLYLEDPMKCRMCTKYRHVDHKLVVKLTDNHTVLKYVTDMAQDVKKIEKLTTLLMR
>seq6
FTNWEEFAKAAERLHSANPEKCRFVTKYNHTKGELVLKLTDDVVCLQYSTNQLQDVKKLEKLSSTLLRSI
>seq7
SWEEFVERSVQLFRGDPNATRYVMKYRHCEGKLVLKVTDDRECLKFKTDQAQDAKKMEKLNNIFF
>seq8
SWDEFVDRSVQLFRADPESTRYVMKYRHCDGKLVLKVTDNKECLKFKTDQAQEAKKMEKLNNIFFTLM
>seq9
KNWEDFEIAAENMYMANPQNCRYTMKYVHSKGHILLKMSDNVKCVQYRAENMPDLKK
>seq10
FDSWDEFVSKSVELFRNHPDTTRYVVKYRHCEGKLVLKVTDNHECLKFKTDQAQDAKKMEK
bioperl clustalw perl • 1.2k views
ADD COMMENTlink modified 3.2 years ago by biocyberman770 • written 3.2 years ago by Andrea40
0
gravatar for biocyberman
3.2 years ago by
biocyberman770
Denmark
biocyberman770 wrote:

How about adding 'C:\Program Files (x86)\ClustalW2' to Windows Path variable. Log out and login again. You know the Path works if you can call clustalw.exe from anywhere without the full path.

Check out the last answer in here to see how you can change Path reliably.

ADD COMMENTlink written 3.2 years ago by biocyberman770

That was one of the first things I did but didn't changed anything. I Just made it work!

Steps to make it work:

1)copy the clustalw2.exe

2)paste it on your e.g. Desktop

3)Rename it to clustalw.exe

4)Give the $ENV{CLUSTALDIR} the new path to clustalw.exe

and it works!

(at first tried to rename the basic clustalw2.exe of 'C:\Program Files (x86)\ClustalW2' but didn't work)

ADD REPLYlink modified 3.2 years ago • written 3.2 years ago by Andrea40

I haven't used Bioperl for several years now so i am not familiar with it. However, from your solution it seems that the clustalw module was looking for a different binary name. Maybe you should check if there is clustalw2 module and use that instead of fitting an unexpected binary to the outdated module. Again, it's just general consideration.

ADD REPLYlink written 3.2 years ago by biocyberman770
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1622 users visited in the last hour