ExportITOL
ExportITOL.RdExport a feature dendrogram and companion annotation files for visualisation in iTOL (Interactive Tree of Life). Produces three files:
A Newick tree (
<outprefix>.nwk)A colour-strip annotation coloured by NPC pathway (or any
mmo$sirius_annotcolumn) (<outprefix>_colorstrip.txt)A bar-chart annotation showing per-feature prevalence across samples (
<outprefix>_barplot.txt)
Usage
ExportITOL(
tree,
mmo,
outprefix = "itol_export",
color_by = "NPC#pathway",
palette = "Dark 3",
na_color = "#CCCCCC"
)Arguments
- tree
Output list from
FeatureDendrogram().- mmo
mmo object. Must contain
mmo$sirius_annot(for colour strip) andmmo$feature_presenceormmo$feature_data(for prevalence bar chart).- outprefix
File path prefix for output files (default:
"itol_export"). Directories in the path must exist.- color_by
Column name in
mmo$sirius_annotused for the colour strip (default:"NPC#pathway").- palette
Qualitative palette name for
colorspace::qualitative_hcl(default:"Dark 3").- na_color
Hex colour for features with no annotation (default:
"#CCCCCC").
Details
How to load in iTOL: Upload the Newick file at https://itol.embl.de/upload.cgi, then drag and drop the two annotation files onto the displayed tree. Select "Circular" layout and enable "Display" for each dataset in the Datasets panel.
Prevalence calculation: Feature prevalence is the proportion of samples in which a feature is detected (abundance > 0). Features absent from the PA table are assigned prevalence 0. This value drives the bar-chart length in iTOL.
Colour-strip annotation:
Each tip is assigned the colour of its NPC pathway (or other chosen column)
from mmo$sirius_annot. Features with no annotation are coloured
na_color. The legend is written into the file header so iTOL renders
it automatically.
Examples
if (FALSE) {
tree <- FeatureDendrogram(mmo, distance = "dreams")
ExportITOL(tree, mmo, outprefix = "output/itol_dreams")
# Upload output/itol_dreams.nwk to iTOL, then drag and drop the two .txt files
}