Class ExpressionDataDoubleMatrix
java.lang.Object
ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix<Double>
ubic.gemma.core.datastructure.matrix.AbstractMultiAssayExpressionDataMatrix<Double>
ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix
- All Implemented Interfaces:
BulkExpressionDataMatrix<Double>,BulkExpressionDataPrimitiveDoubleMatrix,ExpressionDataMatrix<Double>,ExpressionDataPrimitiveDoubleMatrix,MultiAssayBulkExpressionDataMatrix<Double>,SingleCellDerivedBulkExpressionDataMatrix<Double>
public class ExpressionDataDoubleMatrix
extends AbstractMultiAssayExpressionDataMatrix<Double>
implements BulkExpressionDataPrimitiveDoubleMatrix, SingleCellDerivedBulkExpressionDataMatrix<Double>
A data structure that holds a reference to the data for a given expression experiment. The data can be queried by row
or column, returning data for a specific DesignElement or data for a specific BioAssay. This class is not database
aware so the vectors provided must already be 'thawed'.
- Author:
- pavlidis, keshav
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionDataDoubleMatrix(ExpressionDataDoubleMatrix sourceMatrix, int[][] numberOfCells) ExpressionDataDoubleMatrix(ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> vectors) ExpressionDataDoubleMatrix(ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> dataVectors, Collection<QuantitationType> quantitationTypes) ExpressionDataDoubleMatrix(ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> dataVectors, QuantitationType quantitationType) ExpressionDataDoubleMatrix(ExpressionExperiment ee, DoubleMatrix<CompositeSequence, BioMaterial> dataMatrix, QuantitationType qt) Create a matrix given a 'raw' matrix that uses the same samples as the experiment. -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringformat(int row, int column) Format the value at the provided indices of the matrix.get(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.Double[]getColumn(int index) Access a single column of the matrix.double[]getColumnAsDoubles(int index) Retrieve the given column without boxing.double[]getColumnAsDoubles(BioAssay bioAssay) Retrieve the given column without boxing.int[][]getNumberOfCells(int row, int column) int[]getNumberOfCellsForColumn(int column) int[]getNumberOfCellsForColumn(BioMaterial bioMaterial) int[]getNumberOfCellsForRow(int row) int[]getNumberOfCellsForRow(CompositeSequence designElement) Double[][]Access the entire matrix.double[][]Obtain the raw matrix without boxing.Double[]getRow(int index) Access a single row of the matrix, by index.double[]getRowAsDoubles(int index) Retrieve a row without boxing.double[]getRowAsDoubles(CompositeSequence designElement) Retrieve the row for the given design element without boxing.booleanvoidDeprecated.modifying the matrix directly is not recommended, make a copy instead.voidset(CompositeSequence designElement, BioAssay bioAssay, Double value) Deprecated.sliceColumns(List<BioMaterial> bioMaterials) Slice the requested samples (columns) from this matrix.sliceColumns(List<BioMaterial> bioMaterials, BioAssayDimension reorderedDim) Slice the requested samples (columns) from this matrix.sliceRows(List<CompositeSequence> designElements) Slice the given design elements (rows) from the matrix.Create a copy of this matrix with the given data matrix.withMatrix(DoubleMatrix<CompositeSequence, BioMaterial> matrix, Map<QuantitationType, QuantitationType> quantitationTypes) Create a copy of this matrix with the given data matrix and quantitation types.withNumberOfCells(int[][] numberOfCells) Methods inherited from class ubic.gemma.core.datastructure.matrix.AbstractMultiAssayExpressionDataMatrix
addToRowMaps, addToRowMaps, columns, columns, formatRepresentation, get, getBestBioAssayDimension, getBioAssayDimension, getBioAssayDimension, getBioAssayDimensions, getBioAssayForColumn, getBioAssaysForColumn, getBioMaterialForColumn, getBioMaterials, getColumn, getColumnIndex, getColumnIndex, getColumnLabel, getDesignElementForRow, getDesignElements, getExpressionExperiment, getQuantitationType, getQuantitationType, getQuantitationTypes, getRow, getRowElement, getRowElements, getRowIndex, getRowIndices, getRowLabel, rows, selectVectors, selectVectors, selectVectors, selectVectors, setUpColumnElements, setUpColumnElementsMethods inherited from class ubic.gemma.core.datastructure.matrix.AbstractExpressionDataMatrix
format, format, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ubic.gemma.core.datastructure.matrix.BulkExpressionDataMatrix
get, getBioAssayForColumn, getBioMaterials, getColumn, getColumnIndexMethods inherited from interface ubic.gemma.core.datastructure.matrix.ExpressionDataMatrix
columns, getDesignElementForRow, getDesignElements, getExpressionExperiment, getRow, getRowElement, getRowElements, getRowIndex, getRowIndices, rows
-
Constructor Details
-
ExpressionDataDoubleMatrix
public ExpressionDataDoubleMatrix(@Nullable ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> vectors) -
ExpressionDataDoubleMatrix
public ExpressionDataDoubleMatrix(ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> dataVectors, Collection<QuantitationType> quantitationTypes) -
ExpressionDataDoubleMatrix
public ExpressionDataDoubleMatrix(ExpressionExperiment ee, Collection<? extends BulkExpressionDataVector> dataVectors, QuantitationType quantitationType) -
ExpressionDataDoubleMatrix
public ExpressionDataDoubleMatrix(ExpressionExperiment ee, DoubleMatrix<CompositeSequence, BioMaterial> dataMatrix, QuantitationType qt) Create a matrix given a 'raw' matrix that uses the same samples as the experiment. Only simple situations are supported (one platform, not subsetting the dataset).- Parameters:
ee- to be associated with thisdataMatrix- with valid row and column elements, and the dataqt- to be associated with this
-
ExpressionDataDoubleMatrix
public ExpressionDataDoubleMatrix(ExpressionDataDoubleMatrix sourceMatrix, @Nullable int[][] numberOfCells)
-
-
Method Details
-
get
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:
-
getColumnAsDoubles
Description copied from interface:BulkExpressionDataPrimitiveDoubleMatrixRetrieve the given column without boxing.- Specified by:
getColumnAsDoublesin interfaceBulkExpressionDataPrimitiveDoubleMatrix- See Also:
-
getColumn
Description copied from interface:ExpressionDataMatrixAccess a single column of the matrix.- Specified by:
getColumnin interfaceExpressionDataMatrix<Double>- Parameters:
index- index- Returns:
- T[]
-
getColumnAsDoubles
public double[] getColumnAsDoubles(int index) Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve the given column without boxing.- Specified by:
getColumnAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
-
sliceColumns
Description copied from interface:BulkExpressionDataMatrixSlice the requested samples (columns) from this matrix.Dimensions will be altered to reflect only the selected samples.
- Specified by:
sliceColumnsin interfaceBulkExpressionDataMatrix<Double>- Parameters:
bioMaterials- samples to select from the matrix
-
sliceColumns
public ExpressionDataDoubleMatrix sliceColumns(List<BioMaterial> bioMaterials, BioAssayDimension reorderedDim) Description copied from interface:BulkExpressionDataMatrixSlice the requested samples (columns) from this matrix.This also allows specifying a new dimension for the columns that will be used for every design element (rows).
- Specified by:
sliceColumnsin interfaceBulkExpressionDataMatrix<Double>- Parameters:
bioMaterials- samples to select from the matrixreorderedDim- the dimension to use
-
getRawMatrix
Description copied from interface:BulkExpressionDataMatrixAccess the entire matrix.- Specified by:
getRawMatrixin interfaceBulkExpressionDataMatrix<Double>- Returns:
- T[][]
-
getRawMatrixAsDoubles
public double[][] getRawMatrixAsDoubles()Obtain the raw matrix without boxing.- Specified by:
getRawMatrixAsDoublesin interfaceBulkExpressionDataPrimitiveDoubleMatrix- See Also:
-
getRowAsDoubles
Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve the row for the given design element without boxing.- Specified by:
getRowAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
-
getRow
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[]
-
sliceRows
Description copied from interface:ExpressionDataMatrixSlice the given design elements (rows) from the matrix.- Specified by:
sliceRowsin interfaceExpressionDataMatrix<Double>
-
getRowAsDoubles
public double[] getRowAsDoubles(int index) Description copied from interface:ExpressionDataPrimitiveDoubleMatrixRetrieve a row without boxing.- Specified by:
getRowAsDoublesin interfaceExpressionDataPrimitiveDoubleMatrix- See Also:
-
hasMissingValues
public boolean hasMissingValues()- Specified by:
hasMissingValuesin interfaceBulkExpressionDataMatrix<Double>- Returns:
- true if any values are null or NaN (for doubles and floats); any other value that is considered missing.
-
set
Deprecated.modifying the matrix directly is not recommended, make a copy instead. -
getMatrix
-
withMatrix
Create a copy of this matrix with the given data matrix. -
withMatrix
public ExpressionDataDoubleMatrix withMatrix(DoubleMatrix<CompositeSequence, BioMaterial> matrix, Map<QuantitationType, QuantitationType> quantitationTypes) Create a copy of this matrix with the given data matrix and quantitation types.Use this if the matrix and quantitation types are both changing (i.e. normalizing resulting in the
flag to be altered -
getNumberOfCells
- Specified by:
getNumberOfCellsin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
getNumberOfCells
- Specified by:
getNumberOfCellsin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
getNumberOfCellsForColumn
- Specified by:
getNumberOfCellsForColumnin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
getNumberOfCellsForColumn
- Specified by:
getNumberOfCellsForColumnin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
getNumberOfCellsForRow
- Specified by:
getNumberOfCellsForRowin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
getNumberOfCellsForRow
- Specified by:
getNumberOfCellsForRowin interfaceSingleCellDerivedBulkExpressionDataMatrix<Double>
-
withNumberOfCells
-
getRanksByMean
- Returns:
- The expression level ranks (based on mean signal intensity in the vectors)
-
getRowNames
-
set
Deprecated. -
format
Description copied from class:AbstractMultiAssayExpressionDataMatrixFormat the value at the provided indices of the matrix.- Specified by:
formatin classAbstractMultiAssayExpressionDataMatrix<Double>
-