p0 <- SCpubr::do_BarPlot(sample = sample[, sample$subtype == "Oligodendroglioma"],
group.by = "final_annotation",
split.by = "orig.ident",
font.size = 16,
flip = TRUE,
colors.use = cluster_cols,
position = "fill",
legend.position = "none",
plot.grid = FALSE,
add.n = TRUE,
add.n.expand = c(0, 1.15),
axis.text.face = "plain",
add.n.size = 5) +
ggplot2::ylab("") +
ggplot2::xlab("OD") +
ggplot2::theme(axis.text.x = ggplot2::element_blank(),
axis.ticks.x = ggplot2::element_blank(),
strip.text = ggplot2::element_blank(),
plot.margin = ggplot2::margin(t = 0, r = 10, b = 0, l = 10))
p1 <- SCpubr::do_BarPlot(sample = sample[, sample$subtype == "Astrocytoma"],
group.by = "final_annotation",
split.by = "orig.ident",
font.size = 16,
flip = TRUE,
colors.use = cluster_cols,
position = "fill",
legend.position = "none",
plot.grid = FALSE,
add.n = TRUE,
add.n.expand = c(0, 1.15),
axis.text.face = "plain",
add.n.size = 5) +
ggplot2::ylab("") +
ggplot2::xlab("AS") +
ggplot2::theme(axis.text.x = ggplot2::element_blank(),
axis.ticks.x = ggplot2::element_blank(),
strip.text = ggplot2::element_blank(),
plot.margin = ggplot2::margin(t = 0, r = 10, b = 0, l = 10))
p2 <- SCpubr::do_BarPlot(sample = sample,
group.by = "final_annotation",
split.by = "subtype",
flip = TRUE,
position = "fill",
font.size = 16,
colors.use = cluster_cols,
legend.position = "none",
plot.grid = FALSE,
add.n = TRUE,
add.n.expand = c(0, 1.15),
axis.text.face = "plain",
add.n.size = 5) +
ggplot2::xlab("") +
ggplot2::ylab("") +
ggplot2::theme(axis.text.x.bottom = ggplot2::element_blank(),
axis.ticks.x.bottom = ggplot2::element_blank(),
axis.line.x.bottom = ggplot2::element_blank(),
strip.background = ggplot2::element_blank(),
plot.margin = ggplot2::margin(t = 0, r = 10, b = 5, l = 10))
p3 <- SCpubr::do_BarPlot(sample = sample,
group.by = "final_annotation",
split.by = "grade",
flip = TRUE,
position = "fill",
font.size = 16,
colors.use = cluster_cols,
plot.grid = FALSE,
add.n = TRUE,
add.n.expand = c(0, 1.15),
axis.text.face = "plain",
add.n.size = 5,
legend.ncol = 2,
legend.title = "") +
ggplot2::xlab("") +
ggplot2::ylab("") +
ggplot2::theme(axis.text.x.bottom = ggplot2::element_blank(),
axis.ticks.x.bottom = ggplot2::element_blank(),
axis.line.x.bottom = ggplot2::element_blank(),
strip.background = ggplot2::element_blank(),
plot.margin = ggplot2::margin(t = 0, r = 10, b = 5, l = 10))
layout <- paste(c(rep("A", 8), rep("B", 6), rep("C", 2), rep("D", 2), "E"), collapse = "\n")
p <- patchwork::wrap_plots(A = p0,
B = p1,
C = p2,
D = p3,
E = patchwork::guide_area(),
design = layout)