statalign.postprocess.utils
Class NewickParser
java.lang.Object
statalign.postprocess.utils.NewickParser
public class NewickParser
- extends java.lang.Object
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NewickParser
public NewickParser(java.lang.String string)
NewickParser
public NewickParser(java.io.Reader reader)
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
-