Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在BioPython Phylo中使用PhyML_Python_Wrapper_Biopython_Phylogeny - Fatal编程技术网

在BioPython Phylo中使用PhyML

在BioPython Phylo中使用PhyML,python,wrapper,biopython,phylogeny,Python,Wrapper,Biopython,Phylogeny,我最近尝试使用最大可能性从对齐文件创建树,但在遵循BioPython的官方文档时遇到了问题: cmd = PhymlCommandline(input='data/random.phy') out_log, err_log = cmd() 我将路径替换为我自己文件的松弛phylip格式的路径。 使用AlignIO读取我的文件是有效的,因此路径应该不是问题 是否需要安装PhyML并以某种方式将其链接到BioPython安装 不幸的是,文档对此非常简短 我在Windows上通过Anaconda使用

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

cmd = PhymlCommandline(input='data/random.phy')
out_log, err_log = cmd()
我将路径替换为我自己文件的松弛phylip格式的路径。 使用AlignIO读取我的文件是有效的,因此路径应该不是问题

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

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

我在Windows上通过Anaconda使用Juypter笔记本电脑

错误是:

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
FileNotFoundError回溯(最近一次调用)
在()
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\\uuuuuuuu init\uuuuuuuuuuu.py in\uuuuuuu调用(self、stdin、stdout、stderr、cwd、env)
505环球新线=真,
506 cwd=cwd,env=env,
-->507外壳=使用(外壳)
508#使用.communication,因为它可能会与.wait()发生死锁,请参阅Bug 2804
509 stdout\u str,stderr\u str=子进程通信(stdin)
初始化中的~\Anaconda3\lib\subprocess.py(self、args、bufsize、executable、stdin、stdout、stderr、preexec\fn、close\u fds、shell、cwd、env、universal\u新行、startupinfo、creationflags、restore\u信号、start\u new\u会话、pass\u fds、编码、错误)
707 c2pread,c2pwrite,
708错误读取,错误写入,
-->709恢复信号,启动新会话)
710除:
711#如果孩子启动失败,则进行清理。
执行子进程中的~\Anaconda3\lib\subprocess.py(self、args、executable、preexec\u fn、close\u fds、pass\u fds、cwd、env、startupinfo、creationflags、shell、p2cread、p2cwrite、c2pread、c2pwrite、errread、errwrite、未使用的恢复信号、未使用的启动新会话)
995环境,
996 os.fspath(cwd)如果cwd不是None else None,
-->997(创业信息)
998最后:
999#儿童启动。关闭这些管道的父级副本
FileNotFoundError:[WinError 2]数据系统无法更新

-->系统找不到给定的文件

简短回答

  • 从此处下载PhyML:
  • 将操作系统的适当可执行文件解压缩到计算机
  • 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')
    
  • 或者,您可以将可执行文件的路径添加到
    路径
    (见下文)
更长的答案

  • PhymlCommandline
    继承类,该类只是可执行文件的包装
  • 从文件中
请注意,默认情况下,我们假定基础工具安装在 系统$PATH环境变量。这在Linux/Unix下是正常的, 但可能需要在Windows下手动完成。或者,你可以 将二进制文件的完整路径指定为第一个参数(cmd):