@Test(expectedExceptions = IllegalStateException.class) public void testStrandlessReadsFailSetStrand() { final byte[] bases = {'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'}; final byte[] quals = {20, 20, 20, 20, 20, 20, 20, 20}; GATKSAMRecord read = ArtificialSAMUtils.createArtificialRead(bases, quals, "6M"); read.setIsStrandless(true); read.setReadNegativeStrandFlag(true); }
@Test public void testStrandlessReads() { final byte[] bases = {'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'}; final byte[] quals = {20, 20, 20, 20, 20, 20, 20, 20}; GATKSAMRecord read = ArtificialSAMUtils.createArtificialRead(bases, quals, "6M"); Assert.assertEquals(read.isStrandless(), false); read.setReadNegativeStrandFlag(false); Assert.assertEquals(read.isStrandless(), false); Assert.assertEquals(read.getReadNegativeStrandFlag(), false); read.setReadNegativeStrandFlag(true); Assert.assertEquals(read.isStrandless(), false); Assert.assertEquals(read.getReadNegativeStrandFlag(), true); read.setReadNegativeStrandFlag(true); read.setIsStrandless(true); Assert.assertEquals(read.isStrandless(), true); Assert.assertEquals( read.getReadNegativeStrandFlag(), false, "negative strand flag should return false even through its set for a strandless read"); }