use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method failsNOT_DUPLICATE.
@Test
public void failsNOT_DUPLICATE() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
read.setIsDuplicate(true);
Assert.assertFalse(NOT_DUPLICATE.test(read), read.toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testGoodCigars.
@Test(dataProvider = "goodCigars")
public void testGoodCigars(String cigarString) {
GATKRead read = ReadClipperTestUtils.makeReadFromCigar(cigarString);
Assert.assertTrue(GOOD_CIGAR.test(read), read.getCigar().toString());
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method simpleGoodRead.
private GATKRead simpleGoodRead(final SAMFileHeader header) {
final String cigarString = "101M";
final Cigar cigar = TextCigarCodec.decode(cigarString);
GATKRead read = createRead(header, cigar, 1, 0, 10);
read.setMappingQuality(50);
return read;
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method createRead.
/**
* Creates a read record.
*
* @param header header for the new record
* @param cigar the new record CIGAR.
* @param group the new record group index that must be in the range \
* [0,{@link #GROUP_COUNT})
* @param reference the reference sequence index (0-based)
* @param start the start position of the read alignment in the reference
* (1-based)
* @return never <code>null</code>
*/
private GATKRead createRead(final SAMFileHeader header, final Cigar cigar, final int group, final int reference, final int start) {
final GATKRead record = ArtificialReadUtils.createArtificialRead(header, cigar);
record.setPosition(header.getSequence(reference).getSequenceName(), start);
record.setReadGroup(header.getReadGroups().get(group).getReadGroupId());
return record;
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadFilterLibraryUnitTest method testProperlyPairedReadFilter.
@Test
public void testProperlyPairedReadFilter() {
final SAMFileHeader header = createHeaderWithReadGroups();
final GATKRead read = simpleGoodRead(header);
Assert.assertFalse(PROPERLY_PAIRED.test(read), "PROPERLY_PAIRED " + read.toString());
read.setIsPaired(true);
read.setIsProperlyPaired(true);
Assert.assertTrue(PROPERLY_PAIRED.test(read), "PROPERLY_PAIRED " + read.toString());
}
Aggregations