Class MatrixNormalizer<R,C>

java.lang.Object
ubic.gemma.core.util.math.MatrixNormalizer<R,C>

public class MatrixNormalizer<R,C> extends Object
Author:
paul
  • Constructor Details

    • MatrixNormalizer

      public MatrixNormalizer()
  • Method Details

    • quantileNormalize

      public DoubleMatrix<R,C> quantileNormalize(DoubleMatrix<R,C> matrix)
      Rows with all missing will not be returned. Otherwise, missing values are imputed, used for estimating quantiles, and then replaced with missing values at the end.

      Note that the Bioconductor implementation deals with missing values differently, and in a much more complex way. Therefore this gives different answers in the missing value case from Bioconductor (normalize.quantiles).

      Parameters:
      matrix -
      Returns:
    • quantileNormalize

      public DoubleMatrix<R,C> quantileNormalize(DoubleMatrix<R,C> matrix, @Nullable boolean[] includeInReference)
      Quantile-normalize, optionally computing the reference distribution from a subset of the columns.

      Every column is still mapped onto the reference -- the excluded ones are placed on the same scale as the rest, they just do not get a say in what that scale is.

      🛑 Excluding a column is NOT the same as it being missing. imputeMissing(DoubleMatrix) fills a missing cell with its ROW MEAN, so a column of all-NaN becomes a synthetic average sample and still contributes to the reference -- pulling it toward the centre. That is what an outlier-masked column does today. Passing the outlier columns here instead keeps them out of the reference, which is what masking was meant to achieve.

      Parameters:
      includeInReference - one flag per column, true to let it define the reference distribution; null means every column contributes, which is the historical behaviour