Class EmptySubSetIsSkippedTest

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.analysis.expression.diff.EmptySubSetIsSkippedTest

@ContextConfiguration public class EmptySubSetIsSkippedTest extends BaseTest5
An arm of the subset factor that no analyzed sample carries is skipped, not a fatal condition for the experiment.

Why an arm can be empty

makeSubSetMatrices partitions samplesUsed, which is what survived filtering and QC — not the samples assigned to the factor value. So a factor value several samples carry can still partition to nothing. GSE74998 (eid 34217) aborted on exactly that: IllegalArgumentException: The subset was empty for fv: ... Category=cell type Value=embryonic stem cell.

Two things made -ignoreFailingSubsets unable to help, and the second is the one that decides where the fix goes: the exception was outside the AnalysisException hierarchy the per-subset catch matches, and it was raised from matrix construction, which runs BEFORE the guarded loop. The empty arm therefore has to be dropped while the matrices are built.

Author:
paul
  • Constructor Details

    • EmptySubSetIsSkippedTest

      public EmptySubSetIsSkippedTest()
  • Method Details

    • testAnEmptyArmDoesNotAbortTheExperiment

      @Test public void testAnEmptyArmDoesNotAbortTheExperiment()
      The rule, on the path production took. The empty arm is skipped and the two populated arms are analyzed — and it holds with -ignoreFailingSubsets unset, because an arm with no samples is an absence of data to analyze rather than an analysis that failed.
    • testAnEmptyArmWithAStoredSubsetIsSkipped

      @Test public void testAnEmptyArmWithAStoredSubsetIsSkipped()
      The other entry point, run(ee, subsets, dmatrix, config), is handed subsets that already exist rather than deriving them from the matrices — AnalysisSelectionAndExecutionService reuses stored ones. The stored subset for the empty arm still lists its samples, so this map and the map of matrices disagree, and the loop has to skip the arm it has no matrix for.