burntrees.pl
Documentation for burntrees.pl version 0.1.9
burntrees.pl [--burnin=<number>] [--pburnin=<number>] [--start=<number>] [--end=<number>] [--jump=<number>] [--IFeelLucky=<number>] [--treesonly] [--rmbrlens] [--[no]close] [--getinfo] [--[no]labels] [--format=altnexus|phylip] [--outfile=<file_name>] FILE [> OUTPUT]
Script for manipulating tree (*.t, *.trprobs, *.con) and parameter (*.p) files from MrBayes (v.3). The script exctracts trees and (by default) the taxon translation table and the trailing ``end;'' from a MrBayes tree file.
A number of options are available:
Any contiguous interval of trees can be printed, as well as trees only (nothing other than tree descriptions).
The samples can be thinned by setting a value for how many trees to jump before next is printed.
Branch lengths (if present) can be removed from trees before printing.
A random set of trees can be printed from the tree file.
Lines can also be extracted from a MrBayes *.p file.
Trees can be printed in Phylip (Newick) format or as altnexus (sequence labels instead of numbers).
Mandatory arguments to long options are mandatory for short options too
Start printing after tree number.
Forces a trailing ``end;'' to be printed after the last tree. --noclose prevents the ``end;'' to be printed. Note that the trailing ``end;'' in the tree file is printed by default unless --noclose is given.
Concatenate several files -- Not yet implemented. See USAGE for alternatives.
End the printing of trees after tree number (inclusively). If no --end is given, prints to last tree in file.
Trees are printed as specified by format, where format is either altnexus: with sequence (taxon) labels instead of numbers, or phylip (the Newick format).
Print information about the number of trees (or samples in p file), thinning and number of samples in file and quit.
Prints help message and exits.
Specify a probability (value between 0 -- 1) for each tree to be printed. That is, print each tree with prob. number. Note that --IFeelLucky has precedence over --jump.
Specify a thinning. That is, print every number tree.
Print trees using sequence (taxon) labels instead of the sequence numbers in the translation table. --nolabels (which is the default) prevents the sequence numbers to be substituted.
Displays the manual page.
Print directly to file file_name instead of standard out.
Start printing after a fraction of the run, where number is a percentage (e.g. ``50'' for half the run).
Remove branch lengths from trees.
Start printing from tree number (inclusively).
Print trees only (do not print taxon descriptions etc.). If used on a *.p file it skips the ``ID'' line and the headers.
Prints version message and exits.
Reads a Nexus formatted tree FILE, preferrably MrBayes (v.3) *.t, *.con, and *.trprobs files. FILE can also be a MrBayes parameter file (*.p), or any Nexus formatted tree file (this last feature is not thoroughly tested!).
Prints to STDOUT unless --outfile= is used.
Examples:
burntrees.pl --burnin=10 data.t > out.t burntrees.pl --pburnin=50 data.t burntrees.pl --start=11 --end=30 data.t burntrees.pl --jump=10 data.t burntrees.pl --treesonly data.t burntrees.pl --getinfo -b=10 data.t burntrees.pl --rmbrlens data.t burntrees.pl --ifeellucky=0.50 data.t burntrees.pl -b=10 -j=10 -t -r data.t burntrees.pl --treesonly -b=10 data.p burntrees.pl --format=altnexus data.t burntrees.pl -f=phylip --outfile=data.phy data.t burntrees.pl -f=p -b=1 data.con
For concatenation of several files, use (note the append redirection, ``>>''):
burntrees.pl -b=10 -noc data.run1.t > data.t burntrees.pl -b=40 -t data.run2.t >> data.t burntrees.pl -b=20 -t -c data.run3.t >> data.t
To print the '#NEXUS', 'begin trees;', and the translation table only (no trees), use
burntrees.pl -i=0 -noc data.t
To convert the MrBayes file to a 'altnexus' file or a 'phylip' file, use
burntrees.pl --format=altnexus data.t burntrees.pl --format=phylip data.t
To concatenate several files in to one altnexus formatted file, use (note the combination of '--format' and '--labels')
burntrees.pl -b=10 -noc -f=a data.run1.t > data.t burntrees.pl -b=40 -t -l data.run2.t >> data.t burntrees.pl -b=20 -t -c -l data.run3.t >> data.t
To extract the second tree in the MrBayes *.con file in phylip format, use
burntrees.pl -b=1 -f=p data.con
Written by Johan A. A. Nylander
Please report any bugs to jnylander @ users.sourceforge.net.
Uses Perl modules Getopt::Long and Pod::Usage
Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Johan Nylander. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html