Error in MuscleCommandline (biopython)
Entering edit mode
9 months ago
Plus ▴ 20

I have a question for MuscleCommandline.

When I use a biopython to work multiple sequence alignment using MuslceCommandline, there is an error.

The error is Non-zero return code 1, message 'Invalid command line'.

My code is

from Bio.Align.Applications import MuscleCommandline

muscle_exe = r"C:\Users\user1\Desktop\Bioinformatics_with_biopython\muscle5.1.win64.exe"
in_file = r"C:\Users\user1\Desktop\Bioinformatics_with_biopython\Chapter_7\HBA.all.fasta"
out_file = r"C:\Users\user1\Desktop\Bioinformatics_with_biopython\Chapter_7\HBA.aln"

cmd_line = MuscleCommandline(muscle_exe, input=in_file, out=out_file, clw=" ")
stdout, stderr = cmd_line()

I change the path of muscle5.1.win64.exe and HBA.all.fasta.

And I also changed the letter \ to / or not using r before the path.

But there was same error.

At last, I have searched my error in google and biostar etc, but there were no questions of MuscleCommandline error which is same as mine.

How can I fix it?

Biopython Multiple-Sequence-Alignment Python • 1.4k views
Entering edit mode

what is clw=" " for? I'm looking at some other examples on Biostars and don't see the inclusion of the clw parameter in the command line.

Entering edit mode

If you want clustalw output format, wouldn't you also want to use clwout instead of out?

I've not run muscle via Biopython before, but what happens when you try the following:

cmd_line = MuscleCommandline(muscle_exe, input=in_file, clwout=out_file, clw)
Entering edit mode

I don't believe you're using the clw flag correctly. Why are you passing it an empty space as a variable? Based on a quick look at the documentation, its simply a boolean switch.

Entering edit mode

I'm using the clw flag correctly. The reason why I'm using an empty space as a variable to clw flag is because the text book was using an empty space as a variable.

I already used a boolean switch, for example clw=True or clw=False, but it didn't work too.

But the real problem was the ClustalwCommandline. MuslceComamndline wasn't work well in my compyter, but ClustalwCommandline was work very well.

Someone can say to me that I don't have to use MuscleCommandline when it doesn't work and use other way which is ClustalwCommandline works if it works well.

But i just want to know what kind of problem induce that the MuscleCommandline didn't work well in my computer. If that wasn't occurred in different computer, than i would use it to do MSA.

Entering edit mode
6 weeks ago

Hi Here's the answer:

Last checked against version: 3.7, briefly against 3.8

muscle v5 changed the command-line arguments from -in to -align, but biopython still tries to use the v3 arguments (you can also switch to -super5 for many input sequences).

Biopython is currently dropping support for these tool-wrappers so this won't be fixed:

Consider using Python's subprocess to run muscle instead.


Login before adding your answer.

Traffic: 2801 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6