Class SubsettedAnalysisFactorConsistencyTest

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

@ContextConfiguration public class SubsettedAnalysisFactorConsistencyTest extends BaseTest5
A subset analysis has to describe itself with the factors it actually modelled.

fixFactorsForSubset drops the factors a subset cannot model — a factor constant within that subset has no contrast to fit — and the design matrix is built from what it returns. Everything decided beside it has to read the same list: the config carries interactionsToInclude into buildModelFormula, so a config narrowed against the full factor list names an interaction whose factor has no column in the design matrix.

Author:
paul
  • Constructor Details

    • SubsettedAnalysisFactorConsistencyTest

      public SubsettedAnalysisFactorConsistencyTest()
  • Method Details

    • testASubsetThatCannotModelAFactorDoesNotCarryItsInteraction

      @Test public void testASubsetThatCannotModelAFactorDoesNotCarryItsInteraction()
      The rule. ct1 cannot model sex, so neither sex nor the treatment:sex interaction may appear in its analysis — the interaction reaches the model formula through the config, not through the factor list, so a config narrowed against the wrong list puts a term in the formula for a factor the design matrix does not have.
    • testTheSingleSubsetPathDropsAFactorWithMissingValues

      @Test public void testTheSingleSubsetPathDropsAFactorWithMissingValues()
      The single-subset overload, run(ExpressionExperimentSubSet, ...), is a separate path -- it is what a redo of one subset analysis takes -- and it drops incomplete factors itself. A factor some sample in the subset carries no value for cannot be modelled even though it is not constant, so it must not reach the model or the analysis's own record of itself.
    • testTheSingleSubsetPathKeepsACompleteFactor

      @Test public void testTheSingleSubsetPathKeepsACompleteFactor()
      Positive control for the single-subset path, off the same fixture: with nothing missing, ct1 models both factors and keeps the interaction, so an analysis that simply modelled less cannot pass the test above.
    • testASubsetThatCanModelEveryFactorKeepsThemAll

      @Test public void testASubsetThatCanModelEveryFactorKeepsThemAll()
      The positive control on its own: with both subsets carrying both sexes, nothing is dropped anywhere and both analyses keep the interaction. Pins that the rule above narrows only the subset that needs narrowing.