A simple, extensible, Perl script for producing figures of large phylogenetic trees.
- While there are many other tree drawing programs, slacTree was originally written in 2009 to fill a need for producing publication quality figures of circular trees with more than 1000 taxa with custom annotations
- Because it is a single Perl script with very few dependencies, it is easy to run, and easy to further customize
- SVG is used because it is a scalable format allowing for very small representations of entire trees or highly magnified regions with unlimited resolution
- Circular and radial trees are more compact than linear representations
See examples/ for a tutorial
Abundance values from 3 datasets
Magnified region; SVG allows for unlimited scaling
Density plots of 3 datasets
File | Description |
---|---|
slacTree.pl | Main program for drawing SVG trees |
config.txt | Default settings |
default_annotations.txt | Annotations and comments added to new slacTree files |
make_density_jpg.r | Run by slacTree.pl to create density background JPGs |
convert_old_treeinfo.pl | Converts older versions of slacTree or treeinfo files |
examples/ | Tutorial examples |
Usage: slacTree.pl [command] (options)
commands:
newick2st newick file -> basic slactree
jplace2st jplace file -> slactree with abundances
st2newick slactree file -> newick
tree slactree file -> SVG
density slactree file -> density plot overlay SVG
zlim calculate scaling factor (for multiple plots)
options:
-d output density/abundance base file
-f force overwrite of output file (default: no overwrite)
-h show help
-i file input file (use '-' for STDIN)
-o file output file (default: STDOUT)
-t file taxonomic data file (optional)
-z num scaling factor (for multiple plots)
newick2st
Converts a newick tree file into a slactree file for editing or plotting in SVG.
-i input newick tree file
-t optional taxonomic information, tab delimited file format (id, name, taxonomic assignment), the taxonomic assignment is a semi-colon delimited string of taxonomic ranks from high to low, eg. Bacteria;Proteobacteria;Gammaproteobacteria;Enterobacteriales;Enterobacteriaceae;Escherichia-Shigella;Escherichia coli
> slacTree.pl newick2st -i infile.newick -t infile.taxonomy.txt -o outfile.st
jplace2st
Converts a .jplace file (JSON format, from PPlacer) to a slactree file, including node abundances.
-i input jplace file
-t optional taxonomic grouping/color information, tab delimited format (id, color), if there are multiple groups or datasets combined in a single jplace file, then this allows creation of abundance values seperated by color in the slactree file
> slacTree.pl jplace2st -i infile.jplace -t infile.taxa.colors -o outfile.st
st2newick
Outputs a newick tree file, from a slactree file. Is useful if creating/editing the tab delimited format of slactree, for export into other tree programs. Can also be used to fix newick tree files in some cases by running newick2st followed by st2newick.
-i input slactree file
> slacTree.pl st2newick -i infile.st -o outfile.newick
tree
Draws the annotated tree, output in SVG format.
-i input slactree file
-z optional scaling factor to maintain a consistent scaling for multiple plots. Run slacTree zlim command to calculate a value for each plot, prior to deciding on a single -z scaling factor to use.
> slacTree.pl tree -i infile.st -z 0.924 -o outfile.svg
density
Draws the annotated tree, but with a density plot overlay based on abundance values.
-i input slactree file
-z optional scaling factor to maintain a consistent scaling for multiple plots. Run slacTree zlim command to calculate a value for each plot, prior to deciding on a single -z scaling factor to use.
> slacTree.pl density -i infile.st -z 0.924 -o outfile.svg
zlim
Calculates the maximum z scaling factor for a slactree with abundances. Use this with multiple slactree files and choose the largest value to plot each using tree or density commands, in order to maintain a consistent scaling across all plots.
-i input slactree file
> slacTree.pl zlim -i in1.st
0.924
> slacTree.pl zlim -i in2.st
0.876