|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.iastate.metnet.metaomgraph.MetaOmProject
public class MetaOmProject
Class used for dealing with large data sets. A project can be created from
either an InputStream or a File. When created
from an InputStream, data access will be faster, but memory
requirements will be much higher. The opposite is true when created from a
File; slower data access, but much lower memory requirements.
This is because
| Field Summary | |
|---|---|
static java.lang.String |
COMPLETE_LIST
The name of the "complete list" list. |
static java.lang.String |
DELETE_INFO_COLUMN_CAUSE
|
static java.lang.String |
KEEP_CORRELATION_CAUSE
|
static java.lang.String |
LIST_CREATE_CAUSE
|
static java.lang.String |
LIST_DELETE_CAUSE
|
static java.lang.String |
LIST_RENAME_CAUSE
|
static java.lang.String |
NEW_CORRELATION_CAUSE
|
static java.lang.String |
ROW_NAME_CHANGE_CAUSE
|
| Constructor Summary | |
|---|---|
MetaOmProject(java.io.File projectFile)
Constructs a MetaOmProject using the given MetaOmGraph project file. |
|
MetaOmProject(java.io.File source,
int infoColumns,
char delimiter,
boolean ignoreConsecutiveDelimiters,
java.lang.Double blankValue)
Constructs a MetaOmProject with the given parameters. |
|
MetaOmProject(java.io.InputStream instream,
int infoColumns,
char delimiter)
Constructs a MetaOmProject from the given InputStream. |
|
MetaOmProject(java.io.InputStream instream,
int infoColumns,
char delimiter,
boolean allowImport)
Constructs a MetaOmProject from the given InputStream. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Registers a ChangeListener to this project. |
boolean |
addGeneList(int[] entries)
Adds a gene list to the project. |
boolean |
addGeneList(java.lang.String name,
int[] entries)
Adds a gene list to the project. |
boolean |
addGeneList(java.util.Vector entries)
Adds a gene list to the project. |
protected void |
closeDataFile()
Closes the RandomAccessFile used to read data. |
void |
deleteGeneList(java.lang.String name)
Deletes a gene list from this project. |
void |
deleteInfoColumn(int col)
|
int |
findDataColumnHeader(java.lang.String header)
Locates the given data column header. |
protected void |
fireStateChanged(java.lang.String cause)
Calls the stateChanged() method of all registered
ChangeListeners. |
java.lang.Double |
getBlankValue()
|
java.awt.Color |
getColor1()
Retrieves the default color used for the bottom-left portion of new MetaOmChartPanels' background gradient. |
java.awt.Color |
getColor2()
Retrieves the default color used for the top-right portion of new MetaOmChartPanels' background gradient. |
java.lang.String[] |
getColumnHeaders()
|
java.util.ArrayList<java.lang.Integer> |
getCorrelationColumns()
|
double[] |
getData(int row)
Retrieves the numerical data from the given row. |
int |
getDataColumnCount()
|
java.lang.String |
getDataColumnHeader(int index)
Fetches the header of a given column of data, ignoring the infocolumns. |
java.lang.String |
getDataColumnHeader(int index,
boolean shorten)
Fetches the header of a given column of data, ignoring the infocolumns. |
java.lang.String[] |
getDataColumnHeaders()
|
double[] |
getDataFromMemory(int row)
Retrieves the numerical data from the given row for projects created from a stream. |
int |
getDefaultColumn()
Retrieves the index of the "default" info column. |
java.lang.String |
getDefaultTitle()
Retrieves the title used on all new MetaOmChartPanels. |
java.lang.String |
getDefaultXAxis()
Retrieves the label used for the x-axis of all new MetaOmChartPanels. |
java.lang.String |
getDefaultYAxis()
Retrieves the label used for the y-axis of all new MetaOmChartPanels. |
char |
getDelimiter()
|
ExtendedInfoTree |
getExtendedInfo()
Retrieves the root node of this project's extended info tree. |
long |
getFileIndex(int index)
Fetches the file index that marks the start of a given entry. |
java.lang.String[] |
getGeneListNames()
Fetches the names of all the gene lists in this project. |
java.lang.Object[][] |
getGeneListRowNames(java.lang.String name)
Retrieves the row names of all the rows in the given list. |
int[] |
getGeneListRowNumbers(java.lang.String name)
Retrieves the row numbers of all the rows in the given list. |
int |
getInfoColumnCount()
|
java.lang.String[] |
getInfoColumnNames()
Returns cleaned String representations of the names of the information columns. |
int |
getMaxNameLength()
Retrieves the length of the longest data column header in this project. |
int |
getRowCount()
Returns the number of rows in this project. |
java.lang.Object[] |
getRowName(int entry)
Fetches the names of a given row. |
java.lang.Object[][] |
getRowNames()
Fetches the names of the rows. |
java.lang.Object[][] |
getRowNames(int[] rows)
Returns row names for a given list of entries. |
java.util.Hashtable<java.lang.String,TreeSearchQueryConstructionPanel.QuerySet> |
getSavedQueries()
Fetches the saved metadata queries. |
java.util.Hashtable<java.lang.String,CustomSortDialog.CustomSortObject> |
getSavedSorts()
Fetches the saved custom sorts. |
java.io.File |
getSourceFile()
Fetches the delimited text file used to create this project. |
boolean |
hasLastCorrelation()
|
boolean |
ignoreConsecutiveDelimiters()
|
boolean |
isChanged()
Determines if there are unsaved changes to this project. |
boolean |
isCreatedFromStream()
Determines whether this project was created from a stream or a file. |
boolean |
isInitialized()
Determines whether or not this project has been initialized successfully. |
void |
keepLastCorrelation()
|
boolean |
loadExtendedInfo()
Prompts the user to select an XML file, then attempts to initialize the extended info tree from the chosen file. |
boolean |
loadExtendedInfo(org.jdom.Element rootNode)
Initializes this project's extended info tree from the given JDOM Element. |
boolean |
loadExtendedInfo(java.io.File source)
Initializes this project's extended info tree from the given source file. |
boolean |
loadExtendedInfo(java.io.InputStream source)
Initializes this project's extended info tree from the given InputStream. |
boolean |
mayContainBlankValues()
|
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Unregisters a ChangeListener from this project. |
void |
removeLastCorrelation()
|
void |
renameColumnHeader(int col,
java.lang.String name)
|
boolean |
renameGeneList(java.lang.String oldName,
java.lang.String newName)
Renames a gene list. |
boolean |
saveProject(java.io.File destination)
Saves this MetaOmProject to a given file. |
void |
saveQueries(TreeSearchQueryConstructionPanel.QuerySet queries,
java.lang.String name)
Stores the given metadata query |
void |
saveSort(CustomSortDialog.CustomSortObject sort,
java.lang.String name)
Stores the given custom sort. |
void |
setColor1(java.awt.Color color1)
Sets the default color used for the bottom-left portion of new MetaOmChartPanels' background gradient. |
void |
setColor2(java.awt.Color color2)
Sets the default color used for the bottom-left portion of new MetaOmChartPanels' background gradient. |
void |
setDataColumnHeaders(java.lang.Object[] headers)
Sets the data column headers to the given values. |
void |
setDataColumnHeaders(java.lang.Object[][] headers)
Sets the data column headers to the values in headers[x][0]. |
void |
setDefaultColumn(int defaultColumn)
Sets the index of the "default" info column. |
void |
setDefaultTitle(java.lang.String defaultTitle)
Sets the title used on all new MetaOmChartPanels. |
void |
setDefaultXAxis(java.lang.String defaultXAxis)
Sets the label used for the x-axis of all new MetaOmChartPanels. |
void |
setDefaultYAxis(java.lang.String defaultYAxis)
Retrieves the label used for the y-axis of all new MetaOmChartPanels. |
void |
setLastCorrelation(CorrelationValue[] lastCorrelation,
java.lang.String name)
|
void |
setRowNames(java.lang.Object[][] rowNames)
Sets the row names and info column headers to the given values. |
void |
setRowNames(java.lang.Object[][] rowNames,
java.lang.String[] infoColumnNames)
Sets the row names and info column headers to the given values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COMPLETE_LIST
public static final java.lang.String LIST_CREATE_CAUSE
public static final java.lang.String LIST_DELETE_CAUSE
public static final java.lang.String LIST_RENAME_CAUSE
public static final java.lang.String NEW_CORRELATION_CAUSE
public static final java.lang.String KEEP_CORRELATION_CAUSE
public static final java.lang.String ROW_NAME_CHANGE_CAUSE
public static final java.lang.String DELETE_INFO_COLUMN_CAUSE
| Constructor Detail |
|---|
public MetaOmProject(java.io.File source,
int infoColumns,
char delimiter,
boolean ignoreConsecutiveDelimiters,
java.lang.Double blankValue)
isInitialized() method can be used to determine if the
construction was successful.
source - The data file used for the project.infoColumns - The number of information columns in the data file.delimiter - The character used as a delimiter in the data file.public MetaOmProject(java.io.File projectFile)
isInitialized() method can be used to determine if the project
was opened successfully.
projectFile - the MetaOmGraph project file to open
public MetaOmProject(java.io.InputStream instream,
int infoColumns,
char delimiter)
InputStream. If
gene IDs appear in the information columns, the user will be prompted to
import additional data from MetNetDB. Data from the stream must be
delimited tabular data, just as if creating the project from a text file.
The isInitialized() method can be used to determine if the
construction was successful.
instream - the source InputStreaminfoColumns - the number of information columns in the streamdelimiter - the delimiter used by the stream
public MetaOmProject(java.io.InputStream instream,
int infoColumns,
char delimiter,
boolean allowImport)
InputStream.
Data from the stream must be delimited tabular data, just as if creating
the project from a text file. The isInitialized() method can be
used to determine if the construction was successful.
instream - the source InputStreaminfoColumns - the number of information columns in the streamdelimiter - the delimiter used by the streamallowImport - if false, the user will not be prompted to import data from
MetNetDB, even when gene IDs appear in the information columns| Method Detail |
|---|
public boolean saveProject(java.io.File destination)
destination - The file to save to.
public boolean isChanged()
public java.lang.Object[][] getRowNames()
public java.lang.Object[] getRowName(int entry)
entry - The row to name.
public java.util.ArrayList<java.lang.Integer> getCorrelationColumns()
public java.io.File getSourceFile()
public long getFileIndex(int index)
index - The row number whose file index you want to fetch
public java.lang.String[] getInfoColumnNames()
public java.lang.String[] getColumnHeaders()
public boolean addGeneList(java.lang.String name,
int[] entries)
name - The name of the list.entries - The numbers of the rows to include in the list.
public boolean renameGeneList(java.lang.String oldName,
java.lang.String newName)
newName is null, the user will be
prompted to enter a new name. This method only checks for duplicate names
when newName is null, so if you're specifying the new name, make sure a
list with the new name doesn't already exist.
oldName - the gene list's current namenewName - the gene list's new name
public java.lang.String[] getGeneListNames()
public int[] getGeneListRowNumbers(java.lang.String name)
name - the name of a gene list
public java.lang.Object[][] getGeneListRowNames(java.lang.String name)
name - The name of a gene list.
public boolean addGeneList(int[] entries)
entries - The indices of the rows to include in the list.
public boolean addGeneList(java.util.Vector entries)
entries - A Vector that contains the indices of the rows to include in
the list as Integers.
public void deleteGeneList(java.lang.String name)
name - The name of the list to delete.public int getInfoColumnCount()
public int getDataColumnCount()
public java.lang.Object[][] getRowNames(int[] rows)
rows - The entries to name.
public java.lang.String getDataColumnHeader(int index)
index - The column of data.
public java.lang.String getDataColumnHeader(int index,
boolean shorten)
index - The column of data.shorten - If true, the returned name will be shortened. If false, the
result is the same as getDataColumnHeader(index)
public java.lang.String[] getDataColumnHeaders()
public char getDelimiter()
public void setRowNames(java.lang.Object[][] rowNames,
java.lang.String[] infoColumnNames)
rowNames - the names of the rows of this project (non-null)infoColumnNames - the names of the info columns (non-null)public void setRowNames(java.lang.Object[][] rowNames)
rowNames - an array in which index 0 contains the info column headers,
and the rest contain the row names (non-null)public void setDataColumnHeaders(java.lang.Object[][] headers)
headers - array in which index [x][0] contains the values to be used for
the data column headers.public void setDataColumnHeaders(java.lang.Object[] headers)
headers - the new data column headerspublic java.awt.Color getColor1()
MetaOmChartPanels' background gradient.
public void setColor1(java.awt.Color color1)
MetaOmChartPanels' background gradient.
color1 - the new bottom-left color of the chart panel background
gradientpublic java.awt.Color getColor2()
MetaOmChartPanels' background gradient.
public void setColor2(java.awt.Color color2)
MetaOmChartPanels' background gradient.
color2 - the top-right color of the chart panel background gradientpublic int getDefaultColumn()
public void setDefaultColumn(int defaultColumn)
defaultColumn - The index of the info column that contains the default row
name.public java.lang.String getDefaultTitle()
MetaOmChartPanels.
public void setDefaultTitle(java.lang.String defaultTitle)
MetaOmChartPanels.
defaultTitle - the new default chart titlepublic java.lang.String getDefaultXAxis()
MetaOmChartPanels.
public void setDefaultXAxis(java.lang.String defaultXAxis)
MetaOmChartPanels.
defaultXAxis - the new default x-axis labelpublic java.lang.String getDefaultYAxis()
MetaOmChartPanels.
public void setDefaultYAxis(java.lang.String defaultYAxis)
MetaOmChartPanels.
defaultYAxis - the new default y-axis labelpublic int getMaxNameLength()
public ExtendedInfoTree getExtendedInfo()
public boolean loadExtendedInfo()
public boolean loadExtendedInfo(java.io.File source)
source - an XML file
public boolean loadExtendedInfo(java.io.InputStream source)
source - an InputStream with an XML source
public boolean loadExtendedInfo(org.jdom.Element rootNode)
rootNode - the root of the JDOM XML tree from which the extended info
will be loaded
public int findDataColumnHeader(java.lang.String header)
header - the data column header to find
protected void closeDataFile()
throws java.io.IOException
java.io.IOException - if dataIn.close() throws an IOExceptionpublic boolean isInitialized()
public double[] getData(int row)
throws java.io.IOException
getDataColumnCount(). Any "blank" values will have
the value Double.NaN. Since (Double.NaN==Double.NaN)
returns false, to test if a given value from the result is blank, use
Double.isNaN(result[x]).
row - the row to retrieve
java.io.IOException - if there is an error reading from the source file (for
non-stream projects)public double[] getDataFromMemory(int row)
getDataColumnCount().
row - the row to retrieve
public int getRowCount()
public void saveQueries(TreeSearchQueryConstructionPanel.QuerySet queries,
java.lang.String name)
queries - the QuerySet to savename - a name for the metadata querypublic java.util.Hashtable<java.lang.String,TreeSearchQueryConstructionPanel.QuerySet> getSavedQueries()
Hashtable of all saved metadata queries, or null
if no metadata queries have been saved.
public void saveSort(CustomSortDialog.CustomSortObject sort,
java.lang.String name)
sort - the CustomSortObject to savename - a name for the custom sortpublic java.util.Hashtable<java.lang.String,CustomSortDialog.CustomSortObject> getSavedSorts()
Hashtable of all saved custom sorts, or null if
no custom sorts have been saved.public boolean isCreatedFromStream()
public void addChangeListener(javax.swing.event.ChangeListener listener)
ChangeListener to this project. Currently,
ChangeListeners will be notified when a gene list is
added/removed/renamed, or when the row names change. More events will be
added in the future.
listener - the ChangeListener to registerpublic void removeChangeListener(javax.swing.event.ChangeListener listener)
ChangeListener from this project. The
ChangeListener will no longer be notified when this
project changes.
listener - the ChangeListener to removeprotected void fireStateChanged(java.lang.String cause)
stateChanged() method of all registered
ChangeListeners. Currently, this method is called when
gene lists are added/removed/renamed, and when row names change.
public boolean ignoreConsecutiveDelimiters()
public boolean mayContainBlankValues()
public void setLastCorrelation(CorrelationValue[] lastCorrelation,
java.lang.String name)
public void renameColumnHeader(int col,
java.lang.String name)
public boolean hasLastCorrelation()
public void keepLastCorrelation()
public void removeLastCorrelation()
public void deleteInfoColumn(int col)
public java.lang.Double getBlankValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||