|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.data.MST
public class MST
The top-level class that encapsulates all the pertinent information
regarding a MST data file. This class deserializes the information
in a MST data file generated by PEACE and stores it in memory.
The in-memory storage format for the core MST information is
achieved using an hierarchically nested set of MSTNode objects.
In addition, this class also maintains any generated information
that is placed in the file by PEACE.
Note that the in-memory format represented by this class has been
primarily designed to provide more convenient access to the related
information and for display in a GUI. However, this class does
not directly perform any GUI related task. Instead, the GUI display
is organized using the MVC (Model-View-Controller) design pattern.
This class constitutes the "model" as in the MVC terminology.
Note: In order to create a valid MST use the
loadMST(File)
static method.
Field Summary | |
---|---|
private java.lang.String |
fileName
The file name from where the data has been read. |
private boolean |
haveAlignmentInfo
Flag to indicate if the MST data contains initial, pre-assembly alignment metric that is useful to detect where overlaps between two adjacent (parent-child) fragments occur to obtain the given alignment metric. |
private java.util.ArrayList<Pair> |
metadata
The set of meta data that was loaded from the MST file. |
private MSTNode |
root
The root of the MST node. |
Constructor Summary | |
---|---|
private |
MST(java.lang.String fileName)
The constructor creates an empty MST object. |
Method Summary | |
---|---|
java.lang.String |
getFileName()
The absolute path to the file name from where the MST data was originally loaded. |
MSTNode |
getRoot()
Obtain the root node of this MST. |
boolean |
hasAlignmentInfo()
Determine if all nodes in this MST have alignment information. |
static MST |
loadMST(java.io.File mstFile)
This method loads MST data into an in-memory format. |
static MST |
loadMST(java.lang.String fileName,
java.io.InputStream is)
This method loads MST data into an in-memory format. |
protected static Pair |
makeMetadataEntry(java.lang.String line)
This is a helper method that is used to parse a line of meta data entry (line starts with a '#' character) and convert it to a a Pair containing a name, value pair and returns the meta data as a pair. |
protected static boolean |
makeMSTNode(java.util.HashMap<java.lang.Integer,MSTNode> nodeList,
java.lang.String line)
Helper method to process a comma separated set of values representing a MST node. |
void |
print(java.io.PrintStream out)
Method to print the MST in a simple text-based format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String fileName
private MSTNode root
private boolean haveAlignmentInfo
private java.util.ArrayList<Pair> metadata
Constructor Detail |
---|
private MST(java.lang.String fileName)
fileName
- The absolute path to the file from where the
MST data was loaded. This file name is used as an identifier
to locate the files.Method Detail |
---|
public java.lang.String getFileName()
public void print(java.io.PrintStream out)
out
- The output stream to which the MST data is to be
written.public MSTNode getRoot()
public boolean hasAlignmentInfo()
OverlapModel
public static MST loadMST(java.io.File mstFile) throws java.lang.Exception
mstFile
- The MST file (generated by PEACE) from where the
data is to be loaded in the in-memory format.
java.lang.Exception
- This method throws an exception on errors.public static MST loadMST(java.lang.String fileName, java.io.InputStream is) throws java.lang.Exception
fileName
- The absolute path to the file from where the data
is being read.is
- The input stream from where the data is to be read.
java.lang.Exception
- This method throws an exception on errors.protected static boolean makeMSTNode(java.util.HashMap<java.lang.Integer,MSTNode> nodeList, java.lang.String line) throws java.io.IOException
nodeList
- The list of nodes that have been read so far.line
- The line containing node data to be processed and
converted to a MSTNode.
java.io.IOException
- This method throws an exception if the data
was invalid or not read.protected static Pair makeMetadataEntry(java.lang.String line)
line
- The line from the MST file to be processed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |