【问题标题】:Using PhyML within BioPython Phylo在 BioPython Phylo 中使用 PhyML
【发布时间】:2018-09-08 14:31:30
【问题描述】:

我最近尝试使用最大似然法从对齐文件创建树,但在遵循 BioPython 官方文档时遇到了问题:

cmd = PhymlCommandline(input='data/random.phy')
out_log, err_log = cmd()

我用宽松的 phylip 格式将路径替换为我自己的文件的路径。 使用 AlignIO 读取我的文件有效,因此路径应该不是问题。

是否需要安装 PhyML 并以某种方式将其链接到 BioPython 安装?

不幸的是,文档对此非常简短。

我在 Windows 上通过 Anaconda 使用 Juypter Notebook。

错误是:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-4-437a0bc7f21e> in <module>()
  4 cmd = PhymlCommandline(input='C/Users/Nicolas/Documents/Uni/ProjektHerlyn/random.phy', cmd='phyml')
  5 #out_log, err_log = cmd()
----> 6 cmd()

~\Anaconda3\lib\site-packages\Bio\Application\__init__.py in __call__(self, stdin, stdout, stderr, cwd, env)
505                                          universal_newlines=True,
506                                          cwd=cwd, env=env,
--> 507                                          shell=use_shell)
508         # Use .communicate as can get deadlocks with .wait(), see Bug 2804
509         stdout_str, stderr_str = child_process.communicate(stdin)

~\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
707                                 c2pread, c2pwrite,
708                                 errread, errwrite,
--> 709                                 restore_signals, start_new_session)
710         except:
711             # Cleanup if the child failed starting.

~\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
995                                          env,
996                                          os.fspath(cwd) if cwd is not None else None,
--> 997                                          startupinfo)
998             finally:
999                 # Child is launched. Close the parent's copy of those pipe

FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

--> 英文: [WinError 2] System can't find the given file

【问题讨论】:

    标签: python wrapper biopython phylogeny


    【解决方案1】:

    简答

    • 从这里下载 PhyML:http://www.atgc-montpellier.fr/phyml/download.php
    • 为您的操作系统提取适当的可执行文件到您的计算机
    • 将cmd=/your/path/PhyML-3.1_win32.exe' 添加到您的PhymlCommandline 通话中,例如

      cmd = PhymlCommandline(cmd='c:/home/users/nicolas/PhyML-3.1_win32.exe', input='data/random.phy')
      
    • 或者,您可以将可执行文件的路径添加到您的PATH(见下文)

    更长的答案

    • PhymlCommandline 继承了 AbstractCommandline 类,它只是可执行文件的包装器
    • 来自文档

    请注意,默认情况下,我们假设底层工具安装在 系统 $PATH 环境变量。这在 Linux/Unix 下是正常的, 但可能需要在 Windows 下手动完成。或者,您可以 将二进制文件的完整路径指定为第一个参数 (cmd):

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-27
      • 1970-01-01
      • 2015-11-05
      • 1970-01-01
      相关资源
      最近更新 更多