From 9e1d443c47122828412d374dc8f2869e06b40ab0 Mon Sep 17 00:00:00 2001 From: Andrey Sivachenko Date: Tue, 16 Aug 2011 10:55:51 -0400 Subject: [PATCH 1/6] fixing read group name collision: before writing the read into respective stream in nway-out mode we now retrieve the original rg, not the merged/modified one --- .../broadinstitute/sting/utils/sam/NWaySAMFileWriter.java | 5 +++++ 1 file changed, 5 insertions(+) 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); } From c71a4e1832edf1283ac7484742b12644f07745ae Mon Sep 17 00:00:00 2001 From: Andrey Sivachenko Date: Tue, 16 Aug 2011 13:40:35 -0400 Subject: [PATCH 3/6] this is a bug fix; reverting in unstable and pushing from stable instead --- .../broadinstitute/sting/utils/sam/NWaySAMFileWriter.java | 5 ----- 1 file changed, 5 deletions(-) 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 70417889b..3718345a4 100644 --- a/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/NWaySAMFileWriter.java @@ -135,11 +135,6 @@ 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); } From 9f3328db5365f676604a02b1f9b60105602bd9dd Mon Sep 17 00:00:00 2001 From: Andrey Sivachenko Date: Tue, 16 Aug 2011 13:45:40 -0400 Subject: [PATCH 4/6] fixing read group name collision: before writing the read into respective stream in nway-out mode we now retrieve the original rg, not the merged/modified one --- .../broadinstitute/sting/utils/sam/NWaySAMFileWriter.java | 5 +++++ 1 file changed, 5 insertions(+) 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); } From 170d1ff7b677fddd2002a86f0bbca29da4b7f076 Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Tue, 16 Aug 2011 14:17:46 -0400 Subject: [PATCH 5/6] Fix in UG for trying to call indels at IUPAC code bases when in EMIT_ALL_SITES mode --- .../gatk/walkers/genotyper/UnifiedGenotyperEngine.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 a10897172..1b72aae25 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 @@ -485,6 +485,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) { @@ -499,6 +502,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; @@ -516,9 +520,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); From 6e828260a019b18134ae27950f7a1faa08319af0 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Tue, 16 Aug 2011 16:13:47 -0400 Subject: [PATCH 6/6] Removed -B support. Now explodes with error if -B provided. --- .../sting/gatk/CommandLineExecutable.java | 9 ++++----- .../sting/gatk/arguments/GATKArgumentCollection.java | 10 ++-------- .../gatk/arguments/GATKArgumentCollectionUnitTest.java | 8 -------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java b/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java index 32132c7ca..32002e093 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java +++ b/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java @@ -96,24 +96,23 @@ public abstract class CommandLineExecutable extends CommandLineProgram { loadArgumentsIntoObject(walker); argumentSources.add(walker); - Collection newStyle = ListFileUtils.unpackRODBindings(parser.getRodBindings(), parser); + Collection rodBindings = ListFileUtils.unpackRODBindings(parser.getRodBindings(), parser); // todo: remove me when the old style system is removed if ( getArgumentCollection().RODBindings.size() > 0 ) { logger.warn("################################################################################"); logger.warn("################################################################################"); - logger.warn("Deprecated -B rod binding syntax detected. This syntax will be retired in GATK 1.2."); + logger.warn("Deprecated -B rod binding syntax detected. This syntax has been eliminated in GATK 1.2."); logger.warn("Please use arguments defined by each specific walker instead."); for ( String oldStyleRodBinding : getArgumentCollection().RODBindings ) { logger.warn(" -B rod binding with value " + oldStyleRodBinding + " tags: " + parser.getTags(oldStyleRodBinding).getPositionalTags()); } logger.warn("################################################################################"); logger.warn("################################################################################"); + System.exit(1); } - Collection oldStyle = ListFileUtils.unpackRODBindingsOldStyle(getArgumentCollection().RODBindings, parser); - oldStyle.addAll(newStyle); - engine.setReferenceMetaDataFiles(oldStyle); + engine.setReferenceMetaDataFiles(rodBindings); for (ReadFilter filter: filters) { loadArgumentsIntoObject(filter); diff --git a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java index 62135f21b..fd39d46b0 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java +++ b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java @@ -101,6 +101,8 @@ public class GATKArgumentCollection { @Input(fullName = "reference_sequence", shortName = "R", doc = "Reference sequence file", required = false) public File referenceFile = null; + @Deprecated + @Hidden @ElementList(required = false) @Input(fullName = "rodBind", shortName = "B", doc = "Bindings for reference-ordered data, in the form :, ", required = false) public ArrayList RODBindings = new ArrayList(); @@ -340,14 +342,6 @@ public class GATKArgumentCollection { return false; } } - if (other.RODBindings.size() != RODBindings.size()) { - return false; - } - for (int x = 0; x < RODBindings.size(); x++) { - if (!RODBindings.get(x).equals(other.RODBindings.get(x))) { - return false; - } - } if (!other.samFiles.equals(this.samFiles)) { return false; } diff --git a/public/java/test/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollectionUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollectionUnitTest.java index f3e868474..3a242cb13 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollectionUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollectionUnitTest.java @@ -88,14 +88,6 @@ public class GATKArgumentCollectionUnitTest extends BaseTest { collect.intervals.add("intervals".toLowerCase()); collect.excludeIntervals = new ArrayList(); collect.numberOfThreads = 1; - - // make some rod bindings up - ArrayList fakeBindings = new ArrayList(); - fakeBindings.add("Bind1"); - fakeBindings.add("Bind2"); - fakeBindings.add("Bind3"); - - collect.RODBindings = fakeBindings; }