fastq_to_fastq.py 文件源码

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

项目:Fast5-to-Fastq 作者: rrwick 项目源码 文件源码
def load_fastq(filename):
    reads = []
    if get_compression_type(filename) == 'gz':
        open_func = gzip.open
    else:  # plain text
        open_func = open

    with open_func(filename, 'rb') as fastq:
        for line in fastq:
            stripped_line = line.strip()
            if len(stripped_line) == 0:
                continue
            if not stripped_line.startswith(b'@'):
                continue
            name = stripped_line[1:].split()[0]
            sequence = next(fastq).strip()
            _ = next(fastq)
            qualities = next(fastq).strip()
            reads.append((name, sequence, qualities))
    return reads
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号