TreeNode 1.5.2
A library to manipulate phylogenetic trees
Loading...
Searching...
No Matches
PhyloTree.Formats.NcbiAsnText Class Reference

Contains methods to read and write trees in the NCBI ASN.1 text format. More...

Static Public Member Functions

static IEnumerable< TreeNodeParseTrees (string inputFile)
 Parses a tree from an NCBI ASN.1 text 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< TreeNodeParseTrees (Stream inputStream, bool keepOpen=false)
 Parses a tree from an NCBI ASN.1 text 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< TreeNodeParseAllTrees (string inputFile)
 Parses a tree from an NCBI ASN.1 text 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< TreeNodeParseAllTrees (Stream inputStream, bool keepOpen=false)
 Parses a tree from an NCBI ASN.1 text 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 (string source)
 Parses a tree from an NCBI ASN.1 format string into a TreeNode object. More...
 
static TreeNode ParseTree (TextReader reader)
 Parses a tree from a TextReader that reads an NCBI ASN.1 format string 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 text 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 text 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 text 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 text 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 text 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 text 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 string WriteTree (TreeNode tree, string treeType=null, string label=null)
 Writes a TreeNode to a string in NCBI ASN.1 text format. More...
 

Detailed Description

Contains methods to read and write trees in the NCBI ASN.1 text format.

Definition at line 12 of file NcbiAsnText.cs.

Member Function Documentation

◆ ParseAllTrees() [1/2]

static List< TreeNode > PhyloTree.Formats.NcbiAsnText.ParseAllTrees ( Stream  inputStream,
bool  keepOpen = false 
)
static

Parses a tree from an NCBI ASN.1 text format file. Note that the tree can only contain a single file, and this method will always return a list with a single element.

Parameters
inputStreamThe Stream from which the file should be read.
keepOpenDetermines whether the stream should be disposed at the end of this method or not.
Returns
A List<T> containing the tree defined in the file. This will always consist of a single element.

Definition at line 52 of file NcbiAsnText.cs.

◆ ParseAllTrees() [2/2]

static List< TreeNode > PhyloTree.Formats.NcbiAsnText.ParseAllTrees ( string  inputFile)
static

Parses a tree from an NCBI ASN.1 text format file. Note that the tree can only contain a single file, and this method will always return a list with a single element.

Parameters
inputFileThe path to the input file.
Returns
A List<T> containing the tree defined in the file. This will always consist of a single element.

Definition at line 40 of file NcbiAsnText.cs.

◆ ParseTree() [1/2]

static TreeNode PhyloTree.Formats.NcbiAsnText.ParseTree ( string  source)
static

Parses a tree from an NCBI ASN.1 format string into a TreeNode object.

Parameters
sourceThe NCBI ASN.1 format tree string.
Returns
The parsed TreeNode object.

Definition at line 63 of file NcbiAsnText.cs.

◆ ParseTree() [2/2]

static TreeNode PhyloTree.Formats.NcbiAsnText.ParseTree ( TextReader  reader)
static

Parses a tree from a TextReader that reads an NCBI ASN.1 format string into a TreeNode object.

Parameters
readerThe TextReader that reads the NCBI ASN.1 format string.
Returns
The parsed TreeNode object.

Definition at line 74 of file NcbiAsnText.cs.

◆ ParseTrees() [1/2]

static IEnumerable< TreeNode > PhyloTree.Formats.NcbiAsnText.ParseTrees ( Stream  inputStream,
bool  keepOpen = false 
)
static

Parses a tree from an NCBI ASN.1 text format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element.

Parameters
inputStreamThe Stream from which the file should be read.
keepOpenDetermines whether the stream should be disposed at the end of this method or not.
Returns
A IEnumerable<T> containing the tree defined in the file. This will always consist of a single element.

Definition at line 30 of file NcbiAsnText.cs.

◆ ParseTrees() [2/2]

static IEnumerable< TreeNode > PhyloTree.Formats.NcbiAsnText.ParseTrees ( string  inputFile)
static

Parses a tree from an NCBI ASN.1 text format file. Note that the tree can only contain a single file, and this method will always return a collection with a single element.

Parameters
inputFileThe path to the input file.
Returns
A IEnumerable<T> containing the tree defined in the file. This will always consist of a single element.

Definition at line 19 of file NcbiAsnText.cs.

◆ WriteAllTrees() [1/4]

static void PhyloTree.Formats.NcbiAsnText.WriteAllTrees ( IEnumerable< TreeNode trees,
Stream  outputStream,
bool  keepOpen = false,
string  treeType = null,
string  label = null 
)
static

Writes a collection of TreeNodes to a file in NCBI ASN.1 text 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.

Parameters
treesThe collection of trees to write. If this contains more than one tree, an exception will be thrown.
outputStreamThe Stream on which the tree should be written.
keepOpenDetermines whether the outputStream should be kept open after the end of this method.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 359 of file NcbiAsnText.cs.

◆ WriteAllTrees() [2/4]

static void PhyloTree.Formats.NcbiAsnText.WriteAllTrees ( IEnumerable< TreeNode trees,
string  outputFile,
string  treeType = null,
string  label = null 
)
static

Writes a collection of TreeNodes to a file in NCBI ASN.1 text 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.

Parameters
treesThe collection of trees to write. If this contains more than one tree, an exception will be thrown.
outputFileThe path to the output file.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 386 of file NcbiAsnText.cs.

◆ WriteAllTrees() [3/4]

static void PhyloTree.Formats.NcbiAsnText.WriteAllTrees ( List< TreeNode trees,
Stream  outputStream,
bool  keepOpen = false,
string  treeType = null,
string  label = null 
)
static

Writes a list of TreeNodes to a file in NCBI ASN.1 text 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.

Parameters
treesThe list of trees to write. If this contains more than one tree, an exception will be thrown.
outputStreamThe Stream on which the tree should be written.
keepOpenDetermines whether the outputStream should be kept open after the end of this method.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 414 of file NcbiAsnText.cs.

◆ WriteAllTrees() [4/4]

static void PhyloTree.Formats.NcbiAsnText.WriteAllTrees ( List< TreeNode trees,
string  outputFile,
string  treeType = null,
string  label = null 
)
static

Writes a list of TreeNodes to a file in NCBI ASN.1 text 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.

Parameters
treesThe list of trees to write. If this contains more than one tree, an exception will be thrown.
outputFileThe path to the output file.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 433 of file NcbiAsnText.cs.

◆ WriteTree() [1/3]

static void PhyloTree.Formats.NcbiAsnText.WriteTree ( TreeNode  tree,
Stream  outputStream,
bool  keepOpen = false,
string  treeType = null,
string  label = null 
)
static

Writes a TreeNode to a file in NCBI ASN.1 text format.

Parameters
treeThe tree to write.
outputStreamThe Stream on which the tree should be written.
keepOpenDetermines whether the outputStream should be kept open after the end of this method.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 345 of file NcbiAsnText.cs.

◆ WriteTree() [2/3]

static void PhyloTree.Formats.NcbiAsnText.WriteTree ( TreeNode  tree,
string  outputFile,
string  treeType = null,
string  label = null 
)
static

Writes a TreeNode to a file in NCBI ASN.1 text format.

Parameters
treeThe tree to write.
outputFileThe path to the output file.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.

Definition at line 332 of file NcbiAsnText.cs.

◆ WriteTree() [3/3]

static string PhyloTree.Formats.NcbiAsnText.WriteTree ( TreeNode  tree,
string  treeType = null,
string  label = null 
)
static

Writes a TreeNode to a string in NCBI ASN.1 text format.

Parameters
treeThe tree to write.
treeTypeAn optional value for the treetype property defined in the NCBI ASN.1 tree format.
labelAn optional value for the label property defined in the NCBI ASN.1 tree format.
Returns
A string containing the NCBI ASN.1 representation of the TreeNode.

Definition at line 452 of file NcbiAsnText.cs.


The documentation for this class was generated from the following file: