Errors about read group RG information

IMPORTANT: This is the legacy GATK documentation. This information is only valid until Dec 31st 2019. For latest documentation and forum click here

created by delangel

on 2012-07-23

What are read groups?

See the Dictionary entry on read groups.

Errors about missing or undefined read groups

As detailed in the FAQs about input requirements, GATK expects all read groups appearing in the read data to be specified in the file header, and will fail with an error if it does not find that information (whether there is no read group information in the file, or a subset of reads do not have read groups).

Typically you should read group information when you perform the original alignments (with e.g. BWA, which has an option to do so). So what do you do if you forgot to do that, and you don't want to have to rerun BWA all over again?

Solution

You can use a Picard tool called AddOrReplaceReadGroups to add the missing information to your input file.

Here's an example:

# throws an error java -jar GenomeAnalysisTK.jar \ -T HaplotypeCaller \ -R reference.fasta \ -I reads_without_RG.bam \ -o output.vcf # fix the read groups java -jar picard.jar AddOrReplaceReadGroups \ I= reads_without_RG.bam \ O= reads_with_RG.bam \ SORT_ORDER=coordinate \ RGID=foo \ RGLB=bar \ RGPL=illumina \ RGSM=Sample1 \ CREATE_INDEX=True # runs without error java -jar GenomeAnalysisTK.jar \ -T HaplotypeCaller \ -R reference.fasta \ -I reads_with_RG.bam \ -o output.vcf

Note that if you don't know what information to put in the read groups, you should ask whoever performed the sequencing or provided the BAM to give you the metadata you need.

Updated on 2016-01-04

From preterjack9051 on 2018-09-28

The errors are the most common thing and I have also face a lot of errors in it, but when I read all the instructions from [HP Support Australia](https://hpsupports.co/hp-support-australia/ “HP Support Australia”), it appears me very helpful to fix them all.

From eperipolli on 2018-11-22

In my case, I am using public Fastq files and I don’t have the library information when downloading them. What should I do in this case, just skip the LB information when building the RG for the alignment (if I do this, will it generate an error message when using GATK later? ). Or should I create the same LB name for all my samples and assign them to this one when building the RG for the alignment?