Class AbstractBulkExpressionDataMatrix<T>
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix<T>
-
- ubic.gemma.core.datastructure.matrix.AbstractBulkExpressionDataMatrix<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
BulkExpressionDataMatrix<T>
,ExpressionDataMatrix<T>
- Direct Known Subclasses:
BulkExpressionDataDoubleMatrix
,BulkExpressionDataIntMatrix
,EmptyBulkExpressionDataMatrix
public abstract class AbstractBulkExpressionDataMatrix<T> extends AbstractExpressionDataMatrix<T> implements BulkExpressionDataMatrix<T>
Base class for bulk expression data matrices.If you need to handle multiple
BioAssay
perBioMaterial
, useAbstractMultiAssayExpressionDataMatrix
instead.- Author:
- poirigui
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBulkExpressionDataMatrix(List<? extends BulkExpressionDataVector> vectors)
protected
AbstractBulkExpressionDataMatrix(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, QuantitationType quantitationType, List<CompositeSequence> designElements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
columns()
Obtain the total number of columns.T
get(CompositeSequence designElement, BioAssay bioAssay)
Access a single value of the matrix.BioAssayDimension
getBioAssayDimension()
Obtain the dimension for the columns of this matrix.BioAssay
getBioAssayForColumn(int index)
Obtain an assay corresponding to a given column.BioMaterial
getBioMaterialForColumn(int index)
Obtain a biomaterial corresponding to a column.T[]
getColumn(BioAssay bioAssay)
Access a single column of the matrix.int
getColumnIndex(BioAssay bioAssay)
int
getColumnIndex(BioMaterial bioMaterial)
protected String
getColumnLabel(int j)
Obtain a label suitable for describing a column of the matrix.CompositeSequence
getDesignElementForRow(int index)
Return a design element for a given index.List<CompositeSequence>
getDesignElements()
Obtain all the design elements in this data matrix.ExpressionExperiment
getExpressionExperiment()
Return the expression experiment this matrix is holding data for, if known.QuantitationType
getQuantitationType()
Obtain the quantitation type for this matrix.T[]
getRow(CompositeSequence designElement)
Return a row that 'came from' the given design element.ExpressionDataMatrixRowElement
getRowElement(int row)
List<ExpressionDataMatrixRowElement>
getRowElements()
int
getRowIndex(CompositeSequence designElement)
int[]
getRowIndices(CompositeSequence designElement)
Obtain all the rows that correspond to the given design element, ornull
if the design element is not found.protected String
getRowLabel(int i)
Obtain a label suitable for describing a row of the matrix.int
rows()
-
Methods inherited from class ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix
format, format, format, formatRepresentation, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.datastructure.matrix.BulkExpressionDataMatrix
getRawMatrix, hasMissingValues
-
Methods inherited from interface ubic.gemma.core.datastructure.matrix.ExpressionDataMatrix
get, getColumn, getRow
-
-
-
-
Constructor Detail
-
AbstractBulkExpressionDataMatrix
protected AbstractBulkExpressionDataMatrix(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, QuantitationType quantitationType, List<CompositeSequence> designElements)
-
AbstractBulkExpressionDataMatrix
protected AbstractBulkExpressionDataMatrix(List<? extends BulkExpressionDataVector> vectors)
-
-
Method Detail
-
getExpressionExperiment
public ExpressionExperiment getExpressionExperiment()
Description copied from interface:ExpressionDataMatrix
Return the expression experiment this matrix is holding data for, if known.- Specified by:
getExpressionExperiment
in interfaceExpressionDataMatrix<T>
-
getQuantitationType
public QuantitationType getQuantitationType()
Description copied from interface:ExpressionDataMatrix
Obtain the quantitation type for this matrix.- Specified by:
getQuantitationType
in interfaceExpressionDataMatrix<T>
-
getBioAssayDimension
public BioAssayDimension getBioAssayDimension()
Description copied from interface:BulkExpressionDataMatrix
Obtain the dimension for the columns of this matrix.- Specified by:
getBioAssayDimension
in interfaceBulkExpressionDataMatrix<T>
-
columns
public int columns()
Description copied from interface:ExpressionDataMatrix
Obtain the total number of columns.- Specified by:
columns
in interfaceExpressionDataMatrix<T>
-
getColumn
public T[] getColumn(BioAssay bioAssay)
Description copied from interface:BulkExpressionDataMatrix
Access a single column of the matrix.- Specified by:
getColumn
in interfaceBulkExpressionDataMatrix<T>
- Returns:
- a vector for the given column, or null if the column is not present
-
getColumnIndex
public int getColumnIndex(BioAssay bioAssay)
- Specified by:
getColumnIndex
in interfaceBulkExpressionDataMatrix<T>
- Returns:
- the index of the column for the data for the bioAssay, or -1 if missing
-
getColumnIndex
public int getColumnIndex(BioMaterial bioMaterial)
- Specified by:
getColumnIndex
in interfaceBulkExpressionDataMatrix<T>
-
getBioAssayForColumn
public BioAssay getBioAssayForColumn(int index)
Description copied from interface:BulkExpressionDataMatrix
Obtain an assay corresponding to a given column.- Specified by:
getBioAssayForColumn
in interfaceBulkExpressionDataMatrix<T>
-
getBioMaterialForColumn
public BioMaterial getBioMaterialForColumn(int index)
Description copied from interface:BulkExpressionDataMatrix
Obtain a biomaterial corresponding to a column.- Specified by:
getBioMaterialForColumn
in interfaceBulkExpressionDataMatrix<T>
-
rows
public int rows()
- Specified by:
rows
in interfaceExpressionDataMatrix<T>
- Returns:
- int
-
getRow
public T[] getRow(CompositeSequence designElement)
Description copied from interface:ExpressionDataMatrix
Return a row that 'came from' the given design element.- Specified by:
getRow
in interfaceExpressionDataMatrix<T>
- Parameters:
designElement
- de- Returns:
- the corresponding row or null if the design element is not found in the matrix
-
getRowIndex
public int getRowIndex(CompositeSequence designElement)
- Specified by:
getRowIndex
in interfaceExpressionDataMatrix<T>
- Returns:
- the index for the given design element, or -1 if not found
-
getRowIndices
public int[] getRowIndices(CompositeSequence designElement)
Description copied from interface:ExpressionDataMatrix
Obtain all the rows that correspond to the given design element, ornull
if the design element is not found.- Specified by:
getRowIndices
in interfaceExpressionDataMatrix<T>
-
getDesignElements
public List<CompositeSequence> getDesignElements()
Description copied from interface:ExpressionDataMatrix
Obtain all the design elements in this data matrix.- Specified by:
getDesignElements
in interfaceExpressionDataMatrix<T>
-
getDesignElementForRow
public CompositeSequence getDesignElementForRow(int index)
Description copied from interface:ExpressionDataMatrix
Return a design element for a given index.- Specified by:
getDesignElementForRow
in interfaceExpressionDataMatrix<T>
-
get
public T get(CompositeSequence designElement, BioAssay bioAssay)
Description copied from interface:BulkExpressionDataMatrix
Access a single value of the matrix. Note that because there can be multiple bioassays per column and multiple design elements per row, it is possible for this method to retrieve a data that does not come from the bioassay and/or designelement arguments.- Specified by:
get
in interfaceBulkExpressionDataMatrix<T>
- Parameters:
designElement
- debioAssay
- ba- Returns:
- the value at the given design element and bioassay, or
null
if the value is missing
-
getRowElements
public List<ExpressionDataMatrixRowElement> getRowElements()
- Specified by:
getRowElements
in interfaceExpressionDataMatrix<T>
- Returns:
- list of elements representing the row 'labels'.
-
getRowElement
public ExpressionDataMatrixRowElement getRowElement(int row)
- Specified by:
getRowElement
in interfaceExpressionDataMatrix<T>
-
getRowLabel
protected String getRowLabel(int i)
Description copied from class:AbstractExpressionDataMatrix
Obtain a label suitable for describing a row of the matrix.- Specified by:
getRowLabel
in classAbstractExpressionDataMatrix<T>
-
getColumnLabel
protected String getColumnLabel(int j)
Description copied from class:AbstractExpressionDataMatrix
Obtain a label suitable for describing a column of the matrix.- Specified by:
getColumnLabel
in classAbstractExpressionDataMatrix<T>
-
-