Skip to content

treebender

mr-y edited this page Nov 2, 2016 · 1 revision

Treebender

Treebender is a command line program for manipulating trees. The program take a tree in newick or nexus format as indata through standard in or from a file and process it according to given options.

This manual is originally based on the help function (-h) of treebender but with successive changes.

Usage

treebender [arguments] < file.tree
treebender [arguments] file.tree

For the second alternative you need to be careful so treebender does not interpret the filename as an extra argument to a switch. If this happen treebender will expect input from standard in and it will appear as nothing is happening. This can be avoided by giving the filename after the switch --file/-f. When taxa should be given as extra arguments they can be given in a text following the format for the argument. Newline and carriage returns will be ignored. The file name should be given behind the word file and colon, e.g.:

treebender -d file:file_name.txt

Arguments

--branch_lengths / -a

Print branch lengths, the separator can be given as first argument after the switch, e.g.:

treebender -a '\n'

Default is ','. If the switch r is given as second argument after a colon (:), e.g.:

treebender -a '\n:r'

The value of the root branch will be printed as well, if n (default) is given it will not. A separator between output from different trees can be given after another colon.

--change_names / -c

Change the name of tips. Tip names to be changed should be given pairwise with present name first and new name second, separated by '|'. Separate pairs should be separated by ',' e.g.:

treebender -c 'taxon1|new1,taxon2|new2'

The quotation marks are required to cancel the special meaning of |. If several tips have the same name all will be changed. Changes later in the list will be effected by changes made earlier in the list, e.g.

treebender -c 'taxon1|new1,new1|new2'

will change the name of taxon1 to new2.

--clade_credibility

Give the log of the product of the support of all clades.

--clear_internal_node_labels

Delete the internal node labels

--cluster

Get clusters based on method, e.g.:

treebender --cluster branch_length

Available methods:

branch_length

Separate clusters by single link clustering based on phylogenetic distance. Cut off should be given after colon, e.g.:

treebender --cluster branch_length:0.03
long_branch

Returns taxa in clades on branches longer than cut off. Cut off should be given after colon (:).

tip_name

Cluster taxa based on taxon annotation. Should be followed after a colon by a single character that separates different parts of the tip name (default ' ') and after another colon (:) a number giving which position in the name should be used for clustering, (default 1), e.g.:

treebender --cluster tip_name:\|:5

--depth / -D

Get the longest distance from the root to any of the tips.

--distances_to_root / -z

Output the number of nodes and branch length distance to the root for each tip. The separator between tip name and value can be specified, separated by colon, e.g.:

treebender -p ",:|"

Default is newline and tab. A separator between output from different trees can be given after another colon

--drop_tips / -d

Drop the given tips from the tree, e.g.

treebender -d taxon1,taxon2,taxon3

--get_tip_names / -t

Get the names of the tips in the tree, a separator can be specified, e.g.:

treebender -t \\n

will give each name on separate rows (',' is the default separator). A separator between output from different trees can be given after another colon

--get_branch_numbers

Assign branch numbers as node labels.

--get_relaxed_outgroup

Get the taxa in the clade that include the largest fraction of the difference between number of taxa included in the given group and number not included in the group divided by the total number in the group. Taxa given as comma separated string (see --drop_tips).

--file / -f

Give file name, e.g.:

treebender -f file.tree.

--format

Give format of input, e.g.:

treebender --format nexus

If no format is given and the input is a file treebender will try to guess the format, if it is through standard in it will assume newick format.

--help / -h

Print this help.

--internal_node_stats

Print stats about the values on the internal nodes. Counts nodes with value above given value, e.g.:

treebender --internal_node_stats 1.96

Default: 1.0. If extra stats are given in FigTree/treeanotator format the parameter to summarize can be given behind colon, e.g.:

treebender --internal_node_stats 1.96:rate

,or

treebender --internal_node_stats :rate

--interval

Only print the trees in the interval. Interval given as first tree to print - last tree to print, e.g.:

treebender --interval 10-100

, or just the first tree to print, e.g.:

treebender --interval 1000

--inverse / -i

Inverse the string of taxa, e.g. drop all tips but the given. E.g:

treebender -d taxon1,taxon2,taxon3 -i

--is_monophyletic

Test if the given taxa form a monophyletic group, e.g.

treebender --is_monophyletic taxon1,taxon2

--ladderize / -l

Laddrize the tree. If followed by l - left ladderize, if followed by r - right ladderize (default), e.g.

treebender -l r

--matrix_representation

Present a fasta-formated matrix with splits of trees coded as characters. Intended for matrix representation parsimony.

--mid_point_root / -m

Root the tree at the mid point.

--multiply_branch_lengths / -u

Multiply each branch in the tree with the given value, e.g.

treebender -u 3.5

Default 1.0.

--multiply_branch_lengths_clade / -V

Multiply branches in clades defined by the most recent common ancestor of comma separated taxa. Separate clade with colon. E.g.

treebender -V 3:Taxon_1,Taxon_2:Taxon_3,Taxon_4

--multiply_branch_lengths_until / -U

Multiply branches in tree up until given distance (cut off) from root with the given value (separated by colon), e.g.

treebender -U 2:40 

Default 1.0:0.0.

--n_supported

Get the number of nodes with higher support than given value. Should be followed by value, e.g.

--n_supported 70.0

--nni

Perform nearest neighbor interchange. If a integer is given as extra argument the interchange will be done on that branch (use --get_branch_numbers to get branch numbers). If 0 or no extra argument is given a branch will be selected randomly. If 'all' is given NNI will be performed for all branches, e.g.

treebender --nni 4

, or

treebender --nni all

--no_branch_length / -0

Do not print branch lengths. If there are no branch lengths in input tree the default is to print zero length branches in the out tree. This argument override this and print no branch lengths.

--null_short_branches

Set branches with shorter than given value to 0

--number_of_taxa / -n

Get the number of tips/taxa in the tree.

--outgroup_root / -o

Root using most recent common ancestor of given taxa, e.g.

treebender -o taxa1,taxa2

--output

Give tree format for output, nexus (nex or x for short), newick (new or w for short), or svg e.g.:

treebender --output x

Default w. For svg extra graphical commands can be given after a colon (:). Each command should be separated by &, and commands and arguments should be separated by colon. Possible commands are: 'width' set width of figure; 'height' set hight of figure; 'offset' set offset between tips and tip label; 'strokewidth' set the width of the branches; 'fontsize' sets the size of the font used; 'font' sets which font to use; and 'tipcolor' sets the color of the tip labels given in parenthesis directly behind the color. 'width' and 'height' are mandatory if you want to set any other parameter than tip color. E.g.

treebender --output 'svg:width:300&height:400&tipcolor:red(taxon1,taxon2,taxon3)green(taxon4)'

--patristic_distances / -p

Get the total patristic distance to all other taxa in the tree for each taxon, the separator between different taxa, and the separator between taxon name and value can be specified (separated by colon) e.g.:

treebender -p ",: | "

Default is new line and space. A separator between output from different trees can be given after another colon.

--random_tree / -r

Get a random topology (no branch lengths) with given number of taxa, e.g. -r 20 (default 0). Number of random trees can be given behind a colon (:), e.g.:

treebender -r 20:100

--read_figtree_annotations

Will read annotations in FigTree/treeanotator format (e.g. [&rate=1.0,height=3.0]).

--relaxed_outgroup_root

Will root on the group defined as for --get_relaxed_outgroup.

--set_branch_lengths / -b

Set all branches in the tree to the given value, e.g.:

treebender -b 0.5 (default 1.0)

--split

Splits tree based on the longest branch (longest_branch/l) or the mid point (mid_point/m) until a stop criterion set by --split_stop is reached. Which derived tree to split in each iteration can be set after :. Either the tree with the longest branch (l; default for longest_branch split) or the tree with most tips (n; default for mid_point split).

--split_stop

Sets criterion for when to stop splitting trees, either at a maximum number of trees (max_tree_number/t) or when all trees have fewer than a certain number of tips (max_tree_size/s). The number should be given togather with the specific criterion after :.

--rooted / -R

Sets if the tree should be considered as rooted or not (only matters when splitting trees).

--sum_branch_length / -s

Get the sum of the branch lengths in the tree (including root branch if length for this is given).

--verbose / -v

Get additional output.

Clone this wiki locally