Class MaskedExpressionDataMatrix<T>
java.lang.Object
ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix<T>
ubic.gemma.core.datastructure.matrix.MaskedExpressionDataMatrix<T>
- Type Parameters:
T- the type of data in the matrix
- All Implemented Interfaces:
ExpressionDataMatrix<T>
public class MaskedExpressionDataMatrix<T>
extends AbstractExpressionDataMatrix<T>
implements ExpressionDataMatrix<T>
A wrapper for an
ExpressionDataMatrix that applies a mask to the data, allowing selective access to the
underlying matrix.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintcolumns()Obtain the total number of columns.protected Stringformat(int row, int column) Format a matrix entry at a particular row/column.get(int row, int column) Access a single value of the matrix by row and column.T[]getColumn(int column) Access a single column of the matrix.protected StringgetColumnLabel(int j) Obtain a label suitable for describing a column of the matrix.getDesignElementForRow(int index) Return a design element for a given index.Obtain all the design elements in this data matrix.Return the expression experiment this matrix is holding data for, if known.Obtain the quantitation type for this matrix.T[]getRow(int index) Access a single row of the matrix, by index.T[]getRow(CompositeSequence designElement) Return a row that 'came from' the given design element.getRowElement(int row) Deprecated.Deprecated.intgetRowIndex(CompositeSequence designElement) int[]getRowIndices(CompositeSequence designElement) Obtain all the rows that correspond to the given design element, ornullif the design element is not found.protected StringgetRowLabel(int i) Obtain a label suitable for describing a row of the matrix.inverted()static <T> MaskedExpressionDataMatrix<T> maskColumns(ExpressionDataMatrix<T> matrix, boolean[] columnMask, T maskedValue) Mask whole columns of the given matrix.static <T> MaskedExpressionDataMatrix<T> maskElements(ExpressionDataMatrix<T> matrix, boolean[][] mask, T maskedValue) Mask individual elements of the given matrix.static <T> MaskedExpressionDataMatrix<T> maskElements(ExpressionDataMatrix<T> matrix, int[] i, int[] j, T maskedValue) Mask individual elements of the given matrix at the specified coordinates.static <T> MaskedExpressionDataMatrix<T> maskRows(ExpressionDataMatrix<T> matrix, boolean[] rowMask, T maskedValue) Mask whole rows of the given matrix.introws()sliceRows(List<CompositeSequence> designElements) Methods inherited from class ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix
format, format, formatRepresentation, toString
-
Method Details
-
maskElements
public static <T> MaskedExpressionDataMatrix<T> maskElements(ExpressionDataMatrix<T> matrix, boolean[][] mask, @Nullable T maskedValue) Mask individual elements of the given matrix.- Parameters:
maskedValue- value to use for masked elements, usuallynull- See Also:
-
maskElements
public static <T> MaskedExpressionDataMatrix<T> maskElements(ExpressionDataMatrix<T> matrix, int[] i, int[] j, @Nullable T maskedValue) Mask individual elements of the given matrix at the specified coordinates.This uses a sparse representation internally, which is more efficient for large matrices with few masked elements.
- See Also:
-
maskRows
public static <T> MaskedExpressionDataMatrix<T> maskRows(ExpressionDataMatrix<T> matrix, boolean[] rowMask, @Nullable T maskedValue) Mask whole rows of the given matrix.- See Also:
-
maskColumns
public static <T> MaskedExpressionDataMatrix<T> maskColumns(ExpressionDataMatrix<T> matrix, boolean[] columnMask, @Nullable T maskedValue) Mask whole columns of the given matrix.- See Also:
-
getExpressionExperiment
Description copied from interface:ExpressionDataMatrixReturn the expression experiment this matrix is holding data for, if known.- Specified by:
getExpressionExperimentin interfaceExpressionDataMatrix<T>
-
getQuantitationType
Description copied from interface:ExpressionDataMatrixObtain the quantitation type for this matrix.- Specified by:
getQuantitationTypein interfaceExpressionDataMatrix<T>
-
getDesignElements
Description copied from interface:ExpressionDataMatrixObtain all the design elements in this data matrix.- Specified by:
getDesignElementsin interfaceExpressionDataMatrix<T>
-
getDesignElementForRow
Description copied from interface:ExpressionDataMatrixReturn a design element for a given index.- Specified by:
getDesignElementForRowin interfaceExpressionDataMatrix<T>
-
columns
public int columns()Description copied from interface:ExpressionDataMatrixObtain the total number of columns.- Specified by:
columnsin interfaceExpressionDataMatrix<T>
-
getColumn
Description copied from interface:ExpressionDataMatrixAccess a single column of the matrix.- Specified by:
getColumnin interfaceExpressionDataMatrix<T>- Parameters:
column- index- Returns:
- T[]
-
rows
public int rows()- Specified by:
rowsin interfaceExpressionDataMatrix<T>- Returns:
- int
-
getRow
Description copied from interface:ExpressionDataMatrixAccess a single row of the matrix, by index. A complete row is returned.- Specified by:
getRowin interfaceExpressionDataMatrix<T>- Parameters:
index- i- Returns:
- t[]
-
getRow
Description copied from interface:ExpressionDataMatrixReturn a row that 'came from' the given design element.- Specified by:
getRowin interfaceExpressionDataMatrix<T>- Parameters:
designElement- de- Returns:
- the corresponding row or null if the design element is not found in the matrix
-
getRowIndex
- Specified by:
getRowIndexin interfaceExpressionDataMatrix<T>- Returns:
- the index for the given design element, or -1 if not found
-
getRowIndices
Description copied from interface:ExpressionDataMatrixObtain all the rows that correspond to the given design element, ornullif the design element is not found.- Specified by:
getRowIndicesin interfaceExpressionDataMatrix<T>
-
sliceRows
- Specified by:
sliceRowsin interfaceExpressionDataMatrix<T>
-
getRowElements
Deprecated.- Specified by:
getRowElementsin interfaceExpressionDataMatrix<T>- Returns:
- list of elements representing the row 'labels'.
-
getRowElement
Deprecated.- Specified by:
getRowElementin interfaceExpressionDataMatrix<T>
-
get
Description copied from interface:ExpressionDataMatrixAccess a single value of the matrix by row and column.- Specified by:
getin interfaceExpressionDataMatrix<T>
-
inverted
-
getRowLabel
Description copied from class:AbstractExpressionDataMatrixObtain a label suitable for describing a row of the matrix.- Specified by:
getRowLabelin classAbstractExpressionDataMatrix<T>
-
getColumnLabel
Description copied from class:AbstractExpressionDataMatrixObtain a label suitable for describing a column of the matrix.- Specified by:
getColumnLabelin classAbstractExpressionDataMatrix<T>
-
format
Description copied from class:AbstractExpressionDataMatrixFormat a matrix entry at a particular row/column.- Specified by:
formatin classAbstractExpressionDataMatrix<T>
-