Abuntant OTU
DOI: 10.1016/j.envpol.2022.120243
Figure 3A Left
Fig3 left
library(itol.toolkit)
library(data.table)
tree_1 <- "https://raw.githubusercontent.com/TongZhou2017/itol.toolkit/master/inst/extdata/dataset3/abunt-tree.nwk"
hub_1 <- create_hub(tree_1)
data_file_1 <- "https://raw.githubusercontent.com/TongZhou2017/itol.toolkit/master/inst/extdata/dataset3/abunt-metadata.txt"
data_1 <- data.table::fread(data_file_1)
# relabel by genus
unit_1 <- create_unit(data = data_1 %>% select(ID, Genus),
key = "rep_Zheng2022ep_3al_1_labels",
type = "LABELS",
tree = tree_1)
# tree_colors range by phylum
unit_2 <- create_unit(data = data_1 %>% select(ID, Phylum),
key = "rep_Zheng2022ep_3al_2_range",
type = "TREE_COLORS",
subtype = "range",
tree = tree_1)
# color_strip by class
set.seed(123)
unit_3 <- create_unit(data = data_1 %>% select(ID, Class),
key = "rep_Zheng2022ep_3al_3_strip",
type = "DATASET_COLORSTRIP",
color = "wesanderson",
tree = tree_1)
unit_3@common_themes$basic_theme$margin <- 50
# simple_bar by NS
unit_4 <- create_unit(data = data_1 %>% select(ID, NS),
key = "rep_Zheng2022ep_3al_4_simplebar",
type = "DATASET_SIMPLEBAR",
tree = tree_1)
unit_4@specific_themes$basic_plot$size_max <- 100
# simple_bar by OS
unit_5 <- create_unit(data = data_1 %>% select(ID, OS),
key = "rep_Zheng2022ep_3al_5_simplebar",
type = "DATASET_SIMPLEBAR",
tree = tree_1)
unit_5@specific_themes$basic_plot$size_max <- 100
# simple_bar by OS
unit_6 <- create_unit(data = data_1 %>% select(ID, Dissimilarity),
key = "rep_Zheng2022ep_3al_6_gradient",
type = "DATASET_GRADIENT",
tree = tree_1)
#unit_6@specific_themes$heatmap$color$min <- "#0000ff"
#unit_6@specific_themes$heatmap$color$max <- "#ff0000"
hub_1 <- hub_1 +
unit_1 +
unit_2 +
unit_3 +
unit_4 +
unit_5 +
unit_6
write_hub(hub_1,getwd())