Class LinearModelAnalyzer
- java.lang.Object
-
- ubic.gemma.core.analysis.expression.diff.AbstractAnalyzer
-
- ubic.gemma.core.analysis.expression.diff.AbstractDifferentialExpressionAnalyzer
-
- ubic.gemma.core.analysis.expression.diff.LinearModelAnalyzer
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,DiffExAnalyzer
@Component @Scope("prototype") public class LinearModelAnalyzer extends AbstractDifferentialExpressionAnalyzer implements org.springframework.beans.factory.DisposableBean
Handles fitting linear models with continuous or fixed-level covariates. Data are always log-transformed. Interactions can be included if a DifferentialExpressionAnalysisConfig is passed as an argument to 'run'. Currently we only support interactions if there are two factors in the model (no more). One factor can be constant (the same value for all samples); such a factor will be analyzed by looking at the intercept in the fitted model. This is only appropriate for 'non-reference' designs on ratiometric arrays. This also supports subsetting the data based on a factor. For example, a data set with "tissue" as a factor could be analyzed per-tissue rather than with tissue as a covariate. This only handles the analysis, not the persistence or output of the results.- Author:
- paul
-
-
Field Summary
-
Fields inherited from class ubic.gemma.core.analysis.expression.diff.AbstractAnalyzer
compositeSequenceService, expressionDataMatrixService
-
-
Constructor Summary
Constructors Constructor Description LinearModelAnalyzer()
-
Method Summary
-
Methods inherited from class ubic.gemma.core.analysis.expression.diff.AbstractAnalyzer
setExpressionDataMatrixService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.analysis.expression.diff.DiffExAnalyzer
setExpressionDataMatrixService
-
-
-
-
Method Detail
-
populateFactorValuesFromBASet
public static void populateFactorValuesFromBASet(BioAssaySet ee, ExperimentalFactor f, Collection<FactorValue> fvs)
-
makeDataMatrix
public static DoubleMatrix<String,String> makeDataMatrix(ObjectMatrix<String,String,Object> designMatrix, DoubleMatrix<CompositeSequence,BioMaterial> namedMatrix)
Convert the data into a string-keyed matrix. Assumes that the row names of the designMatrix are concordant with the column names of the namedMatrix
-
createBADMap
public static BioAssayDimension createBADMap(List<BioMaterial> columnsToUse)
This bioAssayDimension shouldn't get persisted; it is only for dealing with subset diff ex. analyses.- Parameters:
columnsToUse
- columns to use- Returns:
- bio assay dimension
-
destroy
public void destroy() throws Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
determineInterceptFactor
public ExperimentalFactor determineInterceptFactor(Collection<ExperimentalFactor> factors, QuantitationType quantitationType)
Determine if any factor should be treated as the intercept term.- Specified by:
determineInterceptFactor
in interfaceDiffExAnalyzer
-
computeHitListSizes
public Set<HitListSize> computeHitListSizes(Collection<DifferentialExpressionAnalysisResult> results, Map<CompositeSequence,Collection<Gene>> probeToGeneMap)
Description copied from interface:DiffExAnalyzer
Generate HitListSize entities that will be stored to count the number of diff. ex probes at various preset thresholds, to avoid wasting time generating these counts on the fly later. This is done automatically during analysis, so is just here to allow 'backfilling'.- Specified by:
computeHitListSizes
in interfaceDiffExAnalyzer
- Parameters:
results
- resultsprobeToGeneMap
- map- Returns:
- hit list sizes
-
getNumberOfGenesTested
public int getNumberOfGenesTested(Collection<DifferentialExpressionAnalysisResult> resultList, Map<CompositeSequence,Collection<Gene>> probeToGeneMap)
Description copied from interface:DiffExAnalyzer
Utility method- Specified by:
getNumberOfGenesTested
in interfaceDiffExAnalyzer
- Parameters:
resultList
- result listprobeToGeneMap
- map- Returns:
- number of genes tested
-
run
public DifferentialExpressionAnalysis run(ExpressionExperimentSubSet subset, DifferentialExpressionAnalysisConfig config)
Description copied from interface:DiffExAnalyzer
Note that normally when we run a subset analysis, the subsetting is done internally, so we pass in the expression experiment, not the subset. This method is used for exceptions to that.- Specified by:
run
in interfaceDiffExAnalyzer
- Parameters:
subset
- subsetconfig
- config- Returns:
- analysis
-
run
public Collection<DifferentialExpressionAnalysis> run(ExpressionExperiment expressionExperiment, DifferentialExpressionAnalysisConfig config)
- Specified by:
run
in interfaceDiffExAnalyzer
- Specified by:
run
in classAbstractDifferentialExpressionAnalyzer
- Parameters:
expressionExperiment
- the experimentconfig
- config- Returns:
- analyses. There will be more than one if a subset factor is defined.
-
run
public Collection<DifferentialExpressionAnalysis> run(ExpressionExperiment expressionExperiment, ExpressionDataDoubleMatrix dmatrix, DifferentialExpressionAnalysisConfig config)
Description copied from interface:DiffExAnalyzer
Allows entry of modified data matrices into the workflow.- Specified by:
run
in interfaceDiffExAnalyzer
- Specified by:
run
in classAbstractDifferentialExpressionAnalyzer
- Parameters:
expressionExperiment
- the experimentdmatrix
- D matrixconfig
- config- Returns:
- analyses
-
-