BugFix: byte overflow in SyntheticRead compressed base counts
* fixed and added unit test
This commit is contained in:
parent
44554b2bfd
commit
5ad3dfcd62
|
|
@ -188,6 +188,10 @@ public class MathUtils {
|
||||||
return ! Double.isInfinite(val) && ! Double.isNaN(val);
|
return ! Double.isInfinite(val) && ! Double.isNaN(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static double bound(double value, double minBoundary, double maxBoundary) {
|
||||||
|
return Math.max(Math.min(value, maxBoundary), minBoundary);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isBounded(double val, double lower, double upper) {
|
public static boolean isBounded(double val, double lower, double upper) {
|
||||||
return val >= lower && val <= upper;
|
return val >= lower && val <= upper;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ public class ReadUtilsUnitTest extends BaseTest {
|
||||||
GATKSAMRecord read, reducedRead;
|
GATKSAMRecord read, reducedRead;
|
||||||
final static String BASES = "ACTG";
|
final static String BASES = "ACTG";
|
||||||
final static String QUALS = "!+5?";
|
final static String QUALS = "!+5?";
|
||||||
final private static byte[] REDUCED_READ_COUNTS = new byte[]{10, 20, 30, 40};
|
final private static byte[] REDUCED_READ_COUNTS = new byte[]{10, 20, 30, 40, 1};
|
||||||
final private static byte[] REDUCED_READ_COUNTS_TAG = new byte[]{10, 10, 20, 30}; // just the offsets
|
final private static byte[] REDUCED_READ_COUNTS_TAG = new byte[]{10, 10, 20, 30, -9}; // just the offsets
|
||||||
|
|
||||||
@BeforeTest
|
@BeforeTest
|
||||||
public void init() {
|
public void init() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue