diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index dc728ff6b..b3f77fc06 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -484,6 +484,9 @@ public class UnifiedGenotyperEngine { Map stratifiedContexts = null; + if ( !BaseUtils.isRegularBase( refContext.getBase() ) ) + return null; + if ( model == GenotypeLikelihoodsCalculationModel.Model.INDEL ) { if (UAC.GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES) { @@ -498,6 +501,7 @@ public class UnifiedGenotyperEngine { stratifiedContexts = AlignmentContextUtils.splitContextBySampleName(pileup, UAC.ASSUME_SINGLE_SAMPLE); } else { + // todo - tmp will get rid of extended events so this wont be needed if (!rawContext.hasExtendedEventPileup()) return null; @@ -515,9 +519,6 @@ public class UnifiedGenotyperEngine { } } else if ( model == GenotypeLikelihoodsCalculationModel.Model.SNP ) { - if ( !BaseUtils.isRegularBase( refContext.getBase() ) ) - return null; - // stratify the AlignmentContext and cut by sample stratifiedContexts = AlignmentContextUtils.splitContextBySampleName(rawContext.getBasePileup(), UAC.ASSUME_SINGLE_SAMPLE); diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java b/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java index 3718345a4..70417889b 100644 --- a/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java @@ -135,6 +135,11 @@ public class NWaySAMFileWriter implements SAMFileWriter { public void addAlignment(SAMRecord samRecord) { final SAMReaderID id = toolkit.getReaderIDForRead(samRecord); + String rg = samRecord.getStringAttribute("RG"); + if ( rg != null ) { + String rg_orig = toolkit.getReadsDataSource().getOriginalReadGroupId(rg); + samRecord.setAttribute("RG",rg_orig); + } writerMap.get(id).addAlignment(samRecord); }