This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What does the indel field of bam_pileup1_t mean?

In the bam_pileup1_t struct there are two fields, is_del and indel. I think I understand is_del, it means that the read has a deletion at that point in the reference (corresponds to * in the mpileup output). But what does indel mean?

samtools c bam

2 answers

OK, I now understand. It's funny when you finally ask the question the answer can suddenly become clear. is_del = 1 means that at this position right here the current padded read is a deletion. indel = -k where k > 0 means that the current read is a deletion at the next k reference positions. indel = k where k > 0 makes more sense, it means there is an insertion in the current read between this position and the next position.

Exactly.

From the source code:

@field  indel  indel length; 0 for no indel, positive for ins and negative for del
@field  is_del 1 iff the base on the padded read is a deletion

So what's the difference between indel < 0 and is_del = 1?

Log in to answer this question.