cljam icon indicating copy to clipboard operation
cljam copied to clipboard

Pileup reads with adjacent indels.

Open alumi opened this issue 9 years ago • 1 comments

CIGAR code with adjacent indels (e.g. 1M2D3I, 1M2N3I) is allowed by SAM file format specification.

Insertions and deletions are piled up at the base position just before them according to samtools.

I couldn't figure out the specification for mpileup format, but mpileup output of samtools 1.3.1 seems to be incorrect.

input SAM
@SQ SN:ref  LN:20
r001 0 ref 2 60  1M5D5I  * 0 0 ATGCAT  IIIIII
samtools 1.3.1 output
ref	2	N	1	^]A-5NNNNN	I
ref	3	N	1	*	I
ref	4	N	1	*	I
ref	5	N	1	*	I
ref	6	N	1	*	I
ref	7	N	1	*+5GCATC$	I
cljam output
ref	2	N	1	A-5NNNNN	I
ref	3	N	1	*	~
ref	4	N	1	*	~
ref	5	N	1	*	~
ref	6	N	1	*	~
ref	7	N	1	*+5TGCAT	~

I think inserted sequence +5GCATC should be +5TGCAT. The last base C of the samtools output is affected by upper nibble of the first quality score. There might be an off-by-one error & buffer overrun or something in htslib/samtools implementation.

What should cljam output? Should it be the same as samtools?

alumi avatar Feb 10 '17 07:02 alumi

I found a issue opened for htslib.

alumi avatar Feb 10 '17 08:02 alumi