From 940816f16a6de33c35789ec73f5de02618b647f6 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Fri, 21 Dec 2012 10:50:56 -0500 Subject: [PATCH] GATKSamRecord now checks that the read group is a GATKReadGroupRecord, and if not makes one --- .../src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java index ebb3c1ad0..cf06c59e8 100755 --- a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java @@ -154,7 +154,8 @@ public class GATKSAMRecord extends BAMRecord { @Override public GATKSAMReadGroupRecord getReadGroup() { if ( ! retrievedReadGroup ) { - mReadGroup = (GATKSAMReadGroupRecord)super.getReadGroup(); + final SAMReadGroupRecord rg = super.getReadGroup(); + mReadGroup = rg instanceof GATKSAMReadGroupRecord ? (GATKSAMReadGroupRecord)rg : new GATKSAMReadGroupRecord(rg); retrievedReadGroup = true; } return mReadGroup;