Error in MuscleCommandline (biopython)
1
0
Entering edit mode
2.3 years 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=" ")
print(cmd_line)
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 • 3.0k views
ADD COMMENT
0
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.

ADD REPLY
0
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)
ADD REPLY
0
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.

ADD REPLY
0
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.

ADD REPLY
1
Entering edit mode
19 months ago

Hi Here's the answer: https://biopython.org/docs/1.81/api/Bio.Align.Applications.html

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: https://github.com/biopython/biopython/issues/3902

Consider using Python's subprocess to run muscle instead.

ADD COMMENT

Login before adding your answer.

Traffic: 1953 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6