Source:
<code>static ReductionResult calculateReducedPanelAndPInverses(final ReadCountCollection logNormals, final OptionalInt requestedNumberOfEigenSamples, final Logger logger, final JavaSparkContext ctx) { if (ctx == null) { logger.warn("No Spark context provided, not going to use Spark..."); } final RealMatrix logNormalCounts = logNormals.counts(); final int numberOfCountColumns = logNormalCounts.getColumnDimension(); logger.info("Starting the SVD decomposition of the log-normal counts ..."); final long svdStartTime = System.currentTimeMillis(); final SVD logNormalsSVD = SVDFactory.createSVD(logNormals.counts(), ctx); final long svdEndTime = System.currentTimeMillis(); logger.info(String.format("Finished the SVD decomposition of the log-normal counts. Elapse of %d seconds", (svdEndTime - svdStartTime) / 1000)); final int numberOfEigenSamples = determineNumberOfEigenSamples(requestedNumberOfEigenSamples, numberOfCountColumns, logNormalsSVD, logger); logger.info(String.format("Including %d eigen samples in the reduced PoN", numberOfEigenSamples)); final RealMatrix logNormalsV = logNormalsSVD.getV(); final RealMatrix logNormalsEigenV = logNormalsV.getSubMatrix(0, numberOfCountColumns - 1, 0, numberOfEigenSamples - 1); final RealMatrix reducedCounts = logNormalCounts.multiply(logNormalsEigenV); final RealMatrix logNormalsPseudoInverse = logNormalsSVD.getPinv(); logger.info("Calculating the reduced PoN inverse matrix..."); final long riStartTime = System.currentTimeMillis(); <START> final RealMatrix reducedCountsInverse = SVDFactory.createSVD(reducedCounts, ctx).getPinv(); <END> final long riEndTime = System.currentTimeMillis(); logger.info(String.format("Finished calculating the reduced PoN inverse matrix. Elapse of %d seconds", (riEndTime - riStartTime) / 1000)); return new ReductionResult(logNormalsPseudoInverse, reducedCounts, reducedCountsInverse, logNormalsSVD.getSingularValues()); }</code><technical_language>Rename reducedCountsPseudoInverse</technical_language>

Target:
static ReductionResult calculateReducedPanelAndPInverses(final ReadCountCollection logNormals, final OptionalInt requestedNumberOfEigenSamples, final Logger logger, final JavaSparkContext ctx) { if (ctx == null) { logger.warn("No Spark context provided, not going to use Spark..."); } final RealMatrix logNormalCounts = logNormals.counts(); final int numberOfCountColumns = logNormalCounts.getColumnDimension(); logger.info("Starting the SVD decomposition of the log-normal counts ..."); final long svdStartTime = System.currentTimeMillis(); final SVD logNormalsSVD = SVDFactory.createSVD(logNormals.counts(), ctx); final long svdEndTime = System.currentTimeMillis(); logger.info(String.format("Finished the SVD decomposition of the log-normal counts. Elapse of %d seconds", (svdEndTime - svdStartTime) / 1000)); final int numberOfEigenSamples = determineNumberOfEigenSamples(requestedNumberOfEigenSamples, numberOfCountColumns, logNormalsSVD, logger); logger.info(String.format("Including %d eigen samples in the reduced PoN", numberOfEigenSamples)); final double[] singularValues = logNormalsSVD.getSingularValues(); final RealMatrix reducedCounts = logNormalsSVD.getU().getSubMatrix(0, logNormalCounts.getRowDimension()-1, 0, numberOfEigenSamples - 1).copy(); reducedCounts.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int row, final int column, final double value) { return singularValues[column]*value; } }); final RealMatrix logNormalsPseudoInverse = logNormalsSVD.getPinv(); logger.info("Calculating the reduced PoN inverse matrix..."); final long riStartTime = System.currentTimeMillis(); final RealMatrix reducedCountsPseudoInverse = SVDFactory.createSVD(reducedCounts, ctx).getPinv(); final long riEndTime = System.currentTimeMillis(); logger.info(String.format("Finished calculating the reduced PoN inverse matrix. Elapse of %d seconds", (riEndTime - riStartTime) / 1000)); return new ReductionResult(logNormalsPseudoInverse, reducedCounts, reducedCountsPseudoInverse, logNormalsSVD.getSingularValues()); }