Class HierarchyTree
- java.lang.Object
-
- edu.msu.cme.rdp.classifier.train.validation.HierarchyTree
-
public class HierarchyTree extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HierarchyTree(java.lang.String n, HierarchyTree p, Taxonomy tax)Creates new HierarchyTree given the name and its parent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeParentSeqCount(int i)voidcreateWordOccurrenceFromSubclasses()creates the word occurrence array from its children if the word occurrence for this node does not existjava.util.CollectiongetLeaves()Gets the array of Sequenceleaves if anyintgetMissCount()java.lang.StringgetName()Gets the name of the treenodevoidgetNodeList(java.lang.String level, java.util.List nodeList)get all the lowest level nodes in given hierarchy level starting from the given rootvoidgetNodeMap(java.lang.String level, java.util.HashMap<java.lang.String,HierarchyTree> nodeMap)get all the lowest level nodes in given hierarchy level starting from the given rootintgetNumberofUniqueWords()intgetNumOfLeaves()Counts the number of sequence leaves below this treeintgetNumTotalTestedseq()HierarchyTreegetParent()Gets the parent treenodeintgetSizeofChildren()Gets the size of the childrenintgetSizeofLeaves()Gets the size of sequence leaves directly belong to this tree, not including the hidden leavesintgetSizeofSubclasses()Gets the size of the subclassesHierarchyTreegetSubclassbyName(java.lang.String n)Gets the subclass with the given namejava.util.Collection<HierarchyTree>getSubclasses()Gets the array of the subclasses if anyTaxonomygetTaxonomy()intgetTotalSeqs()intgetWordOccurrence(int wordIndex)Gets the word occurrence for the given word indexintgetWordOccurrenceSize()voidhideSeq(edu.msu.cme.rdp.readseq.utils.orientation.GoodWordIterator iterator)This method hides a sequence by removing the words of that sequence from the total wordOccurrencevoidincMissCount()voidincNumTotalTestedseq()voidincreTotalSeqs()voidinitWordOccurrence(LineageSequence pSeq, float[] wordPriorArr, boolean initWordOccurrence)This method initiate the word occurrence from the sequences for the lowest level of the hierarchy treebooleanisSingleton()booleanisWordOccurDone()voidunhideSeq(edu.msu.cme.rdp.readseq.utils.orientation.GoodWordIterator iterator)This method initiate the word occurrence from the sequences for the lowest level of the hierarchy tree
-
-
-
Constructor Detail
-
HierarchyTree
public HierarchyTree(java.lang.String n, HierarchyTree p, Taxonomy tax)Creates new HierarchyTree given the name and its parent
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the treenode
-
getParent
public HierarchyTree getParent()
Gets the parent treenode
-
getSubclasses
public java.util.Collection<HierarchyTree> getSubclasses()
Gets the array of the subclasses if any
-
getLeaves
public java.util.Collection getLeaves()
Gets the array of Sequenceleaves if any
-
getSubclassbyName
public HierarchyTree getSubclassbyName(java.lang.String n)
Gets the subclass with the given name
-
getSizeofChildren
public int getSizeofChildren()
Gets the size of the children
-
getSizeofSubclasses
public int getSizeofSubclasses()
Gets the size of the subclasses
-
getSizeofLeaves
public int getSizeofLeaves()
Gets the size of sequence leaves directly belong to this tree, not including the hidden leaves
-
initWordOccurrence
public void initWordOccurrence(LineageSequence pSeq, float[] wordPriorArr, boolean initWordOccurrence) throws java.io.IOException
This method initiate the word occurrence from the sequences for the lowest level of the hierarchy tree- Throws:
java.io.IOException
-
unhideSeq
public void unhideSeq(edu.msu.cme.rdp.readseq.utils.orientation.GoodWordIterator iterator) throws java.io.IOExceptionThis method initiate the word occurrence from the sequences for the lowest level of the hierarchy tree- Throws:
java.io.IOException
-
hideSeq
public void hideSeq(edu.msu.cme.rdp.readseq.utils.orientation.GoodWordIterator iterator) throws java.io.IOExceptionThis method hides a sequence by removing the words of that sequence from the total wordOccurrence- Throws:
java.io.IOException
-
changeParentSeqCount
public void changeParentSeqCount(int i)
-
isWordOccurDone
public boolean isWordOccurDone()
-
getWordOccurrenceSize
public int getWordOccurrenceSize()
-
getNumberofUniqueWords
public int getNumberofUniqueWords()
-
createWordOccurrenceFromSubclasses
public void createWordOccurrenceFromSubclasses()
creates the word occurrence array from its children if the word occurrence for this node does not exist
-
getWordOccurrence
public int getWordOccurrence(int wordIndex)
Gets the word occurrence for the given word index
-
getNumOfLeaves
public int getNumOfLeaves()
Counts the number of sequence leaves below this tree
-
increTotalSeqs
public void increTotalSeqs()
-
getTotalSeqs
public int getTotalSeqs()
-
getMissCount
public int getMissCount()
-
getNumTotalTestedseq
public int getNumTotalTestedseq()
-
incNumTotalTestedseq
public void incNumTotalTestedseq()
-
incMissCount
public void incMissCount()
-
getTaxonomy
public Taxonomy getTaxonomy()
-
isSingleton
public boolean isSingleton()
-
getNodeList
public void getNodeList(java.lang.String level, java.util.List nodeList)get all the lowest level nodes in given hierarchy level starting from the given root
-
getNodeMap
public void getNodeMap(java.lang.String level, java.util.HashMap<java.lang.String,HierarchyTree> nodeMap)get all the lowest level nodes in given hierarchy level starting from the given root
-
-