Class SingleCellExpressionDataDoubleMatrix
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.SingleCellExpressionDataDoubleMatrix
-
- All Implemented Interfaces:
ExpressionDataMatrix<Double>
,ExpressionDataPrimitiveDoubleMatrix
,SingleCellExpressionDataMatrix<Double>
public class SingleCellExpressionDataDoubleMatrix extends Object implements SingleCellExpressionDataMatrix<Double>, ExpressionDataPrimitiveDoubleMatrix
- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description SingleCellExpressionDataDoubleMatrix(Collection<SingleCellExpressionDataVector> vectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
columns()
Obtain the total number of columns.Double
get(int row, int column)
Access a single value of the matrix by row and column.double
getAsDouble(int row, int column)
Retrieve the value at the given row and column without boxing.BioAssay
getBioAssayForColumn(int j)
Obtain a bioassay applicable to a given column.List<BioAssay>
getBioAssays()
Obtain the list of bioassays.String
getCellIdForColumn(int j)
Obtain the cell ID of a given column.List<String>
getCellIds()
Note: cell IDs are only unique within a given assayDouble[]
getColumn(int column)
Access a single column of the matrix.double[]
getColumnAsDoubles(int column)
Retrieve the given column without boxing.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.no.uib.cipr.matrix.sparse.CompRowMatrix
getMatrix()
Obtain the sparse matrix underlying this.QuantitationType
getQuantitationType()
Return the quantitation type for this matrix.Double[]
getRow(int index)
Access a single row of the matrix, by index.Double[]
getRow(CompositeSequence designElement)
Return a row that 'came from' the given design element.double[]
getRowAsDoubles(int index)
Retrieve a row without boxing.double[]
getRowAsDoubles(CompositeSequence designElement)
Retrieve the row for the given design element without boxing.ExpressionDataMatrixRowElement
getRowElement(int row)
ExpressionDataMatrixRowElement
getRowElement(CompositeSequence designElement)
List<ExpressionDataMatrixRowElement>
getRowElements()
int
getRowIndex(CompositeSequence designElement)
SingleCellDimension
getSingleCellDimension()
Return the single-cell dimension for this matrix.int
rows()
-
-
-
Constructor Detail
-
SingleCellExpressionDataDoubleMatrix
public SingleCellExpressionDataDoubleMatrix(Collection<SingleCellExpressionDataVector> vectors)
-
-
Method Detail
-
getMatrix
public no.uib.cipr.matrix.sparse.CompRowMatrix getMatrix()
Obtain the sparse matrix underlying this.
-
getExpressionExperiment
public ExpressionExperiment getExpressionExperiment()
Description copied from interface:ExpressionDataMatrix
Return the expression experiment this matrix is holding data for.- Specified by:
getExpressionExperiment
in interfaceExpressionDataMatrix<Double>
-
columns
public int columns()
Description copied from interface:ExpressionDataMatrix
Obtain the total number of columns.- Specified by:
columns
in interfaceExpressionDataMatrix<Double>
-
get
public Double get(int row, int column)
Description copied from interface:ExpressionDataMatrix
Access a single value of the matrix by row and column.- Specified by:
get
in interfaceExpressionDataMatrix<Double>
-
getAsDouble
public double getAsDouble(int row, int column)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrix
Retrieve the value at the given row and column without boxing.- Specified by:
getAsDouble
in interfaceExpressionDataPrimitiveDoubleMatrix
- See Also:
ExpressionDataMatrix.get(int, int)
-
getColumn
public Double[] getColumn(int column)
Description copied from interface:SingleCellExpressionDataMatrix
Access a single column of the matrix.Important note: Retrieving a column is a
O(n log m)
operation wheren
is the number of vectors andm
is the number of cells. Always favour row-oriented operations when possible.- Specified by:
getColumn
in interfaceExpressionDataMatrix<Double>
- Specified by:
getColumn
in interfaceSingleCellExpressionDataMatrix<Double>
- Parameters:
column
- index- Returns:
- T[]
-
getColumnAsDoubles
public double[] getColumnAsDoubles(int column)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrix
Retrieve the given column without boxing.- Specified by:
getColumnAsDoubles
in interfaceExpressionDataPrimitiveDoubleMatrix
- See Also:
ExpressionDataMatrix.getColumn(int)
-
getBioAssays
public List<BioAssay> getBioAssays()
Description copied from interface:SingleCellExpressionDataMatrix
Obtain the list of bioassays.- Specified by:
getBioAssays
in interfaceSingleCellExpressionDataMatrix<Double>
-
getBioAssayForColumn
public BioAssay getBioAssayForColumn(int j)
Description copied from interface:SingleCellExpressionDataMatrix
Obtain a bioassay applicable to a given column.- Specified by:
getBioAssayForColumn
in interfaceSingleCellExpressionDataMatrix<Double>
-
getCellIds
public List<String> getCellIds()
Description copied from interface:SingleCellExpressionDataMatrix
Note: cell IDs are only unique within a given assay- Specified by:
getCellIds
in interfaceSingleCellExpressionDataMatrix<Double>
-
getCellIdForColumn
public String getCellIdForColumn(int j)
Description copied from interface:SingleCellExpressionDataMatrix
Obtain the cell ID of a given column.- Specified by:
getCellIdForColumn
in interfaceSingleCellExpressionDataMatrix<Double>
-
getDesignElements
public List<CompositeSequence> getDesignElements()
Description copied from interface:ExpressionDataMatrix
Obtain all the design elements in this data matrix.- Specified by:
getDesignElements
in interfaceExpressionDataMatrix<Double>
-
getDesignElementForRow
public CompositeSequence getDesignElementForRow(int index)
Description copied from interface:ExpressionDataMatrix
Return a design element for a given index.- Specified by:
getDesignElementForRow
in interfaceExpressionDataMatrix<Double>
-
getRow
public Double[] getRow(CompositeSequence designElement)
Description copied from interface:ExpressionDataMatrix
Return a row that 'came from' the given design element.- Specified by:
getRow
in interfaceExpressionDataMatrix<Double>
- Parameters:
designElement
- de- Returns:
- the corresponding row or null if the design element is not found in the matrix
-
getRowAsDoubles
public double[] getRowAsDoubles(CompositeSequence designElement)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrix
Retrieve the row for the given design element without boxing.- Specified by:
getRowAsDoubles
in interfaceExpressionDataPrimitiveDoubleMatrix
- See Also:
ExpressionDataMatrix.getRow(CompositeSequence)
-
getRow
public Double[] getRow(int index)
Description copied from interface:ExpressionDataMatrix
Access a single row of the matrix, by index. A complete row is returned.- Specified by:
getRow
in interfaceExpressionDataMatrix<Double>
- Parameters:
index
- i- Returns:
- t[]
-
getRowAsDoubles
public double[] getRowAsDoubles(int index)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrix
Retrieve a row without boxing.- Specified by:
getRowAsDoubles
in interfaceExpressionDataPrimitiveDoubleMatrix
- See Also:
ExpressionDataMatrix.getRow(int)
-
getRowIndex
public int getRowIndex(CompositeSequence designElement)
- Specified by:
getRowIndex
in interfaceExpressionDataMatrix<Double>
- Returns:
- the index for the given design element, or -1 if not found
-
getRowElements
public List<ExpressionDataMatrixRowElement> getRowElements()
- Specified by:
getRowElements
in interfaceExpressionDataMatrix<Double>
- Returns:
- list of elements representing the row 'labels'.
-
getRowElement
public ExpressionDataMatrixRowElement getRowElement(int row)
- Specified by:
getRowElement
in interfaceExpressionDataMatrix<Double>
-
getRowElement
@Nullable public ExpressionDataMatrixRowElement getRowElement(CompositeSequence designElement)
- Specified by:
getRowElement
in interfaceExpressionDataMatrix<Double>
-
rows
public int rows()
- Specified by:
rows
in interfaceExpressionDataMatrix<Double>
- Returns:
- int
-
getQuantitationType
public QuantitationType getQuantitationType()
Description copied from interface:SingleCellExpressionDataMatrix
Return the quantitation type for this matrix.- Specified by:
getQuantitationType
in interfaceSingleCellExpressionDataMatrix<Double>
-
getSingleCellDimension
public SingleCellDimension getSingleCellDimension()
Description copied from interface:SingleCellExpressionDataMatrix
Return the single-cell dimension for this matrix.- Specified by:
getSingleCellDimension
in interfaceSingleCellExpressionDataMatrix<Double>
-
-