Ideally, I'd like to do something like the following:
f = pysam.AlignmentFile(filename, index_filename=index_filename) read = list(f.fetch('Chromosome', 1, 10000)) read.get_variations()
And have that output something like:
[ (1, 'A', 'C'), # An A -> C mismatch at position 1 (15, 'I', 'CGGG'), # An insertion of the string 'CGGG' starting at position 15 of the read (32, 'D', 4), # A deletion of 4 base pairs starting at position 32 ]
I know that it's possible to figure out all of those values by parsing the CIGAR string and MD tags but I'm wondering if there's a more intuitive interface.