有没有一种方法可以使用BioPython将FASTA文件转换成Genbank格式?关于如何从Genbank转换到FASTA,有很多答案,但不是相反的。
发布于 2022-08-26 05:13:15
以下是何塞对python3和新生物游戏的回答的更新。Biopython不再使用字母表。也许它能帮你节省一点时间。
from Bio import SeqIO
input_handle = open("test.fasta", "r")
output_handle = open("test.gb", "w")
sequences = list(SeqIO.parse(input_handle, "fasta"))
# assign molecule type
for seq in sequences:
seq.annotations['molecule_type'] = 'DNA'
count = SeqIO.write(sequences, output_handle, "genbank")
output_handle.close()
input_handle.close()
print("Converted {} records".format(count))发布于 2022-04-24 17:06:09
对于未提交的序列,可以将fasta格式转换为gb格式,这些序列没有登录号。还没有提交给国家调查局。
https://stackoverflow.com/questions/30181545
复制相似问题