Class DifferentialExpressionAnalysisConfig
- Author:
- keshav
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault value for whether moderated test statistics should be used. -
Constructor Summary
ConstructorsConstructorDescriptionCopy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFactorsToInclude(Collection<ExperimentalFactor> factors) voidaddInteractionsToInclude(Collection<Collection<ExperimentalFactor>> interactions) voidAdd an interaction of two factors to include in the analysis.protected booleanbooleanType of analysis to perform.Factors whose levels are blocking terms (e.g.How each categorical factor's levels are coded in the design matrix, which decides what its coefficients mean.getContrastCoding(ExperimentalFactor factor) How the given factor's levels are coded;ContrastCoding.TREATMENTunless set.longMaximum time to spend on the analysis, in milliseconds.Override the minimum number of unique values (as a fraction of the number of assays) for a particular design element to be included in the analysis.Override the minimum number of cells for a particular gene to be included in the analysis.Override the minimum number of cells for a particular sample to be included in the analysis.Override the minimum number of samples to apply the repetitive value filter.Override the minimum variance for a particular design element to be included in the analysis.Override the default mode of operation for theRepetitiveValuesFilter.Factor to subset the analysis on, if non-null.If this is non-null, this is a subset analysis for this factor value.inthashCode()booleanAfter the new analyses are saved, delete the experiment's other analyses on the same subset factor: without a subset factor, every other analysis that is not a subset analysis; with one, every other analysis of that factor's subsets.booleanFit the blocking factor as a random intercept (mixed model) instead of fixed-effect columns: the inter-block correlation is estimated from the data (limmaduplicateCorrelation) and the fit runs by GLS (limmagls.series).booleanKeep processing other subsets when encountering anAnalysisExceptionon a subset.booleanWhether to create archive files.booleanWhether moderated test statistics should be used.booleanIndicate if this analysis should be persisted.booleanSet true for RNA-seq data setsvoidsetAnalysisType(AnalysisType analysisType) Type of analysis to perform.voidsetBlockingFactors(Collection<ExperimentalFactor> factors) Mark factors as blocking terms (subjects of a paired design).voidsetContrastCoding(ExperimentalFactor factor, ContrastCoding coding) Choose how one factor's levels are coded.voidsetDeleteOtherAnalyses(boolean deleteOtherAnalyses) After the new analyses are saved, delete the experiment's other analyses on the same subset factor: without a subset factor, every other analysis that is not a subset analysis; with one, every other analysis of that factor's subsets.voidsetEstimateBlockingCorrelation(boolean estimateBlockingCorrelation) Fit the blocking factor as a random intercept (mixed model) instead of fixed-effect columns: the inter-block correlation is estimated from the data (limmaduplicateCorrelation) and the fit runs by GLS (limmagls.series).voidsetIgnoreFailingSubsets(boolean ignoreFailingSubsets) Keep processing other subsets when encountering anAnalysisExceptionon a subset.voidsetMakeArchiveFile(boolean makeArchiveFile) Whether to create archive files.voidsetMaxAnalysisTimeMillis(long maxAnalysisTimeMillis) Maximum time to spend on the analysis, in milliseconds.voidsetMinimumFractionOfUniqueValues(Double minimumFractionOfUniqueValues) Override the minimum number of unique values (as a fraction of the number of assays) for a particular design element to be included in the analysis.voidsetMinimumNumberOfCellsPerGene(Integer minimumNumberOfCellsPerGene) Override the minimum number of cells for a particular gene to be included in the analysis.voidsetMinimumNumberOfCellsPerSample(Integer minimumNumberOfCellsPerSample) Override the minimum number of cells for a particular sample to be included in the analysis.voidsetMinimumNumberOfSamplesToApplyRepetitiveValuesFilter(Integer minimumNumberOfSamplesToApplyRepetitiveValuesFilter) Override the minimum number of samples to apply the repetitive value filter.voidsetMinimumVariance(Double minimumVariance) Override the minimum variance for a particular design element to be included in the analysis.voidsetModerateStatistics(boolean moderateStatistics) Whether moderated test statistics should be used.voidsetPersist(boolean persist) Indicate if this analysis should be persisted.voidsetRepetitiveValuesFilterMode(DifferentialExpressionAnalysisFilter.RepetitiveValuesFilterMode repetitiveValuesFilterMode) Override the default mode of operation for theRepetitiveValuesFilter.voidsetSubsetFactor(ExperimentalFactor subsetFactor) Factor to subset the analysis on, if non-null.voidsetSubsetFactorValue(FactorValue subsetFactorValue) If this is non-null, this is a subset analysis for this factor value.voidsetUseWeights(boolean useWeights) Set true for RNA-seq data setstoString()
-
Field Details
-
DEFAULT_MODERATE_STATISTICS
public static final boolean DEFAULT_MODERATE_STATISTICSDefault value for whether moderated test statistics should be used.- See Also:
-
-
Constructor Details
-
DifferentialExpressionAnalysisConfig
public DifferentialExpressionAnalysisConfig() -
DifferentialExpressionAnalysisConfig
Copy constructor.
-
-
Method Details
-
setContrastCoding
Choose how one factor's levels are coded. Continuous factors have no levels and are rejected. -
getContrastCoding
How the given factor's levels are coded;ContrastCoding.TREATMENTunless set. -
addFactorsToInclude
-
setBlockingFactors
Mark factors as blocking terms (subjects of a paired design). Categorical factors only; each must also be infactorsToIncludeto reach the model. -
addInteractionToInclude
Add an interaction of two factors to include in the analysis.A blocking factor (a paired-design subject term) cannot take part: subject-by-treatment terms are exactly what a mixed model is for, and this analyzer does not support those. Model the treatment effect with the subject as a pure block instead.
-
addInteractionsToInclude
-
getAnalysisType
Type of analysis to perform. -
isModerateStatistics
public boolean isModerateStatistics()Whether moderated test statistics should be used.This is usually done with the empirical Bayes method.
-
getFactorsToInclude
-
getContrastCoding
How each categorical factor's levels are coded in the design matrix, which decides what its coefficients mean. A factor absent from this map isContrastCoding.TREATMENT.Per factor rather than per analysis because the two codings answer different questions and a single model can want both: a genotype factor with a wild-type control is read against that control, while a tissue factor in the same design has no control to be read against and wants
ContrastCoding.SUM_TO_ZERO, where every level is reported against the mean of the level means.- See Also:
-
getInteractionsToInclude
-
getBlockingFactors
Factors whose levels are blocking terms (e.g. subjects in a paired or repeated-measures design). Their columns stay in the design so every other factor's contrasts are adjusted for them, but the blocking factor itself gets no result set: the subject-to-subject differences are nuisance, not findings.Categorical factors only. The factor must still be in
factorsToInclude; a factor here but not there is ignored with a warning. Explicit config overrides any curator hint the factor carries, and no blocking factor is guessed automatically.- See Also:
-
isPersist
public boolean isPersist()Indicate if this analysis should be persisted. -
isDeleteOtherAnalyses
public boolean isDeleteOtherAnalyses()After the new analyses are saved, delete the experiment's other analyses on the same subset factor: without a subset factor, every other analysis that is not a subset analysis; with one, every other analysis of that factor's subsets.Only a fresh run honours this, and only when
persistis set. Nothing is deleted before the new analyses are saved, so a run that fails leaves the existing analyses in place. -
getSubsetFactor
Factor to subset the analysis on, if non-null. -
getSubsetFactorValue
If this is non-null, this is a subset analysis for this factor value.Only applicable for analysis on a
ExpressionExperimentSubSet. -
isIgnoreFailingSubsets
public boolean isIgnoreFailingSubsets()Keep processing other subsets when encountering anAnalysisExceptionon a subset.This is about carrying on when SOME subsets succeed. If no subset yields an analysis, an
AllSubSetAnalysesFailedExceptionis raised regardless of this setting — it carries whichever subset failures were collected, and a subset can also leave the loop skipped rather than failed (DE_Exclude, no samples left to analyze, or no factor the subset can model). -
isUseWeights
public boolean isUseWeights()Set true for RNA-seq data sets -
getMinimumNumberOfCellsPerSample
Override the minimum number of cells for a particular sample to be included in the analysis.This is only applied if
ExpressionDataDoubleMatrix.getNumberOfCells()orBioAssay.getNumberOfCells()is populated. Note that theBioAssay-level number of cells is only considered for preferred QTs.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_CELLS_PER_SAMPLE. -
getMinimumNumberOfCellsPerGene
Override the minimum number of cells for a particular gene to be included in the analysis.This is only applied if
ExpressionDataDoubleMatrix.getNumberOfCells()is populated.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_CELLS_PER_GENE. -
getRepetitiveValuesFilterMode
@Nullable public DifferentialExpressionAnalysisFilter.RepetitiveValuesFilterMode getRepetitiveValuesFilterMode()Override the default mode of operation for theRepetitiveValuesFilter.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_REPETITIVE_VALUES_FILTER_MODE -
getMinimumNumberOfSamplesToApplyRepetitiveValuesFilter
Override the minimum number of samples to apply the repetitive value filter.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_SAMPLES_TO_APPLY_REPETITIVE_VALUES_FILTER -
getMinimumFractionOfUniqueValues
Override the minimum number of unique values (as a fraction of the number of assays) for a particular design element to be included in the analysis.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_FRACTION_OF_UNIQUE_VALUES. -
getMinimumVariance
Override the minimum variance for a particular design element to be included in the analysis.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_VARIANCE. -
isMakeArchiveFile
public boolean isMakeArchiveFile()Whether to create archive files. -
getMaxAnalysisTimeMillis
public long getMaxAnalysisTimeMillis()Maximum time to spend on the analysis, in milliseconds. Ignored if zero or less. -
isEstimateBlockingCorrelation
public boolean isEstimateBlockingCorrelation()Fit the blocking factor as a random intercept (mixed model) instead of fixed-effect columns: the inter-block correlation is estimated from the data (limmaduplicateCorrelation) and the fit runs by GLS (limmagls.series). The blocking factor then has NO columns in the design -- it lives in the correlation structure -- so its factor values are only used to assign samples to blocks.Requires
blockingFactorsto be non-empty and the data to be complete and unweighted: the per-observation gls.series branch (voom weights + correlation, or missing values + correlation) is not ported yet and the analyzer rejects the combination. Consensus correlation only (limma's default), not per-probe correlations. -
setAnalysisType
Type of analysis to perform. -
setModerateStatistics
public void setModerateStatistics(boolean moderateStatistics) Whether moderated test statistics should be used.This is usually done with the empirical Bayes method.
-
setPersist
public void setPersist(boolean persist) Indicate if this analysis should be persisted. -
setDeleteOtherAnalyses
public void setDeleteOtherAnalyses(boolean deleteOtherAnalyses) After the new analyses are saved, delete the experiment's other analyses on the same subset factor: without a subset factor, every other analysis that is not a subset analysis; with one, every other analysis of that factor's subsets.Only a fresh run honours this, and only when
persistis set. Nothing is deleted before the new analyses are saved, so a run that fails leaves the existing analyses in place. -
setSubsetFactor
Factor to subset the analysis on, if non-null. -
setSubsetFactorValue
If this is non-null, this is a subset analysis for this factor value.Only applicable for analysis on a
ExpressionExperimentSubSet. -
setIgnoreFailingSubsets
public void setIgnoreFailingSubsets(boolean ignoreFailingSubsets) Keep processing other subsets when encountering anAnalysisExceptionon a subset.This is about carrying on when SOME subsets succeed. If no subset yields an analysis, an
AllSubSetAnalysesFailedExceptionis raised regardless of this setting — it carries whichever subset failures were collected, and a subset can also leave the loop skipped rather than failed (DE_Exclude, no samples left to analyze, or no factor the subset can model). -
setUseWeights
public void setUseWeights(boolean useWeights) Set true for RNA-seq data sets -
setMinimumNumberOfCellsPerSample
Override the minimum number of cells for a particular sample to be included in the analysis.This is only applied if
ExpressionDataDoubleMatrix.getNumberOfCells()orBioAssay.getNumberOfCells()is populated. Note that theBioAssay-level number of cells is only considered for preferred QTs.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_CELLS_PER_SAMPLE. -
setMinimumNumberOfCellsPerGene
Override the minimum number of cells for a particular gene to be included in the analysis.This is only applied if
ExpressionDataDoubleMatrix.getNumberOfCells()is populated.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_CELLS_PER_GENE. -
setRepetitiveValuesFilterMode
public void setRepetitiveValuesFilterMode(@Nullable DifferentialExpressionAnalysisFilter.RepetitiveValuesFilterMode repetitiveValuesFilterMode) Override the default mode of operation for theRepetitiveValuesFilter.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_REPETITIVE_VALUES_FILTER_MODE -
setMinimumNumberOfSamplesToApplyRepetitiveValuesFilter
public void setMinimumNumberOfSamplesToApplyRepetitiveValuesFilter(@Nullable Integer minimumNumberOfSamplesToApplyRepetitiveValuesFilter) Override the minimum number of samples to apply the repetitive value filter.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_NUMBER_OF_SAMPLES_TO_APPLY_REPETITIVE_VALUES_FILTER -
setMinimumFractionOfUniqueValues
Override the minimum number of unique values (as a fraction of the number of assays) for a particular design element to be included in the analysis.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_FRACTION_OF_UNIQUE_VALUES. -
setMinimumVariance
Override the minimum variance for a particular design element to be included in the analysis.Defaults to
DifferentialExpressionAnalysisFilter.DEFAULT_MINIMUM_VARIANCE. -
setMakeArchiveFile
public void setMakeArchiveFile(boolean makeArchiveFile) Whether to create archive files. -
setMaxAnalysisTimeMillis
public void setMaxAnalysisTimeMillis(long maxAnalysisTimeMillis) Maximum time to spend on the analysis, in milliseconds. Ignored if zero or less. -
setEstimateBlockingCorrelation
public void setEstimateBlockingCorrelation(boolean estimateBlockingCorrelation) Fit the blocking factor as a random intercept (mixed model) instead of fixed-effect columns: the inter-block correlation is estimated from the data (limmaduplicateCorrelation) and the fit runs by GLS (limmagls.series). The blocking factor then has NO columns in the design -- it lives in the correlation structure -- so its factor values are only used to assign samples to blocks.Requires
blockingFactorsto be non-empty and the data to be complete and unweighted: the per-observation gls.series branch (voom weights + correlation, or missing values + correlation) is not ported yet and the analyzer rejects the combination. Consensus correlation only (limma's default), not per-probe correlations. -
equals
-
canEqual
-
hashCode
-
toString
-