0

I am new in the python area but I would like to use biopython to align some DNA sequences. I got a script from internet and I ran it as follows (~ is the short for my home path):

~$ python
Python 3.5.1 (default, Jul  3 2016, 12:57:35)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio.Align.Applications import MuscleCommandline
>>> muscle_exe = r"/usr/bin/muscle"
>>> in_file = r"~/SpiderOak Hive/LAB/Lab book/Ery/Seqs/tester.fasta"
>>> out_file = "~/SpiderOak Hive/LAB/Lab book/Ery/Seqs/tester_aligned.fasta"
>>> muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
>>> print(muscle_cline)
/usr/bin/muscle -in "~/SpiderOak Hive/LAB/Lab
book/Ery/Seqs/tester.fasta" -out "~/SpiderOak Hive/LAB/Lab
book/Ery/Seqs/tester_aligned.fasta"

but when lauching the application I got:

>>> muscle_cline()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python3.5/lib/python3.5/site-packages/Bio/Application/__init__.py",
line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 137 from
'/usr/bin/muscle -in "/home/gigiux/SpiderOak Hive/LAB/Lab
book/Ery/Seqs/tester.fasta" -out "/home/gigiux/SpiderOak Hive/LAB/Lab
book/Ery/Seqs/tester_aligned.fasta"', message 'MUSCLE v3.8.31 by
Robert C. Edgar'
>>>

What would be the issue? I have seen on internet that it might be due to memory problems; in that case is the code OK? and how could I run large alignments?

And also: why should I use = r"path" rather than simply "path"?

Many thanks,

Luigi

Gigiux
  • 144
  • 1
  • 7
  • The `r'path'` question is http://stackoverflow.com/questions/19065115/python-windows-path-slash -- did you google before asking? – tripleee Sep 21 '16 at 08:45
  • The error message clearly states that `/usr/bin/muscle` failed. This is not a problem with your Python code, as such (though it may contain invalid assumptions). See the `muscle` documentation to figure out why it's failing -- anyway, without access to the failing code, we have no way to tell what's right or wrong with it. – tripleee Sep 21 '16 at 08:50
  • Possible duplicate of [Why does my Perl script exit with 137?](https://stackoverflow.com/questions/1041182/why-does-my-perl-script-exit-with-137) – kenorb Apr 03 '19 at 16:48

1 Answers1

1

Your code seems to be correct, and it works with small alignments. The 137 status code might be related to an "Out Of Memory" kill like in this question. Check the last kernel messages with the command dmesg looking for lines like:

kernel: Out of memory: Kill process 52959 (java) score 164 or sacrifice child
Community
  • 1
  • 1
xbello
  • 7,223
  • 3
  • 28
  • 41