What does the indel field of bam_pileup1_t mean?
2
0
Entering edit mode
7.3 years ago
kettleg ▴ 30

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 bam c • 1.8k views
2
Entering edit mode
7.3 years ago
kettleg ▴ 30

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.

0
Entering edit mode

Exactly.

0
Entering edit mode
7.3 years ago

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
1
Entering edit mode

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