Reputation: 11
In the biopython cookbook I couldn't find how to actually run clustalw
. I have done what is on the cookbook but it is not running clustalw
just printing
clustalw2 -infile=opuntia.fasta
Can anyone help me how to actually run clustalw
?
Upvotes: 1
Views: 264
Reputation: 31679
The section is copied from the BioPython documentation.
>>> from Bio.Align.Applications import ClustalwCommandline
>>> cline = ClustalwCommandline("clustalw2", infile="opuntia.fasta")
>>> print(cline)clustalw2 -infile=opuntia.fasta
If you run
from Bio.Align.Applications import ClustalwCommandline
cline = ClustalwCommandline("clustalw2", infile="opuntia.fasta")
print(cline)
it will do 3 things
ClustalwCommandline
module from BioPythonClustalwCommandline
objectIf you want to execute the program, you would need to call the created object
stdout, stderr = cline()
which will then run the whole program with your provided parameters. The "normal" output will be found in stdout
and all errors in stderr
.
If get an error that the executable cannot be found, you either need to add the directory of clustalw2
to your path or specify the full path (e.g. cline = ClustalwCommandline("c:/users/gufran/programs/clustalw.exe", infile="opuntia.fasta"
).
Upvotes: 1