Skip to content

Pileup reads with adjacent indels. #28

@alumi

Description

@alumi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions