Load data and simple data cleaning
fungal_df = read_excel("/Users/cuihening/Desktop/output/output_results.xlsx", sheet = 4) %>%
janitor::clean_names()
stoma_df = read_excel("/Users/cuihening/Desktop/output/output_results.xlsx", sheet = 5) %>%
janitor::clean_names()
cell_df = read_excel("/Users/cuihening/Desktop/output/output_results.xlsx", sheet = 6) %>%
janitor::clean_names()
Feature distribution
Fungus
dep_dis =
fungal_df %>%
ggplot(aes(x = depth_um)) +
geom_density(fill = "#77969A", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$depth_um), linetype = "dotted") +
labs(x = "Depth") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
brea_dis =
fungal_df %>%
ggplot(aes(x = breadth_um)) +
geom_density(fill = "#CC543A", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$breadth_um), linetype = "dotted") +
labs(x = "Breadth") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
volu_dis =
fungal_df %>%
ggplot(aes(x = volume_um3)) +
geom_density(fill = "#E9A368", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$volume_um3), linetype = "dotted") +
labs(x = "Volume") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
avg_branch_dis =
fungal_df %>%
ggplot(aes(x = avg_branch_length_um)) +
geom_density(fill = "#b98b73", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$avg_branch_length_um), linetype = "dotted") +
labs(x = "Average branch length") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
num_branch_dis =
fungal_df %>%
ggplot(aes(x = num_branches)) +
geom_density(fill = "#cb997e", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$num_branches), linetype = "dotted") +
labs(x = "Branch number") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
max_branch_dis =
fungal_df %>%
ggplot(aes(x = max_branch_length)) +
geom_density(fill = "#ddbea9", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$max_branch_length), linetype = "dotted") +
labs(x = "Max Branch length") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
mip_area_dis =
fungal_df %>%
ggplot(aes(x = mip_area_um2)) +
geom_density(fill = "#ddbea9", alpha = 0.6) +
geom_vline(xintercept = mean(fungal_df$mip_area_um2), linetype = "dotted") +
labs(x = "MIP area") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
combination_plt =
subplot(
ggplotly(dep_dis),
ggplotly(brea_dis),
ggplotly(volu_dis),
ggplotly(avg_branch_dis),
ggplotly(num_branch_dis),
ggplotly(max_branch_dis),
ggplotly(mip_area_dis),
nrows = 4,
titleY = TRUE,
titleX = TRUE,
margin = 0.1
)
combination_plt =
combination_plt %>%
layout(showlegend = F)
combination_plt
Cell
centx_dis =
cell_df %>%
ggplot(aes(x = centroid_x)) +
geom_density(fill = "#77969A", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$centroid_x), linetype = "dotted") +
labs(x = "centroid X") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
centy_dis =
cell_df %>%
ggplot(aes(x = centroid_y)) +
geom_density(fill = "#ddbea9", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$centroid_y), linetype = "dotted") +
labs(x = "centroid Y") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
width_dis =
cell_df %>%
ggplot(aes(x = width_um)) +
geom_density(fill = "#E9A368", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$width_um), linetype = "dotted") +
labs(x = "Width") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
height_dis =
cell_df %>%
ggplot(aes(x = height_um)) +
geom_density(fill = "#ffe8d6", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$height_um), linetype = "dotted") +
labs(x = "height") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
area_dis =
cell_df %>%
ggplot(aes(x = area_um2)) +
geom_density(fill = "#d4c7b0", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$area_um2), linetype = "dotted") +
labs(x = "Area") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
eccen_dis =
cell_df %>%
ggplot(aes(x = eccentricity)) +
geom_density(fill = "#a5a58d", alpha = 0.6) +
geom_vline(xintercept = mean(cell_df$eccentricity), linetype = "dotted") +
labs(x = "Eccentricity") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
combination_cellplt =
subplot(
ggplotly(centx_dis),
ggplotly(centy_dis),
ggplotly(width_dis),
ggplotly(height_dis),
ggplotly(area_dis),
ggplotly(eccen_dis),
nrows = 2,
titleY = TRUE,
titleX = TRUE,
margin = 0.1
)
combination_cellplt =
combination_cellplt %>%
layout(showlegend = F)
combination_cellplt
Stoma
centx_sdis =
stoma_df %>%
ggplot(aes(x = centroid_x)) +
geom_density(fill = "#77969A", alpha = 0.6) +
geom_vline(xintercept = mean(stoma_df$centroid_x), linetype = "dotted") +
labs(x = "centroid X") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
centy_sdis =
stoma_df %>%
ggplot(aes(x = centroid_y)) +
geom_density(fill = "#d4c7b0", alpha = 0.6) +
geom_vline(xintercept = mean(stoma_df$centroid_y), linetype = "dotted") +
labs(x = "centroid Y") +
theme(legend.title = element_blank(),
axis.text.x = element_text(angle = 45))
combination_stomaplt =
subplot(
ggplotly(centx_sdis),
ggplotly(centy_sdis),
titleY = TRUE,
titleX = TRUE,
margin = 0.1
)
combination_stomaplt =
combination_stomaplt %>%
layout(showlegend = F)
combination_stomaplt