Class ExpressionDataDoubleMatrix

  • All Implemented Interfaces:
    Serializable, ExpressionDataMatrix<Double>

    public class ExpressionDataDoubleMatrix
    extends BaseExpressionDataMatrix<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
    See Also:
    Serialized Form
    • Constructor Detail

      • ExpressionDataDoubleMatrix

        public ExpressionDataDoubleMatrix()
        To comply with bean specifications. Not to be instantiated.
      • ExpressionDataDoubleMatrix

        public ExpressionDataDoubleMatrix​(ExpressionDataDoubleMatrix sourceMatrix,
                                          DoubleMatrix<CompositeSequence,​BioMaterial> dataMatrix,
                                          Collection<QuantitationType> quantitationTypes)
        Create a data matrix like sourceMatrix but use the values and quantitations from dataMatrix.

        Note: The rows can be different from the original matrix, but the columns must be the same.

        Parameters:
        sourceMatrix - source matrix from which most of the meta-data will be imported
        dataMatrix - data matrix to use
        quantitationTypes - quantitation types used by the dataMatrix
      • ExpressionDataDoubleMatrix

        public ExpressionDataDoubleMatrix​(ExpressionDataDoubleMatrix sourceMatrix,
                                          List<CompositeSequence> rowsToUse)
        Create a matrix based on another one's selected rows.
        Parameters:
        rowsToUse - rows
        sourceMatrix - matrix
      • ExpressionDataDoubleMatrix

        public ExpressionDataDoubleMatrix​(ExpressionExperiment ee,
                                          QuantitationType qt,
                                          DoubleMatrix<CompositeSequence,​BioMaterial> matrix)
        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 this
        qt - to be associated with this
        matrix - with valid row and column elements, and the data
      • ExpressionDataDoubleMatrix

        public ExpressionDataDoubleMatrix​(ExpressionDataDoubleMatrix sourceMatrix,
                                          List<BioMaterial> columnsToUse,
                                          BioAssayDimension reorderedDim)
        Create a matrix based on another one's selected columns. The results will be somewhat butchered - only a single BioAssayDimension and the ranks will be copied over (not recomputed based on the selected columns).
        Parameters:
        columnsToUse - columns
        sourceMatrix - matrix
        reorderedDim - the reordered bioAssayDimension.
    • Method Detail

      • columns

        public int columns()
        Description copied from interface: ExpressionDataMatrix
        Total number of columns.
        Returns:
        int
      • get

        public Double get​(CompositeSequence designElement,
                          BioAssay bioAssay)
        Description copied from interface: ExpressionDataMatrix
        Access a single value of the matrix. Note that because there can be multiple bioassays per column and multiple designelements per row, it is possible for this method to retrieve a data that does not come from the bioassay and/or designelement arguments.
        Parameters:
        designElement - de
        bioAssay - ba
        Returns:
        T t
      • get

        public Double get​(int row,
                          int column)
        Description copied from interface: ExpressionDataMatrix
        Access a single value of the matrix. This is generally the easiest way to do it.
        Parameters:
        row - row
        column - col
        Returns:
        t
      • getColumn

        public Double[] getColumn​(BioAssay bioAssay)
        Description copied from interface: ExpressionDataMatrix
        Access a single column of the matrix.
        Parameters:
        bioAssay - i
        Returns:
        T[]
      • getColumn

        public Double[] getColumn​(Integer index)
        Description copied from interface: ExpressionDataMatrix
        Access a single column of the matrix.
        Parameters:
        index - index
        Returns:
        T[]
      • getColumns

        public Double[][] getColumns​(List<BioAssay> bioAssays)
        Description copied from interface: ExpressionDataMatrix
        Access a submatrix slice by columns
        Parameters:
        bioAssays - ba
        Returns:
        t[][]
      • getRawMatrix

        public Double[][] getRawMatrix()
        Description copied from interface: ExpressionDataMatrix
        Access the entire matrix.
        Returns:
        T[][]
      • getRow

        public Double[] getRow​(CompositeSequence designElement)
        Description copied from interface: ExpressionDataMatrix
        Return a row that 'came from' the given design element.
        Parameters:
        designElement - de
        Returns:
        t
      • getRow

        public Double[] getRow​(Integer index)
        Description copied from interface: ExpressionDataMatrix
        Access a single row of the matrix, by index. A complete row is returned.
        Parameters:
        index - i
        Returns:
        t[]
      • hasMissingValues

        public boolean hasMissingValues()
        Returns:
        true if any values are null or NaN (for Doubles); all other values are considered non-missing.
      • rows

        public int rows()
        Returns:
        int
      • set

        public void set​(int row,
                        int column,
                        Double value)
        Description copied from interface: ExpressionDataMatrix
        Set a value in the matrix, by index
        Parameters:
        row - row
        column - col
        value - val
      • toRawDataVectors

        public Collection<RawExpressionDataVector> toRawDataVectors()
        Same as toProcessedDataVectors but uses RawExpressionDataVector
        Returns:
        Convert this to a collection of vectors.
      • getRanks

        public Map<CompositeSequence,​Double> getRanks()
        Returns:
        The expression level ranks (based on mean signal intensity in the vectors); this will be empty if the vectors used to construct the matrix were not ProcessedExpressionDataVectors.
      • getRawRow

        public double[] getRawRow​(Integer index)
      • setRow

        public void setRow​(int rowIndex,
                           Double[] data)
        Sets the row of matrix to the input data.
        Parameters:
        rowIndex - The row index of the data in the matrix to be replaced.
        data - The input data.