Bsoft 2.1.4
Bernard's software package
rwtree.cpp File Reference

Functions for reading (and writing) trees. More...

#include "rwtree.h"
#include "utilities.h"

Functions

Bnoderead_tree (char *filename)
 Reads a phylip format tree file. More...
 
Bnodetree_read_node (char **handle, Bnode *one)
 Reads a node into a tree structure. More...
 
int tree_calculate_angle (Bnode *node, int *itip, float tip_angle)
 Calculates an angle for each node for plotting. More...
 
int tree_delete_node (Bnode *node)
 Deletes a node with all daughter nodes. More...
 
int tree_rotate (Bnode *node, float angle)
 Adds an angle to all nodes. More...
 
int tree_show (Bnode *node)
 Shows a node with all daughter nodes. More...
 

Variables

int verbose
 

Detailed Description

Functions for reading (and writing) trees.

Author
Bernard Heymann
Date
Created: 20010722
Modified: 20110810

Function Documentation

◆ read_tree()

Bnode * read_tree ( char *  filename)

Reads a phylip format tree file.

Reads the tree file using a recursive approach.
Parameters
*filenametree file name.
Returns
Bnode* a pointer to the root node of the tree.

◆ tree_calculate_angle()

int tree_calculate_angle ( Bnode node,
int *  itip,
float  tip_angle 
)

Calculates an angle for each node for plotting.

Parameters
*nodenode.
*itipthe number of tip nodes passed.
tip_anglethe angular increment for each tip node.
Returns
int 0.

◆ tree_delete_node()

int tree_delete_node ( Bnode node)

Deletes a node with all daughter nodes.

Parameters
*nodenode.
Returns
int 0.

◆ tree_read_node()

Bnode * tree_read_node ( char **  handle,
Bnode one 
)

Reads a node into a tree structure.

Parameters
**handlepointer to the buffer holding the phylip format tree.
*oneone node.
Returns
Bnode* a pointer to the new node of the tree.

◆ tree_rotate()

int tree_rotate ( Bnode node,
float  angle 
)

Adds an angle to all nodes.

The angle must be specified in radians.
Parameters
*nodenode.
anglerotation angle (radians).
Returns
int 0.

◆ tree_show()

int tree_show ( Bnode node)

Shows a node with all daughter nodes.

Parameters
*nodenode.
Returns
int 0.

Variable Documentation

◆ verbose

int verbose
extern