FORUMCategory: BioinformaticsMissing ReadGroup in bam
zhibin Staff asked 2 years ago



When I ran GATK HaplotypeCaller, GATK complained that my bam file was missing read group (RG) tag. How do I fix my bam file?

1 Answers
Best Answer
Eloi Mercier answered 2 years ago



You can use the AddOrReplaceReadGroups function from GATK to add the RG tags (https://broadinstitute.github.io/picard/command-line-overview.html#AddOrReplaceReadGroups).

java -jar picard.jar AddOrReplaceReadGroups \
 I=input.bam \
 O=output.bam \
 RGID=4 \
 RGLB=lib1 \
 RGPL=illumina \
 RGPU=unit1 \
 RGSM=20

If you do not know what to put in the read group, you need to contact the person who performed the sequencing and ask them to give you this information.

zhibin Staff replied 2 years ago

Thanks, problem solved!