org.genepattern.data.expr
Class ExpressionData

java.lang.Object
  extended byorg.genepattern.data.expr.ExpressionData
All Implemented Interfaces:
IExpressionData
Direct Known Subclasses:
ResExpressionData

public class ExpressionData
extends java.lang.Object
implements IExpressionData

Implementation of IExpressionData interface


Constructor Summary
ExpressionData(DoubleMatrix2D dataset, java.lang.String[] _rowDescriptions, java.lang.String[] _columnDescriptions)
           
 
Method Summary
 double get(int row, int column)
          Gets a single element
 double[][] getArray()
          Gets the underlying double[][] array
 int getColumnCount()
          Gets the number of column in the expression data matrix
 java.lang.String getColumnDescription(int column)
          Gets the column description at the given column or null if no column description exists.
 java.lang.String[] getColumnDescriptions()
          Gets the array containing the column descriptions or null if no column descriptions are set
 int getColumnIndex(java.lang.String columnName)
          Gets the column index for the column name .
 java.lang.String getColumnName(int column)
          Gets the column name at the given column
 java.lang.String[] getColumnNames()
          Allocates a new array contains the column names
 DoubleMatrix2D getExpressionMatrix()
          Gets the 2-dimensional matrix that holds the expression values
 double[] getRow(int row)
          Gets the underlying array at the given row
 int getRowCount()
          Gets the number of rows in the expression data matrix
 java.lang.String getRowDescription(int row)
          Gets the row description at the given row or null if no row description exists.
 java.lang.String[] getRowDescriptions()
          Gets the array containing the row descriptions or null if no row descriptions are set
 int getRowIndex(java.lang.String rowName)
          Gets the row index for the row name .
 java.lang.String getRowName(int row)
          Gets the row name at the given row
 java.lang.String[] getRowNames()
          Allocates a new array contains the row names
 double getValue(int row, int column)
          Gets the expression value at the given row and column.
 java.lang.String getValueAsString(int row, int column)
          Gets the value at the given row and column as a string.
 void set(int rowIndex, int columnIndex, double value)
          Sets a single element.
 void set(java.lang.String rowName, java.lang.String columnName, double value)
          Sets a single element.
 void setColumnDescription(int column, java.lang.String description)
           
 void setColumnDescriptions(java.lang.String[] descs)
          Sets the column descriptions
 void setColumnName(int column, java.lang.String name)
           
 void setRowDescription(int row, java.lang.String description)
           
 void setRowDescriptions(java.lang.String[] descs)
          Sets the row descriptions
 void setRowName(int row, java.lang.String name)
           
 ExpressionData slice(int[] rowIndices, int[] columnIndices)
           
 ExpressionData slice(java.lang.String[] rowNames, java.lang.String[] columnNames)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionData

public ExpressionData(DoubleMatrix2D dataset,
                      java.lang.String[] _rowDescriptions,
                      java.lang.String[] _columnDescriptions)
Method Detail

slice

public ExpressionData slice(java.lang.String[] rowNames,
                            java.lang.String[] columnNames)

slice

public ExpressionData slice(int[] rowIndices,
                            int[] columnIndices)

setRowDescription

public void setRowDescription(int row,
                              java.lang.String description)

setColumnDescription

public void setColumnDescription(int column,
                                 java.lang.String description)

setColumnName

public void setColumnName(int column,
                          java.lang.String name)

setRowName

public void setRowName(int row,
                       java.lang.String name)

getColumnDescription

public java.lang.String getColumnDescription(int column)
Description copied from interface: IExpressionData
Gets the column description at the given column or null if no column description exists.

Specified by:
getColumnDescription in interface IExpressionData
Parameters:
column - The column
Returns:
The column description

getRowDescription

public java.lang.String getRowDescription(int row)
Description copied from interface: IExpressionData
Gets the row description at the given row or null if no row description exists.

Specified by:
getRowDescription in interface IExpressionData
Parameters:
row - The row
Returns:
The row description

getRowCount

public int getRowCount()
Description copied from interface: IExpressionData
Gets the number of rows in the expression data matrix

Specified by:
getRowCount in interface IExpressionData
Returns:
The number of rows

getColumnCount

public int getColumnCount()
Description copied from interface: IExpressionData
Gets the number of column in the expression data matrix

Specified by:
getColumnCount in interface IExpressionData
Returns:
The number of column

getValue

public double getValue(int row,
                       int column)
Description copied from interface: IExpressionData
Gets the expression value at the given row and column.

Specified by:
getValue in interface IExpressionData
Parameters:
row - The row
column - The column
Returns:
The expression value

getValueAsString

public java.lang.String getValueAsString(int row,
                                         int column)
Description copied from interface: IExpressionData
Gets the value at the given row and column as a string.

Specified by:
getValueAsString in interface IExpressionData
Parameters:
row - The row
column - The column
Returns:
The expression value

getColumnName

public java.lang.String getColumnName(int column)
Description copied from interface: IExpressionData
Gets the column name at the given column

Specified by:
getColumnName in interface IExpressionData
Parameters:
column - The column
Returns:
The column name

getRowName

public java.lang.String getRowName(int row)
Description copied from interface: IExpressionData
Gets the row name at the given row

Specified by:
getRowName in interface IExpressionData
Parameters:
row - The row
Returns:
The row name

getRowNames

public java.lang.String[] getRowNames()
Allocates a new array contains the row names

Returns:
The row names.

getRowDescriptions

public java.lang.String[] getRowDescriptions()
Gets the array containing the row descriptions or null if no row descriptions are set

Returns:
The row descriptions.

setRowDescriptions

public void setRowDescriptions(java.lang.String[] descs)
Sets the row descriptions

Parameters:
descs -
Throws:
java.lang.IllegalArgumentException - if desc.length != getRowCount()

getColumnNames

public java.lang.String[] getColumnNames()
Allocates a new array contains the column names

Returns:
The column names.

getColumnDescriptions

public java.lang.String[] getColumnDescriptions()
Gets the array containing the column descriptions or null if no column descriptions are set

Returns:
The column descriptions.

setColumnDescriptions

public void setColumnDescriptions(java.lang.String[] descs)
Sets the column descriptions

Parameters:
descs -
Throws:
java.lang.IllegalArgumentException - if desc.length != getColumnCount()

getExpressionMatrix

public DoubleMatrix2D getExpressionMatrix()
Gets the 2-dimensional matrix that holds the expression values

Returns:
The expression matrix

getArray

public double[][] getArray()
Gets the underlying double[][] array

Returns:
the array

getRow

public double[] getRow(int row)
Gets the underlying array at the given row

Parameters:
row - Row index
Returns:
the row array

getRowIndex

public int getRowIndex(java.lang.String rowName)
Gets the row index for the row name .

Specified by:
getRowIndex in interface IExpressionData
Parameters:
rowName - the row name.
Returns:
the row index, or -1 if the row name is not contained in this matrix

getColumnIndex

public int getColumnIndex(java.lang.String columnName)
Gets the column index for the column name .

Specified by:
getColumnIndex in interface IExpressionData
Parameters:
columnName - the column name.
Returns:
the column index, or -1 if the column name is not contained in this matrix

set

public void set(int rowIndex,
                int columnIndex,
                double value)
Sets a single element.

Parameters:
value - A(row,column).
rowIndex - The row index.
columnIndex - The column index.

set

public void set(java.lang.String rowName,
                java.lang.String columnName,
                double value)
Sets a single element.

Parameters:
value - A(row,column).
rowName - The row name.
columnName - The column name.

get

public double get(int row,
                  int column)
Gets a single element

Parameters:
row - Row index.
column - Column index.
Returns:
The value at A[row,column]


Hosted by docs.bugaco.com