write_hub.Rd
Write itol.hub object into template files.
write_hub(object, dir = getwd(), with_tree = FALSE)
itol.hub object holds the complete data and theme information. This is an all-in-one object that collects all the information. Based on this object, it is possible to export template files directly. It can also be converted to an operation unit object for the detailed processing of individual datasets. The object can also be saved locally for reproducible visualization to share. This object contains species or sample clustering trees, sequence alignment, species abundance or gene expression table, multi-level taxonomic information, metadata, and a list of custom themes. Each element name in the theme list is prefixed with the column name of the metadata and is used to establish the association between the theme and the data. For some special dataset types, the storage location is not in the metadata, but it also conforms to the association with themes. The program automatically decides where to read the data according to the different output template types. The user only needs to explicitly define the theme name to be output consistent with the data name prefix.
output dir path. Define the output files location using absolute or relative path. The template files will output by the key information from theme name in the hub object.
output with tree file in newick format.
No return value, only output template files
tree <- system.file("extdata",
"tree_of_itol_templates.tree",
package = "itol.toolkit")
hub <- create_hub(tree = tree)
data("template_groups")
df_group <- data.frame(id = unique(template_groups$group),
data = unique(template_groups$group))
## create unit
unit_1 <- create_unit(data = df_group,
key = "Quickstart_1",
type = "TREE_COLORS",
subtype = "clade",
line_type = c(rep("normal",4),"dashed"),
size_factor = 5,
tree = tree)
#> Identifying data column to auto setup color parameter
#> Using default color pattern: table2itol
unit_2 <- create_unit(data = df_group,
key = "Quickstart_2",
type = "DATASET_COLORSTRIP",
tree = tree)
#> Using default color pattern: table2itol
## write hub
hub <- hub + unit_1 + unit_2
write_hub(hub,tempdir())