|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstatalign.io.input.DataReader
statalign.io.input.plugins.NewickReader
public class NewickReader
Class to parse Newick format tree files or strings. The tree must either be an rooted or unrooted binary tree, the latter will be rooted after parsing at the middle of the third branch of the top node as the Tree class does not support unrooted trees. The vertex[] array of the tree are filled such that the leaf nodes come first in the order they are visited by a left-first preorder traversal then the internal nodes in the reversed order they are visited by the same traversal (root will be the last). The latter ones get labelled by their index in the array. Vertex.vertexNum fields are filled. You can specify a lower limit on edge lengths using the appropriate constructors. Default is a lower limit of 0. Any number of white space (including new lines) may be present.
Nested Class Summary | |
---|---|
class |
NewickReader.FormatException
|
static class |
NewickReader.FormatExceptType
|
Constructor Summary | |
---|---|
NewickReader()
Constructs a NewickReader with the default minimum edge length of 0. |
|
NewickReader(double minEdgeLen)
Constructs a NewickReader with a specified minimum edge length. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
Tree |
read(java.io.Reader reader)
Parses tree. |
java.util.List<java.lang.String> |
supportedExtensions()
DataReader plugins must override this to return a list of supported file extensions. |
Methods inherited from class statalign.io.input.DataReader |
---|
read, read, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NewickReader()
public NewickReader(double minEdgeLen)
Method Detail |
---|
public Tree read(java.io.Reader reader) throws java.io.IOException
read
in class DataReader
java.io.IOException
- only if parsing from file and I/O error occurs
NewickReader.FormatException
NewickReader.FormatException
- if
java.io.IOException
- if I/O error occurspublic java.util.List<java.lang.String> supportedExtensions()
DataReader
supportedExtensions
in class DataReader
public static void main(java.lang.String[] args) throws java.io.IOException, NewickReader.FormatException
java.io.IOException
NewickReader.FormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |