-
Notifications
You must be signed in to change notification settings - Fork 2
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.
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
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 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.
Give the log of the product of the support of all clades.
Delete the internal node labels
Get clusters based on method, e.g.:
treebender --cluster 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
Returns taxa in clades on branches longer than cut off. Cut off should be given after colon (:).
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
Get the longest distance from the root to any of the tips.
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 the given tips from the tree, e.g.
treebender -d taxon1,taxon2,taxon3
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
Assign branch numbers as node labels.
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).
Give file name, e.g.:
treebender -f file.tree.
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.
Print this help.
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
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 the string of taxa, e.g. drop all tips but the given. E.g:
treebender -d taxon1,taxon2,taxon3 -i
Test if the given taxa form a monophyletic group, e.g.
treebender --is_monophyletic taxon1,taxon2
Laddrize the tree. If followed by l - left ladderize, if followed by r - right ladderize (default), e.g.
treebender -l r
Present a fasta-formated matrix with splits of trees coded as characters. Intended for matrix representation parsimony.
Root the tree at the mid point.
Multiply each branch in the tree with the given value, e.g.
treebender -u 3.5
Default 1.0.
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 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.
Get the number of nodes with higher support than given value. Should be followed by value, e.g.
--n_supported 70.0
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
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.
Set branches with shorter than given value to 0
Get the number of tips/taxa in the tree.
Root using most recent common ancestor of given taxa, e.g.
treebender -o taxa1,taxa2
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)'
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.
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
Will read annotations in FigTree/treeanotator format (e.g. [&rate=1.0,height=3.0]).
Will root on the group defined as for --get_relaxed_outgroup.
Set all branches in the tree to the given value, e.g.:
treebender -b 0.5 (default 1.0)
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).
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 :.
Sets if the tree should be considered as rooted or not (only matters when splitting trees).
Get the sum of the branch lengths in the tree (including root branch if length for this is given).
Get additional output.