Skip to content

Commit

Permalink
new fig3
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Geuenich committed Jun 1, 2023
1 parent 42a8193 commit b0658e7
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions pipeline/figures/figure3.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,63 +44,3 @@ pdf("output/v8/paper-figures/figure3-overall-benchmark.pdf", height = 8.4, width
eval
dev.off()

space_eval <- (plot_spacer() | eval) +
plot_layout(widths = c(0.001, 1))

pdf("output/v8/paper-figures/figure3.pdf", height = 12, width = 9)
schematic / wrap_elements(full = space_eval) +
plot_annotation(tag_levels = "A") +
plot_layout(heights = c(1.7, 4))
dev.off()




sel_acc <- filter(acc, corrupted == 0) |>
filter(AL_alg == "rf" | is.na(AL_alg)) |>
filter(rand == 0 | is.na(rand)) |>
filter(.metric == "f_meas") |>
filter(initial == "ranking" | is.na(initial))


cross_cohort_ranks <- get_ranked_mean_estimate_by_cohort(sel_acc)
method_order <- get_cross_cohort_mean_ranked_estimate(cross_cohort_ranks) |>
pull(selection_procedure)

sel_acc |>
group_by(selection_procedure, cell_num, cohort) |>
mutate(selection_procedure = factor(selection_procedure, levels = method_order),
mean_estimate = mean(.estimate),
lower_quant = quantile(na.omit(.estimate), 0.25),
upper_quant = quantile(na.omit(.estimate), 0.75)) |>
ggplot() +
aes(fill = selection_procedure) +
geom_segment(aes(x = as.character(cell_num),
y = lower_quant, yend = upper_quant),
position = position_dodge(width = 0.9)) +
geom_point(aes(x = as.character(cell_num), y = mean_estimate, colour = selection_procedure),
position = position_dodge(width = 0.9)) +
scale_color_manual(values = sel_meth_cols) +
whatsthatcell_theme() +
facet_wrap(~cohort, scales = "free_y", nrow = 1) +
labs(title = metric) +
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))


devtools::load_all("../ggplot2/")
p <- sel_acc |>
filter(cohort == "scRNASeq" & cell_num == 100) |>
group_by(selection_procedure, cell_num, cohort) |>
mutate(selection_procedure = factor(selection_procedure, levels = method_order),
mean_estimate = mean(.estimate),
lower_quant = quantile(na.omit(.estimate), 0.25),
upper_quant = quantile(na.omit(.estimate), 0.75)) |>
ggplot(aes(cell_num, mean_estimate, colour = selection_procedure))

# Want the ends stay stable? Define them.
p + geom_segment(
aes(xend = cell_num, yend = 0),
position = position_dodge(width = 0.9)
)

p + geom_segment(aes(yend = 0), position = position_dodge(width = 0.8))

0 comments on commit b0658e7

Please sign in to comment.