Hello,
I have loaded a BAM file in Bioconductor with the GenomicAlignments package. I am looking for a way to extract the position of the mismatches (X in the CIGAR line) as a GRanges object, but so far I only found a function (cigarRangesAlongReferenceSpace) that returns an IRanges object. Is there a simple way to project these IRanges to the GAlignements in order to produce on GRange per IRange?

I am trying this but it is slow.
In the end, I suppose that the reason why such a function does not exist is because one can just run
bcftoolson the BAM file and load the variant calls withVariantAnnotation::readVcf?