debug.py 文件源码

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

项目:kindel 作者: bede 项目源码 文件源码
def show_weights(sample_ids):
    # sample_weights = [SeqIO.read('tests/bam/test_cns/' + id + '.bam.cns.fa', 'fasta') for id in sample_ids]

    # print(sample_weights)

    alignments = []
    for sample_id in sample_ids:
        alignments.append(kindel.parse_alignment('tests/bam/' + sample_id + '.bam'))

    for id, alignment in zip(sample_ids, alignments):
        print(id)
        for i, w in enumerate(alignment.weights):
            coverage = sum({nt:w[nt] for nt in list('ACGT')}.values())
            consensus = kindel.consensus(w)
            print(i+1,
                  coverage,
                  consensus[0],
                  consensus[1],
                  consensus[2],
                  str(alignment.clip_starts[i]) + 'clip' + str(alignment.clip_ends[i]),
                  'TIE' if consensus[3] else '',
                  'DIVERGENT' if consensus[2] and consensus[2] <= 0.75 else '',
                  w)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号