Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkDuplicates flow options now start with FLOW_ #1976

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
{
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
Loading