Prepare analysis workflow

Set filepaths and parameters

knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
options(
  readr.show_progress = FALSE,
  digits = 2,
  scipen = 8,
  future.globals.maxSize = +Inf
)
library(tidyverse)
library(scran)
library(scater)
library(pheatmap)
theme_set(theme_bw())
data_dir <- "./data"
figures_dir <- file.path("./figures", "scrnaseq")

Define functions

plot_gene <- function(gene) {
  p <- plotExpression(sce10x,
    features = gene,
    x = "sample",
    exprs_values = "logcounts",
    colour_by = "condition",
    point_size = .5
  ) +
    facet_wrap(~ colData(sce10x)$clusters, ncol = 1) +
    labs(title=gene)
  ggsave(file.path(figures_dir, paste0(gene, "_violin_expression.pdf")), p)

  return(p)
}


plot_gene_heatmap <- function(gene) {
  p <-
    ggplot(dt, aes(umap1,
      umap2,
      colour = assay(sce10x_stem, "logcounts")[gene, ]
    )) +
    geom_point(size = .5) +
    stat_density_2d(alpha = 0.4) +
    scale_colour_viridis_c(option = "magma", direction = -1, name = gene) +
    annotate("text",
      x = c(-1, -1, 14),
      y = c(3, -3, 2),
      label = c("stem 1", "stem 2", "stem 3"),
      colour = "black", size = 4
    ) +
    theme_classic()

  ggsave(file.path(figures_dir, "stem_expression",  paste0(gene, "_umap_expression.pdf")), p)
  return(p)
}

plot_gene_heatmap_facet <- function(gene) {
  p <-
    ggplot(dt, aes(umap1,
      umap2,
      colour = assay(sce10x_stem, "logcounts")[gene, ]
    )) +
    geom_point(size = .5) +
    stat_density_2d(alpha = 0.4) +
    scale_colour_viridis_c(option = "magma", direction = -1, name = gene) +
    facet_wrap(~condition, ncol = 1) +
    theme_classic()

  ggsave(file.path(figures_dir, "stem_expression", paste0(gene, "_umap_expression_facet.pdf")), p)
  return(p)
}
sce10x <-
  readRDS(file.path(
    data_dir,
    "preprocessed",
    "sce10x_filtered_final.rds"
  ))
table(colData(sce10x)$clusters, colData(sce10x)$sample)
            
             yng1 yng2 yng3 aged1 aged2 aged3 aged4
  fap_1       295  284  389  1630  1585  1134   833
  fap_2       203  106  248   390   424   434   194
  macrophage  282  274  398    58   245   149   189
  stem_1      397  661  541   370   404   185   435
  stem_2      549 1030  379   151   278   141   304
  stem_3      253  222  129     0     0     0     0

Subset

sce10x_stem <- sce10x[, colData(sce10x)$celltype == "stem"]
sce10x_fap <- sce10x[, colData(sce10x)$celltype == "fap"]
sce10x_macrophage <- sce10x[, colData(sce10x)$celltype == "macrophage"]
table(colData(sce10x_stem)$clusters, colData(sce10x_stem)$condition)
        
          yng aged
  stem_1 1599 1394
  stem_2 1958  874
  stem_3  604    0

Count Pax7 Myf5 cells

dt_genes <-
  t(assay(sce10x_stem, "counts")[c("Pax7", "Myf5"), ]) %>%
  as.matrix() %>%
  as_tibble() %>%
  mutate(Pax7_Myf5 = case_when(
    Pax7 > 0 & Myf5 > 0 ~ "Pax7+Myf5+",
    Pax7 > 0 & Myf5 == 0 ~ "Pax7+Myf5-",
    Pax7 == 0 & Myf5 > 0 ~ "Pax7-Myf5+",
    Pax7 == 0 & Myf5 == 0 ~ "Pax7-Myf5-"
  ))
ggplot(
  bind_cols(dt_genes %>% select(Pax7_Myf5), colData(sce10x_stem) %>%
    as_tibble() %>%
    mutate(log10_sum = log10(sum)) %>%
    select(log10_sum, clusters, condition, clusters_condition)),
  aes(log10_sum)
) +
  geom_histogram(aes(fill = clusters_condition), bins = 50) +
  facet_wrap(~Pax7_Myf5) +
  theme_classic()

ggplot(
  bind_cols(dt_genes %>%
    select(Pax7_Myf5), colData(sce10x_stem) %>%
    as_tibble() %>%
    mutate(log10_sum = log10(sum)) %>%
    select(log10_sum, clusters, condition, clusters_condition)),
  aes(log10_sum)
) +
  geom_histogram(aes(fill = Pax7_Myf5), alpha = 0.7, bins = 50) +
  facet_wrap(~clusters_condition) +
  theme_classic()

table(dt_genes$Pax7_Myf5, sce10x_stem$clusters)
            
             stem_1 stem_2 stem_3
  Pax7-Myf5-    347    132     88
  Pax7-Myf5+    263    142     47
  Pax7+Myf5-    635    443    173
  Pax7+Myf5+   1748   2115    296
table(dt_genes$Pax7_Myf5, sce10x_stem$condition)
            
              yng aged
  Pax7-Myf5-  117  450
  Pax7-Myf5+  216  236
  Pax7+Myf5-  479  772
  Pax7+Myf5+ 3349  810
table(dt_genes$Pax7_Myf5, sce10x_stem$clusters_condition)
            
             stem_1_aged stem_1_yng stem_2_aged stem_2_yng stem_3_yng
  Pax7-Myf5-         328         19         122         10         88
  Pax7-Myf5+         167         96          69         73         47
  Pax7+Myf5-         463        172         309        134        173
  Pax7+Myf5+         436       1312         374       1741        296
plotExpression(sce10x_stem,
  features = "Pax7",
  x = c("Myf5"),
  exprs_values = "logcounts",
  colour_by = "clusters",
  point_size = .7,
  point_alpha = 0.8,
  ncol = 4
) +
  coord_fixed() +
  facet_wrap(~ colData(sce10x_stem)$condition)

Plot UMAP embeddings

dt <- bind_cols(
  reducedDim(sce10x_stem, "mnn_umap") %>%
    as_tibble(),
  colData(sce10x_stem) %>%
    as_tibble()
)
p1 <-
  ggplot(dt, aes(umap1,
    umap2,
    colour = clusters
  )) +
  geom_point(size = 1) +
  scale_colour_viridis_d(option = "plasma") +
  theme_classic()
p1
ggsave(file.path(figures_dir, "umap", "umap_mnn_stem.pdf"), p1)
Saving 7.29 x 4.5 in image

p2 <- ggplot(dt, aes(umap1,
  umap2,
  colour = clusters
)) +
  geom_point(size = 1) +
  scale_colour_viridis_d(option = "plasma") +
  theme_classic() +
  facet_wrap(~condition, ncol = 2)
p2 

ggsave(file.path(figures_dir, "umap",
                 "umap_stem_clusters_condition.pdf"), p2)
Saving 7.29 x 4.5 in image

p3 <- ggplot(dt, aes(umap1,
  umap2,
  colour = condition
)) +
  geom_point(size = 1, alpha = 0.7) +
  scale_colour_viridis_d(option = "plasma") +
  theme_classic()
p3
ggsave(file.path(figures_dir,  "umap",
                 "umap_stem_clusters_condition_color.pdf"), p3)
Saving 7.29 x 4.5 in image

Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
3: In readChar(file, size, TRUE) : truncating string with embedded nuls
4: In readChar(file, size, TRUE) : truncating string with embedded nuls
dt_fap <-
  bind_cols(
  reducedDim(sce10x_fap, "mnn_umap") %>%
    as_tibble(),
  colData(sce10x_fap) %>%
    as_tibble()
  )

p4 <-
  ggplot(dt_fap, aes(umap1,
    umap2,
    colour = clusters
  )) +
  geom_point(size = 1) +
  scale_colour_viridis_d(option = "plasma") +
  theme_classic()
p4
ggsave(file.path(figures_dir,  "umap",
                 "umap_mnn_fap.pdf"), p4)
Saving 7.29 x 4.5 in image

p5 <- ggplot(dt_fap, aes(umap1,
  umap2,
  colour = clusters
)) +
  geom_point(size = 1) +
  scale_colour_viridis_d(option = "plasma") +
  theme_classic() +
  facet_wrap(~condition, ncol = 2)
p5
ggsave(file.path(figures_dir,  "umap",
                 "umap_fap_clusters_condition.pdf"), p5)
Saving 7.29 x 4.5 in image

dt_macrophage <-
  bind_cols(
  reducedDim(sce10x_macrophage, "mnn_umap") %>%
    as_tibble(),
  colData(sce10x_macrophage) %>%
    as_tibble()
  )

p6 <-
  ggplot(dt_macrophage) +
  geom_point(aes(umap1,
    umap2,
    colour = clusters
  ),
  size = 1,
  alpha = 1
  ) +
  theme_classic() +
  facet_wrap(~condition, ncol = 2)
p6
ggsave(file.path(figures_dir,  "umap",
                 "umap_mnn_macrophage.pdf"), p6)
Saving 7.29 x 4.5 in image

Plot expression of markers

Plot Cytokines

cytokines <- c("Il6", "Il15", "Txlna","Il18", "Tnf", "Il10" )
map(cytokines, plot_gene)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

irf <- read_csv(file.path(
Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
3: In readChar(file, size, TRUE) : truncating string with embedded nuls
4: In readChar(file, size, TRUE) : truncating string with embedded nuls
5: In readChar(file, size, TRUE) : truncating string with embedded nuls
6: In readChar(file, size, TRUE) : truncating string with embedded nuls
7: In readChar(file, size, TRUE) : truncating string with embedded nuls
    data_dir,
    "gene_lists",
    "irf.txt"), col_names = FALSE)
Parsed with column specification:
cols(
  X1 = col_character()
)
irf <- str_to_title(irf %>% pull(X1))
There were 21 warnings (use warnings() to see them)
irf <- irf[irf %in% rownames(sce10x_stem)]
irf
 [1] "Stat2"   "Nfatc2"  "Nfat5"   "Nfatc3"  "Irf1"    "Irf7"    "Nfatc4"  "Irf9"    "Nfatc1"  "Gfi1"    "Stat1"   "Tcf7"   
[13] "Tcf7l2"  "Jun"     "Batf"    "Batf"    "Foxo1"   "Irf4"    "Neurog2" "Tcf7l1"  "Irf8"    "Prdm4"   "Esx1"    "Hoxb7"  
[25] "Fosl1"   "Stat3"   "Twist1"  "Twist2" 
map( irf , plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

[[16]]

[[17]]

[[18]]

[[19]]

[[20]]

[[21]]

[[22]]

[[23]]

[[24]]

[[25]]

[[26]]

[[27]]

[[28]]

Mygenic factors

myogenic_factors <- c("Pax7", "Myf6", "Myf5", "Myod1", "Myog")
myogenic_factors_plots <- map(myogenic_factors, plot_gene)
Saving 7 x 7 in image
myogenic_factors_plots
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

myogenic_factors_heatmaps <- map(myogenic_factors, plot_gene_heatmap)
Saving 7 x 7 in image
myogenic_factors_heatmaps
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

cluster 3 vs 12y up regulated

HALLMARK_G2M_CHECKPOINT <- c("Ccnb2", "Cenpa", "H2az1", "Hmgn2", "Mcm5", "Stmn1")
HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION <- c("Acta2", "Lgals1")
top_clust3vs12y_up <- c("Myog", "Pclaf", "Cdkn1c", "Stmn1", "Ctnna2", "Cfap77", "Ankrd10", "Lsm6", "Spats2l", "Cdk2ap1")
map(HALLMARK_G2M_CHECKPOINT, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

map(HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

map(top_clust3vs12y_up, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

cluster 3 vs 12y down regulated

HALLMARK_G2M_CHECKPOINT_down <- c("Mt2")
HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION_down <- c("Crlf1", "Igfbp4", "Sdc4")
HALLMARK_UV_RESPONSE_DN <- c("Igfbp5", "Kcnma1", "Ltbp1")
top_clust3vs12y_down <- c(
  "Gpx3", "Hs6st3", "Nppc", "Chodl", "Apoe",
  "Mt1", "Pdzd2", "Tnxb", "Rora", "Tmtc2",
  "Igfbp4", "Meg3", "Serping1", "Erfe", "Id3"
)
map(HALLMARK_G2M_CHECKPOINT_down, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

map(HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION_down, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

map(HALLMARK_UV_RESPONSE_DN, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

map(top_clust3vs12y_down, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

cluster stem 2 upregulated

HALLMARK_TNFA_SIGNALING_VIA_NFKB <- c("Nfkb1", "Pmepa1", "Sdc4")
top_clust2vs1_up <- c(
  "Col8a1", "Pakap_ENSMUSG00000038729.24", "Mt1", "Dnah7a", "Arid5b",
  "Samd4", "Mpp7", "Asb5", "9030624G23Rik", "Mt2", "Gm48228", "Emp1"
)
map(HALLMARK_TNFA_SIGNALING_VIA_NFKB, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

map(top_clust2vs1_up, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

cluster stem 1 upregulated

HALLMARK_TNFA_SIGNALING_VIA_NFKB_stem1 <- c("Fos", "Jun", "Egr1", "Ier2", "Socs3")
top_stem1 <- c("Gm26802", "ENSMUSG00000052837.6", "Ier5l")
map(HALLMARK_TNFA_SIGNALING_VIA_NFKB_stem1, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

map(top_stem1, plot_gene_heatmap)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

Aging upregulated

HALLMARK_ALLOGRAFT_REJECTION_APOPTOSIS <- c("Ccl11", "Anxa1", "Dcn", "Timp3")
top_aging_up <- c(
  "Frmpd4", "Grid2", "Csmd1", "P2ry14", "Mbd1",
  "Mt1", "Glis3", "Eya2", "Aff1", "Myo1d", "Sugct",
  "Spock3", "Ntn4", "Thsd7a", "Smim3", "Ell2", "Cfh"
)
map(HALLMARK_ALLOGRAFT_REJECTION_APOPTOSIS, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

map(top_aging_up, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

[[16]]

[[17]]

Aging downregulated

HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION_MYOGENESIS <-
  c(
    "Col3a1", "Col4a1", "Col4a2", "Crlf1", "Gas1", "Lama2",
    "Lamc1", "Lgals1", "Mest", "Mmp2", "Pdlim4", "Serpinh1",
    "Sparc", "Tagln", "Vim", "Cnn3", "Gsn", "Igf1"
  )
HALLMARK_MYC_TARGETS_V1 <- c("Eef1b2", "Hsp90ab1", "Ppia", "Rack1", "Rpl14", "Rpl22", "Rpl34", "Rplp0", "Rps3", "Rps6")
HALLMARK_P53_PATHWAY <- c("Cd81", "Cd82", "Rack1", "Rpl36", "Rps12", "S100a10", "Zfp36l1")
HALLMARK_TNFA_SIGNALING_VIA_NFKB <- c("Ccnd1", "Marcks", "Msc")
top_aging_down <- c("Dgkg", "Sorbs2", "Itm2a", "Kif21a", "mt-Co2", "mt-Nd3", "mt-Atp6", "mt-Co3", "Meg3", "Tmsb10", "Apoe", "Dag1")
map(HALLMARK_EPITHELIAL_MESENCHYMAL_TRANSITION_MYOGENESIS, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

[[16]]

[[17]]

[[18]]

map(HALLMARK_MYC_TARGETS_V1, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

map(HALLMARK_P53_PATHWAY, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

map(HALLMARK_TNFA_SIGNALING_VIA_NFKB, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

map(top_aging_down, plot_gene_heatmap_facet)
Saving 7 x 7 in image
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

Plot heatmaps

moderated_lfc_leg_muscle  <-
Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
3: In readChar(file, size, TRUE) : truncating string with embedded nuls
4: In readChar(file, size, TRUE) : truncating string with embedded nuls
5: In readChar(file, size, TRUE) : truncating string with embedded nuls
6: In readChar(file, size, TRUE) : truncating string with embedded nuls
7: In readChar(file, size, TRUE) : truncating string with embedded nuls
  read_tsv(file.path(
    "tables",
    "scrnaseq",
    "moderated_lfc_leg_muscle.txt"
  ))
Parsed with column specification:
cols(
  gene_id = col_character(),
  sc_mean = col_double(),
  sc_aging = col_double(),
  sc_clust2vs1 = col_double(),
  sc_clust3vs12y = col_double(),
  bulk_engraf = col_double(),
  bulk_aging = col_double(),
  bulk_niche = col_double(),
  svalue_sc_aging = col_double(),
  svalue_sc_clust2vs1 = col_double(),
  svalue_sc_clust3vs12y = col_double(),
  svalue_bulk_engraf = col_double(),
  svalue_bulk_aging = col_double(),
  svalue_bulk_niche = col_double(),
  description = col_character(),
  gene_biotype = col_character(),
  chr = col_double(),
  ensembl_gene_id_version = col_character()
)
genes_hits <-
There were 14 warnings (use warnings() to see them)
  moderated_lfc_leg_muscle%>%
  filter((abs(sc_aging) > 1 & svalue_sc_aging < 10^-8) | 
           abs(sc_clust3vs12y) > 1 & svalue_sc_clust3vs12y < 10^-8 |
           abs(sc_clust2vs1) > 0.75 & svalue_sc_clust2vs1 < 10^-8) %>%
  pull(gene_id)
genes_hits
  [1] "mt-Co3"                      "mt-Atp6"                     "mt-Co1"                      "mt-Cytb"                    
  [5] "Eef1a1"                      "Tpt1"                        "Gnas"                        "mt-Co2"                     
  [9] "mt-Nd4"                      "Zbtb20"                      "Mt1"                         "Rpl41"                      
 [13] "Actb"                        "Rplp1"                       "Rplp0"                       "Fos"                        
 [17] "Rps3a1"                      "mt-Nd1"                      "Ubc"                         "Rps15a"                     
 [21] "Rpl9"                        "Rps27a"                      "mt-Nd2"                      "Rpl28"                      
 [25] "Rpl18a"                      "Rpl35a"                      "Rpl32"                       "Ptma"                       
 [29] "Rpl37a"                      "Rpl27a"                      "Rora"                        "Rpl26"                      
 [33] "Rpl17"                       "Meg3"                        "Rps12"                       "mt-Rnr2"                    
 [37] "Rpl35"                       "Rpl19"                       "Galnt2l"                     "Rps18"                      
 [41] "Rpl36"                       "Rps14"                       "Rps9"                        "Gm28661"                    
 [45] "Rps23"                       "ENSMUSG00000052837.6"        "Gpx3"                        "Rps29"                      
 [49] "Rpl34"                       "Rps27"                       "Rps3"                        "Uba52"                      
 [53] "Tmsb4x"                      "Rpl13a"                      "Airn"                        "Rps11"                      
 [57] "Hsp90ab1"                    "Rpl11"                       "Jun"                         "Rpl3"                       
 [61] "Rplp2"                       "Eef2"                        "Egr1"                        "Hspa8"                      
 [65] "Rpl10a"                      "Sparc"                       "Rps13"                       "Tmsb10"                     
 [69] "Rps15"                       "Rpl24"                       "Rack1"                       "Rpl14"                      
 [73] "Rpl12"                       "Rpl10"                       "Mt2"                         "Rpl7a-ps12"                 
 [77] "Rpl29"                       "Nfia"                        "Pakap_ENSMUSG00000038729.24" "Rps25"                      
 [81] "H3f3a"                       "Cd63"                        "Apoe"                        "Rps6"                       
 [85] "Zeb2"                        "Rpl15"                       "Rpl22"                       "Sdc4"                       
 [89] "Ppia"                        "Chodl"                       "Zfp36l1"                     "Rpl4"                       
 [93] "mt-Nd3"                      "ENSMUSG00000039607.16"       "Rpl7a"                       "Nfkb1"                      
 [97] "Naca"                        "Rpl5"                        "Filip1l"                     "Rpl27"                      
[101] "Lgals1"                      "Rhoj"                        "Rpl10-ps3"                   "Nfib"                       
[105] "Col3a1"                      "Itm2a"                       "Rpl23a"                      "Oaz1"                       
[109] "Gas1"                        "Mbnl2"                       "Ppp1r14b"                    "Lama2"                      
[113] "Gas5"                        "Crip1"                       "Vim"                         "Cfap77"                     
[117] "Eef1b2"                      "Gsn"                         "Dag1"                        "Rps17"                      
[121] "Rps7"                        "Gm11808"                     "Kxd1"                        "Hmgb1"                      
[125] "Pdlim4"                      "Cox8a"                       "Pmepa1"                      "Crip2"                      
[129] "Itm2b"                       "Cox4i1"                      "Kalrn"                       "Hs6st3"                     
[133] "Mpp7"                        "Runx1"                       "Gm28438"                     "Cnn3"                       
[137] "Cp"                          "Nppc"                        "Ltbp1"                       "Igfbp5"                     
[141] "Samd4"                       "Uqcrh"                       "Serping1"                    "Hspa5"                      
[145] "Socs3"                       "Crlf1"                       "S100a10"                     "Rpl31"                      
[149] "Serf2"                       "Chchd2"                      "Sh3glb1"                     "Atp5e"                      
[153] "Grb10"                       "Csmd1"                       "Col4a1"                      "Pfn1"                       
[157] "Tmtc2"                       "Cd81"                        "Arid5b"                      "Ier2"                       
[161] "Anxa5"                       "Peg3"                        "Gapdh"                       "Asb5"                       
[165] "Atp5b"                       "Cox7c"                       "Marcks"                      "Gm15500"                    
[169] "Atp5l"                       "Cox6c"                       "Ptms"                        "Eef1g"                      
[173] "Gxylt2"                      "Myl6"                        "Anxa2"                       "Gal"                        
[177] "Pdzd2"                       "Cd82"                        "Cavin2"                      "Kcnma1"                     
[181] "Calr"                        "Acta2"                       "Anxa6"                       "H2az1"                      
[185] "Capns1"                      "Emp1"                        "Cav1"                        "Serpinh1"                   
[189] "Hsp90b1"                     "Tagln"                       "Ccnd1"                       "Col4a2"                     
[193] "Atp1a2"                      "Msc"                         "Col6a1"                      "Mest"                       
[197] "Tnxb"                        "Igf1"                        "Hmgn2"                       "Timp3"                      
[201] "Glis3"                       "Igfbp4"                      "Aff1"                        "Ankrd10"                    
[205] "Gm48228"                     "Lsm6"                        "9030624G23Rik"               "Ntn4"                       
[209] "Anxa1"                       "Myo1d"                       "Sugct"                       "9530026P05Rik"              
[213] "Cdkn1c"                      "Spock3"                      "Dnah7a"                      "Dgkg"                       
[217] "Thsd7a"                      "Grid2"                       "Ccl11"                       "Stmn1"                      
[221] "Mbd1"                        "Gm26802"                     "Sorbs2"                      "Myog"                       
[225] "Col8a1"                      "Ier5l"                       "Eya2"                        "Frmpd4"                     
[229] "Iigp1"                       "P2ry14"                      "6030407O03Rik"               "Kif21a"                     
[233] "Gm7536"                      "ENSMUSG00000031842.14"       "Cenpa"                       "Ccnb2"                      
[237] "Ctnna2"                      "Pclaf"                      
Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
3: In readChar(file, size, TRUE) : truncating string with embedded nuls
4: In readChar(file, size, TRUE) : truncating string with embedded nuls
5: In readChar(file, size, TRUE) : truncating string with embedded nuls
6: In readChar(file, size, TRUE) : truncating string with embedded nuls
7: In readChar(file, size, TRUE) : truncating string with embedded nuls
p1 <- 
  plotHeatmap(sce10x_stem,
              color =colorRampPalette(RColorBrewer::brewer.pal(n = 11, name ="RdBu"))(11),
            features=genes_hits,
            colour_columns_by=c("clusters_condition"),
          #  cluster_cols=FALSE,
            cluster_rows=TRUE,
           center=TRUE, 
          # zlim= c(-3,3),
           order_columns_by=c("clusters_condition", "sizeFactor"), 
         #  gaps_row = seq(0,5*5,by=5),
         symmetric=TRUE
         )
p1
ggsave( file.path(figures_dir, "heatmaps", "stem_aging_de_genes_heatmap.pdf"), p1)

p1 <- 
  plotHeatmap(sce10x_stem,
              color =colorRampPalette(RColorBrewer::brewer.pal(n = 9, name ="YlGnBu"))(18),
            features=genes_hits,
            colour_columns_by=c("clusters_condition"),
          #  cluster_cols=FALSE,
            cluster_rows=TRUE,
         #  center=TRUE, 
          # zlim= c(-3,3),
           order_columns_by=c("clusters_condition", "sizeFactor"), 
         #  gaps_row = seq(0,5*5,by=5),
         #symmetric=TRUE
         )
p1

ggsave( file.path(figures_dir, "heatmaps", "stem_aging_de_genes_heatmap_noncentered.pdf"), p1)
Saving 14 x 30 in image
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] pheatmap_1.0.12             scater_1.16.2               scran_1.16.0                SingleCellExperiment_1.10.1
 [5] SummarizedExperiment_1.18.2 DelayedArray_0.14.1         matrixStats_0.56.0          Biobase_2.48.0             
 [9] GenomicRanges_1.40.0        GenomeInfoDb_1.24.2         IRanges_2.22.2              S4Vectors_0.26.1           
[13] BiocGenerics_0.34.0         forcats_0.5.0               stringr_1.4.0               dplyr_1.0.2                
[17] purrr_0.3.4                 readr_1.3.1                 tidyr_1.1.2                 tibble_3.0.3               
[21] ggplot2_3.3.2               tidyverse_1.3.0            

loaded via a namespace (and not attached):
 [1] bitops_1.0-6              fs_1.5.0                  lubridate_1.7.9           RColorBrewer_1.1-2       
 [5] httr_1.4.2                rprojroot_1.3-2           tools_4.0.2               backports_1.1.9          
 [9] R6_2.4.1                  irlba_2.3.3               vipor_0.4.5               DBI_1.1.0                
[13] colorspace_1.4-1          withr_2.2.0               tidyselect_1.1.0          gridExtra_2.3            
[17] compiler_4.0.2            cli_2.0.2                 rvest_0.3.6               BiocNeighbors_1.6.0      
[21] xml2_1.3.2                isoband_0.2.2             labeling_0.3              scales_1.1.1             
[25] digest_0.6.25             rmarkdown_2.3             XVector_0.28.0            base64enc_0.1-3          
[29] htmltools_0.5.0           pkgconfig_2.0.3           dbplyr_1.4.4              limma_3.44.3             
[33] rlang_0.4.7               readxl_1.3.1              rstudioapi_0.11           DelayedMatrixStats_1.10.1
[37] farver_2.0.3              generics_0.0.2            jsonlite_1.7.1            BiocParallel_1.22.0      
[41] RCurl_1.98-1.2            magrittr_1.5              BiocSingular_1.4.0        GenomeInfoDbData_1.2.3   
[45] Matrix_1.2-18             Rcpp_1.0.5                ggbeeswarm_0.6.0          munsell_0.5.0            
[49] fansi_0.4.1               viridis_0.5.1             lifecycle_0.2.0           yaml_2.2.1               
[53] stringi_1.5.3             edgeR_3.30.3              MASS_7.3-52               zlibbioc_1.34.0          
[57] grid_4.0.2                blob_1.2.1                dqrng_0.2.1               crayon_1.3.4             
[61] lattice_0.20-41           cowplot_1.1.0             haven_2.3.1               hms_0.5.3                
[65] locfit_1.5-9.4            knitr_1.29                pillar_1.4.6              igraph_1.2.5             
[69] reprex_0.3.0              glue_1.4.2                evaluate_0.14             packrat_0.5.0            
[73] modelr_0.1.8              vctrs_0.3.4               cellranger_1.1.0          gtable_0.3.0             
[77] assertthat_0.2.1          xfun_0.17                 rsvd_1.0.3                broom_0.7.0              
[81] viridisLite_0.3.0         beeswarm_0.2.3            statmod_1.4.34            ellipsis_0.3.1           
LS0tCnRpdGxlOiAiTW91c2UgbXVzY2xlIHN0ZW0gY2VsbDogcGxvdCBzdGVtIGdlbmVzIgphdXRob3I6IAotIG5hbWU6IFJpY2sgRmFyb3VuaQogIGFmZmlsaWF0aW9uOgogIC0gJmNydWsgR8Opbm9tZSBRdcOpYmVjIElubm92YXRpb24gQ2VudHJlLCBNY0dpbGwgVW5pdmVyc2l0eSwgTW9udHJlYWwsIENhbmFkYQpkYXRlOiAnYHIgZm9ybWF0KFN5cy5EYXRlKCksICIlWS0lQi0lZCIpYCcKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6CiAgICBkZl9wcmludDogcGFnZWQKICAgIGNvZGVfZm9sZGluZzogc2hvdwogICAgdG9jOiBubwogICAgdG9jX2Zsb2F0OiAKICAgICAgY29sbGFwc2VkOiBmYWxzZQogICAgICBzbW9vdGhfc2Nyb2xsOiBmYWxzZQotLS0KCgojIFByZXBhcmUgYW5hbHlzaXMgd29ya2Zsb3cKCiMjIFNldCBmaWxlcGF0aHMgYW5kIHBhcmFtZXRlcnMKC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