separateFASTA.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:icing 作者: NationalGenomicsInfrastructure 项目源码 文件源码
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")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号