【问题标题】:Run clustalw2 without input FASTA file在不输入 FASTA 文件的情况下运行 clustalw2
【发布时间】:2013-09-17 22:31:28
【问题描述】:

如何在没有输入 FASTA 文件的情况下运行 ClustalW2

我可以在命令中添加管道吗?我目前在Biopython Tutorial and Cookbook 中关注section 6.2.1

【问题讨论】:

  • 你必须有一些你想对齐的序列——它们在内存中是 SeqRecord 对象吗?在内存中作为 FASTA 格式字符串?还有什么?

标签: python biopython fasta clustal


【解决方案1】:

关于使用 Biopython

我假设您希望使用 clustal 包装器 ClustalwCommandLine。作为一个包装器,它的功能是从一个实例创建适当的命令行调用。

我认为直接使用命令行工具通常更容易,使用 subprocess(因此完全跳过 Biopython)。

stdin in clustalw2

咨询clustalw2 documentation,我发现无法从stdin传递数据:

        DATA (sequences)

-INFILE=file.ext                             :input sequences.
-PROFILE1=file.ext  and  -PROFILE2=file.ext  :profiles (old alignment).

stdin in clustalo

但是,如果可以选择升级到 Clustal Omega,您可以在 Clustal Omega documentation 中看到可以通过 - 表示从 stdin 获取输入:

SEQUENCE INPUT:

-i, --in, --infile={<file>,-}
    Multiple sequence input file (- for stdin)

参考how do I pass a string in subprocess.Popen,简而言之:

from subprocess import Popen, PIPE, STDOUT


proc = Popen(['clustalwo', '-', <...>], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
stdout = p.communicate(input='> Seq one\nATCGCTACGCACTACGTACG...')

【讨论】:

    猜你喜欢
    • 2016-08-14
    • 2022-01-21
    • 2011-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多