We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

MergeBAM RG ID and SM tags

fazulurfazulur hyderabadMember

Dear GATK team,

I have gone through the discussion on Merging lane wise bam and still I have little confusion.

Does it make difference if we have same RG ID and SM tags across all lanes as it was mentioned that MarkDuplicates will consider the library (flowcell)?

What if we have same sample lanes sequenced in more than one flowcell. How Markduplicates handled such cases? How does it affect on variant calling?

Please help me to resolve this type of cases.

Thanks In Advance
Fazulur Rehaman


  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @fazulur

    Yes, MarkDuplicates takes read group information into account to remove sequencing artifacts. If you have read group information you should definitely use it. Take a look at these docs: https://software.broadinstitute.org/gatk/documentation/article?id=11015

  • fazulurfazulur hyderabadMember

    Hi @BhanuGandham,

    Thanks a lot for useful links on MarkDuplicates. It was very helpful.

    I followed the below procedure to merge multisequence bam

    Markduplicates on individual bam
    Merge individual bams
    AddOrReplaceGroups to merged bam
    Markduplicates Merged bam

    I have little confusion in 3rd & 4th steps.
    Here is an example


    For individual BAM RG line will have the below
    ID=sample1_L001 lb=flowcellID SM=sample1
    ID=sample1_L002 lb=flowcellID SM=sample1

    After merging lane-wise bam, I am getting two RG lines in bam header. So I used picard AddorReplaceGroups to change RG line. Please correct me if I am wrong?

    ID=sample1 lb=flowcellID SM=sample1

    If I give samplename for both SM and ID fields, does it effect anything in MarkDuplicates on mergedbam.

    Please suggest me to resolve this issues.

    Thanks & Regards
    Fazulur Rehaman

Sign In or Register to comment.