2.8 years ago by
What is the error you're getting? There's a good chance that you don't have MUSCLE or Clustal installed on your computer, or Biopython cannot find the executables.
You can tell Biopython where to find these executables, from the help:
>>> from Bio.Align.Applications import MuscleCommandline
>>> muscle_exe = r"C:\Program Files\Aligments\muscle3.8.31_i86win32.exe"
>>> in_file = r"C:\My Documents\unaligned.fasta"
>>> out_file = r"C:\My Documents\aligned.fasta"
>>> muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
"C:\Program Files\Aligments\muscle3.8.31_i86win32.exe" -in "C:\My Documents\unaligned.fasta" -out "C:\My Documents\aligned.fasta"
It works the same for clustalw:
>>> clustalw_cline = ClustalwCommandline(r"C:\Program Files\Aligments\clustalw2", infile=in_file)
Of course you'd have to adjust the path.