diff --git a/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowArgumentCollection.java b/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowArgumentCollection.java index 116faf0c00..b2da763edc 100644 --- a/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowArgumentCollection.java +++ b/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowArgumentCollection.java @@ -21,21 +21,21 @@ public enum FLOW_DUPLICATE_SELECTION_STRATEGY { "in addition to the start location, which is always significant (i.e. require single-ended reads to start and" + "end on the same position to be considered duplicate) " + "(for this argument, \"read end\" means 3' end).", optional = true) - public boolean USE_END_IN_UNPAIRED_READS = false; + public boolean FLOW_USE_END_IN_UNPAIRED_READS = false; @Argument(doc = "Use position of the clipping as the end position, when considering duplicates (or use the unclipped end position) " + "(for this argument, \"read end\" means 3' end).", optional = true) - public boolean USE_UNPAIRED_CLIPPED_END = false; + public boolean FLOW_USE_UNPAIRED_CLIPPED_END = false; @Argument(doc = "Maximal difference of the read end position that counted as equal. Useful for flow based " + "reads where the end position might vary due to sequencing errors. " + "(for this argument, \"read end\" means 3' end)", optional = true) - public int UNPAIRED_END_UNCERTAINTY = 0; + public int FLOW_UNPAIRED_END_UNCERTAINTY = 0; @Argument(doc = "Maximal difference of the read start position that counted as equal. Useful for flow based " + "reads where the end position might vary due to sequencing errors. " + "(for this argument, \"read start\" means 5' end in the direction of sequencing)", optional = true) - public int UNPAIRED_START_UNCERTAINTY = 0; + public int FLOW_UNPAIRED_START_UNCERTAINTY = 0; @Argument(doc = "Skip first N flows, starting from the read's start, when considering duplicates. Useful for flow based reads where sometimes there " + "is noise in the first flows " + diff --git a/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelper.java b/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelper.java index 2d3611a7b4..d8ae6cf590 100644 --- a/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelper.java +++ b/src/main/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelper.java @@ -71,7 +71,7 @@ public MarkDuplicatesForFlowHelper(final MarkDuplicates md) { } private void validateFlowParameteres() { - if ( md.flowBasedArguments.UNPAIRED_END_UNCERTAINTY != 0 && !md.flowBasedArguments.USE_END_IN_UNPAIRED_READS ) { + if ( md.flowBasedArguments.FLOW_UNPAIRED_END_UNCERTAINTY != 0 && !md.flowBasedArguments.FLOW_USE_END_IN_UNPAIRED_READS) { throw new IllegalArgumentException("Invalid parameter combination. UNPAIRED_END_UNCERTAINTY can not be specified when USE_END_IN_UNPAIRED_READS not specified"); } } @@ -175,7 +175,7 @@ public ReadEndsForMarkDuplicates buildReadEnds(final SAMFileHeader header, final // adjust start/end coordinates ends.read1Coordinate = getReadEndCoordinate(rec, !rec.getReadNegativeStrandFlag(), true, md.flowBasedArguments); - if (md.flowBasedArguments.USE_END_IN_UNPAIRED_READS) { + if (md.flowBasedArguments.FLOW_USE_END_IN_UNPAIRED_READS) { ends.read2Coordinate = getReadEndCoordinate(rec, rec.getReadNegativeStrandFlag(), false, md.flowBasedArguments); } @@ -235,12 +235,12 @@ private boolean areComparableForDuplicatesWithEndSignificance(final ReadEndsForM if (areComparable) { areComparable = endCoorInRangeWithUncertainty(lhsRead1Coordinate1Min, lhsRead1Coordinate1Max, - rhs.read1Coordinate, md.flowBasedArguments.UNPAIRED_START_UNCERTAINTY); + rhs.read1Coordinate, md.flowBasedArguments.FLOW_UNPAIRED_START_UNCERTAINTY); } if (areComparable) { areComparable = (!endCoorSignificant(lhs.read2Coordinate, rhs.read2Coordinate) || endCoorInRangeWithUncertainty(lhsRead1Coordinate2Min, lhsRead1Coordinate2Max, - rhs.read2Coordinate, md.flowBasedArguments.UNPAIRED_END_UNCERTAINTY)); + rhs.read2Coordinate, md.flowBasedArguments.FLOW_UNPAIRED_END_UNCERTAINTY)); } return areComparable; @@ -377,7 +377,7 @@ protected static int getReadEndCoordinate(final SAMRecord rec, final boolean sta if ( flowOrder.isValid() ) { // simple case - if ( flowBasedArguments.USE_UNPAIRED_CLIPPED_END ) { + if ( flowBasedArguments.FLOW_USE_UNPAIRED_CLIPPED_END) { return alignmentCoor; } @@ -412,7 +412,7 @@ protected static int getReadEndCoordinate(final SAMRecord rec, final boolean sta } } final int coor = unclippedCoor + (startEnd ? hmerSize : -hmerSize); - return flowBasedArguments.USE_UNPAIRED_CLIPPED_END + return flowBasedArguments.FLOW_USE_UNPAIRED_CLIPPED_END ? (startEnd ? Math.max(coor, alignmentCoor) : Math.min(coor, alignmentCoor)) : coor; } diff --git a/src/test/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelperTest.java b/src/test/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelperTest.java index b8d033308c..6486c097f2 100644 --- a/src/test/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelperTest.java +++ b/src/test/java/picard/sam/markduplicates/MarkDuplicatesForFlowHelperTest.java @@ -86,7 +86,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, null, false, null, null), new TestRecordInfo(74, 12, null, true, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=false" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=false" }, null }, // testUSE_END_IN_UNPAIRED_READS: End location is significant @@ -96,7 +96,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, null, false, null, null), new TestRecordInfo(74, 12, null, false, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=true" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true" }, null }, // testUSE_UNPAIRED_CLIPPED_END: Do not use clipped locations (meaning, use unclipped) @@ -106,7 +106,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, "1S76M", false, null, null), new TestRecordInfo(74, 12, "74M", false, null, null) }, - new String[] { "USE_UNPAIRED_CLIPPED_END=false" }, null + new String[] { "FLOW_USE_UNPAIRED_CLIPPED_END=false" }, null }, // testUSE_UNPAIRED_CLIPPED_END: Use clipped locations (meaning, use clipped) @@ -116,7 +116,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, "1S76M", false, null, null), new TestRecordInfo(74, 12, "74M", true, null, null) }, - new String[] { "USE_UNPAIRED_CLIPPED_END=true" }, null + new String[] { "FLOW_USE_UNPAIRED_CLIPPED_END=true" }, null }, // testUSE_UNPAIRED_CLIPPED_END: Use clipped locations (meaning, use clipped) @@ -126,7 +126,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, "1S76M1S", true, null, null), new TestRecordInfo(78, 11, "78M", false, null, null) }, - new String[] { "USE_UNPAIRED_CLIPPED_END=false", "USE_END_IN_UNPAIRED_READS=true" }, null + new String[] { "FLOW_USE_UNPAIRED_CLIPPED_END=false", "FLOW_USE_END_IN_UNPAIRED_READS=true" }, null }, // testUSE_UNPAIRED_CLIPPED_END: Use clipped locations (meaning, use clipped) @@ -136,7 +136,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12, "1S76M1S", false, null, null), new TestRecordInfo(78, 11, "78M", false, null, null) }, - new String[] { "USE_UNPAIRED_CLIPPED_END=true", "USE_END_IN_UNPAIRED_READS=true" }, null + new String[] { "FLOW_USE_UNPAIRED_CLIPPED_END=true", "FLOW_USE_END_IN_UNPAIRED_READS=true" }, null }, // testFLOW_SKIP_FIRST_N_FLOWS: Do not use clipped locations (meaning, use unclipped) @@ -146,7 +146,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12,"76M", false, "ACGTT", "TTGCA"), new TestRecordInfo(76, 12, "76M", true, "ACGGT", "TGGCA") }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "FLOW_SKIP_FIRST_N_FLOWS=0" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_SKIP_FIRST_N_FLOWS=0" }, null }, // testFLOW_SKIP_FIRST_N_FLOWS: Do not use clipped locations (meaning, use unclipped) @@ -156,7 +156,7 @@ public Object[][] forFlowDataProvider() { new TestRecordInfo(76, 12,"76M", false, "ACGTT", "TTGCA"), new TestRecordInfo(76, 12, "76M", false, "CCGGT", "TGGCA") }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "FLOW_SKIP_FIRST_N_FLOWS=3" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_SKIP_FIRST_N_FLOWS=3" }, null }, // testFLOW_QUALITY_SUM_STRATEGY: normal sum @@ -226,7 +226,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(84, 12, null, true, null, null), new TestRecordInfo(94, 12, null, false, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "UNPAIRED_END_UNCERTAINTY=10" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_UNPAIRED_END_UNCERTAINTY=10" }, null }, // testUNPAIRED_START_UNCERTAINTY: End location is significant and uncertain, end sorted @@ -237,7 +237,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(64, 22, null, true, null, null), new TestRecordInfo(54, 32, null, true, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "UNPAIRED_START_UNCERTAINTY=10" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_UNPAIRED_START_UNCERTAINTY=10" }, null }, // testUNPAIRED_END_UNCERTAINTY: End location is significant and uncertain, end not sorted @@ -248,7 +248,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(194, 12, null, false, null, null), new TestRecordInfo(184, 12, null, true, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "UNPAIRED_END_UNCERTAINTY=10" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_UNPAIRED_END_UNCERTAINTY=10" }, null }, // testUNPAIRED_END_UNCERTAINTY: End location is significant and uncertain, end not sorted, multiple non-dup @@ -259,7 +259,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(294, 12, null, false, null, null), new TestRecordInfo(184, 12, null, false, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=true", "UNPAIRED_END_UNCERTAINTY=10" }, null + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=true", "FLOW_UNPAIRED_END_UNCERTAINTY=10" }, null }, // Barcode { @@ -268,7 +268,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(76, 12, null, false, null, null), new TestRecordInfo(74, 12, null, true, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=false", "BARCODE_TAG=BC" }, + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=false", "BARCODE_TAG=BC" }, new TesterModifier() { @Override public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) { @@ -285,7 +285,7 @@ public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) new TestRecordInfo(76, 12, null, false, null, null), new TestRecordInfo(74, 12, null, false, null, null) }, - new String[] { "USE_END_IN_UNPAIRED_READS=false", "BARCODE_TAG=BC" }, + new String[] { "FLOW_USE_END_IN_UNPAIRED_READS=false", "BARCODE_TAG=BC" }, new TesterModifier() { @Override public void modify(final AbstractMarkDuplicatesCommandLineProgramTester tester) {