【发布时间】:2016-09-21 08:44:10
【问题描述】:
我是 python 领域的新手,但我想使用 biopython 来对齐一些 DNA 序列。我从互联网上得到了一个脚本,并按如下方式运行它(~ 是我的主路径的缩写):
~$ 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"
但是在启动应用程序时我得到了:
>>> 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'
>>>
会有什么问题?我在网上看到这可能是由于内存问题;在那种情况下,代码可以吗?以及如何运行大型对齐?
还有:我为什么要使用 = r"path" 而不是简单的 "path"?
非常感谢,
路易吉
【问题讨论】:
-
r'path'的问题是stackoverflow.com/questions/19065115/python-windows-path-slash -- 你在问之前谷歌了吗? -
错误信息明确指出
/usr/bin/muscle失败。这不是您的 Python 代码的问题,因此(尽管它可能包含无效的假设)。请参阅muscle文档以找出失败的原因——无论如何,如果无法访问失败的代码,我们就无法判断它的对错。
标签: biopython