Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeBamAlignment conflicting headers between mapped and unmapped #1789

Open
GATKSupportTeam opened this issue Mar 30, 2022 · 0 comments
Open

Comments

@GATKSupportTeam
Copy link
Collaborator

MergeBamAlignment should throw an error message when the BAM files have conflicting @rg tags in the headers.

This request was created from a contribution made by TA on March 04, 2022 15:13 UTC.

Link: https://gatk.broadinstitute.org/hc/en-us/community/posts/4532746666523-MergeBamAlignment-conflicting-headers-between-mapped-and-unmapped

--

Hi,

I wanted to ask how MergeBamAlignment deals with conflicting header information. Specifically if the unmapped BAM and mapped BAM have different @rg tags in the header then how does it resolve? I do not see this in documentation.

My issue is that I add @rg tag information during alignment with BWA-MEM. But when I use mergebamalignment while the reads retain the @rg ID the header changes the @rgid to the unmapped BAM. Therefore the read group IDs of the actual reads is different than the header. I have three screen shots below of this. 

I don't see any documentation of how to deal with conflicting headers - I know a workaround is to change the readgroups with AddOrReplace read groups after MergeBamAlignmnet but I would rather do this at the level of MergeBamAlignment

This question is similar but doesn't say how it resolves this conflict: https://gatk.broadinstitute.org/hc/en-us/community/posts/4406765311515-Read-group-info-in-mapped-and-unmapped-bam-files?input\_string=MergeBamAlignment%20conflicting%20headers%20between%20mapped%20and%20unmapped

Thank you!

After merge bam alignment RG

BWA-MEM mapped RG

Unmapped read group

My version of GATK is 4.2.1.0

My MergeBamAlignment command was

gatk MergeBamAlignment Aligned=sorted_mapped_group"$read_batch_num".bam UNMAPPED=sorted_unmapped_group"$read_batch_num".bam o=bam_aligned_"$read_batch_num".bam R=~/evronylab/reference-files/hg38-gatk/Homo_sapiens_assembly38.fasta

(created from Zendesk ticket #275269)
gz#275269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant