## sfig9: loading the required packages -----
<- c("fs", "futile.logger", "configr", "stringr", "ggpubr", "ggthemes",
pkgs "glue", "ggsci", "patchwork", "tidyverse", "dplyr", "viridis", "Seurat")
for (pkg in pkgs) {
suppressPackageStartupMessages(library(pkg, character.only = T))
}<- "collabrators"
project <- "wangwenjie"
dataset <- "mouse"
species <- glue("~/projects/{project}/analysis/{dataset}/{species}/figures/sfig9")
workdir |> fs::dir_create() |> setwd() workdir
26 Supplemental Figure 9
26.1 Extended Data Fig. 9
26.1.1 sfig9a: mouse regulon activity score of Gata1, Tal1 and Sox2
### sfig9a: mouse regulon activity scoring -----
<-
csv_fn1 "/cluster/home/danyang_jh/projects/collabrators/analysis/wangwenjie/mouse/figures/rds/fig4a_tf_mouseobj_full_frame.csv"
<- read_csv(csv_fn1)
mouseobj_full_frame <- c("Gata1(+)", "Tal1(+)", "Sox2(+)")
setis ::mclapply(setis, function(seti){
parallel<- mouseobj_full_frame |>
p ::filter(name == {{seti}}) |>
dplyrggplot(aes(x = imagecol, y = imagerow, color = value)) +
geom_point(size = 0.1) +
scale_color_viridis_c() +
+
my_theme1 facet_wrap(~ tissue, ncol = 3) +
coord_fixed() +
ggtitle(seti) +
::DarkTheme() + NoGrid() + NoAxes()
Seuratggsave(glue("./sfig9a_mouse_tf_{seti}.pdf"), width = 7, height = 3)
mc.cores = 3) },
26.1.2 sfig9b: TF in human embryos
<- c("GATA1(+)", "TAL1(+)", "SOX2(+)")
setis <-
csv_fn2 "/cluster/home/danyang_jh/projects/collabrators/analysis/wangwenjie/mouse/figures/rds/fig4b_tf_humanobj_full_frame.csv"
<- read_csv(csv_fn2)
humanobj_full_frame ::mclapply(setis, function(seti){
parallel<- humanobj_full_frame |>
p ::filter(name == {{seti}}) |>
dplyrggplot(aes(x = imagecol, y = imagerow, color = value)) +
geom_point(size = 0.01) +
scale_color_viridis_c() +
+
my_theme1 facet_wrap(~ tissue, nrow = 1) +
coord_fixed() +
ggtitle(seti) +
::DarkTheme() + NoGrid() + NoAxes()
Seuratggsave(glue("./sfig9b_human_tf_{seti}.pdf"), width = 7, height = 3, unit = "in")
mc.cores = 3) },
26.1.3 sfig9c: Lin28a expression in mouse embryo
<-
rds_fn2 "/cluster/home/danyang_jh/projects/collabrators/analysis/wangwenjie/mouse/figures/rds/fig4a_tf_mouseobj.rds"
<- read_rds(rds_fn2)
seu_obj
<- "/cluster/home/danyang_jh/projects/collabrators/analysis/wangwenjie/mouse/figures/rds/mmu_visium_lst.rds"
rds_fn2 <- read_rds(rds_fn2)
mmu_visium_lst
<- lapply(paste0("E", c(9.5, 11.5, 13.5)), \(stg) {
plst1 if(stg == "E9.5") {
<- 4.5
scale_fct <- 3
plot_width <- 3
plot_height <- "slice1"
sel_img else if (stg == "E11.5") {
} <- 2.4
scale_fct <- 3
plot_width <- 3
plot_height <- "slice1.3"
sel_img else {
} <- 4.5
scale_fct <- 3
plot_width <- 3
plot_height <- "slice1.2"
sel_img
}DefaultAssay(seu_obj) <- "SCT"
<- Seurat::SpatialFeaturePlot(seu_lst[[stg]], features = "Lin28a", ncol = 1,
p1 pt.size.factor = scale_fct, images = sel_img) & my_theme1 &
::NoAxes() & coord_fixed()
Seurat
})pdf("sfig9c_Lin28a_featplot.pdf", width = 2, height = 2)
print(plst1)
dev.off()
26.1.4 sfig9d: LIN28A expression in human embryo
<- "/cluster/home/danyang_jh/projects/collabrators/analysis/wangwenjie/mouse/figures/rds/hsa_visium_obj_lst.rds"
rds_fn1 <- read_rds(rds_fn1)
seu_lst
<- lapply(paste0("yao", c(1, 2, 5)), \(stg) {
plst1 if(stg == "yao1") {
<- 3
scale_fct <- 3
plot_width <- 3
plot_height else if (stg == "yao2") {
} <- 1.8
scale_fct <- 3
plot_width <- 3
plot_height else {
} <- 1.2
scale_fct <- 3
plot_width <- 3
plot_height
}
<- genes_lst1[[stg]]
feats <- Seurat::SpatialFeaturePlot(seu_lst[[stg]], features = "LIN28A",
p1 pt.size.factor = scale_fct, stroke = NA,
& my_theme1 &
) ::NoAxes() & coord_fixed() & viridis::scale_fill_viridis()
Seurat
})pdf("sfig9d_LIN28A_featplot.pdf", width = 2, height = 2)
print(plst1)
dev.off()