|
FORESTER 1.7 | |||||||
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 double[] |
calculateMeanBoostrapValue(Tree t)
Calculates the mean and standard deviation of all nodes of Tree t which have a boostrap values zero or more. |
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 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 |
createUnbalancedTree(int i)
Creates a completely unbalanced Tree with i external nodes. |
static void |
extractSpeciesNameFromSeqName(Tree tree)
Copies the content of the sequence name field to the species name field (if empty - does not overwrite!) for each node of Tree tree. |
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.String s)
Checks whether String s 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)
Reads a Tree in NH or NHX format from a textfile f. |
static Tree |
readNHtree(java.net.URL url)
Reads a Tree in NH or NHX format from a URL url. |
static java.lang.String |
removeComments(java.lang.String s)
Removes everythin between '[' and ']' -- except between '[&&NHX' and ']'. |
static java.lang.String |
removeWhiteSpace(java.lang.String s)
Removes all white space from String s. |
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 |
|
Constructor Detail |
public TreeHelper()
Method Detail |
public static Tree readNHtree(java.io.File f) throws java.lang.Exception
public static Tree readNHtree(java.net.URL url) 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 extractSpeciesNameFromSeqName(Tree tree)
If the sequence name appears to be (contain) a SWISS-PROT name, the species name is extracted in the following manner: It extracts all characters after the last<\b> "_" and before any potential "/", "-", "\", ";", ".".
If the sequence name appears not to be (contain) a SWISS-PROT, name it is just copied unchanged to the species name field. (last modified: 03/01/01)
tree
- the Tree for which species names are to be extracted/copiedpublic static void cleanSpeciesNamesInExtNodes(Tree tree)
public static double[] calculateMeanBoostrapValue(Tree t)
(Last modified: 05/03/01)
t
- reference to a tree with bootstrap valuespublic static boolean isEmpty(java.lang.String s)
public static java.lang.String removeWhiteSpace(java.lang.String s)
public static java.lang.String removeComments(java.lang.String s)
public static int countAndCheckParantheses(java.lang.String nh_string)
public static boolean checkCommas(java.lang.String nh_string)
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 createUnbalancedTree(int i)
|
FORESTER 1.7 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |