1

I am trying to align 4 difference sequences using MuscleCommandLine. This code works perfectly on Anaconda and Mac but I am trying to make it work on Windows and I am having several issues.

muscle_exe = r'../muscle3.8.31_i86darwin64.exe'
in_file = r'../infile.fasta'
out_file = r'../aln_out.fasta'
    
muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
muscle_cline()

When I try this using Anaconda on Mac, I get the result. However, when running the same code on Window, I get the following error:

---------------------------------------------------------------------------
ApplicationError                          Traceback (most recent call last)
<ipython-input-3-70ad09443dc6> in <module>
      3 genome = genome_location(before, after, alignment)
      4 
----> 5 filename = custom_fasta(genome, alignment)
      6 
      7 info = AlignIO.read(r'../aln_out.fasta','fasta')

<ipython-input-1-655071c8d454> in custom_fasta(locations_dict, names)
    185 
    186     muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
--> 187     muscle_cline()
    188 
    189     return(filename)

~\Anaconda3\lib\site-packages\Bio\Application\__init__.py in __call__(self, stdin, stdout, stderr, cwd, env)
    567 
    568         if return_code:
--> 569             raise ApplicationError(return_code, str(self), stdout_str, stderr_str)
    570         return stdout_str, stderr_str
    571 

ApplicationError: Non-zero return code 1 from '../muscle3.8.31_i86darwin64.exe -in ../infile.fasta -out ../aln_out.fasta', message "'..' is not recognized as an internal or external command,"

I have read the documentation but this is not listed as an issue. This same question has been asked before but no solution has been offered. People keep asking to install muscle, but the way it works with Biopython and Anaconda is that you do not need to install it.

So why does this keep happening?

Harr1ls
  • 71
  • 5
  • Are you sure you want to be using an executable ending in `i86darwin64.exe` on a Windows machine? Darwin is the code name for macOS. – MattDMo Aug 21 '22 at 15:08
  • I have tried this one and `muscle5.1.win64.exe` which is the version for windows. But both of them give the same error, @MattDMo. I think I copied the code for when I used the macOS version, just changed it and the error is the same: `ApplicationError: Non-zero return code 1 from '../genomes/muscle5.1.win64.exe -in ../genomes/infile.fasta -out ../genomes/aln_out.fasta', message "'..' is not recognized as an internal or external command,"` – Harr1ls Aug 21 '22 at 15:14
  • Try changing your forward slashes `/` to backslashes ``\``. Sometimes that makes a difference. – MattDMo Aug 21 '22 at 15:16
  • It gives an syntax error... so it must be something else @MattDMo – Harr1ls Aug 21 '22 at 15:31
  • Can you post the syntax error as well? I would suggest to use `muscle_exe = os.path.join('..', 'muscle3.8.31_i86darwin64.exe')` also for the other files – FlyingTeller Aug 22 '22 at 11:26
  • Just try to use `Path` from `pathlib` for all your paths. As it was aforementioned, the problem in a slash symbol. – Vovin Aug 31 '22 at 12:25

0 Answers0