最近,我尝试使用最大的可能性从对齐文件创建树,但是在遵循官方的BioPython文档时遇到了问题:
cmd = PhymlCommandline(input='data/random.phy')
out_log, err_log = cmd()我以轻松的phylip格式将路径替换为自己文件的路径。用AlignIO读取我的文件是有效的,所以路径不应该是问题所在。
是否需要安装PhyML并以某种方式将其链接到BioPython安装?
不幸的是,这方面的文档非常少。
我在Windows上通过Anaconda使用。
错误是:
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系统找不到给定的文件
发布于 2018-09-09 09:41:26
短答案
cmd=/your/path/PhyML-3.1_win32.exe'添加到PhymlCommandline调用中。
PhymlCommandline(cmd='c:/home/users/nicolas/PhyML-3.1_win32.exe',输入=“数据/随机.菲”)PATH中(参见下面)更长的答案
PhymlCommandline继承了AbstractCommandline类,它只是可执行文件的包装器。注意,默认情况下,我们假设底层工具安装在system $PATH环境变量上。这在Linux/Unix下是正常的,但可能需要在Windows下手动完成。或者,可以将二进制文件的完整路径指定为第一个参数(cmd):
https://stackoverflow.com/questions/52236273
复制相似问题