Using Biopython to access MUSCLE
Entering edit mode
4.8 years ago
jtbioinfo ▴ 10

Hello! I am very new to computing and have run into an issue I cannot seem to find a solution for online. I am trying to use the Biopython wrapper to access MUSCLE in order to align ~100 sequences of 5-10kb. I believe I have successfully installed MUSCLE - when I type muscle into my command line, I get the following:

MUSCLE v3.8.31 by Robert C. Edgar
This software is donated to the public domain.
Please cite: Edgar, R.C. Nucleic Acids Res 32(5), 1792-97.

Basic usage

    muscle -in <inputfile> -out <outputfile>

Common options (for a complete list please see the User Guide):

    -in <inputfile>    Input file in FASTA format (default stdin)
    -out <outputfile>  Output alignment in FASTA format (default stdout)
    -diags             Find diagonals (faster for similar sequences)
    -maxiters <n>      Maximum number of iterations (integer, default 16)
    -maxhours <h>      Maximum time to iterate in hours (default no limit)
    -html              Write output in HTML format (default FASTA)
    -msf               Write output in GCG MSF format (default FASTA)
    -clw               Write output in CLUSTALW format (default FASTA)
    -clwstrict         As -clw, with 'CLUSTAL W (1.81)' header
    -log[a] <logfile>  Log to file (append if -loga, overwrite if -log)
    -quiet             Do not write progress messages to stderr
    -version           Display version information and exit

Without refinement (very fast, avg accuracy similar to T-Coffee): -maxiters 2
Fastest possible (amino acids): -maxiters 1 -diags -sv -distance1 kbit20_3
Fastest possible (nucleotides): -maxiters 1 -diags

However, when I attempt to use the Biopython wrapper in my IDE just as in the example from the Biopython tutorial:

from Bio.Align.Applications import MuscleCommandline

cline = MuscleCommandline(input='opuntia.fasta')

, I get the following error:

Bio.Application.ApplicationError: Non-zero return code 2 from '<file_name>' message 'MUSCLE v3.8.31 by Robert C. Edgar'

Does anybody have any idea as to what could be causing the error?

Thanks in advance!

biopython alignment • 2.8k views
Entering edit mode

It might be better to ask in the biopython mailing list. But it seems like the interface of muscle has changed

Entering edit mode

Thank you - I'll try that.

Entering edit mode
5 months ago
tzwang ▴ 10

Although this question was asked 4 years before, I ran into this error today and solved it, so I'll leave my solution here in case anybody searching for the answer find it.

You can try to add muscle_exe path in your command, like shown in biopython examples:

muscle_exe = r"C:\Program Files\Alignments\muscle3.8.31_i86win32.exe"
muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)

If in Linux, just use which muscle and copy the path here to solve it.


Login before adding your answer.

Traffic: 2477 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