Package ubic.basecode.math.linearmodels
Class MeanVarianceEstimator
java.lang.Object
ubic.basecode.math.linearmodels.MeanVarianceEstimator
Estimate mean-variance relationship and use this to compute weights for least squares fitting. R's limma.voom()
Charity Law and Gordon Smyth. See Law et al.
Running voom() on data matrices with NaNs is not currently supported.
- Author:
- ptan
-
Constructor Summary
ConstructorsConstructorDescriptionGeneric method for calculating mean and variance, as a data diagnostic.MeanVarianceEstimator
(DesignMatrix designMatrix, DoubleMatrix2D data, DoubleMatrix1D librarySize) Executes voom() to calculate weights.MeanVarianceEstimator
(DesignMatrix designMatrix, DoubleMatrix<String, String> data, DoubleMatrix1D librarySize) Preferred interface if you want control over how the design is set up. -
Method Summary
-
Constructor Details
-
MeanVarianceEstimator
public MeanVarianceEstimator(DesignMatrix designMatrix, DoubleMatrix<String, String> data, DoubleMatrix1D librarySize) Preferred interface if you want control over how the design is set up. Executes voom() to calculate weights.- Parameters:
designMatrix
-data
- expected to be log2cpm, and already filteredlibrarySize
- library size (matrix column sum)
-
MeanVarianceEstimator
public MeanVarianceEstimator(DesignMatrix designMatrix, DoubleMatrix2D data, DoubleMatrix1D librarySize) Executes voom() to calculate weights.- Parameters:
designMatrix
-data
- a normalized count matrixlibrarySize
- library size (matrix column sum)
-
MeanVarianceEstimator
Generic method for calculating mean and variance, as a data diagnostic.voom() is not executed and therefore no weights are calculated.
- Parameters:
data
- data to be processed
-
-
Method Details
-
getLibrarySize
- Returns:
- total library size
-
getLoess
- Returns:
- the loess fit of the mean-variance relationship
-
getMeanVariance
- Returns:
- the mean and variance of the normalized data, columns 0 and 1 respectively
-
getNormalizedValue
- Returns:
- data, as supplied (should be log2cpm)
-
getWeights
- Returns:
- inverse variance weights if voom was applied
-
quarterRootVariance
-