Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Duplicate tags are incorrectly ignored in SAM v1.6 files #2272

@twrightsman

Description

@twrightsman

Version

$ samtools --version
samtools 1.22.1
Using htslib 1.22.1
Copyright (C) 2025 Genome Research Ltd.

Version 1.22.1 (build h96c455f_0) from Bioconda.

Environment

  • Debian 12 Linux amd64

Reproduce

Duplicate tags are forbidden as of SAM v1.6:

Within each (non-@CO) header line, no field tag may appear more than once and the order in which the fields appear is not significant.

Using the following SAM file does not raise any error with samtools:

@HD	VN:1.6	SO:coordinate
@RG	ID:rg1	DS:desc1	DS:desc2
@SQ	SN:ref	LN:45
r001	99	ref	7	30	8M2I4M1D3M	=	37	39	TTAGATAAAGGATACTG	*	RG:Z:rg1
$ samtools quickcheck test.sam
$ echo $?
0
$ samtools view -b test.sam > /dev/null
$ echo $?
0

See also a related issue first raised with noodles: zaeleus/noodles#352

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions