我需要一个程序从fasta文件(大约1000个序列)中读取每个序列,并将每个序列用作另一个应用程序(RNAfold)的输入以进行二级结构预测。我正在使用python。可能吗?有人可以给我一个指导代码吗?
@Lennart 我已将代码修改为以下代码:
$
from Bio import SeqIO
import subprocess, re
PIPE = -1
handle = open ("D:\python\hsa.fa", "rU")
for record in SeqIO.parse(handle, "fasta"):
output = subprocess.Popen("D:\python\RNAfold.exe -p -d2 --noLP -P", shell=True, stdin = PIPE, stdout = PIPE)
print output
handle.close()
并且得到以下与 RNAfold 输出无关的输出:我的代码有什么问题?
<subprocess.Popen object at 0x02CCEE90>
<subprocess.Popen object at 0x02CCEF30>
<subprocess.Popen object at 0x02CCEF70>
<subprocess.Popen object at 0x02CCEFB0>
<subprocess.Popen object at 0x02CCEB90>
<subprocess.Popen object at 0x02CCEE30>
<subprocess.Popen object at 0x02CCECD0>
<subprocess.Popen object at 0x02CCED90>
<subprocess.Popen object at 0x02CCEEB0>