GATKSamRecord now checks that the read group is a GATKReadGroupRecord, and if not makes one

This commit is contained in:
Mark DePristo 2012-12-21 10:50:56 -05:00
parent 14944b5d73
commit 940816f16a
1 changed files with 2 additions and 1 deletions

View File

@ -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;