From 5dab95aa5adf881e54e5b41cddf46372b3e3f9da Mon Sep 17 00:00:00 2001 From: andrewk Date: Tue, 29 Sep 2009 06:35:50 +0000 Subject: [PATCH] Fix getMergedReadGroupsByReaders so that it provides read groups in the same way Picard does so that it works correctly when input read files have no clashes in their read groups and retain their original read group names. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1737 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/GenomeAnalysisEngine.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index c1b03d002..4707a5060 100755 --- a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -327,9 +327,14 @@ public class GenomeAnalysisEngine { rg_sets.add(groups); for ( SAMReadGroupRecord g : r.getFileHeader().getReadGroups() ) { - // use HeaderMerger to translate original read group id from the reader into the read group id in the - // merged stream, and save that remapped read group id to associate it with specific reader - groups.add( hm.getReadGroupId(r, g.getReadGroupId()) ); + if (hm.hasGroupIdDuplicates()) { // Check if there were read group clashes with hasGroupIdDuplicates and if so: + // use HeaderMerger to translate original read group id from the reader into the read group id in the + // merged stream, and save that remapped read group id to associate it with specific reader + groups.add( hm.getReadGroupId(r, g.getReadGroupId()) ); + }else{ + // otherwise, pass through the unmapped read groups since this is what Picard does as well + groups.add( g.getReadGroupId() ); + } } }