def separateFasta(fasta,prefix):
"""Utility to separate a multi-FASTA to separate FASTA files"""
for seq_record in SeqIO.parse(fasta, "fasta"):
# we are changing the IDs from "HLA:HLA..." to "HLA...". This makes IGV and other tools much happier
# would be nice to know what lead to this idiocity in naming conventions
seq_record.id = seq_record.id.replace("HLA:","")
seq_record.id = prefix + seq_record.id
print("writing " + seq_record.id)
SeqIO.write(seq_record,seq_record.id + ".fasta", "fasta")
separateFASTA.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录