TreeNode 1.5.2
A library to manipulate phylogenetic trees
|
Contains methods to read and write trees in the NCBI ASN.1 binary format.
Note: this is a hackish reverse-engineering of the NCBI binary ASN format. A lot of this is derived by assumptions and observations.
More...
Static Public Member Functions | |
static IEnumerable< TreeNode > | ParseTrees (string inputFile) |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element. More... | |
static IEnumerable< TreeNode > | ParseTrees (Stream inputStream, bool keepOpen=false) |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element. More... | |
static List< TreeNode > | ParseAllTrees (string inputFile) |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a list with a single element. More... | |
static List< TreeNode > | ParseAllTrees (Stream inputStream, bool keepOpen=false) |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a list with a single element. More... | |
static TreeNode | ParseTree (BinaryReader reader) |
Parses a tree from a BinaryReader reading a stream in NCBI ASN.1 binary format into a TreeNode object. More... | |
static void | WriteTree (TreeNode tree, string outputFile, string treeType=null, string label=null) |
Writes a TreeNode to a file in NCBI ASN.1 binary format. More... | |
static void | WriteTree (TreeNode tree, Stream outputStream, bool keepOpen=false, string treeType=null, string label=null) |
Writes a TreeNode to a file in NCBI ASN.1 binary format. More... | |
static void | WriteAllTrees (IEnumerable< TreeNode > trees, Stream outputStream, bool keepOpen=false, string treeType=null, string label=null) |
Writes a collection of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the collection contains more than one tree an exception will be thrown. More... | |
static void | WriteAllTrees (IEnumerable< TreeNode > trees, string outputFile, string treeType=null, string label=null) |
Writes a collection of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the collection contains more than one tree an exception will be thrown. More... | |
static void | WriteAllTrees (List< TreeNode > trees, Stream outputStream, bool keepOpen=false, string treeType=null, string label=null) |
Writes a list of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the tree contains more than one tree an exception will be thrown. More... | |
static void | WriteAllTrees (List< TreeNode > trees, string outputFile, string treeType=null, string label=null) |
Writes a list of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the list contains more than one tree an exception will be thrown. More... | |
static void | WriteTree (TreeNode tree, BinaryWriter writer, string treeType=null, string label=null) |
Writes a TreeNode to a BinaryWriter in NCBI ASN.1 binary format. More... | |
Contains methods to read and write trees in the NCBI ASN.1 binary format.
Note: this is a hackish reverse-engineering of the NCBI binary ASN format. A lot of this is derived by assumptions and observations.
Definition at line 13 of file NcbiAsnBer.cs.
|
static |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a list with a single element.
inputStream | The Stream from which the file should be read. |
keepOpen | Determines whether the stream should be disposed at the end of this method or not. |
Definition at line 145 of file NcbiAsnBer.cs.
|
static |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a list with a single element.
inputFile | The path to the input file. |
Definition at line 132 of file NcbiAsnBer.cs.
|
static |
Parses a tree from a BinaryReader reading a stream in NCBI ASN.1 binary format into a TreeNode object.
reader | The BinaryReader that reads a stream in NCBI ASN.1 binary format. |
Definition at line 156 of file NcbiAsnBer.cs.
|
static |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element.
inputStream | The Stream from which the file should be read. |
keepOpen | Determines whether the stream should be disposed at the end of this method or not. |
Definition at line 122 of file NcbiAsnBer.cs.
|
static |
Parses a tree from an NCBI ASN.1 binary format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element.
inputFile | The path to the input file. |
Definition at line 111 of file NcbiAsnBer.cs.
|
static |
Writes a collection of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the collection contains more than one tree an exception will be thrown.
trees | The collection of trees to write. If this contains more than one tree, an exception will be thrown. |
outputStream | The Stream on which the tree should be written. |
keepOpen | Determines whether the outputStream should be kept open after the end of this method. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 550 of file NcbiAsnBer.cs.
|
static |
Writes a collection of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the collection contains more than one tree an exception will be thrown.
trees | The collection of trees to write. If this contains more than one tree, an exception will be thrown. |
outputFile | The path to the output file. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 577 of file NcbiAsnBer.cs.
|
static |
Writes a list of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the tree contains more than one tree an exception will be thrown.
trees | The list of trees to write. If this contains more than one tree, an exception will be thrown. |
outputStream | The Stream on which the tree should be written. |
keepOpen | Determines whether the outputStream should be kept open after the end of this method. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 605 of file NcbiAsnBer.cs.
|
static |
Writes a list of TreeNodes to a file in NCBI ASN.1 binary format. Note that only one tree can be saved in each file; if the list contains more than one tree an exception will be thrown.
trees | The list of trees to write. If this contains more than one tree, an exception will be thrown. |
outputFile | The path to the output file. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 624 of file NcbiAsnBer.cs.
|
static |
Writes a TreeNode to a BinaryWriter in NCBI ASN.1 binary format.
tree | The tree to write. |
writer | The BinaryWriter on which the tree will be written.. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 643 of file NcbiAsnBer.cs.
|
static |
Writes a TreeNode to a file in NCBI ASN.1 binary format.
tree | The tree to write. |
outputStream | The Stream on which the tree should be written. |
keepOpen | Determines whether the outputStream should be kept open after the end of this method. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 536 of file NcbiAsnBer.cs.
|
static |
Writes a TreeNode to a file in NCBI ASN.1 binary format.
tree | The tree to write. |
outputFile | The path to the output file. |
treeType | An optional value for the treetype property defined in the NCBI ASN.1 tree format. |
label | An optional value for the label property defined in the NCBI ASN.1 tree format. |
Definition at line 522 of file NcbiAsnBer.cs.