[Bioperl-l] Help for using Clustalw.pm

James Wasmuth james.wasmuth at ed.ac.uk
Tue Jul 27 12:41:58 EDT 2004


 I'm not sure whether $ENV{CLUSTALDIR} does not work because you're 
working in Windows.  Anyone have an idea?

As for keeping the output, there's two ways:

1. in the params use the 'outfile' => something.aln

I think its 'outfile'. You'll need to check with the clustalw 
documentaion as to the commandline option to specify the name of the 
outfile. Sorry I can't remember.

or

2.

$factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
$aln = $factory->align($inputfilename);

#$aln is a SimpleAlign object which you can write to file.

$out = Bio::AlignIO->new(-file => ">outputfilename",
                           -format => 'msf');

while ( my $single = $aln->next_aln() ) { $out->write_aln($single); }

I think this should work. Let me know if it doesn't. It's been a while 
since I've used these.

-james


>
>
>
> Sun, Jian wrote:
>
>>Hi, James;
>>  Thanks a lot. It seems that the below command line didn't modifed the CLUSTALDIR variable.
>>$ENV{CLUSTALDIR} = 'C:/Program Files/Apache Group/Apache2/bin/';
>>
>>So I copied to Clustalw.exe to current file directory then the program works. And I get another question:
>>How can I setup the directory to keep the result file? Where to set this?
>> 
>>Thanks again and very appreciated
>>Jane
>>
>>________________________________
>>
>>From: James Wasmuth [mailto:james.wasmuth at ed.ac.uk]
>>Sent: Tue 7/27/2004 7:42 AM
>>To: James Wasmuth
>>Cc: Sun, Jian; bioperl-l at bioperl.org
>>Subject: Re: [Bioperl-l] Help for using Clustalw.pm
>>
>>
>>
>>Ooops,
>>
>>I seem to have errant asterisks
>>
>>$clustalfound = Bio::Tools::Run::Alignment::Clustalw->exists_clustal()
>>
>>
>>James Wasmuth wrote:
>>
>>  
>>
>>>Jane,
>>>
>>>Try:
>>>
>>>$clustalfound = *Bio::Tools::Run::Alignment::Clustalw*->exists_clustal()
>>>
>>>print "$clustalfound";
>>>
>>>if '0' then it can't find an executable of clustalw. Does it work from
>>>the commandline ?
>>>
>>>-james
>>>
>>>
>>>Sun, Jian wrote:
>>>
>>>    
>>>
>>>>Dear all:
>>>>    I tried to align multiple sequence through Clustalw.pm, and I
>>>>used the source code attached below:
>>>>*****************************************************************************************************
>>>>
>>>>#!C:\Perl\bin\perl.exe
>>>>use lib "C:\Perl\lib";
>>>>
>>>>use Bio::Perl;
>>>>use Bio::Tools::Run::Alignment::Clustalw;
>>>>use strict;
>>>>use warnings;
>>>>
>>>>$ENV{CLUSTALDIR} = 'C:/Program Files/Apache Group/Apache2/bin/';
>>>>my @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
>>>> my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
>>>> my $ktuple = 3;
>>>> $factory->ktuple($ktuple);  # change the parameter before executing
>>>> my $str = Bio::SeqIO->new(-file=> 'Clustseq.fa', '-format' => 'Fasta');
>>>>my @seq_array =();
>>>>while ( my $seq = $str->next_seq() ) {push (@seq_array, $seq) ;}
>>>> my $seq_array_ref = \@seq_array;
>>>>     # where @seq_array is an array of Bio::Seq objects
>>>> my $aln = $factory->align($seq_array_ref);
>>>>**************************************************************************
>>>>
>>>>
>>>>and when I run the pl file, I get this error message:
>>>>
>>>>///////////////////////////////////////////////////////////////////////////////////////////
>>>>
>>>>Clustalw program not found as clustalw or not executable.
>>>>......  'clustalw' is not recognized as an internal or external
>>>>command, operable program or batch file.
>>>>---------------------EXCEPTION-----------------------------------------
>>>>MSG: Clustalw call <clustal align -infile=C:\...\> crashed:256
>>>>
>>>>STACK Bio::Tools::Run::Alignment::Clustalw::_run
>>>>c:/Perl/Site/Lib/Bio/Toold/Run/Alignment/Clustalw.pm:581
>>>>STACK Bio::Tools::Run::Alignment::Clustalw::_run
>>>>c:/Perl/Site/Lib/Bio/Toold/Run/Alignment/Clustalw.pm:507
>>>>STACK toplevel test726pl.pl:33
>>>>-----------------------------------------------------------------------------------------
>>>>
>>>>///////////////////////////////////////////////////////////////////////////////////////
>>>>
>>>>
>>>>Since I already set the CLUSTALDIR variable, I don't know why the
>>>>Clustalw is still not execuatable. Did I did the right setting?  Does
>>>>anyone have this kind of experience?
>>>>Thanks in advance.
>>>>Jane
>>>>
>>>>
>>>>_______________________________________________
>>>>Bioperl-l mailing list
>>>>Bioperl-l at portal.open-bio.org
>>>>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>>>>
>>>>
>>>>      
>>>>
>>
>>--
>>I like nonsense, it wakes up the brain cells.
>>                -- Dr. Seuss
>>
>>Blaxter Nematode Genomics Group  |
>>School of Biological Sciences    |
>>Ashworth Laboratories            | tel: +44 131 650 7403
>>University of Edinburgh          | web: www.nematodes.org
>>Edinburgh                        |
>>EH9 3JT                          |
>>UK                               |     
>>
>>
>>
>>
>>
>>  
>>
>
>-- 
>I like nonsense, it wakes up the brain cells.
>		-- Dr. Seuss
>
>Blaxter Nematode Genomics Group  |
>School of Biological Sciences    |
>Ashworth Laboratories            | tel: +44 131 650 7403
>University of Edinburgh          | web: www.nematodes.org
>Edinburgh                        |
>EH9 3JT                          |
>UK                               |	
>
>  
>

-- 
I like nonsense, it wakes up the brain cells.
		-- Dr. Seuss

Blaxter Nematode Genomics Group  |
School of Biological Sciences    |
Ashworth Laboratories            | tel: +44 131 650 7403
University of Edinburgh          | web: www.nematodes.org
Edinburgh                        |
EH9 3JT                          |
UK                               |	




More information about the Bioperl-l mailing list