Cytoscape 2.1 (c) 2004 ISB, MSKCC, UCSD

cytoscape.data
Class ExpressionData

java.lang.Object
  extended bycytoscape.data.ExpressionData
All Implemented Interfaces:
Serializable

public class ExpressionData
extends Object
implements Serializable

This class provides a reader for the common file format for expression data and an interface to access the data.

There are variations in the file format used; the following assumptions about the file format are considered valid. Attempting to read a file that does not satisfy these assumptions is not guaranteed to work.

1. A token is a consecutive sequence of alphanumeric characters separated by whitespace.
2. The file consists of an arbitrary number of lines, each of which contains the same number of tokens (except for possibly the first line) and has a total length less than 8193 characters.
3. The first line of the file is a header line with one of the following three formats:

cond1 cond2 ... condN cond1 cond2 ... condN NumSigConds

cond1 cond2 ... condN

<\t><\t>RATIOS<\t><\t>...LAMBDAS

Here cond1 through condN are the names of the conditions. In the first case, the two sequences of condition names must match exactly in order and lexicographically; each name among cond1 ... condN must be unique. In the second case, each name must be unique, but need only appear once. The last label, NumSigConds, is optional.
The third case is the standard header for a MTX file. The numer of '\t' characters between the words "RATIOS" and "LAMBDAS" is equal to the number of ratio columns in the file (which must be equal to the number of lambda columns).

4. Each successive line represents the measurements for a partcular gene, and has one of the following two formats, depending on the header:

E E ... E S S ... S I

E E ... E

where is the formal name of the gene, is the common name, the E's are tokens, parsable as doubles, representing the expression level change for each condition, the S's are tokens parsable as doubles representing the statistical significance of the expression level change, and I is an optional integer giving the number of conditions in which the expression level change was significant for this gene.

The first format is used in conjuction with the first or third header formats. The second format is used in conjunction with the second header format.

5. An optional last line can be included with the following form:

NumSigGenes: I I ... I

where there are N I's, each an integer representing the number of significant genes in that condition.

See Also:
Serialized Form

Field Summary
static int LAMBDA
           
static int MAX_LINE_SIZE
           
static int NONE
           
static int PVAL
          Kinds of significance values
static int UNKNOWN
           
 
Constructor Summary
ExpressionData()
           
ExpressionData(String filename)
           
ExpressionData(String filename, TaskMonitor taskMonitor)
           
 
Method Summary
 void convertLambdasToPvals()
          Converts all lambdas to p-values.
 void copyToAttribs(cytoscape.data.GraphObjAttributes nodeAttribs, TaskMonitor taskMonitor)
          Copies ExpressionData data structure into GraphObjAttributes data structure.
 Vector getAllMeasurements()
           
 int getConditionIndex(String condition)
           
 String[] getConditionNames()
           
 String getDescription()
          Returns a text description of this data object.
 double[][] getExtremeValues()
           
 String getFileName()
           
 File getFullPath()
           
 String getGeneDescriptor(String gene)
           
 String[] getGeneDescriptors()
           
 Vector getGeneDescriptorsVector()
           
 String[] getGeneNames()
           
 Vector getGeneNamesVector()
           
 cytoscape.data.mRNAMeasurement getMeasurement(String gene, String condition)
           
 Vector getMeasurements(String gene)
           
 int getNumberOfConditions()
           
 int getNumberOfGenes()
           
static double getPvalueFromLambda(double lambda)
           
 int getSignificanceType()
           
 boolean hasSignificanceValues()
           
 boolean loadData(String filename)
           
 boolean oldLoadData(String filename)
           
 void setGeneDescriptors(Vector newDescripts)
           
 void setGeneNames(Vector newNames)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LINE_SIZE

public static final int MAX_LINE_SIZE
See Also:
Constant Field Values

PVAL

public static final int PVAL
Kinds of significance values

See Also:
Constant Field Values

LAMBDA

public static final int LAMBDA
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values
Constructor Detail

ExpressionData

public ExpressionData()

ExpressionData

public ExpressionData(String filename)
               throws IOException

ExpressionData

public ExpressionData(String filename,
                      TaskMonitor taskMonitor)
               throws IOException
Method Detail

getFileName

public String getFileName()

getFullPath

public File getFullPath()

oldLoadData

public boolean oldLoadData(String filename)
                    throws IOException
Throws:
IOException

loadData

public boolean loadData(String filename)
                 throws IOException
Throws:
IOException

convertLambdasToPvals

public void convertLambdasToPvals()
Converts all lambdas to p-values. Lambdas are lost after this call.


getPvalueFromLambda

public static double getPvalueFromLambda(double lambda)
Returns:
a very close approximation of the pvalue that corresponds to the given lambda value

getSignificanceType

public int getSignificanceType()
Returns:
one of NONE, UNKNOWN, PVAL, LAMBDA

getDescription

public String getDescription()
Returns a text description of this data object.


getNumberOfGenes

public int getNumberOfGenes()

getNumberOfConditions

public int getNumberOfConditions()

getGeneNames

public String[] getGeneNames()

getGeneNamesVector

public Vector getGeneNamesVector()

setGeneNames

public void setGeneNames(Vector newNames)

getGeneDescriptors

public String[] getGeneDescriptors()

getGeneDescriptorsVector

public Vector getGeneDescriptorsVector()

setGeneDescriptors

public void setGeneDescriptors(Vector newDescripts)

getConditionNames

public String[] getConditionNames()

getConditionIndex

public int getConditionIndex(String condition)

getExtremeValues

public double[][] getExtremeValues()

getGeneDescriptor

public String getGeneDescriptor(String gene)

hasSignificanceValues

public boolean hasSignificanceValues()

getAllMeasurements

public Vector getAllMeasurements()

getMeasurements

public Vector getMeasurements(String gene)

getMeasurement

public cytoscape.data.mRNAMeasurement getMeasurement(String gene,
                                                     String condition)

copyToAttribs

public void copyToAttribs(cytoscape.data.GraphObjAttributes nodeAttribs,
                          TaskMonitor taskMonitor)
Copies ExpressionData data structure into GraphObjAttributes data structure.

Parameters:
nodeAttribs - Node Attributes Object.
taskMonitor - Task Monitor. Can be null.

www.cytoscape.org