【发布时间】:2017-10-27 20:11:49
【问题描述】:
我最初将我的 fasta 序列转换为带有 Bio.SeqIO.to_dict 语句的字典。我想将子集字典写回fasta文件。
Test 是一个 python 字典,以 fasta 标头作为键,序列作为索引。
我的代码尝试使用 SeqIO.write:
with open("example.fasta", "w") as handle:
SeqIO.write(test, handle, "fasta")
AttributeError: 'str' object has no attribute 'id'
恐怕通过将 SeqIO 生成器对象转换为字典,我无法轻松返回其他 SeqIO 函数所期望的输入。
【问题讨论】:
标签: python dictionary biopython fasta