<p>The read group identifier needs to be specified in both the header lines of the BAM/SAM file and the alignment line. No other fields are required, but note that because the additional information is only stored once (i.e. in the header), it won't add much to file sizes or processing time if additional fields are included. If any of the other optional fields cause problems (either by inclusion or exclusion), it would be helpful to <a href="https://github.com/samtools/htsjdk/issues" rel="nofollow noreferrer">report an issue</a> about it.</p>

<p>Older tools required you to specify both a header read group ID and an alignment read group ID, but most tools of the recent tools I've used seem to be intelligent enough that they will add headers for any read groups without that information.</p>

CC BY-SA 3.0
2017-06-09T16:01:18.067Z
2017-06-09T16:01:18.067Z
gringer
<p>The sample tag (i.e. SM) was a mandatory tag in the <a href="https://sourceforge.net/p/samtools/code/HEAD/tree/trunk/sam-spec/" rel="noreferrer">initial SAM spec</a> (see the <code>.pages</code> file; you need a mac to open it). When transitioned to Latex, this requirement was mysteriously dropped. Picard is conforming to the initial spec. Anyway, the sample tag is important to quite a few tools. I would encourage you to add it.</p>

CC BY-SA 4.0
2019-10-10T19:46:07.847Z
The mystery was explained in a [samtools-devel message at the time](https://sourceforge.net/p/samtools/mailman/message/25788014/): _Sometimes, we simply want to group reads without sample information_. See also [hts-specs issue #286](https://github.com/samtools/hts-specs/issues/286).
John Marshall
CC BY-SA 3.0
2017-06-09T16:28:09.460Z
2017-06-09T16:28:09.460Z
user172818
<p>The <a href="https://samtools.github.io/hts-specs/SAMv1.pdf" rel="noreferrer">SAM specification</a> indicates that each read group must have a unique ID field, but does not mark any other field as required. </p>

<p>I have also discovered that htsjdk throws exceptions if the sample (SM) field is empty, though there is no indication in the specification that this is required. </p>

<p>Are there other read group fields that I should expect to be required by common tools? </p>

<file-formats><sam>
What are the de facto required fields in a SAM/BAM read group?
# What are the de facto required fields in a SAM/BAM read group?

(Asked by: username_0 on 2017-06-09)

The [SAM specification](https://samtools.github.io/hts-specs/SAMv1.pdf) indicates that each read group must have a unique ID field, but does not mark any other field as required.

I have also discovered that htsjdk throws exceptions if the sample (SM) field is empty, though there is no indication in the specification that this is required.

Are there other read group fields that I should expect to be required by common tools?

**Tags:** file-formats, sam

---

## 2 answers

### Answer by username_2 on 2017-06-09. Score: 9 | Accepted answer

The sample tag (i.e. SM) was a mandatory tag in the [initial SAM spec](https://sourceforge.net/p/samtools/code/HEAD/tree/trunk/sam-spec/) (see the `.pages` file; you need a mac to open it). When transitioned to Latex, this requirement was mysteriously dropped. Picard is conforming to the initial spec. Anyway, the sample tag is important to quite a few tools. I would encourage you to add it.

> **Comments:**
> **username_3**: The mystery was explained in a [samtools-devel message at the time](https://sourceforge.net/p/samtools/mailman/message/25788014/): _Sometimes, we simply want to group reads without sample information_. See also [hts-specs issue #286](https://github.com/samtools/hts-specs/issues/286).  

---

### Answer by username_1 on 2017-06-09. Score: 3

The read group identifier needs to be specified in both the header lines of the BAM/SAM file and the alignment line. No other fields are required, but note that because the additional information is only stored once (i.e. in the header), it won't add much to file sizes or processing time if additional fields are included. If any of the other optional fields cause problems (either by inclusion or exclusion), it would be helpful to [report an issue](https://github.com/samtools/htsjdk/issues) about it.

Older tools required you to specify both a header read group ID and an alignment read group ID, but most tools of the recent tools I've used seem to be intelligent enough that they will add headers for any read groups without that information.


---

