From a04a51dc547213c7574b4ce27c42c36c7fe95f41 Mon Sep 17 00:00:00 2001 From: Samuel Lee Date: Fri, 15 Feb 2019 10:28:29 -0500 Subject: [PATCH] Added check to skip outlier truncation if number of matrix elements exceeds Integer.MAX_VALUE in CreateReadCountPanelOfNormals. (#4734) --- .../tools/copynumber/denoising/SVDDenoisingUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/copynumber/denoising/SVDDenoisingUtils.java b/src/main/java/org/broadinstitute/hellbender/tools/copynumber/denoising/SVDDenoisingUtils.java index 9ed4cd13814..2b858e5c5a6 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/copynumber/denoising/SVDDenoisingUtils.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/copynumber/denoising/SVDDenoisingUtils.java @@ -332,6 +332,8 @@ public double visit(int sampleIndex, int intervalIndex, double value) { if (extremeOutlierTruncationPercentile == 0.) { logger.info(String.format("A value of 0 was provided for argument %s, so the corresponding truncation step will be skipped...", CreateReadCountPanelOfNormals.EXTREME_OUTLIER_TRUNCATION_PERCENTILE_LONG_NAME)); + } else if ((long) preprocessedReadCounts.getRowDimension() * preprocessedReadCounts.getColumnDimension() > Integer.MAX_VALUE) { + logger.warn("The number of matrix elements exceeds Integer.MAX_VALUE, so outlier truncation will be skipped..."); } else { final double[] values = Doubles.concat(preprocessedReadCounts.getData()); final double minimumOutlierTruncationThreshold = new Percentile(extremeOutlierTruncationPercentile).evaluate(values);