Class TreeFactory


  • public class TreeFactory
    extends java.lang.Object
    • Constructor Detail

      • TreeFactory

        public TreeFactory​(java.io.Reader taxReader)
                    throws java.io.IOException
        Creates new TreeFactory
        Throws:
        java.io.IOException
    • Method Detail

      • buildTree

        public void buildTree()
        build the taxonomic tree without sequences attached to it
      • addSequence

        public HierarchyTree addSequence​(LineageSequence pSeq)
                                  throws java.io.IOException
        For the given sequence name, its ancestors, and the sequence, creates a HierarchyTree for each ancestor, If the root does not exist, creates the root with a null parent. If the root is already exist, checks the ParsedSequence to see if its oldest ancestor is the same as the previous root.
        Throws:
        java.io.IOException
      • addSequence

        public HierarchyTree addSequence​(LineageSequence pSeq,
                                         boolean initWordOccurrence)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getTaxonomy

        public Taxonomy getTaxonomy​(java.lang.String seqName,
                                    java.lang.String ancestorName,
                                    int pid,
                                    int index)
      • getRoot

        public HierarchyTree getRoot()
        Gets the root of the tree
      • getRankSet

        public java.util.Set<java.lang.String> getRankSet()
      • getLowestRank

        public java.lang.String getLowestRank()
      • displayTreePhylo

        public void displayTreePhylo​(HierarchyTree root,
                                     java.lang.String index,
                                     int indent)
        display the phylogenetic tree for each node, display the index and the name for each sequence, diaplay the name and the description
      • calculateWordPrior

        public void calculateWordPrior()
      • printWordPriors

        public void printWordPriors()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getWordPrior

        public float getWordPrior​(int wordIndex)