|
forester v1.3 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--forester.tree.TreeHelper
Constructor Summary | |
TreeHelper()
|
Method Summary | |
static boolean |
checkCommas(java.lang.String nh_string)
Checks the commas of a String nh_string potentially representing a Tree in NH or NHX format. |
static java.lang.String |
checkForUnnessaryParentheses(java.lang.String nh_string,
int openparantheses)
Checks for unnessary parentheses in a String nh_string potentially representing a Tree in NH or NHX format. |
static java.lang.String |
checkNHformat(java.lang.String s)
Checks a String s potentially representing a Tree in NH or NHX format. |
static void |
cleanSpeciesNamesInExtNodes(Tree tree)
For each external node of Tree tree: Cleans up SWISS-PROT species names: It removes everything (including ) after a potential "/", "_", "-", "\", ";", ".". |
static int |
countAndCheckParantheses(java.lang.String nh_string)
Checks whether number of "(" equals number of ")" in String nh_string potentially representing a Tree in NH or NHX format. |
static Tree |
createBalancedTree(int i)
Creates a completely balanced Tree with 2^i external nodes. |
static Tree |
createUnbalancedTree(int i)
Creates a completely unbalanced Tree with i external nodes. |
static void |
extractSpeciesNameFromSPseqName(Tree tree)
For each node of Tree tree: Extracts the species name (as SWISS-PROT abbreviation) from the sequence name (if SWISS-PROT names are used) and writes it to the species name field if this is empty. |
static void |
intervalNumberSpecies(Tree t,
int i)
Sets the species name of the external Nodes of Tree t to 1, 1+i, 2, 2+i, 3, 3+i, .... |
static boolean |
isEmpty(java.lang.StringBuffer sb)
Checks whether StringBuffer sb is empty. |
static void |
numberSpeciesInDescOrder(Tree t)
Sets the species namea of the external Nodes of Tree t to descending integers, ending with 1. |
static void |
numberSpeciesInOrder(Tree t)
Sets the species namea of the external Nodes of Tree t to ascending integers, starting with 1. |
static void |
randomizeSpecies(int min,
int max,
Tree t)
Sets the species names of the external Nodes of Tree t to a random positive integer number between (and including) min and max. |
static Tree[] |
readMultipleNHTrees(java.io.File multipletreefile)
Reads in multiple Trees from a File multipletreefile, containing Tree descriptions in New Hampshire (NH) or New Hampshire X (NHX) format separated by semicolons followed by a newline. |
static Tree |
readNHtree(java.io.File f,
boolean check)
Reads a Tree in NH or NHX format from a textfile f. |
static Tree |
readNHtree(java.net.URL url,
boolean check)
Reads a Tree in NH or NHX format from a URL url. |
static java.lang.StringBuffer |
removeCstyleComments(java.lang.StringBuffer sb)
Removes C-style comments from StringBuffer sb. |
static java.lang.StringBuffer |
removeWhiteSpace(java.lang.StringBuffer sb)
Removes all white space from StringBuffer sb. |
static void |
writeNHtree(Tree t,
java.io.File f,
boolean nhx,
boolean overwrite1,
boolean overwrite2)
Writes a Tree t to a textfile f. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TreeHelper()
Method Detail |
public static Tree readNHtree(java.io.File f, boolean check) throws java.lang.Exception
public static Tree readNHtree(java.net.URL url, boolean check) throws java.lang.Exception
public static void writeNHtree(Tree t, java.io.File f, boolean nhx, boolean overwrite1, boolean overwrite2) throws java.lang.Exception
public static Tree[] readMultipleNHTrees(java.io.File multipletreefile) throws java.lang.Exception
multipletreefile
- Textfile containg Tree descriptions
in NH or NHX format separated by
semicolons followd by a newlinepublic static void extractSpeciesNameFromSPseqName(Tree tree)
public static void cleanSpeciesNamesInExtNodes(Tree tree)
public static java.lang.String checkNHformat(java.lang.String s)
public static boolean isEmpty(java.lang.StringBuffer sb)
public static java.lang.StringBuffer removeWhiteSpace(java.lang.StringBuffer sb)
public static java.lang.StringBuffer removeCstyleComments(java.lang.StringBuffer sb)
public static int countAndCheckParantheses(java.lang.String nh_string)
public static boolean checkCommas(java.lang.String nh_string)
public static java.lang.String checkForUnnessaryParentheses(java.lang.String nh_string, int openparantheses)
nh_string
- NH or NHXopenparantheses
- total number of open parantheses (int)public static void randomizeSpecies(int min, int max, Tree t)
t
- whose external species names are to be randomizedmin
- minimal value for random numbersmax
- maximum value for random numberspublic static void numberSpeciesInOrder(Tree t)
public static void numberSpeciesInDescOrder(Tree t)
public static void intervalNumberSpecies(Tree t, int i)
public static Tree createBalancedTree(int i)
public static Tree createUnbalancedTree(int i)
|
forester v1.3 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |