From ee348ac9d4049a4e142779f9a7ac95f7e4c0b596 Mon Sep 17 00:00:00 2001 From: ebanks Date: Mon, 10 Jan 2011 20:27:04 +0000 Subject: [PATCH] Add a hidden mode to the realigner to turn off SW but still use indels other than known ones (i.e. those already in the reads) git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4969 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/indels/IndelRealigner.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java index 80513cea3..2bca0121c 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java @@ -91,6 +91,10 @@ public class IndelRealigner extends ReadWalker { @Argument(fullName="useOnlyKnownIndels", shortName="knownsOnly", required=false, doc="Don't run 'Smith-Waterman' to generate alternate consenses; use only known indels provided as RODs for constructing the alternate references.") protected boolean USE_KNOWN_INDELS_ONLY = false; + @Hidden + @Argument(fullName="doNotUseSW", shortName="doNotUseSW", required=false, doc="Don't run 'Smith-Waterman' to generate alternate consenses; use only known indels provided as RODs or indels in the reads for constructing the alternate references.") + protected boolean NO_SW = false; + @Argument(fullName="maxReadsInRam", shortName="maxInRam", doc="max reads allowed to be kept in memory at a time by the SAMFileWriter. "+ "If too low, the tool may run out of system file descriptors needed to perform sorting; if too high, the tool may run out of memory.", required=false) protected int MAX_RECORDS_IN_RAM = 500000; @@ -598,10 +602,10 @@ public class IndelRealigner extends ReadWalker { byte[] reference = readsToClean.getReference(referenceReader); int leftmostIndex = (int)readsToClean.getLocation().getStart(); - final ArrayList refReads = new ArrayList(); // reads that perfectly match ref + final ArrayList refReads = new ArrayList(); // reads that perfectly match ref final ArrayList altReads = new ArrayList(); // reads that don't perfectly match final LinkedList altAlignmentsToTest = new LinkedList(); // should we try to make an alt consensus from the read? - final Set altConsenses = new LinkedHashSet(); // list of alt consenses + final Set altConsenses = new LinkedHashSet(); // list of alt consenses // if there are any known indels for this region, get them and create alternate consenses generateAlternateConsensesFromKnownIndels(altConsenses, leftmostIndex, reference); @@ -611,7 +615,7 @@ public class IndelRealigner extends ReadWalker { long totalRawMismatchSum = determineReadsThatNeedCleaning(reads, refReads, altReads, altAlignmentsToTest, altConsenses, leftmostIndex, reference); // use 'Smith-Waterman' to create alternate consenses from reads that mismatch the reference, using totalRawMismatchSum as the random seed - if ( !USE_KNOWN_INDELS_ONLY ) + if ( !USE_KNOWN_INDELS_ONLY && !NO_SW ) generateAlternateConsensesFromReads(altAlignmentsToTest, altConsenses, reference, leftmostIndex, totalRawMismatchSum); // if ( debugOn ) System.out.println("------\nChecking consenses...\n--------\n");