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 intcolumns()Obtain the total number of columns.Doubleget(int row, int column)Access a single value of the matrix by row and column.doublegetAsDouble(int row, int column)Retrieve the value at the given row and column without boxing.BioAssaygetBioAssayForColumn(int j)Obtain a bioassay applicable to a given column.List<BioAssay>getBioAssays()Obtain the list of bioassays.StringgetCellIdForColumn(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.CompositeSequencegetDesignElementForRow(int index)Return a design element for a given index.List<CompositeSequence>getDesignElements()Obtain all the design elements in this data matrix.ExpressionExperimentgetExpressionExperiment()Return the expression experiment this matrix is holding data for.no.uib.cipr.matrix.sparse.CompRowMatrixgetMatrix()Obtain the sparse matrix underlying this.QuantitationTypegetQuantitationType()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.ExpressionDataMatrixRowElementgetRowElement(int row)ExpressionDataMatrixRowElementgetRowElement(CompositeSequence designElement)List<ExpressionDataMatrixRowElement>getRowElements()intgetRowIndex(CompositeSequence designElement)SingleCellDimensiongetSingleCellDimension()Return the single-cell dimension for this matrix.introws()
-
-
-
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:ExpressionDataMatrixReturn the expression experiment this matrix is holding data for.- Specified by:
getExpressionExperimentin interfaceExpressionDataMatrix<Double>
-
columns
public int columns()
Description copied from interface:ExpressionDataMatrixObtain the total number of columns.- Specified by:
columnsin interfaceExpressionDataMatrix<Double>
-
get
public Double get(int row, int column)
Description copied from interface:ExpressionDataMatrixAccess a single value of the matrix by row and column.- Specified by:
getin interfaceExpressionDataMatrix<Double>
-
getAsDouble
public double getAsDouble(int row, int column)Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve the value at the given row and column without boxing.- Specified by:
getAsDoublein interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
ExpressionDataMatrix.get(int, int)
-
getColumn
public Double[] getColumn(int column)
Description copied from interface:SingleCellExpressionDataMatrixAccess a single column of the matrix.Important note: Retrieving a column is a
O(n log m)operation wherenis the number of vectors andmis the number of cells. Always favour row-oriented operations when possible.- Specified by:
getColumnin interfaceExpressionDataMatrix<Double>- Specified by:
getColumnin interfaceSingleCellExpressionDataMatrix<Double>- Parameters:
column- index- Returns:
- T[]
-
getColumnAsDoubles
public double[] getColumnAsDoubles(int column)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve the given column without boxing.- Specified by:
getColumnAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
ExpressionDataMatrix.getColumn(int)
-
getBioAssays
public List<BioAssay> getBioAssays()
Description copied from interface:SingleCellExpressionDataMatrixObtain the list of bioassays.- Specified by:
getBioAssaysin interfaceSingleCellExpressionDataMatrix<Double>
-
getBioAssayForColumn
public BioAssay getBioAssayForColumn(int j)
Description copied from interface:SingleCellExpressionDataMatrixObtain a bioassay applicable to a given column.- Specified by:
getBioAssayForColumnin interfaceSingleCellExpressionDataMatrix<Double>
-
getCellIds
public List<String> getCellIds()
Description copied from interface:SingleCellExpressionDataMatrixNote: cell IDs are only unique within a given assay- Specified by:
getCellIdsin interfaceSingleCellExpressionDataMatrix<Double>
-
getCellIdForColumn
public String getCellIdForColumn(int j)
Description copied from interface:SingleCellExpressionDataMatrixObtain the cell ID of a given column.- Specified by:
getCellIdForColumnin interfaceSingleCellExpressionDataMatrix<Double>
-
getDesignElements
public List<CompositeSequence> getDesignElements()
Description copied from interface:ExpressionDataMatrixObtain all the design elements in this data matrix.- Specified by:
getDesignElementsin interfaceExpressionDataMatrix<Double>
-
getDesignElementForRow
public CompositeSequence getDesignElementForRow(int index)
Description copied from interface:ExpressionDataMatrixReturn a design element for a given index.- Specified by:
getDesignElementForRowin interfaceExpressionDataMatrix<Double>
-
getRow
public Double[] getRow(CompositeSequence designElement)
Description copied from interface:ExpressionDataMatrixReturn a row that 'came from' the given design element.- Specified by:
getRowin 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:ExpressionDataPrimitiveDoubleMatrixRetrieve the row for the given design element without boxing.- Specified by:
getRowAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
ExpressionDataMatrix.getRow(CompositeSequence)
-
getRow
public Double[] getRow(int index)
Description copied from interface:ExpressionDataMatrixAccess a single row of the matrix, by index. A complete row is returned.- Specified by:
getRowin interfaceExpressionDataMatrix<Double>- Parameters:
index- i- Returns:
- t[]
-
getRowAsDoubles
public double[] getRowAsDoubles(int index)
Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve a row without boxing.- Specified by:
getRowAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
ExpressionDataMatrix.getRow(int)
-
getRowIndex
public int getRowIndex(CompositeSequence designElement)
- Specified by:
getRowIndexin interfaceExpressionDataMatrix<Double>- Returns:
- the index for the given design element, or -1 if not found
-
getRowElements
public List<ExpressionDataMatrixRowElement> getRowElements()
- Specified by:
getRowElementsin interfaceExpressionDataMatrix<Double>- Returns:
- list of elements representing the row 'labels'.
-
getRowElement
public ExpressionDataMatrixRowElement getRowElement(int row)
- Specified by:
getRowElementin interfaceExpressionDataMatrix<Double>
-
getRowElement
@Nullable public ExpressionDataMatrixRowElement getRowElement(CompositeSequence designElement)
- Specified by:
getRowElementin interfaceExpressionDataMatrix<Double>
-
rows
public int rows()
- Specified by:
rowsin interfaceExpressionDataMatrix<Double>- Returns:
- int
-
getQuantitationType
public QuantitationType getQuantitationType()
Description copied from interface:SingleCellExpressionDataMatrixReturn the quantitation type for this matrix.- Specified by:
getQuantitationTypein interfaceSingleCellExpressionDataMatrix<Double>
-
getSingleCellDimension
public SingleCellDimension getSingleCellDimension()
Description copied from interface:SingleCellExpressionDataMatrixReturn the single-cell dimension for this matrix.- Specified by:
getSingleCellDimensionin interfaceSingleCellExpressionDataMatrix<Double>
-
-