This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Connect To Stand-Alone Clustalw Using Php Commands

I have a text file on my local computer which contains all the sequences i wish to align. However i want to know how do i give this file to the stand-alone clustalw using script (I'm, mainly working with php scripts) and generate results in another text file. Any help will be appreciated!

clustalw multiple

3 answers

If you run ClustalW with the '-help' option it will provide details of the command-line options which can be used. The complete help text, which includes details of all the command-line options, can be found on the Clustal web site: http://www.clustal.org/

A convenient way of seeing how to construct the command-line is to run a sample job on the EMBL-EBI's ClustalW2 service, and look at the "Submission Details" tab of the result. This details the parameters and the command-line used to run the job.

As for calling ClustalW, or any other program, from a PHP script... see the PHP: system documentation.

Use the exec() function to call clustalw:

 $command = "clustalw2 -INFILE=".$input_filename." -OUTFILE=".$output_filename;

 exec($command);

@pasta : I tried this command in commandline but it gives me a error saying "paramter required for /infile". Also my php script returns no value.. Please help!

Just use php to call cmd commands. php may have commands like exec and system.[?] However I do not know php very well, I am using python and clustalw2, to call clustalw2 using python script like this (a example of DNA alignment):[?][?] import os[?] os.popen('clustalw2 -INFILE=input_filename -PWDNAMATRIX=IUB -TYPE=DNA -OUTPUT=FASTA -OUTFILE=output_filename')

[?] note: input_filename and output_filename stand for input and output file.

Log in to answer this question.