Skip to content

Commit

Permalink
SpermSeqMarkDuplicatesTest to demonstrate multiple reads overlapping …
Browse files Browse the repository at this point in the history
…a locus. (#411)
  • Loading branch information
jamesnemesh authored Apr 11, 2024
1 parent 053c8ba commit 2d509f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class SpermSeqMarkDuplicatesTest {


File INPUT = new File ("testdata/org/broadinstitute/spermseq/metrics/duplicates/test_sorted.bam");

File INPUT_SIMPLE= new File ("testdata/org/broadinstitute/spermseq/metrics/duplicates/test_overlap.bam");
@Test
// tests which reads are marked as duplicates by the read position strategy.
public void testDetectDuplicatesByReadPositionStrategy() throws IOException {
Expand Down Expand Up @@ -104,6 +104,29 @@ public void testMetrics () {

}

/**
* Test the simple case where the reads overlap.
*/
@Test
public void testSimpleOverlap () throws IOException {
// there should be no dupes in this file.
Set<String> dupes = new HashSet<String>();

SpermSeqMarkDuplicates d = new SpermSeqMarkDuplicates();
d.INPUT= Collections.singletonList(INPUT_SIMPLE);
d.OUTPUT=File.createTempFile("testDetectDuplicatesByReadPositionStrategy.", ".bam");
d.OUTPUT.deleteOnExit();
d.OUTPUT_STATS=File.createTempFile("testDetectDuplicatesByReadPositionStrategy.", ".pcr_duplicate_metrics");
d.OUTPUT_STATS.deleteOnExit();
Assert.assertEquals(0, d.doWork());

SamReader inputSam = SamReaderFactory.makeDefault().open(d.OUTPUT);
for (SAMRecord r: inputSam) {
boolean duplicateReadFlag = r.getDuplicateReadFlag();
Assert.assertFalse(duplicateReadFlag);
}
}



}
Binary file not shown.

0 comments on commit 2d509f9

Please sign in to comment.