multithread_large_fasta.py 文件源码

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

项目:LoReAn 作者: lfaino 项目源码 文件源码
def single_fasta(ref, wd):
    """
    From a fasta file make single files with each sequence
    :param ref:
    :param wd:
    :return:
    """
    wd_split = wd + '/split/'
    logistic.check_create_dir(wd_split)
    fastaFile = open(ref, 'r')
    single_fasta_list = []
    for record in SeqIO.parse(fastaFile, "fasta"):
        fasta_name = wd_split + '/' + record.id + '.fasta'
        single_fasta_list.append(fasta_name)
        output_handle = open(fasta_name, "w")
        SeqIO.write(record, output_handle, "fasta")
        output_handle.close()
    return single_fasta_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号