Skip to content

Commit

Permalink
Merge pull request WayScience#120 from MikeLippincott/figS7
Browse files Browse the repository at this point in the history
add a new data split platemap
  • Loading branch information
MikeLippincott authored Feb 28, 2024
2 parents bebb2f7 + 8a9ee07 commit 6312d06
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 39 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
243 changes: 210 additions & 33 deletions figures/S7.supplemental_figure7/notebooks/S7.ipynb

Large diffs are not rendered by default.

78 changes: 72 additions & 6 deletions figures/S7.supplemental_figure7/scripts/S7.r
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ updated_platemap$label[is.na(updated_platemap$label)] <- "Blank"
# replace pool with Pool in label
updated_platemap$label[updated_platemap$label == "pool"] <- "Pool"
# replace holdout with Holdout in label
updated_platemap$label[updated_platemap$label == "holdout"] <- "Holdout"
updated_platemap$label[updated_platemap$label == "holdout"] <- "Holdout well"
# replace treatment_holdout with Treatment Holdout in label
updated_platemap$label[updated_platemap$label == "treatment_holdout"] <- "Treatment Holdout"
updated_platemap$label[updated_platemap$label == "treatment_holdout"] <- "Treatment holdout"
unique(updated_platemap$Metadata_cell_type)
unique(updated_platemap$label)

Expand All @@ -214,8 +214,8 @@ updated_platemap$label <- factor(
levels = c(
'Blank',
'Pool',
'Holdout',
'Treatment Holdout'
'Holdout well',
'Treatment holdout'
)
)

Expand All @@ -225,6 +225,72 @@ options(repr.plot.width = width, repr.plot.height = height, units = "cm")
# set pallette
viridis_pal_custom <- viridis::viridis_pal(option = "C")(5)

data_split_plate_map_full <- (
raw_map(
data = updated_platemap$label,
well = updated_platemap$well_id,
plate = 384, # number of wells in plate apriori known
size = 14 # size of the wells displayed
)
+ theme_dark()
+ ggplot2::geom_point(
aes(shape = updated_platemap$Metadata_cell_type),
size = 5
)
+ labs(fill = "Data Split", shape = "Cell Type")
# change legend text size for fill

+ guides(shape = guide_legend(override.aes = list(size = 12), nrow = 1))
+ guides(fill = guide_legend(override.aes = list(size = 12),ncol = 2))
+ theme(
legend.title = element_text(size = 18,hjust = 0.5),
legend.text = element_text(size = 16),
)
# cell type legend
+ scale_shape_manual(
values = c(
'Blank' = 0,
'PBMC' = 19,
'SH-SY5Y' = 8
)
)
# data split legend
+ scale_fill_manual(
values = c(
'Blank' = "grey",
'Pool' = viridis_pal_custom[3],
'Holdout well' = viridis_pal_custom[4],
'Treatment holdout' = viridis_pal_custom[5]

)
)
+ theme(
axis.text.x = element_text(size = 16),
axis.text.y = element_text(size = 16)
)

)
data_split_plate_map_full
ggsave(
filename = "../figures/data_split_plate_map_full.png",
plot = data_split_plate_map_full,
width = width,
height = height,
units = "in",
dpi = 600
)


# remove SHSY5Y from the platemap
updated_platemap <- updated_platemap[updated_platemap$Metadata_cell_type != "SH-SY5Y",]
head(updated_platemap)

width <- 14
height <- 14
options(repr.plot.width = width, repr.plot.height = height, units = "cm")
# set pallette
viridis_pal_custom <- viridis::viridis_pal(option = "C")(5)

data_split_plate_map <- (
raw_map(
data = updated_platemap$label,
Expand Down Expand Up @@ -259,8 +325,8 @@ data_split_plate_map <- (
values = c(
'Blank' = "grey",
'Pool' = viridis_pal_custom[3],
'Holdout' = viridis_pal_custom[4],
'Treatment Holdout' = viridis_pal_custom[5]
'Holdout well' = viridis_pal_custom[4],
'Treatment holdout' = viridis_pal_custom[5]

)
)
Expand Down

0 comments on commit 6312d06

Please sign in to comment.