|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.data.ClusterNode
public class ClusterNode
A class that represents a single cluster in a cluster tree. This class is a pure data class that is used to encapsulate the information pertaining to a single cluster. This class is a self-referential structure, in that it contains a list of Cluster objects that represent child clusters of this cluster. This definition permits a Cluster to contain a complete cluster collection a part of it. The Cluster objects are created and used by the ClusterTree class that represents the top-level class.
Field Summary | |
---|---|
private java.util.ArrayList<ClusterNode> |
children
This array list contains the list of child clusters and EST nodes contained by this cluster node. |
private int |
clusterOrESTID
A number that is assigned to this node. |
(package private) java.util.HashMap<java.lang.Integer,java.lang.Integer> |
estGroups
The aggregate classification information associated with this EST. |
private java.lang.String |
name
A name set to identify filtered clusters. |
private ClusterNode |
parent
The parent cluster for this MSTcluster. |
Constructor Summary | |
---|---|
ClusterNode(ClusterNode parent,
boolean estNode,
int id,
java.lang.String name)
Constructor to create a Cluster. |
Method Summary | |
---|---|
void |
addChild(ClusterNode node)
Add another cluster as the child cluster of this cluster node. |
protected void |
classify(ESTList estList,
javax.swing.ProgressMonitor pm)
Method to compute classification statistics for this cluster node. |
double[] |
computeStatistics()
Method to compute and return statistics about this cluster. |
java.util.ArrayList<ClusterNode> |
getChildren()
Obtain the child nodes associated with this node. |
int |
getClusterId()
Obtain the cluster id associated with an EST node. |
java.util.HashMap<java.lang.Integer,java.lang.Integer> |
getESTClasses()
Obtain the aggregate classification information for this cluster. |
int |
getESTCount(boolean recursive)
Method to determine number of ESTs contained in this cluster node. |
int |
getESTId()
Obtain the EST id associated with an EST node. |
int |
getLargestClusterSize()
Determine the largest cluster in this cluster node. |
java.lang.String |
getName()
Obtain the name associated with this cluster (if any) This method must be used to obtain the name associated with this cluster. |
boolean |
isESTNode()
Determine if this node represents a EST entry in the cluster tree. |
boolean |
isLeaf()
Determine if this cluster is a leaf cluster that has no child clusters or EST entries. |
boolean |
isRoot()
Determine if this cluster node is the root cluster. |
void |
print(java.io.PrintStream out,
ClusterNode cluster,
java.lang.String indent)
Method to recursively print the information that is stored in this cluster. |
java.lang.String |
toString()
This method returns basic information about this cluster node. |
void |
write(ESTList estList,
java.io.PrintStream os)
Method to dump the EST data out in FASTA file format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ClusterNode parent
private int clusterOrESTID
private java.lang.String name
private java.util.ArrayList<ClusterNode> children
java.util.HashMap<java.lang.Integer,java.lang.Integer> estGroups
Constructor Detail |
---|
public ClusterNode(ClusterNode parent, boolean estNode, int id, java.lang.String name)
parent
- The parent cluster for this cluster node (if known).
The parent value is typically set when this node is added as a child
to another cluster node.estNode
- If this flag is true, that indicates that this
estNodename
- The name to be set for this cluster. This name is typically
read from a cluster file. Clusters generated by filters (called dummy
clusters) typically have a name. Clusters generated due to regular
clustering process do not have a name associated with them.Method Detail |
---|
public void addChild(ClusterNode node)
node
- The cluster node to be added as a direct child of this
cluster node.public boolean isRoot()
Note: This method is meaningful only after a complete cluster hierarchy has been built.
public boolean isLeaf()
Note: This method is meaningful only after a complete cluster hierarchy has been built.
public boolean isESTNode()
public int getESTId()
Note: The return value from this method is meaningful
only if the isESTNode()
method returns true.
public int getClusterId()
Note: The return value from this method is meaningful
only if the isESTNode()
method returns false.
public java.lang.String getName()
public java.util.ArrayList<ClusterNode> getChildren()
Note: This method returns null if the node does not have any children.
public java.util.HashMap<java.lang.Integer,java.lang.Integer> getESTClasses()
Note: The return value from this method may be null if a suitable classifier is not available for this cluster or if a classifier has not been computed.
public java.lang.String toString()
toString
in class java.lang.Object
public int getLargestClusterSize()
public void print(java.io.PrintStream out, ClusterNode cluster, java.lang.String indent)
out
- The output stream to which the data is to be serialized.cluster
- The cluster to be printed.indent
- The number of spaces to be used to indent the output.public void write(ESTList estList, java.io.PrintStream os)
estList
- The list of ESTs from which the EST data is to be
obtained for writing.os
- The output stream to which the EST must be written in
a FASTA format.protected void classify(ESTList estList, javax.swing.ProgressMonitor pm)
estList
- The list of ESTs associated with the clusters. This
information is used to compute aggregate classification data for
each cluster.pm
- An optional progress monitor to be used to indicate progress
as the data is computed.public int getESTCount(boolean recursive)
recursive
- This this parameter is true, then this method
recursively descends down the cluster hierarchy to determine the
number of ESTs in this specific node.
public double[] computeStatistics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |