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 201ba879127..c08483e6ddc 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);