Skip to content

Commit

Permalink
increase size of fig 4 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaybio authored Mar 12, 2024
1 parent 17c0174 commit a8d4e14
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 37 deletions.
65 changes: 37 additions & 28 deletions 7.figures/Figure4_LOIO_analysis.ipynb

Large diffs are not rendered by default.

Binary file modified 7.figures/figures/main_figure_4_loio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 20 additions & 9 deletions 7.figures/nbconverted/Figure4_LOIO_analysis.r
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ per_image_category_gg <- (
+ facet_grid(
"Mitocheck_Plot_Label~Model_Feature_Type"
)
+ geom_text(data=percent_summary_df, aes(label = add_plot_text, x = 12, y = 0.8))
+ geom_text(
data=percent_summary_df,
aes(label = add_plot_text, x = 12, y = 0.7),
size = 5
)
+ labs(
x = "Average rank of correct label\n(per held out image)",
y = "Average probability of correct label\n(per held out image)"
Expand All @@ -198,7 +202,7 @@ per_image_category_gg <- (
)
+ geom_vline(xintercept=2, linetype = "dashed", color = "red")
+ theme(
strip.text = element_text(size = 8.3),
strip.text = element_text(size = 11),
)
+ guides(
color = guide_legend(
Expand Down Expand Up @@ -337,15 +341,18 @@ correct_pred_proportion_gg <- (
color = "black",
aes(label = count),
nudge_x = 0.07,
size = 3
size = 4
)
+ facet_grid(
"Model_Feature_Type~correct_pred",
labeller = labeller(correct_pred = custom_labeller, Shuffled = shuffled_labeller)
)
+ theme_bw()
+ phenotypic_ggplot_theme
+ theme(axis.text = element_text(size = 7.5))
+ theme(
axis.text = element_text(size = 9.5),
strip.text = element_text(size = 11)
)
+ scale_fill_manual(
paste0("Does cell\npass strict\nthreshold?\n(p = ", high_threshold, ")"),
values = focus_corr_colors,
Expand Down Expand Up @@ -447,7 +454,8 @@ correct_class_phenotype_pred_gg <- (
),
color = "black",
aes(label = total_count),
nudge_y = 0.12
nudge_y = 0.12,
size = 4
)
+ coord_flip()
+ scale_fill_manual(
Expand All @@ -458,19 +466,22 @@ correct_class_phenotype_pred_gg <- (
)
+ theme_bw()
+ phenotypic_ggplot_theme
+ theme(axis.text.x = element_text(size = 6.5))
+ labs(x = "Mitocheck phenotype categories", y = "Cell proportions")
+ theme(
axis.text.x = element_text(size = 7.5),
strip.text = element_text(size = 11)
)
+ labs(x = "Phenotype categories", y = "Cell proportions")
)

correct_class_phenotype_pred_gg

right_bottom_nested <- (
correct_pred_proportion_gg / correct_class_phenotype_pred_gg
) + plot_layout(heights = c(1, 0.7))
) + plot_layout(heights = c(1, 0.2))

compiled_fig <- (
per_image_category_gg | right_bottom_nested
) + plot_layout(widths = c(1, 0.72)) + plot_annotation(tag_levels = "A")
) + plot_layout(widths = c(1, 0.77)) + plot_annotation(tag_levels = "A")

ggsave(output_fig_loio, dpi = 500, height = 10, width = 15)

Expand Down

0 comments on commit a8d4e14

Please sign in to comment.