Overrepresentation analysis of Th or Trh modulation in Onecut3 +/- subsets of glutamatergic neurons in the Lateral hypothalamic area dataset from Mickelsen LE et al 2019

Author

Evgenii O. Tretiakov

Published

April 22, 2023

Code
bioproject <- "PRJNA515063"
project <- "mickelsen2019_LHA"
cb_fpr <- 0.001
low_cutoff_gene <- 500
high_cutoff_gene <- NULL
high_cutoff_gene <- 7000
low_cutoff_umis <- NULL
low_cutoff_umis <- -Inf
high_cutoff_umis <- 25000
high_cutoff_pc_mt <- 15
high_cutoff_pc_ribo <- 15
high_cutoff_pc_hb <- 0.1
high_cutoff_doublet_score <- 0.33
high_cutoff_complexity <- 0.85
Code
srt <- LoadH5Seurat(
  file = here(
    data_dir,
    sprintf("%s-whole_dataset-fpr_%s-clusters.h5Seurat", bioproject, cb_fpr)
  )
)
srt
An object of class Seurat 
66001 features across 9053 samples within 3 assays 
Active assay: SCT (21785 features, 3500 variable features)
 2 other assays present: RAW, RNA
 2 dimensional reductions calculated: pca, umap
Code
neurons <- subset(srt, subset = Rbfox3 > 0 | Elavl4 > 0 | Snap25 > 0 | Stmn2 > 0)
onecut <- subset(neurons, subset = Onecut3 > 0 | Onecut2 > 0)
onecut3 <- subset(onecut, subset = Onecut3 > 0 & Slc17a6 > 0)
Code
mtx_neurons <-
  onecut3 %>%
  GetAssayData("data", "RNA") %>%
  as.data.frame() %>%
  t()
rownames(mtx_neurons) <- colnames(onecut3)

# Filter features
filt_low_genes <-
  colSums(mtx_neurons) %>%
  .[. > quantile(., 0.2)] %>%
  names()
mtx_neurons %<>% .[, filt_low_genes]

min_filt_vector <-
  mtx_neurons %>%
  as_tibble() %>%
  select(all_of(filt_low_genes)) %>%
  summarise(across(.fns = ~ quantile(.x, .1))) %>%
  as.list() %>%
  map(as.double) %>%
  simplify() %>%
  .[colnames(mtx_neurons)]

# Prepare table of intersection sets analysis
content_mtx_neuro <-
  (mtx_neurons > min_filt_vector) %>%
  as_tibble() %>%
  mutate_all(as.numeric)

onecut3$trh_status <-
  content_mtx_neuro %>%
  select(Trh) %>%
  mutate(trh = Trh > 0) %>%
  .$trh
onecut3$trh_status <- onecut3$trh_status %>%
  if_else(true = "Trh",
    false = "query"
  )

## Split on basis of neurotrans and test for difference
onecut3_trh <- SplitObject(onecut3, split.by = "trh_status")

markers_logreg <-
  FindAllMarkers(
    onecut3,
    assay = "RNA",
    verbose = FALSE,
    random.seed = reseed,
    only.pos = TRUE,
    min.pct = 0.1,
    base = 10,
    logfc.threshold = 0.1,
    densify = TRUE,
    test.use = "LR"
  )
write_csv(
  markers_logreg,
  here(
    tables_dir, "logreg-Vglut2_Onecut3_populations-DEG.csv"
  )
)
Code
top10_markers <-
  Extract_Top_Markers(
    marker_dataframe = markers_logreg,
    num_genes = 10,
    named_vector = FALSE,
    make_unique = TRUE,
    rank_by = "avg_log10FC"
  )

Iterate_FeaturePlot_scCustom(
  seurat_object = onecut3,
  gene_list = top10_markers,
  single_pdf = TRUE,
  reduction = "umap",
  colors_use = viridis(
    n = 30,
    alpha = .55,
    direction = -1,
    option = "E"
  ),
  pt.size = 3,
  alpha_exp = 0.45,
  alpha_na_exp = 0.1,
  file_path = here(plots_dir),
  file_name = "logreg_top10-Vglut2_Onecut3_populations-DEG.pdf"
)

DotPlots grouped by orig.ident

Expression of GABA receptors in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = gabar,
  group.by = "orig.ident",
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of GABA receptors in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = gabar,
  group.by = "orig.ident",
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

Expression of glutamate receptors in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = glutr,
  group.by = "orig.ident",
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of glutamate receptors in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = glutr,
  group.by = "orig.ident",
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

DotPlots

Expression of GABA receptors in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = gabar,
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of GABA receptors in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = gabar,
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

Expression of glutamate receptors in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = glutr,
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of glutamate receptors in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = glutr,
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

Neuropeptides

Expression of Neuropeptides in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = np,
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of Neuropeptides in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = np,
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

Expression of Neuropeptides receptors in query Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$query,
  features = npr,
  cols = c("#adffff", "#0084ff"),
  assay = "RNA"
) + RotatedAxis()

Expression of Neuropeptides receptors in Trh Onecut3 positive cells

Code
DotPlot(
  object = onecut3_trh$Trh,
  features = npr,
  cols = c("#ffc2c2", "#ff3c00"),
  assay = "RNA"
) + RotatedAxis()

Code
sbs_mtx_oc <-
  onecut %>%
  GetAssayData("data", "RNA") %>%
  as.data.frame() %>%
  t()
rownames(sbs_mtx_oc) <- colnames(onecut)

# Filter features
filt_low_genes2 <-
  colSums(sbs_mtx_oc) %>%
  .[. > quantile(., 0.4)] %>%
  names()
sbs_mtx_oc %<>% .[, filt_low_genes2]

min_filt_vector2 <-
  sbs_mtx_oc %>%
  as_tibble() %>%
  select(all_of(filt_low_genes2)) %>%
  summarise(across(.fns = ~ quantile(.x, .005))) %>%
  as.list() %>%
  map(as.double) %>%
  simplify() %>%
  .[filt_low_genes2]

# Prepare table of intersection sets analysis
content_sbs_mtx_oc <-
  (sbs_mtx_oc > min_filt_vector2) %>%
  as_tibble() %>%
  mutate_all(as.numeric)


onecut$gaba_status <-
  content_sbs_mtx_oc %>%
  select(Gad1, Gad2, Slc32a1) %>%
  mutate(gaba = if_all(.fns = ~ .x > 0)) %>%
  .$gaba

onecut$gaba_occurs <-
  content_sbs_mtx_oc %>%
  select(Gad1, Gad2, Slc32a1) %>%
  mutate(gaba = if_any(.fns = ~ .x > 0)) %>%
  .$gaba

onecut$glut_status <-
  content_sbs_mtx_oc %>%
  select(Slc17a6) %>%
  mutate(glut = Slc17a6 > 0) %>%
  .$glut

oc_fin <-
  subset(onecut,
    cells = union(
      WhichCells(onecut,
        expression = gaba_status == TRUE & glut_status == FALSE
      ),
      WhichCells(onecut,
        expression = glut_status == TRUE & gaba_occurs == FALSE
      )
    )
  )

oc_fin$status <- oc_fin$gaba_status %>%
  if_else(true = "query",
    false = "Trh"
  )
Idents(oc_fin) <- "status"

sbs_mtx_oc <-
  oc_fin %>%
  GetAssayData("data", "RNA") %>%
  as.data.frame() %>%
  t()
rownames(sbs_mtx_oc) <- colnames(oc_fin)

# Filter features
filt_low_genes2 <-
  colSums(sbs_mtx_oc) %>%
  .[. > quantile(., 0.4)] %>%
  names()
sbs_mtx_oc %<>% .[, filt_low_genes2]

min_filt_vector2 <-
  sbs_mtx_oc %>%
  as_tibble() %>%
  select(all_of(filt_low_genes2)) %>%
  summarise(across(.fns = ~ quantile(.x, .005))) %>%
  as.list() %>%
  map(as.double) %>%
  simplify() %>%
  .[filt_low_genes2]

# Prepare table of intersection sets analysis
content_sbs_mtx_oc <-
  (sbs_mtx_oc > min_filt_vector2) %>%
  as_tibble() %>%
  mutate_all(as.numeric)
Code
upset(as.data.frame(content_sbs_mtx_oc),
  order.by = "freq",
  sets.x.label = "Number of cells",
  text.scale = c(2, 1.6, 2, 1.3, 2, 3),
  nsets = 15,
  sets = c("Gad1", "Gad2", "Slc32a1", "Slc17a6", "Onecut3"),
  queries = list(
    list(
      query = intersects,
      params = list("Gad1", "Gad2", "Slc32a1", "Onecut3"),
      active = T
    ),
    list(
      query = intersects,
      params = list("Slc17a6", "Onecut3"),
      active = T
    )
  ),
  nintersects = 20,
  empty.intersections = NULL
)

Code
upset(as.data.frame(content_sbs_mtx_oc),
  order.by = "freq",
  sets.x.label = "Number of cells",
  text.scale = c(2, 1.6, 2, 1.3, 2, 3),
  nsets = 15,
  sets = c("Th", "Trh", "Slc32a1", "Slc17a6", "Onecut3"),
  queries = list(
    list(
      query = intersects,
      params = list("Th", "Slc32a1", "Onecut3"),
      active = T
    ),
    list(
      query = intersects,
      params = list("Trh", "Slc17a6", "Onecut3"),
      active = T
    )
  ),
  nintersects = 20,
  empty.intersections = NULL
)

Code
sbs_mtx_oc_full <- content_sbs_mtx_oc |>
  select(any_of(c(neurotrans, glutr, gabar, "Trh", "Th", "Onecut3"))) |>
  dplyr::bind_cols(oc_fin@meta.data)

sbs_mtx_oc_full |> glimpse()
Rows: 384
Columns: 95
$ Slc17a6                      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ Slc1a1                       <dbl> 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,…
$ Slc1a2                       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ Slc1a6                       <dbl> 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,…
$ Gad1                         <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Slc32a1                      <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Slc6a1                       <dbl> 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gria1                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,…
$ Gria2                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gria3                        <dbl> 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gria4                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Grid1                        <dbl> 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,…
$ Grid2                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Grik1                        <dbl> 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1,…
$ Grik2                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Grik3                        <dbl> 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,…
$ Grik4                        <dbl> 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0,…
$ Grik5                        <dbl> 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1,…
$ Grin1                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,…
$ Grin2a                       <dbl> 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0,…
$ Grin2b                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Grin2d                       <dbl> 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1,…
$ Grin3a                       <dbl> 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1,…
$ Grm1                         <dbl> 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1,…
$ Grm5                         <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,…
$ Grm2                         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ Grm3                         <dbl> 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1,…
$ Grm4                         <dbl> 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0,…
$ Grm7                         <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,…
$ Grm8                         <dbl> 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,…
$ Gabra1                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,…
$ Gabra2                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabra3                       <dbl> 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0,…
$ Gabra4                       <dbl> 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0,…
$ Gabra5                       <dbl> 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,…
$ Gabrb1                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabrb2                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabrb3                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabrg1                       <dbl> 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0,…
$ Gabrg2                       <dbl> 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabrg3                       <dbl> 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ Gabre                        <dbl> 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
$ Gabrq                        <dbl> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,…
$ Gabbr1                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,…
$ Gabbr2                       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,…
$ Trh                          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,…
$ Th                           <dbl> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,…
$ Onecut3                      <dbl> 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,…
$ nCount_RAW                   <dbl> 19623, 12483, 12675, 13940, 15363, 15310,…
$ nFeature_RAW                 <int> 6025, 4802, 4842, 4980, 5118, 5211, 5297,…
$ nCount_RNA                   <dbl> 19162, 12185, 12373, 13618, 14957, 15002,…
$ nFeature_RNA                 <int> 5978, 4781, 4818, 4958, 5081, 5193, 5268,…
$ orig.ident                   <chr> "SRR8441476", "SRR8441476", "SRR8441476",…
$ nFeature_Diff                <int> 47, 21, 24, 22, 37, 18, 29, 29, 31, 31, 1…
$ nCount_Diff                  <dbl> 461, 298, 302, 322, 406, 308, 376, 361, 3…
$ percent_mito                 <dbl> 4.075775, 3.947476, 2.327649, 5.742400, 1…
$ percent_ribo                 <dbl> 5.3908778, 8.1657776, 5.5524125, 6.865912…
$ percent_mito_ribo            <dbl> 9.466653, 12.113254, 7.880061, 12.608313,…
$ percent_hb                   <dbl> 0.000000000, 0.000000000, 0.000000000, 0.…
$ log10GenesPerUMI             <dbl> 0.8818700, 0.9005570, 0.8999119, 0.893857…
$ cell_name                    <chr> "SRR8441476_AAATGCCAGGCGACAT-1", "SRR8441…
$ barcode                      <chr> "AAATGCCAGGCGACAT-1", "AACCGCGAGCGGATCA-1…
$ latent_RT_efficiency         <dbl> 3.283587, 2.502992, 2.562110, 2.646928, 2…
$ latent_cell_probability      <dbl> 0.9999477, 0.9998801, 0.9999301, 0.999928…
$ latent_scale                 <dbl> 4695.590, 4008.599, 3921.173, 4068.829, 4…
$ doublet_score                <dbl> 0.04804282, 0.07987788, 0.05905781, 0.068…
$ predicted_doublets           <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ QC                           <chr> "Pass", "Pass", "Pass", "Pass", "Pass", "…
$ var_regex                    <dbl> 10.766100, 13.254001, 9.140871, 14.003525…
$ RNA_snn_res.0.5              <fct> 4, 5, 11, 5, 4, 5, 4, 4, 4, 4, 4, 4, 4, 1…
$ RNA_snn_res.0.74082856775745 <fct> 3, 6, 13, 6, 3, 9, 3, 3, 3, 3, 3, 3, 3, 4…
$ RNA_snn_res.1.24733796060143 <fct> 5, 6, 16, 6, 5, 11, 5, 9, 9, 28, 28, 9, 9…
$ RNA_snn_res.3.000001         <fct> 11, 13, 17, 13, 11, 12, 11, 8, 8, 27, 27,…
$ seurat_clusters              <fct> 3, 20, 27, 20, 30, 19, 10, 3, 3, 10, 11, …
$ k_tree                       <fct> 9, 5, 23, 5, 1, 14, 1, 9, 9, 1, 1, 9, 4, …
$ comb_clstr1                  <fct> 3, 6, 13, 6, 3, 9, 3, 3, 3, 3, 3, 3, 3, 4…
$ S.Score                      <dbl> 0.001711877, -0.019196776, -0.038780572, …
$ G2M.Score                    <dbl> 0.022455905, 0.001625043, -0.014130781, -…
$ Phase                        <chr> "G2M", "G2M", "G1", "S", "G2M", "G1", "G2…
$ nCount_SCT                   <dbl> 5786, 6661, 6617, 6344, 6031, 6118, 6219,…
$ nFeature_SCT                 <int> 3074, 3904, 3858, 3495, 3117, 3251, 3442,…
$ SCT_snn_res.1                <fct> 9, 5, 20, 5, 4, 13, 4, 9, 9, 4, 4, 9, 4, …
$ SCT_snn_res.1.10569909553377 <fct> 9, 5, 20, 5, 4, 12, 4, 9, 9, 4, 4, 9, 6, …
$ SCT_snn_res.1.23112793047964 <fct> 9, 5, 22, 5, 2, 12, 2, 9, 9, 2, 2, 9, 6, …
$ SCT_snn_res.1.38237925427927 <fct> 9, 5, 23, 5, 2, 12, 2, 9, 9, 2, 2, 9, 6, …
$ SCT_snn_res.1.5683423560766  <fct> 9, 5, 22, 5, 2, 12, 2, 9, 9, 2, 2, 9, 6, …
$ SCT_snn_res.1.80251553997986 <fct> 9, 5, 23, 5, 1, 14, 1, 9, 9, 1, 1, 9, 4, …
$ SCT_snn_res.2.10643815972253 <fct> 7, 19, 26, 19, 2, 13, 2, 7, 7, 2, 2, 7, 4…
$ SCT_snn_res.2.51672603000175 <fct> 6, 20, 26, 20, 4, 14, 4, 6, 6, 4, 7, 6, 7…
$ SCT_snn_res.3.10106021549219 <fct> 6, 20, 26, 20, 5, 12, 5, 6, 6, 9, 9, 6, 9…
$ SCT_snn_res.4.00000100000001 <fct> 3, 20, 27, 20, 30, 19, 10, 3, 3, 10, 11, …
$ gaba_status                  <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
$ gaba_occurs                  <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
$ glut_status                  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
$ status                       <chr> "query", "query", "query", "query", "quer…
Code
sbs_mtx_oc_full$modulator <-
  sbs_mtx_oc_full %>%
  select(Trh, Th) %>%
  mutate(modulator = if_any(.fns = ~ .x > 0)) %>%
  .$modulator

sbs_mtx_oc_full$oc3 <-
  (sbs_mtx_oc_full$Onecut3 > 0)

library(ggstatsplot)
# for reproducibility
set.seed(123)

## plot
# ggpiestats(
#   data = sbs_mtx_oc_full,
#   x = modulator,
#   y = status,
#   perc.k = 1,
#   package = "ggsci",
#   palette = "category10_d3",
# ) + # further modification with `{ggplot2}` commands
#   ggplot2::theme(
#     plot.title = ggplot2::element_text(
#       color = "black",
#       size = 14,
#       hjust = 0
#     )
#   )

# plot
grouped_ggpiestats(
  # arguments relevant for `ggpiestats()`
  data = sbs_mtx_oc_full,
  x = modulator,
  y = oc3,
  grouping.var = status,
  perc.k = 1,
  package = "ggsci",
  palette = "category10_d3",
  # arguments relevant for `combine_plots()`
  title.text = "Neuromodulator specification of onecut-driven hypothalamic neuronal lineages by Onecut3 and main neurotransmitter expression",
  caption.text = "Asterisks denote results from proportion tests; \n***: p < 0.001, ns: non-significant",
  plotgrid.args = list(nrow = 2)
)

Session information

Code
devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.2 (2022-10-31)
 os       Ubuntu 22.04.2 LTS
 system   x86_64, linux-gnu
 ui       X11
 language en_US:en
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Etc/UTC
 date     2023-04-22
 pandoc   2.19.2 @ /opt/python/3.8.8/bin/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package              * version     date (UTC) lib source
 abind                  1.4-5       2016-07-21 [1] RSPM (R 4.2.0)
 base64enc              0.1-3       2015-07-28 [1] RSPM (R 4.2.0)
 BayesFactor            0.9.12-4.4  2022-07-05 [1] RSPM (R 4.2.0)
 bayestestR             0.13.0      2022-09-18 [1] RSPM (R 4.2.0)
 beeswarm               0.4.0       2021-06-01 [1] RSPM (R 4.2.0)
 Biobase                2.58.0      2022-11-01 [1] RSPM (R 4.2.2)
 BiocGenerics           0.44.0      2022-11-01 [1] RSPM (R 4.2.2)
 bit                    4.0.5       2022-11-15 [1] RSPM (R 4.2.0)
 bit64                  4.0.5       2020-08-30 [1] RSPM (R 4.2.0)
 bitops                 1.0-7       2021-04-24 [1] RSPM (R 4.2.0)
 cachem                 1.0.7       2023-02-24 [1] RSPM (R 4.2.0)
 callr                  3.7.3       2022-11-02 [1] RSPM (R 4.2.0)
 circlize               0.4.15      2022-05-10 [1] RSPM (R 4.2.0)
 cli                    3.6.1       2023-03-23 [1] RSPM (R 4.2.0)
 cluster                2.1.4       2022-08-22 [1] RSPM (R 4.2.0)
 coda                   0.19-4      2020-09-30 [1] RSPM (R 4.2.0)
 codetools              0.2-19      2023-02-01 [1] RSPM (R 4.2.0)
 colorspace             2.1-0       2023-01-23 [1] RSPM (R 4.2.0)
 correlation            0.8.4       2023-04-08 [1] Github (easystats/correlation@3d5cd1e)
 cowplot                1.1.1       2020-12-30 [1] RSPM (R 4.2.0)
 crayon                 1.5.2       2022-09-29 [1] RSPM (R 4.2.0)
 data.table             1.14.8      2023-02-17 [1] RSPM (R 4.2.0)
 datawizard             0.7.1       2023-04-03 [1] RSPM (R 4.2.0)
 DelayedArray           0.24.0      2022-11-01 [1] RSPM (R 4.2.2)
 deldir                 1.0-6       2021-10-23 [1] RSPM (R 4.2.0)
 devtools               2.4.5       2022-10-11 [1] RSPM (R 4.2.0)
 digest                 0.6.31      2022-12-11 [1] RSPM (R 4.2.0)
 dplyr                * 1.1.1       2023-03-22 [1] RSPM (R 4.2.0)
 effectsize             0.8.3       2023-01-28 [1] RSPM (R 4.2.0)
 ellipsis               0.3.2       2021-04-29 [1] RSPM (R 4.2.0)
 emmeans                1.8.5       2023-03-08 [1] RSPM (R 4.2.0)
 estimability           1.4.1       2022-08-05 [1] RSPM (R 4.2.0)
 evaluate               0.20        2023-01-17 [1] RSPM (R 4.2.0)
 fansi                  1.0.4       2023-01-22 [1] RSPM (R 4.2.0)
 farver                 2.1.1       2022-07-06 [1] RSPM (R 4.2.0)
 fastmap                1.1.1       2023-02-24 [1] RSPM (R 4.2.0)
 fitdistrplus           1.1-8       2022-03-10 [1] RSPM (R 4.2.0)
 forcats              * 1.0.0       2023-01-29 [1] RSPM (R 4.2.0)
 fs                     1.6.1       2023-02-06 [1] RSPM (R 4.2.0)
 future               * 1.32.0      2023-03-07 [1] RSPM (R 4.2.0)
 future.apply           1.10.0      2022-11-05 [1] RSPM (R 4.2.0)
 generics               0.1.3       2022-07-05 [1] RSPM (R 4.2.0)
 GenomeInfoDb           1.34.9      2023-02-02 [1] RSPM (R 4.2.2)
 GenomeInfoDbData       1.2.9       2023-04-08 [1] RSPM (R 4.2.2)
 GenomicRanges          1.50.2      2022-12-16 [1] RSPM (R 4.2.2)
 ggbeeswarm             0.7.1.9000  2023-04-08 [1] Github (eclarke/ggbeeswarm@5dc91cc)
 ggmin                  0.0.0.9000  2023-04-08 [1] Github (sjessa/ggmin@8ada274)
 ggplot2              * 3.4.2       2023-04-03 [1] RSPM (R 4.2.0)
 ggprism                1.0.4       2023-04-08 [1] Github (csdaw/ggprism@0e411f4)
 ggrastr                1.0.1       2023-04-08 [1] Github (VPetukhov/ggrastr@7aed9af)
 ggrepel                0.9.2.9999  2023-04-08 [1] Github (slowkow/ggrepel@fe3b5c3)
 ggridges               0.5.4       2022-09-26 [1] RSPM (R 4.2.0)
 ggstatsplot          * 0.11.0.9000 2023-04-08 [1] Github (IndrajeetPatil/ggstatsplot@fe83ae6)
 GlobalOptions          0.1.2       2020-06-10 [1] RSPM (R 4.2.0)
 globals                0.16.2      2022-11-21 [1] RSPM (R 4.2.0)
 glue                   1.6.2       2022-02-24 [1] RSPM (R 4.2.0)
 goftest                1.2-3       2021-10-07 [1] RSPM (R 4.2.0)
 gridExtra              2.3         2017-09-09 [1] RSPM (R 4.2.0)
 gtable                 0.3.3       2023-03-21 [1] RSPM (R 4.2.0)
 hdf5r                  1.3.8       2023-01-21 [1] RSPM (R 4.2.2)
 here                 * 1.0.1       2020-12-13 [1] RSPM (R 4.2.0)
 hms                    1.1.3       2023-03-21 [1] RSPM (R 4.2.0)
 htmltools              0.5.5       2023-03-23 [1] RSPM (R 4.2.0)
 htmlwidgets            1.6.2       2023-03-17 [1] RSPM (R 4.2.0)
 httpuv                 1.6.9       2023-02-14 [1] RSPM (R 4.2.0)
 httr                   1.4.5       2023-02-24 [1] RSPM (R 4.2.0)
 ica                    1.0-3       2022-07-08 [1] RSPM (R 4.2.0)
 igraph                 1.4.1       2023-02-24 [1] RSPM (R 4.2.0)
 insight                0.19.1      2023-03-18 [1] RSPM (R 4.2.0)
 IRanges                2.32.0      2022-11-01 [1] RSPM (R 4.2.2)
 irlba                  2.3.5.1     2022-10-03 [1] RSPM (R 4.2.0)
 janitor                2.2.0.9000  2023-04-08 [1] Github (sfirke/janitor@d64c8bb)
 jsonlite               1.8.4       2022-12-06 [1] RSPM (R 4.2.0)
 kableExtra           * 1.3.4       2021-02-20 [1] RSPM (R 4.2.0)
 KernSmooth             2.23-20     2021-05-03 [1] RSPM (R 4.2.0)
 knitr                * 1.42        2023-01-25 [1] RSPM (R 4.2.0)
 ks                     1.14.0      2022-11-24 [1] RSPM (R 4.2.0)
 labeling               0.4.2       2020-10-20 [1] RSPM (R 4.2.0)
 later                  1.3.0       2021-08-18 [1] RSPM (R 4.2.0)
 lattice                0.21-8      2023-04-05 [1] RSPM (R 4.2.0)
 lazyeval               0.2.2       2019-03-15 [1] RSPM (R 4.2.0)
 leiden                 0.4.3       2022-09-10 [1] RSPM (R 4.2.0)
 lifecycle              1.0.3       2022-10-07 [1] RSPM (R 4.2.0)
 listenv                0.9.0       2022-12-16 [1] RSPM (R 4.2.0)
 lmtest                 0.9-40      2022-03-21 [1] RSPM (R 4.2.0)
 lubridate            * 1.9.2       2023-02-10 [1] RSPM (R 4.2.0)
 magrittr             * 2.0.3       2022-03-30 [1] RSPM (R 4.2.0)
 MASS                   7.3-58.1    2022-08-03 [1] CRAN (R 4.2.2)
 Matrix                 1.5-4       2023-04-04 [1] RSPM (R 4.2.0)
 MatrixGenerics         1.10.0      2022-11-01 [1] RSPM (R 4.2.2)
 MatrixModels           0.5-1       2022-09-11 [1] RSPM (R 4.2.0)
 matrixStats            0.63.0      2022-11-18 [1] RSPM (R 4.2.0)
 mclust                 6.0.0       2022-10-31 [1] RSPM (R 4.2.0)
 memoise                2.0.1       2021-11-26 [1] RSPM (R 4.2.0)
 mime                   0.12        2021-09-28 [1] RSPM (R 4.2.0)
 miniUI                 0.1.1.1     2018-05-18 [1] RSPM (R 4.2.0)
 multcomp               1.4-23      2023-03-09 [1] RSPM (R 4.2.0)
 munsell                0.5.0       2018-06-12 [1] RSPM (R 4.2.0)
 mvtnorm                1.1-3       2021-10-08 [1] RSPM (R 4.2.0)
 Nebulosa             * 1.8.0       2022-11-01 [1] RSPM (R 4.2.2)
 nlme                   3.1-162     2023-01-31 [1] RSPM (R 4.2.0)
 paletteer              1.5.0       2022-10-19 [1] RSPM (R 4.2.0)
 parallelly             1.35.0      2023-03-23 [1] RSPM (R 4.2.0)
 parameters             0.20.3      2023-04-05 [1] RSPM (R 4.2.0)
 patchwork            * 1.1.2.9000  2023-04-08 [1] Github (thomasp85/patchwork@c14c960)
 pbapply                1.7-0       2023-01-13 [1] RSPM (R 4.2.0)
 pillar                 1.9.0       2023-03-22 [1] RSPM (R 4.2.0)
 pkgbuild               1.4.0       2022-11-27 [1] RSPM (R 4.2.0)
 pkgconfig              2.0.3       2019-09-22 [1] RSPM (R 4.2.0)
 pkgload                1.3.2       2022-11-16 [1] RSPM (R 4.2.0)
 plotly                 4.10.1      2022-11-07 [1] RSPM (R 4.2.0)
 plyr                   1.8.8       2022-11-11 [1] RSPM (R 4.2.0)
 png                    0.1-8       2022-11-29 [1] RSPM (R 4.2.0)
 polyclip               1.10-4      2022-10-20 [1] RSPM (R 4.2.0)
 pracma                 2.4.2       2022-09-22 [1] RSPM (R 4.2.0)
 prettyunits            1.1.1       2020-01-24 [1] RSPM (R 4.2.0)
 prismatic              1.1.1       2022-08-15 [1] RSPM (R 4.2.0)
 processx               3.8.0       2022-10-26 [1] RSPM (R 4.2.0)
 profvis                0.3.7       2020-11-02 [1] RSPM (R 4.2.0)
 progressr              0.13.0      2023-01-10 [1] RSPM (R 4.2.0)
 promises               1.2.0.1     2021-02-11 [1] RSPM (R 4.2.0)
 ps                     1.7.4       2023-04-02 [1] RSPM (R 4.2.0)
 purrr                * 1.0.1       2023-01-10 [1] RSPM (R 4.2.0)
 R6                     2.5.1       2021-08-19 [1] RSPM (R 4.2.0)
 RANN                   2.6.1       2019-01-08 [1] RSPM (R 4.2.0)
 RColorBrewer         * 1.1-3       2022-04-03 [1] RSPM (R 4.2.0)
 Rcpp                   1.0.10      2023-01-22 [1] RSPM (R 4.2.0)
 RcppAnnoy              0.0.20      2022-10-27 [1] RSPM (R 4.2.0)
 RCurl                  1.98-1.12   2023-03-27 [1] RSPM (R 4.2.0)
 readr                * 2.1.4       2023-02-10 [1] RSPM (R 4.2.0)
 rematch2               2.1.2       2020-05-01 [1] RSPM (R 4.2.0)
 remotes                2.4.2       2021-11-30 [1] RSPM (R 4.2.0)
 repr                   1.1.6       2023-01-26 [1] RSPM (R 4.2.0)
 reshape2               1.4.4       2020-04-09 [1] RSPM (R 4.2.0)
 reticulate           * 1.28-9000   2023-04-08 [1] Github (rstudio/reticulate@63a5c3e)
 rlang                  1.1.0       2023-03-14 [1] RSPM (R 4.2.0)
 rmarkdown              2.21        2023-03-26 [1] RSPM (R 4.2.0)
 ROCR                   1.0-11      2020-05-02 [1] RSPM (R 4.2.0)
 rprojroot              2.0.3       2022-04-02 [1] RSPM (R 4.2.0)
 rstudioapi             0.14        2022-08-22 [1] RSPM (R 4.2.0)
 Rtsne                  0.16        2022-04-17 [1] RSPM (R 4.2.0)
 rvest                  1.0.3       2022-08-19 [1] RSPM (R 4.2.0)
 S4Vectors              0.36.2      2023-02-26 [1] RSPM (R 4.2.2)
 sandwich               3.0-2       2022-06-15 [1] RSPM (R 4.2.0)
 scales                 1.2.1       2022-08-20 [1] RSPM (R 4.2.0)
 scattermore            0.8         2022-02-14 [1] RSPM (R 4.2.0)
 scCustomize          * 1.1.1       2023-04-08 [1] Github (samuel-marsh/scCustomize@d08268d)
 sctransform            0.3.5       2022-09-21 [1] RSPM (R 4.2.0)
 sessioninfo            1.2.2       2021-12-06 [1] RSPM (R 4.2.0)
 Seurat               * 4.3.0       2022-11-18 [1] RSPM (R 4.2.2)
 SeuratDisk           * 0.0.0.9020  2023-04-08 [1] Github (mojaveazure/seurat-disk@9b89970)
 SeuratObject         * 4.1.3       2022-11-07 [1] RSPM (R 4.2.0)
 shape                  1.4.6       2021-05-19 [1] RSPM (R 4.2.0)
 shiny                  1.7.4       2022-12-15 [1] RSPM (R 4.2.0)
 SingleCellExperiment   1.20.1      2023-03-17 [1] RSPM (R 4.2.2)
 skimr                * 2.1.5       2023-04-08 [1] Github (ropensci/skimr@d5126aa)
 snakecase              0.11.0      2019-05-25 [1] RSPM (R 4.2.0)
 sp                     1.6-0       2023-01-19 [1] RSPM (R 4.2.0)
 spatstat.data          3.0-1       2023-03-12 [1] RSPM (R 4.2.0)
 spatstat.explore       3.1-0       2023-03-14 [1] RSPM (R 4.2.0)
 spatstat.geom          3.1-0       2023-03-12 [1] RSPM (R 4.2.0)
 spatstat.random        3.1-4       2023-03-13 [1] RSPM (R 4.2.0)
 spatstat.sparse        3.0-1       2023-03-12 [1] RSPM (R 4.2.0)
 spatstat.utils         3.0-2       2023-03-11 [1] RSPM (R 4.2.0)
 statsExpressions       1.5.0       2023-02-19 [1] RSPM (R 4.2.0)
 stringi                1.7.12      2023-01-11 [1] RSPM (R 4.2.0)
 stringr              * 1.5.0       2022-12-02 [1] RSPM (R 4.2.0)
 SummarizedExperiment   1.28.0      2022-11-01 [1] RSPM (R 4.2.2)
 survival               3.5-5       2023-03-12 [1] RSPM (R 4.2.0)
 svglite                2.1.1       2023-01-10 [1] RSPM (R 4.2.0)
 systemfonts            1.0.4       2022-02-11 [1] RSPM (R 4.2.0)
 tensor                 1.5         2012-05-05 [1] RSPM (R 4.2.0)
 TH.data                1.1-1       2022-04-26 [1] RSPM (R 4.2.0)
 tibble               * 3.2.1       2023-03-20 [1] RSPM (R 4.2.0)
 tidyr                * 1.3.0       2023-01-24 [1] RSPM (R 4.2.0)
 tidyselect             1.2.0       2022-10-10 [1] RSPM (R 4.2.0)
 tidyverse            * 2.0.0.9000  2023-04-08 [1] Github (tidyverse/tidyverse@8ec2e1f)
 timechange             0.2.0       2023-01-11 [1] RSPM (R 4.2.0)
 tzdb                   0.3.0       2022-03-28 [1] RSPM (R 4.2.0)
 UpSetR               * 1.4.0       2023-04-08 [1] Github (hms-dbmi/UpSetR@b14854a)
 urlchecker             1.0.1       2021-11-30 [1] RSPM (R 4.2.0)
 usethis                2.1.6       2022-05-25 [1] RSPM (R 4.2.0)
 utf8                   1.2.3       2023-01-31 [1] RSPM (R 4.2.0)
 uwot                   0.1.14      2022-08-22 [1] RSPM (R 4.2.0)
 vctrs                  0.6.1       2023-03-22 [1] RSPM (R 4.2.0)
 vipor                  0.4.5       2017-03-22 [1] RSPM (R 4.2.0)
 viridis              * 0.6.2       2021-10-13 [1] RSPM (R 4.2.0)
 viridisLite          * 0.4.1       2022-08-22 [1] RSPM (R 4.2.0)
 vroom                  1.6.1       2023-01-22 [1] RSPM (R 4.2.0)
 webshot                0.5.4       2022-09-26 [1] RSPM (R 4.2.0)
 withr                  2.5.0       2022-03-03 [1] RSPM (R 4.2.0)
 xfun                   0.38        2023-03-24 [1] RSPM (R 4.2.0)
 xml2                   1.3.3       2021-11-30 [1] RSPM (R 4.2.0)
 xtable                 1.8-4       2019-04-21 [1] RSPM (R 4.2.0)
 XVector                0.38.0      2022-11-01 [1] RSPM (R 4.2.2)
 yaml                   2.3.7       2023-01-23 [1] RSPM (R 4.2.0)
 zeallot              * 0.1.0       2018-01-28 [1] RSPM (R 4.2.0)
 zlibbioc               1.44.0      2022-11-01 [1] RSPM (R 4.2.2)
 zoo                    1.8-11      2022-09-17 [1] RSPM (R 4.2.0)

 [1] /opt/R/4.2.2/lib/R/library

──────────────────────────────────────────────────────────────────────────────