예제 #1
0
파일: cli.py 프로젝트: lneaves/kindel
def consensus(bam_path: 'path to SAM/BAM file',
              realign: 'attempt to reconstruct reference around soft-clip boundaries'=False,
              min_depth: 'substitute Ns at coverage depths beneath this value'=2,
              min_overlap: 'match length required to close soft-clipped gaps'=7,
              clip_decay_threshold: 'read depth fraction at which to cease clip extension'=0.1,
              mask_ends: 'ignore clip dominant positions within n positions of termini'=50,
              trim_ends: 'trim ambiguous nucleotides (Ns) from sequence ends'=False,
              uppercase: 'close gaps using uppercase alphabet'=False):
    '''Infer consensus sequence(s) from alignment in SAM/BAM format'''
    result = kindel.bam_to_consensus(bam_path,
                                     realign,
                                     min_depth,
                                     min_overlap,
                                     clip_decay_threshold,
                                     mask_ends,
                                     trim_ends,
                                     uppercase)
    print(result.report, file=sys.stderr)
    SeqIO.write(result.consensuses, sys.stdout,'fasta')
예제 #2
0
def test_bam_to_consensus_minimap2():
    for fn in mm2_fns:
        assert kindel.bam_to_consensus(fn)
예제 #3
0
def test_bam_to_consensus_realign_bwa():
    for fn in bwa_fns:
        assert kindel.bam_to_consensus(fn, realign=True)
예제 #4
0
def test_bam_to_consensus_bwa():
    for fn in bwa_fns:
        assert kindel.bam_to_consensus(fn)