Class TwoChannelExpressionDataMatrixBuilder
java.lang.Object
ubic.gemma.core.datastructure.matrix.TwoChannelExpressionDataMatrixBuilder
Utility methods for taking an ExpressionExperiment and returning various types of ExpressionDataMatrices, such as the
processed data, preferred data, background, etc. This class is not database aware; use the
ExpressionDataMatrixService to get ready-to-use matrices starting from an ExpressionExperiment.
This handles complexities such as experiments that contain multiple array designs with differing quantitation types.
- Author:
- pavlidis
-
Constructor Summary
ConstructorsConstructorDescriptionTwoChannelExpressionDataMatrixBuilder(Collection<? extends BulkExpressionDataVector> vectors) TwoChannelExpressionDataMatrixBuilder(Collection<ProcessedExpressionDataVector> processedVectors, Collection<? extends BulkExpressionDataVector> otherVectors) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd two matrices.static Collection<QuantitationType> getMissingValueQuantitationTypes(ExpressionExperiment expressionExperiment) intstatic Collection<QuantitationType> getPreferredAndMissingQuantitationTypes(ExpressionExperiment expressionExperiment) static Collection<QuantitationType> getPreferredQuantitationTypes(ExpressionExperiment expressionExperiment) static Collection<QuantitationType> getUsefulQuantitationTypes(Collection<QuantitationType> eeQtTypes) static Collection<QuantitationType> getUsefulQuantitationTypes(ExpressionExperiment expressionExperiment) booleanstatic voidLog-transform the values in the matrix (base 2).voidscalarDivideMatrix(ExpressionDataDoubleMatrix matrix, double dividend) Divide all values by the dividend
-
Constructor Details
-
TwoChannelExpressionDataMatrixBuilder
public TwoChannelExpressionDataMatrixBuilder(Collection<? extends BulkExpressionDataVector> vectors) - Parameters:
vectors- collection of vectors. They should be thawed first.
-
TwoChannelExpressionDataMatrixBuilder
public TwoChannelExpressionDataMatrixBuilder(Collection<ProcessedExpressionDataVector> processedVectors, Collection<? extends BulkExpressionDataVector> otherVectors)
-
-
Method Details
-
getMissingValueQuantitationTypes
public static Collection<QuantitationType> getMissingValueQuantitationTypes(ExpressionExperiment expressionExperiment) - Parameters:
expressionExperiment- (should be lightly thawed)- Returns:
- a collection of QTs
-
getPreferredAndMissingQuantitationTypes
public static Collection<QuantitationType> getPreferredAndMissingQuantitationTypes(ExpressionExperiment expressionExperiment) -
getPreferredQuantitationTypes
public static Collection<QuantitationType> getPreferredQuantitationTypes(ExpressionExperiment expressionExperiment) -
getUsefulQuantitationTypes
public static Collection<QuantitationType> getUsefulQuantitationTypes(Collection<QuantitationType> eeQtTypes) - Parameters:
eeQtTypes- the QTs- Returns:
- just the quantitation types that are likely to be 'useful': Preferred, present/absent, signals and background from both channels (if present).
-
getUsefulQuantitationTypes
public static Collection<QuantitationType> getUsefulQuantitationTypes(ExpressionExperiment expressionExperiment) - Parameters:
expressionExperiment- the EE to get the QTs for- Returns:
- just the quantitation types that are likely to be 'useful': Preferred, present/absent, signals and background from both channels (if present).
-
getBackgroundChannelA
-
getBackgroundChannelB
-
getBioAssayDimensions
-
getBkgSubChannelA
-
getExpressionExperiment
-
getIntensity
- Returns:
- Compute an intensity matrix. For two-channel arrays, this is the geometric mean of the background-subtracted signals on the two channels. For two-color arrays, if one channel is missing (as happens sometimes) the intensities returned are just from the one channel. For one-color arrays, this is the same as the preferred data matrix.
-
getMissingValueData
- Returns:
- a matrix of booleans, or null if a missing value quantitation type ("absent/present", which may have been computed by our system) is not found. This will return the values whether the array design is two-color or not.
-
getNumMissingValues
-
getPreferredData
- Returns:
- The matrix for the preferred data - NOT the processed data (though they may be the same, in fact)
-
getPreferredQTypes
-
getProcessedData
-
getRanksByMean
-
getSignalChannelA
-
getSignalChannelB
-
isAnyMissing
public boolean isAnyMissing() -
logTransformMatrix
Log-transform the values in the matrix (base 2). Non-positive values (which have no logarithm defined) are entered as NaN.- Parameters:
matrix- matrix
-
addMatrices
Add two matrices. Ideally, they matrices are conformant, but if they are not (as some rows are sometimes missing for some quantitation types), this method attempts to handle it anyway (see below). The rows and columns do not have to be in the same order, but they do have to have the same column keys and row keys (with the exception of missing rows). The result is stored in a. If the number of rows are not the same, and/or the rows have different keys in the two matrices, some rows will simply not get added and a warning will be issued.- Parameters:
a- matrix ab- matrix b- Throws:
IllegalArgumentException- if the matrices are not column-conformant.
-
scalarDivideMatrix
Divide all values by the dividend- Parameters:
matrix- matrixdividend- dividend- Throws:
IllegalArgumentException- if dividend == 0.
-