From ab140e28264490db11e517fb2e699771f87ec4cd Mon Sep 17 00:00:00 2001 From: Mark Fleharty Date: Mon, 30 Sep 2019 13:57:56 -0400 Subject: [PATCH] Fixing up tests in MarkDuplicates so that tests with duplex UMIs are handled properly (#1404) * Fixing up tests in MarkDuplicates so that tests with duplex UMIs are handled properly. --- .../MarkDuplicateWithMissingBarcodeTest.java | 11 ++++++++++- .../picard/sam/markduplicates/MarkDuplicatesTest.java | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/test/java/picard/sam/markduplicates/MarkDuplicateWithMissingBarcodeTest.java b/src/test/java/picard/sam/markduplicates/MarkDuplicateWithMissingBarcodeTest.java index ea01e04bb6..e9b989b438 100644 --- a/src/test/java/picard/sam/markduplicates/MarkDuplicateWithMissingBarcodeTest.java +++ b/src/test/java/picard/sam/markduplicates/MarkDuplicateWithMissingBarcodeTest.java @@ -19,13 +19,22 @@ private class MarkDuplicatesWithMissingBarcodesTester extends MarkDuplicatesTest @Override public void runTest() { boolean hasRX = false; + boolean isDuplex = false; for (final String argument : this.getArgs()) { if (argument.startsWith(getArgumentName())) { hasRX = true; break; } + if (argument.startsWith("DUPLEX_UMI")) { + isDuplex = true; + break; + } + } + + // Tests that specify the RX tag, or the DUPLEX_UMI argument should not be used with missing barcodes. + if (!hasRX && !isDuplex) { + addArg(getArgumentName() + "=" + getTagValue()); } - if (!hasRX) addArg(getArgumentName() + "=" + getTagValue()); super.runTest(); } diff --git a/src/test/java/picard/sam/markduplicates/MarkDuplicatesTest.java b/src/test/java/picard/sam/markduplicates/MarkDuplicatesTest.java index 868a264069..f12654b587 100644 --- a/src/test/java/picard/sam/markduplicates/MarkDuplicatesTest.java +++ b/src/test/java/picard/sam/markduplicates/MarkDuplicatesTest.java @@ -311,7 +311,7 @@ public void testWithIndividualReadBarcodes() { } @DataProvider(name = "testDuplexUmiDataProvider") - private Object[][] testDuplexUmiDataProvider() { + public Object[][] testDuplexUmiDataProvider() { return new Object[][]{ { // Test case where UMIs are not duplex, but are the same. @@ -358,7 +358,7 @@ private Object[][] testDuplexUmiDataProvider() { }; } - @Test(dataProvider = "testDuplexUmiDataProvider",enabled = false) + @Test(dataProvider = "testDuplexUmiDataProvider") public void testWithUMIs(final boolean duplexUmi, final List UMIs, final List alignmentStart1, final List alignmentStart2, final List isDuplicate, final List isFirstNegativeStrand, final List isSecondNegativeStrand) {