use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method VALID_ALIGNMENT_START_allows_unmapped_case1.
@Test
public void VALID_ALIGNMENT_START_allows_unmapped_case1() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
read.setIsUnmapped();
Assert.assertTrue(VALID_ALIGNMENT_START.test(read), "VALID_ALIGNMENT_START failed on an unmapped read");
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testReadCigarLengthMismatch.
@Test
public void testReadCigarLengthMismatch() {
GATKRead read = ReadClipperTestUtils.makeReadFromCigar("4M", 1);
Assert.assertFalse(READLENGTH_EQUALS_CIGARLENGTH.test(read), read.getCigar().toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testLibraryReadFilter.
@Test
public void testLibraryReadFilter() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
final LibraryReadFilter f = new LibraryReadFilter(header);
final String foo = "Foo";
header.getReadGroup(read.getReadGroup()).setLibrary(foo);
//fail
Assert.assertFalse(f.test(read), read.toString());
f.libraryToKeep = foo;
//pass
Assert.assertTrue(f.test(read), read.toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testReadStrandFilter.
@Test
public void testReadStrandFilter() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
ReadStrandFilter f = new ReadStrandFilter();
f.keepOnlyReverse = false;
read.setIsReverseStrand(false);
//pass
Assert.assertTrue(f.test(read), read.toString());
read.setIsReverseStrand(true);
//fail
Assert.assertFalse(f.test(read), read.toString());
f.keepOnlyReverse = true;
read.setIsReverseStrand(false);
//fail
Assert.assertFalse(f.test(read), read.toString());
read.setIsReverseStrand(true);
//pass
Assert.assertTrue(f.test(read), read.toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testMaxInsertSizeFilter.
@Test
public void testMaxInsertSizeFilter() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead pairedRead = simpleGoodRead(header);
final GATKRead unpairedRead = simpleGoodRead(header);
pairedRead.setIsPaired(true);
final FragmentLengthReadFilter f = new FragmentLengthReadFilter();
pairedRead.setFragmentLength(150);
unpairedRead.setFragmentLength(150);
f.maxFragmentLength = 180;
//pass
Assert.assertTrue(f.test(pairedRead), pairedRead.toString());
//pass
Assert.assertTrue(f.test(unpairedRead), pairedRead.toString());
f.maxFragmentLength = 90;
//fail
Assert.assertFalse(f.test(pairedRead), pairedRead.toString());
//pass
Assert.assertTrue(f.test(unpairedRead), pairedRead.toString());
pairedRead.setFragmentLength(-150);
f.maxFragmentLength = 180;
//pass
Assert.assertTrue(f.test(pairedRead), pairedRead.toString());
//pass
Assert.assertTrue(f.test(unpairedRead), pairedRead.toString());
f.maxFragmentLength = 90;
//fail
Assert.assertFalse(f.test(pairedRead), pairedRead.toString());
//pass
Assert.assertTrue(f.test(unpairedRead), pairedRead.toString());
}
Aggregations