Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Supplemental Figure 2 #25

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
380 changes: 380 additions & 0 deletions 4.figures/SuppFigure2_Plate4_platemaps.ipynb

Large diffs are not rendered by default.

jenna-tomkinson marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions 4.figures/nbconverted/SuppFigure2_Plate4_platemaps.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(grid))
suppressPackageStartupMessages(library(patchwork))
suppressPackageStartupMessages(library(platetools))

figure_dir <- "figures/supplementary"
output_supp_figure_2 <- file.path(figure_dir, "supp_figure_2_plate4_platemaps.png")

url <- "https://raw.githubusercontent.com/WayScience/nf1_cellpainting_data/main/0.download_data/metadata/platemap_NF1_plate4.csv"
plate_4_df <- read.csv(url)

dim(plate_4_df)
head(plate_4_df)

platemap_dose <- platetools::raw_map(
data = as.character(plate_4_df$Concentration),
well = plate_4_df$well_position,
plate = 96,
size = 8
) +
ggtitle(paste("siRNA treatment and dose platemap")) +
theme(plot.title = element_text(size = 12, face = "bold")) +
ggplot2::geom_point(aes(shape = plate_4_df$siRNA)) +
ggplot2::scale_shape_discrete(
name = "siRNA Treatments",
limits = c("None", "Scramble", "NF1 Target 1", "NF1 Target 2"),
guide = guide_legend(override.aes = list(size = 3)) # Adjust size here
) +
ggplot2::scale_fill_manual(
name = "Concentrations (nM)",
values = c("#ffffff", "#d9f0d9", "#a3e8a3", "#6ed46e", "#3ab93a", "#007a00")
) +
theme(
legend.text = element_text(size = 10),
legend.title = element_text(size = 12),
legend.position = "right",
# move legend around so it fits better on the screen
legend.margin = margin(-15, 0, 10, 0),
legend.box = "vertical",
axis.text.x = element_text(size = 10), # Adjust x-axis tick size
axis.text.y = element_text(size = 10) # Adjust y-axis tick size
)

platemap_dose


# Platemap for genotype
platemap_genotype <- platetools::raw_map(
data = plate_4_df$genotype,
well = plate_4_df$well_position,
plate = 96,
size = 8
) +
ggtitle(paste("Genotype platemap")) +
theme(plot.title = element_text(size = 12, face = "bold")) +
ggplot2::scale_fill_discrete(name = "Genotype") +
theme(
legend.text = element_text(size = 10),
legend.title = element_text(size = 12),
legend.position = "right",
# move legend around so it fits better on the screen
legend.margin = margin(-10, 0, 10, 0),
legend.box = "horizontal",
axis.text.x = element_text(size = 10), # Adjust x-axis tick size
axis.text.y = element_text(size = 10) # Adjust y-axis tick size
)

platemap_genotype


align_plot_gg <- (
platemap_dose /
platemap_genotype
) + plot_layout(heights = c(1, 1))

supp_fig_2_gg <- (
align_plot_gg
) + plot_annotation(tag_levels = "A") & theme(plot.tag = element_text(size = 15))

# Save or display the plot
ggsave(output_supp_figure_2, dpi = 500, height = 8, width = 8)

supp_fig_2_gg
29 changes: 29 additions & 0 deletions figure_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: nf1_figures
channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::jupyter
- conda-forge::jupyterlab
- conda-forge::ipykernel
- conda-forge::python
- conda-forge::r-irkernel
- conda-forge::nb_conda_kernels
- conda-forge::widgetsnbextension
- conda-forge::jupyter_contrib_nbextensions
- conda-forge::r-base=4.2.2
- conda-forge::r-dplyr=1.0.10
- conda-forge::r-tidyr
- conda-forge::r-readr
- conda-forge::r-stringr
- conda-forge::r-ggplot2
- conda-forge::r-ggrepel
- conda-forge::r-gridextra
- conda-forge::r-devtools
- conda-forge::r-reshape2
- conda-forge::r-cowplot
- conda-forge::r-patchwork
- conda-forge::r-magick
- conda-forge::r-platetools
- conda-forge::r-arrow
- bioconda::bioconductor-complexheatmap