" RGID plus read name and it will always be unique for every read": even if the aligner produces more than one hit per pair (sam flag=256) ?
Do read names need to be unique over multiple readgroups in a BAM?
After merging multiple bam files that contain paired reads Picard ValidateSam complains about all kinds of read pair errors.
These errors seem to be caused by picard not using the readgroup name in combination with the read name, and so finding pairs that are not valid, because they are not really pairs. (forward and reverse are from a different read group).
Is this an error in Picard that it doesn't use the readgroup information for validating pairs or is it part of the bam specification that read names should be unique over multiple read groups?
1 answer
I am not sure about your problem with Picard but read names are not supossed to be unique in a merged bam file if they have a unique read group id or RGID tag. In other words, two reads with the same names coming from different runs can be merged into one file if you have unique RGIDs for them. Most of the softwares will check for uniqueness of RGID plus read name and it will always be unique for every read. Earlier people used to concatenate RGID and read name to create a unique read names in a bam file. I am sure Picard is one of the smartest NGS tool we have and it should be able to differentiate reads with the same names but different RGIDs.
PS: By RGIDs, I mean RG: tags in BAM file.
Log in to answer this question.