Putative fix for BAQ array out of bounds
-- Old code required qual to be <64, which isn't strictly necessary. Now uses the Picard SAMUtils.MAX_PHRED_SCORE constant -- Unittest to enforce this behavior
This commit is contained in:
parent
ecc7f34774
commit
6592972f82
|
|
@ -152,7 +152,7 @@ public class BAQ {
|
|||
}
|
||||
}
|
||||
|
||||
private double calcEpsilon( byte ref, byte read, byte qualB ) {
|
||||
protected double calcEpsilon( byte ref, byte read, byte qualB ) {
|
||||
return EPSILONS[ref][read][qualB];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -172,6 +172,17 @@ public class BAQUnitTest extends BaseTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
public void testBAQQualRange() {
|
||||
BAQ baq = new BAQ(1e-3, 0.1, 7, (byte)4, false); // matches current samtools parameters
|
||||
final byte ref = (byte)'A';
|
||||
final byte alt = (byte)'A';
|
||||
|
||||
for ( int i = 0; i <= SAMUtils.MAX_PHRED_SCORE; i++ )
|
||||
Assert.assertTrue(baq.calcEpsilon( ref, alt, (byte)i) >= 0.0, "Failed to get baq epsilon range");
|
||||
}
|
||||
|
||||
|
||||
public void testBAQ(BAQTest test, boolean lookupWithFasta) {
|
||||
BAQ baqHMM = new BAQ(1e-3, 0.1, 7, (byte)4, false); // matches current samtools parameters
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue