Class QuantileNormalizeInPlaceTest

java.lang.Object
ubic.gemma.core.analysis.preprocess.QuantileNormalizeInPlaceTest

public class QuantileNormalizeInPlaceTest extends Object
QuantileNormalizer.normalizeInPlace(double[][], boolean[]) must give exactly the values of QuantileNormalizer.normalize(DoubleMatrix, boolean[]), with and without reference columns and with missing values.

Exactly means bit for bit: the arrays are compared with Arrays.deepEquals(Object[], Object[]), which compares doubles as Double.equals(Object), so a NaN must be a NaN, and -0.0 and 0.0 are different values. The in-place implementation performs the same floating-point operations in the same order as the matrix one, so there is no tolerance to justify.

  • Constructor Details

    • QuantileNormalizeInPlaceTest

      public QuantileNormalizeInPlaceTest()
  • Method Details

    • matchesTheMatrixNormalizerOnTheFixture

      @Test public void matchesTheMatrixNormalizerOnTheFixture() throws Exception
      Throws:
      Exception
    • matchesTheMatrixNormalizerOnTheFixtureWithReferenceColumns

      @Test public void matchesTheMatrixNormalizerOnTheFixtureWithReferenceColumns() throws Exception
      Throws:
      Exception
    • matchesTheMatrixNormalizerOnTheFixtureWithMaskedOutliersAndMissingValues

      @Test public void matchesTheMatrixNormalizerOnTheFixtureWithMaskedOutliersAndMissingValues() throws Exception
      The outlier case the processed-vector pipeline produces: the outlier columns are masked (all NaN) and excluded from the reference, other cells are missing here and there, and one row has no value at all.
      Throws:
      Exception
    • restoresMissingValuesAfterImputingThemForTheRanking

      @Test public void restoresMissingValuesAfterImputingThemForTheRanking()
    • leavesRowsWithNoValueUntouched

      @Test public void leavesRowsWithNoValueUntouched()
      The matrix path drops a row with no value from its result, and the caller used to leave such a vector as it was. The in-place path must not touch it either.
    • matchesTheMatrixNormalizerOnSignedZeros

      @Test public void matchesTheMatrixNormalizerOnSignedZeros()
      Master's version of this test pinned a divergence on columns mixing -0.0 and 0.0, which came from sorting with Arrays.sort(double[]) (which orders -0.0 first) rather than with colt's sort. Sorting the same way as the matrix path removes it.
    • matchesTheMatrixNormalizerOnRandomInputs

      @Test public void matchesTheMatrixNormalizerOnRandomInputs()
      Many small matrices of varied shape, tie density, missing-value density and reference subsets, including masked columns, rows with no value and signed zeros.
    • rejectsTheSameReferenceColumnsAsTheMatrixNormalizer

      @Test public void rejectsTheSameReferenceColumnsAsTheMatrixNormalizer()