gpt4 book ai didi

python - Biopython 中的 clustalw 和muscle

转载 作者:行者123 更新时间:2023-12-01 05:26:26 33 4
gpt4 key购买 nike

我在使用biopython时遇到问题,我有Python版本 v3.3,我安装了biopython-1.61.win-amd64-py3.3我想将 DNA 序列与 ClustalwMuscle

进行比对

对于Clustalw:

from Bio.Clustalw import MultipleAlignCL

我收到以下错误:

No module named 'Bio.Clustalw'

对于肌肉:

>>> from Bio.Align.Applications import MuscleCommandline
>>> muscle_cline = MuscleCommandline(input="input.fasta")
>>> stdout, stderr = muscle_cline()

我收到以下错误:

stdout, stderr = muscle_cline()
File "..\..\lib\site-packages\Bio\Application\__init__.py", line 434, in __call__
shell=(sys.platform!="win32"))
File "..:\..\lib\subprocess.py", line 818, in __init__
restore_signals, start_new_session)
File "..:\..\lib\subprocess.py", line 1096, in _execute_child
raise WindowsError(*e.args)
FileNotFoundError: [WinError 2] The specified file is not found

最佳答案

首先,尝试从 here 安装 Biopython 1.63 ,它可能会解决您的一些问题。

其次,确保您使用的是 the latest Python来自 python.org - 如果更新 Biopython 后仍然遇到相同的错误,您可能需要再次运行安装程序以确保您的文件没有损坏。

<小时/>

我找到了this这表明 Bio.Clustalw 已被弃用。

This module has been superseded by the Bio.AlignIO framework for alignment parsing, and the ClustalW command line wrapper in Bio.Align.Applications for calling the tool. These are both described in the current version of the Biopython Tutorial and Cookbook.

这就解释了这一点。至于 Bio.Align.Applications.MuscleCommandLine,在其上运行 help() 给出以下代码示例:

>>> from Bio.Align.Applications import MuscleCommandline
>>> muscle_exe = r"C:\Program Files\Aligments\muscle3.8.31_i86win32.exe"
>>> in_file = r"C:\My Documents\unaligned.fasta"
>>> out_file = r"C:\My Documents\aligned.fasta"
>>> muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
>>> print(muscle_cline)
"C:\Program Files\Aligments\muscle3.8.31_i86win32.exe" -in "C:\My Documents\unaligned.fasta" -out "C:\My Documents\aligned.fasta"

因此,您的错误表明未找到正确的 muscle.exe,因此您需要将其位置作为参数传递。

关于python - Biopython 中的 clustalw 和muscle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21245544/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com