__init__.py 文件源码

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

项目:enasearch 作者: bebatut 项目源码 文件源码
def format_seq_content(seq_str, out_format):
    """Format a string with sequences into a list of BioPython sequence objects (SeqRecord)

    :param seq_str: string with sequences to format
    :param out_format: fasta or fastq

    :return: a list of SeqRecord objects with the sequences in the input string
    """
    sequences = []
    with tempfile.TemporaryFile(mode='w+') as fp:
        fp.write(seq_str)
        fp.seek(0)
        for record in SeqIO.parse(fp, out_format):
            sequences.append(record)
    return sequences
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号