This is a test version of Biostars. For the public version, visit https://www.biostars.org.
remove CIGAR strings starting with insertion

I'm trying to use mutato (https://github.com/annalam/mutato) to perform somatic variant calling on BAM files aligned with BWA.

mutato call --alt-reads=5 --alt-frac=0.05 hg19.fa sample.bam > variants.vcf

I get the follow error:

ERROR: CIGAR strings starting with insertion are not supported

What can I do to change the Bam file to avoid this error?

variant-calling cfdna cigar mutato

Have you tried asking the author? You might be able to use pysam to filter alignments based on CIGAR strings with insertions (cigarType == 1). You could also probably use bioalcidaejdk, which has methods for parsing CIGAR strings.

1 answer

I made a small program, kind of reverse engineered from mutato source code itself, that makes a new BAM file free of the "bad" CIGAR strings starting with insertion/deletion. it was fun to learn a little bit of rust to make this work https://github.com/cmdcolin/filter_cigars

i only briefly tested it but seemed like it worked on a basic CIGAR that I provided it with

maybe a fix could be applied to mutato source code directly, it could be worth reporting to them that tools like BWA output this type of thing naturally. that said, "insertions/deletions at the 0 position" seem more like they should be e.g. soft clipping. maybe you could check that you are using the latest bwa for example to see that this wasn't fixed in bwa.

Log in to answer this question.