Package edu.msu.cme.rdp.classifier.train
Class RawHierarchyTree
- java.lang.Object
-
- edu.msu.cme.rdp.classifier.train.RawHierarchyTree
-
public class RawHierarchyTree extends java.lang.ObjectA RawHierarchyTree holds the raw taxon and sequences information. A RawHierarchyTree can only have one type of children: child treenodes or child sequences.
-
-
Constructor Summary
Constructors Constructor Description RawHierarchyTree(java.lang.String n, RawHierarchyTree p, Taxonomy tax)Creates new RawHierarchyTree given the name and its parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetCopyNumber()intgetGenusIndex()Returns the genus index of this treenode.intgetGenusNodeCount()intgetLeaveCount()Counts the number of sequence leaves below this tree.java.lang.StringgetName()Gets the name of the treenode.voidgetNodeMap(java.lang.String level, java.util.HashMap<java.lang.String,RawHierarchyTree> nodeMap)get all the lowest level nodes in given hierarchy level starting from the given rootintgetNonSingletonLeaveCount()Counts the number of non-singleton sequence leaves below this tree.RawHierarchyTreegetParent()Gets the parent treenode.intgetSizeofChildren()Gets the size of the children, either taxon children or sequence leaves.intgetSizeofSubclasses()Gets the size of the child treenodes.RawHierarchyTreegetSubclassbyName(java.lang.String n)Gets the child treenode with the given name.java.util.Collection<RawHierarchyTree>getSubclasses()Gets the array of the subclasses if any.TaxonomygetTaxonomy()Returns the taxon object of this treenode.intgetWordOccurrence(int wordIndex)Gets the word occurrence for the given word index.intgetWordOccurrenceSize()Returns the size of the array wordOccurrence.booleanhasCopyNumber()voidinitWordOccurrence(LineageSequence pSeq, float[] wordPriorArr)This method initiates the word occurrences from a sequence for the lowest level of the hierarchy tree.booleanisSingleton()voidreleaseWordOccurrence()Resets the array wordOccurrence to null.protected voidsetCopyNumber(float c)voidsetGenusIndex(int i)Sets the genus index of this treenode.
-
-
-
Constructor Detail
-
RawHierarchyTree
public RawHierarchyTree(java.lang.String n, RawHierarchyTree p, Taxonomy tax)Creates new RawHierarchyTree given the name and its parent. Note: a RawHierarchyTree can only have one type of children: child treenodes or child sequences. Usually the lowest ranked nodes contain the sequence leaves.
-
-
Method Detail
-
setCopyNumber
protected void setCopyNumber(float c)
-
getCopyNumber
public float getCopyNumber()
-
hasCopyNumber
public boolean hasCopyNumber()
-
getName
public java.lang.String getName()
Gets the name of the treenode.
-
getParent
public RawHierarchyTree getParent()
Gets the parent treenode.
-
getSubclasses
public java.util.Collection<RawHierarchyTree> getSubclasses()
Gets the array of the subclasses if any.
-
getSubclassbyName
public RawHierarchyTree getSubclassbyName(java.lang.String n)
Gets the child treenode with the given name.
-
getSizeofChildren
public int getSizeofChildren()
Gets the size of the children, either taxon children or sequence leaves.
-
getSizeofSubclasses
public int getSizeofSubclasses()
Gets the size of the child treenodes.
-
initWordOccurrence
public void initWordOccurrence(LineageSequence pSeq, float[] wordPriorArr) throws java.io.IOException
This method initiates the word occurrences from a sequence for the lowest level of the hierarchy tree. Duplicate words from one sequence will be count only once.- Throws:
java.io.IOException
-
getWordOccurrenceSize
public int getWordOccurrenceSize()
Returns the size of the array wordOccurrence.
-
getWordOccurrence
public int getWordOccurrence(int wordIndex)
Gets the word occurrence for the given word index.
-
releaseWordOccurrence
public void releaseWordOccurrence()
Resets the array wordOccurrence to null.
-
getLeaveCount
public int getLeaveCount()
Counts the number of sequence leaves below this tree.
-
getGenusNodeCount
public int getGenusNodeCount()
-
isSingleton
public boolean isSingleton()
-
getNonSingletonLeaveCount
public int getNonSingletonLeaveCount()
Counts the number of non-singleton sequence leaves below this tree.
-
getTaxonomy
public Taxonomy getTaxonomy()
Returns the taxon object of this treenode.
-
setGenusIndex
public void setGenusIndex(int i)
Sets the genus index of this treenode.
-
getGenusIndex
public int getGenusIndex()
Returns the genus index of this treenode.
-
getNodeMap
public void getNodeMap(java.lang.String level, java.util.HashMap<java.lang.String,RawHierarchyTree> nodeMap)get all the lowest level nodes in given hierarchy level starting from the given root
-
-