use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testSingleReadGroupFilter.
@Test
public void testSingleReadGroupFilter() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
final String fred = "fred";
ReadGroupReadFilter f = new ReadGroupReadFilter();
f.readGroup = "";
read.setReadGroup(fred);
//fail
Assert.assertFalse(f.test(read), read.toString());
f.readGroup = fred;
//pass
Assert.assertTrue(f.test(read), read.toString());
f.readGroup = fred;
read.setReadGroup(fred + "suffix");
//fail - exact matching
Assert.assertFalse(f.test(read), read.toString());
f.readGroup = fred;
read.setReadGroup(fred.toUpperCase());
//fail - case sensitive matching
Assert.assertFalse(f.test(read), read.toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class MetricsReadFilterUnitTest method canRestrictToAlignedReadsOnly.
@Test
public void canRestrictToAlignedReadsOnly() {
final GATKRead alignedRead = when(mock(GATKRead.class).isUnmapped()).thenReturn(false).getMock();
final GATKRead unalignedRead = when(mock(GATKRead.class).isUnmapped()).thenReturn(true).getMock();
assertTrue(this.alignedOnlyFilter.test(alignedRead), this.alignedOnlyFilter.toString());
assertFalse(this.alignedOnlyFilter.test(unalignedRead), this.alignedOnlyFilter.toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class MetricsReadFilterUnitTest method blocksSupplementaryAlignmentReads.
@Test
public void blocksSupplementaryAlignmentReads() {
final GATKRead supplementaryAlignedRead = when(mock(GATKRead.class).isSupplementaryAlignment()).thenReturn(true).getMock();
this.alwaysBlocks(supplementaryAlignedRead);
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class MetricsReadFilterUnitTest method canRestrictToBothAlignedAndPfReads.
@Test
public void canRestrictToBothAlignedAndPfReads() {
final GATKRead alignedAndPfRead = mock(GATKRead.class);
when(alignedAndPfRead.isUnmapped()).thenReturn(false);
when(alignedAndPfRead.failsVendorQualityCheck()).thenReturn(false);
assertTrue(this.pfAndAlignedOnlyFilter.test(alignedAndPfRead));
final GATKRead alignedButNotPfRead = mock(GATKRead.class);
when(alignedButNotPfRead.isUnmapped()).thenReturn(false);
when(alignedButNotPfRead.failsVendorQualityCheck()).thenReturn(true);
assertFalse(this.pfAndAlignedOnlyFilter.test(alignedButNotPfRead));
final GATKRead pfButUnalignedRead = mock(GATKRead.class);
when(pfButUnalignedRead.failsVendorQualityCheck()).thenReturn(false);
when(pfButUnalignedRead.isUnmapped()).thenReturn(true);
assertFalse(this.pfAndAlignedOnlyFilter.test(pfButUnalignedRead));
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class MetricsReadFilterUnitTest method canRestrictToPfReadsOnly.
@Test
public void canRestrictToPfReadsOnly() {
final GATKRead pfRead = when(mock(GATKRead.class).failsVendorQualityCheck()).thenReturn(false).getMock();
final GATKRead nonPfRead = when(mock(GATKRead.class).failsVendorQualityCheck()).thenReturn(true).getMock();
assertTrue(this.pfOnlyFilter.test(pfRead), this.pfOnlyFilter.toString());
assertFalse(this.pfOnlyFilter.test(nonPfRead), this.pfOnlyFilter.toString());
}
Aggregations