org.peace_tools.workspace
Class DataSet

java.lang.Object
  extended by org.peace_tools.workspace.DataSet

public class DataSet
extends java.lang.Object

The top-level data set that encapsulates the meta data regarding data files that are all related to a single EST file. The objective of this organization is to minimize data redundancy. Typically a single EST data file is analyzed multiple times in order to determine a suitable clustering. This scheme (that is centered around the primary EST data file) is meant to reflect the practical use of these files and work with them.


Field Summary
private  java.util.ArrayList<MSTClusterData> clusterList
          The optional list of clustering data files that are currently associated with this data set.
private  java.lang.String description
          A user defined description for this EST data file.
private  java.lang.String id
          The unique generated data set ID value for this data.
private  java.util.ArrayList<MSTData> mstList
          The optional list of MST data files that are currently associated with this data set.
private  java.lang.String path
          The complete path to the actual EST file on the local machine.
 
Constructor Summary
DataSet(java.lang.String id, java.lang.String path, java.lang.String description)
          Constructor to create a Data Set entry.
 
Method Summary
 void add(MSTClusterData cluster)
          Add a new MST-based clustering data file to this data set.
 void add(MSTData mstData)
          Add a new Minimum Spanning Tree (MST) data file to this data set.
static DataSet create(org.w3c.dom.Element data)
          Helper method to utilize data from a DOM tree to create a suitable DataSet entry.
 MSTClusterData getClusterData(java.lang.String jobID)
          Obtain the MSTClusterData entry for a given job ID.
 java.util.ArrayList<MSTClusterData> getClusterList()
          Obtain the list of clustering data files encapsulated by this data set.
 java.lang.String getDescription()
          Obtain the user supplied description for this this data.
 java.lang.String getID()
          Obtain the work space wide unique identifier set for this data set.
 MSTData getMSTData(java.lang.String jobID)
          Obtain the MSTData entry for a given job ID.
 java.util.ArrayList<MSTData> getMSTList()
          Obtain the list of MST data files encapsulated by this data set.
 java.lang.String getPath()
          Obtain the complete file name and path where the actual EST file is located.
 void marshall(org.w3c.dom.Element workspace)
          Method to marshall the data stored in this object to become part of a DOM tree element passed in.
 void marshall(java.io.PrintWriter out)
          Method to marshall the data stored in this object directly to a XML fragment.
 void remove(MSTClusterData cluster)
          Remove an existing MST-based clustering data file from this data set.
 void remove(MSTData mstData)
          Remove an existing Minimum Spanning Tree (MST) data file from this data set.
 void setDescription(java.lang.String desc)
          Set an user supplied description for this this data.
 void setID(java.lang.String id)
          Set the workspace-wide ID for this DataSet.
 void setPath(java.lang.String path)
          Set the complete file name and path where the actual EST file is located.
 java.lang.String toString()
          Overrides the default implementation in the base class to simply return the last part of the EST file associated with this data set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mstList

private java.util.ArrayList<MSTData> mstList
The optional list of MST data files that are currently associated with this data set. The mst list contains the MST data that was derived by analyzing the EST file associated with this data set.


clusterList

private java.util.ArrayList<MSTClusterData> clusterList
The optional list of clustering data files that are currently associated with this data set. The list contains the clustering data that was derived by analyzing the MST file(s) associated with this data set.


path

private java.lang.String path
The complete path to the actual EST file on the local machine. The EST file is expected to be in FASTA file format.


description

private java.lang.String description
A user defined description for this EST data file. This description is set when a new job is scheduled and persisted in the work space configuration for future references.


id

private java.lang.String id
The unique generated data set ID value for this data. This value is created when a new data set is added. This value is persisted in the work space configuration. It provides a convenient mechanism to refer to a specific entry within the workspace. The IDs are generated via a call to Workspace.reserveID() method.

Constructor Detail

DataSet

public DataSet(java.lang.String id,
               java.lang.String path,
               java.lang.String description)
Constructor to create a Data Set entry. This constructor must be used to create a new data set entry to be added to the work space.

Parameters:
id - The workspace-wide unique ID to be set for this data set. This ID must be obtained via a call to Workspace.reserveID().
path - The path to the actual EST file (on the local machine) that is referred by this entry.
description - A user defined description for the EST data file.
Method Detail

create

public static DataSet create(org.w3c.dom.Element data)
                      throws java.lang.Exception
Helper method to utilize data from a DOM tree to create a suitable DataSet entry. This method is typically used to create a suitable entry when loading a work space into the GUI.

Parameters:
data - The DOM element to be used for creating the DataSet entry and populating with the needed data.
Returns:
The newly created data set object based on the DOM data.
Throws:
java.lang.Exception - This method throws an exception when errors occur during reading and processing elements from the DOM node.

getPath

public java.lang.String getPath()
Obtain the complete file name and path where the actual EST file is located. This value is set when a new data set is added to the work space. The path for the EST file is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the path to the EST FASTA file.

setPath

public void setPath(java.lang.String path)
Set the complete file name and path where the actual EST file is located. This value is set when a new data set is added to the work space. The path for the EST file is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Parameters:
path - The complete file name and path to the EST FASTA file.

getDescription

public java.lang.String getDescription()
Obtain the user supplied description for this this data. The value is set when a new data set is added to the work space. The description is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the user supplied description set for this EST data file.

getID

public java.lang.String getID()
Obtain the work space wide unique identifier set for this data set. The ID value is created when data sets are added. The ID is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the unique identifier set for this data set.

setID

public void setID(java.lang.String id)
Set the workspace-wide ID for this DataSet. This method can be used to reset the ID associated with this data set. This method can be used as long as the data set has not been added to the workspace. After it has been added, it is unwise to change the ID.

Parameters:
id - The new ID to be set for this entry. This value is obtained via a call to Workspace.reserveID() method.

setDescription

public void setDescription(java.lang.String desc)
Set an user supplied description for this this data. The value is set when a new data set is added to the work space. The description is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Parameters:
desc - The user supplied description set for this EST file.

getMSTList

public java.util.ArrayList<MSTData> getMSTList()
Obtain the list of MST data files encapsulated by this data set.

Returns:
The list (zero or more) of MST data files that are associated with this data set.

getClusterList

public java.util.ArrayList<MSTClusterData> getClusterList()
Obtain the list of clustering data files encapsulated by this data set.

Returns:
The list (zero or more) of clustering data files that are associated with this data set.

getMSTData

public MSTData getMSTData(java.lang.String jobID)
Obtain the MSTData entry for a given job ID.

Parameters:
jobID - The ID of the job for which the MST data is to be searched and retrieved.
Returns:
The MSTData corresponding to the given job ID. If the entry was not found this method returns null.

getClusterData

public MSTClusterData getClusterData(java.lang.String jobID)
Obtain the MSTClusterData entry for a given job ID.

Parameters:
jobID - The ID of the job for which the cluster entry is to be searched and retrieved.
Returns:
The MSTClusterData corresponding to the given job ID. If the entry was not found this method returns null.

marshall

public final void marshall(org.w3c.dom.Element workspace)
Method to marshall the data stored in this object to become part of a DOM tree element passed in. This method assumes that the element passed in corresponds to the parent Workspace node in the DOM tree.

Parameters:
workspace - The DOM element corresponding to the "Workspace" node that contains this entry.

marshall

public final void marshall(java.io.PrintWriter out)
Method to marshall the data stored in this object directly to a XML fragment. The XML fragment is guaranteed to be compatible with the PEACE work space configuration data.

Parameters:
out - The stream to which the XML must be serialized.

add

public void add(MSTData mstData)
Add a new Minimum Spanning Tree (MST) data file to this data set. The MST data must have been generated for the EST file associated with this data set.

Note: This method reports the newly added MSTData entry to all workspace listeners by firing a suitable event.

Parameters:
mstData - The new MSTData entry to be added to this data set.

remove

public void remove(MSTData mstData)
Remove an existing Minimum Spanning Tree (MST) data file from this data set.

Note: This method reports the removed MSTData entry to all workspace listeners by firing a suitable event.

Parameters:
mstData - The MSTData entry to be removed from this data set.

add

public void add(MSTClusterData cluster)
Add a new MST-based clustering data file to this data set. The MST data must have been generated for the EST file associated with this data set.

Note: This method reports the newly added entry to all workspace listeners by firing a suitable event.

Parameters:
cluster - The new clustering entry to be added to this data set.

remove

public void remove(MSTClusterData cluster)
Remove an existing MST-based clustering data file from this data set.

Note: This method reports the removed cluster entry to all work space listeners by firing a suitable event.

Parameters:
cluster - The cluster entry to be removed from this data set.

toString

public java.lang.String toString()
Overrides the default implementation in the base class to simply return the last part of the EST file associated with this data set.

Overrides:
toString in class java.lang.Object
Returns:
A short string representation that is easy to display primarily in a tree view of the work space.