statalign.postprocess.utils
Class NewickParser

java.lang.Object
  extended by statalign.postprocess.utils.NewickParser

public class NewickParser
extends java.lang.Object


Constructor Summary
NewickParser(java.io.Reader reader)
           
NewickParser(java.lang.String string)
           
 
Method Summary
 void close()
           
static java.lang.String getDecodedTaxaName(java.lang.String encodedTaxa)
          A utility function to decode taxa names that have been encoded by getEncodedTaxaName(String).
static java.lang.String getEncodedTaxaName(java.lang.String taxa)
          A utility function to encode taxa names so they do not contain any of the Newick formats special characters, as specified in isSpecialChar(int).
 TreeNode parse()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewickParser

public NewickParser(java.lang.String string)

NewickParser

public NewickParser(java.io.Reader reader)
Method Detail

close

public void close()
           throws NewickParserException
Throws:
NewickParserException

parse

public TreeNode parse()
               throws NewickParserException
Throws:
NewickParserException

getEncodedTaxaName

public static java.lang.String getEncodedTaxaName(java.lang.String taxa)
A utility function to encode taxa names so they do not contain any of the Newick formats special characters, as specified in isSpecialChar(int). It also removes the speces from the names. TODO: It does however not deal with parenthesis at the moment.

Parameters:
taxa - the taxa name to be encoded.
Returns:
the encoded taxa name.

getDecodedTaxaName

public static java.lang.String getDecodedTaxaName(java.lang.String encodedTaxa)
A utility function to decode taxa names that have been encoded by getEncodedTaxaName(String). It does not reverse the spaces however. TODO: make it deal with parenthesis.

Parameters:
encodedTaxa -