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')
def test_bam_to_consensus_minimap2(): for fn in mm2_fns: assert kindel.bam_to_consensus(fn)
def test_bam_to_consensus_realign_bwa(): for fn in bwa_fns: assert kindel.bam_to_consensus(fn, realign=True)
def test_bam_to_consensus_bwa(): for fn in bwa_fns: assert kindel.bam_to_consensus(fn)