Last updated: 2023-08-17

Checks: 7 0

Knit directory: Hevesi_2023/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20230121) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 54541d8. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    .cache/
    Ignored:    .config/
    Ignored:    .nv/
    Ignored:    .snakemake/
    Ignored:    analysis/figure/
    Ignored:    cellbender/
    Ignored:    cellranger/
    Ignored:    data/Pr5P7_clusters.h5ad
    Ignored:    data/THP7_clusters.h5ad
    Ignored:    fastq/
    Ignored:    souporcell/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/figure_2d-THP7.Rmd) and HTML (docs/figure_2d-THP7.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 54541d8 Evgenii O. Tretiakov 2023-08-17 updated output
html 9014631 Evgenii O. Tretiakov 2023-08-17 Build site.
Rmd d1dcfea Evgenii O. Tretiakov 2023-08-02 alternative stacked violin plot may be helpful for ventrobasal thalamus where we show two clusters with dotplot relative scale
Rmd edcb936 Evgenii O. Tretiakov 2023-03-14 update methods
html 263f215 Evgenii O. Tretiakov 2023-03-13 Build site.
Rmd 3111dee Evgenii O. Tretiakov 2023-03-13 workflowr::wflow_publish(c("analysis/eda.Rmd", "analysis/figure_2d-THP7.Rmd",
html 4ef209f Evgenii O. Tretiakov 2023-03-05 Build site.
Rmd e584a94 Evgenii O. Tretiakov 2023-03-04 workflowr::wflow_publish(c("analysis/eda.Rmd", "analysis/figure_2d-THP7.Rmd",

Load dataset

srt <- LoadH5Seurat(here(data_dir, "THP7_clusters.h5Seurat"))
Idents(srt) <- "sep_clstr"
neurons <- subset(srt, subset = Rbfox3 > 0 | Elavl4 > 0 | Snap25 > 0 | Stmn2 > 0)
gneurons <- subset(neurons, subset = Gal > 0)

We check list of genes based on our prior knowledge.

gene_of_interest <-
  c("Gal", "Galr1", "Galr2", "Galr3",
    "Slc17a7", "Slc6a4", "Ache", 
    "Prkaca", "Adcy1", "Grin1", 
    "Cck", "Oxt", "Npy", "Sst", "Avp")

genes_present <- Gene_Present(data = srt, gene_list = gene_of_interest)
genes_present
$found_features
 [1] "Gal"     "Galr1"   "Galr2"   "Slc17a7" "Slc6a4"  "Ache"    "Prkaca" 
 [8] "Adcy1"   "Grin1"   "Cck"     "Npy"     "Sst"    

$bad_features
[1] "Galr3" "Oxt"   "Avp"  

$wrong_case_found_features
[1] "NA (check not performed.  Set 'case_check = TRUE' to perform check."
DotPlot_scCustom(
  seurat_object = srt,
  assay = "RNA",
  features = genes_present$found_features,
  flip_axes = TRUE,
  x_lab_rotate = TRUE,
  colors_use = viridis(n = 30, alpha = .75, direction = -1, option = "E"))

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
4ef209f Evgenii O. Tretiakov 2023-03-05
DimPlot_scCustom(
  srt,
  label = TRUE,
  repel = TRUE,
  pt.size = 2,
  figure_plot = TRUE
  ) + ggtitle("Clusters") + NoLegend()

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05

Derive and filter matrix of neurons

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

# Filter features
filt_low_genes <-
    colSums(mtx_neurons) %>%
    .[. > quantile(., 0.4)] %>%
    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)

Visualise intersections sets that we are going to use (highlighted)

upset(as.data.frame(content_mtx_neuro),
  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"),
  queries = list(
    list(
      query = intersects,
      params = list("Gad1", "Gad2", "Slc32a1"),
      active = T
    ),
    list(
      query = intersects,
      params = list("Slc17a6"),
      active = T
    )
  ),
  nintersects = 60,
  empty.intersections = "on"
)

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13
upset(as.data.frame(content_mtx_neuro),
  order.by = "freq",
  sets.x.label = "Number of cells",
  text.scale = c(2, 1.6, 2, 1.3, 2, 3),
  nsets = 15,
  sets = c("Gal", "Slc32a1", "Slc17a6"),
  queries = list(
    list(
      query = intersects,
      params = list("Gal", "Slc32a1"),
      active = T
    ),
    list(
      query = intersects,
      params = list("Gal", "Slc17a6"),
      active = T
    )
  ),
  nintersects = 60,
  empty.intersections = "on"
)

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Make subset of stable neurons

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

gneurons$gaba_expr <-
  content_mtx_neuro %>%
  select(Gad1, Gad2, Slc32a1) %>%
  mutate(gaba = if_any(.fns = ~ .x > 0)) %>%
  .$gaba

gneurons$glut_status <-
  content_mtx_neuro %>%
  select(Slc17a6) %>%
  mutate(glut = Slc17a6 > 0) %>%
  .$glut

neuro_fin <-
  subset(gneurons,
    cells = union(
      WhichCells(gneurons,
        expression = gaba_status == TRUE & glut_status == FALSE),
      WhichCells(gneurons,
        expression = glut_status == TRUE & gaba_expr == FALSE)))

Check contingency tables for neurotransmitter signature

neuro_fin@meta.data %>%
  janitor::tabyl(glut_status, gaba_status)

Make splits of neurons by neurotransmitter signature

neuro_fin$status <- neuro_fin$gaba_status %>%
  if_else(true = "GABAergic",
    false = "glutamatergic")
Idents(neuro_fin) <- "status"
SaveH5Seurat(
  object    = neuro_fin,
  filename  = here(data_dir, "neuro_fin-THP7"),
  overwrite = TRUE,
  verbose   = TRUE
)

## Split on basis of neurotrans and test for difference
neuro_fin_neurotrans <- SplitObject(neuro_fin, split.by = "status")

DotPlots grouped by orig.ident

Expression of GABA receptors in GABAergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$GABAergic,
        features = gabar,
        group.by = "orig.ident",
        cols = c("#adffff", "#0084ff"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of GABA receptors in glutamatergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$glutamatergic,
        features = gabar,
        group.by = "orig.ident",
        cols = c("#ffc2c2", "#ff3c00"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of glutamate receptors in GABAergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$GABAergic,
        features = glutr,
        group.by = "orig.ident",
        cols = c("#adffff", "#0084ff"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of glutamate receptors in glutamatergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$glutamatergic,
        features = glutr,
        group.by = "orig.ident",
        cols = c("#ffc2c2", "#ff3c00"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

DotPlots

Expression of GABA receptors in GABAergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$GABAergic,
        features = gabar,
        group.by = "k_tree",
        cols = c("#adffff", "#0084ff"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of GABA receptors in glutamatergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$glutamatergic,
        features = gabar,
        group.by = "k_tree",
        cols = c("#ffc2c2", "#ff3c00"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of glutamate receptors in GABAergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$GABAergic,
        features = glutr,
        group.by = "k_tree",
        cols = c("#adffff", "#0084ff"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13

Expression of glutamate receptors in glutamatergic Gal positive cells

DotPlot(object = neuro_fin_neurotrans$glutamatergic,
        features = glutr,
        group.by = "k_tree",
        cols = c("#ffc2c2", "#ff3c00"),
        col.min = -1, col.max = 1
) + RotatedAxis()

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
263f215 Evgenii O. Tretiakov 2023-03-13
sbs_mtx_neuro <-
    neurons %>%
    GetAssayData("data", "RNA") %>%
    as.data.frame() %>%
    t()
rownames(sbs_mtx_neuro) <- colnames(neurons)

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

min_filt_vector2 <-
    sbs_mtx_neuro %>%
    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_neuro <-
    (sbs_mtx_neuro > min_filt_vector2) %>%
    as_tibble() %>%
    mutate_all(as.numeric)


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

neurons$gaba_expr <-
  content_sbs_mtx_neuro %>%
  select(Gad1, Gad2, Slc32a1) %>%
  mutate(gaba = if_any(.fns = ~ .x > 0)) %>%
  .$gaba

neurons$glut_status <-
  content_sbs_mtx_neuro %>%
  select(Slc17a6) %>%
  mutate(glut = Slc17a6 > 0) %>%
  .$glut

neuro_fin <-
  subset(neurons,
    cells = union(
      WhichCells(neurons,
        expression = gaba_status == TRUE & glut_status == FALSE),
      WhichCells(neurons,
        expression = glut_status == TRUE & gaba_expr == FALSE)))

neuro_fin$status <- neuro_fin$gaba_status %>%
  if_else(true = "GABAergic",
    false = "glutamatergic")
Idents(neuro_fin) <- "status"

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

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

min_filt_vector2 <-
    sbs_mtx_neuro %>%
    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_neuro <-
    (sbs_mtx_neuro > min_filt_vector2) %>%
    as_tibble() %>%
    mutate_all(as.numeric)
sbs_mtx_neuro_full <- content_sbs_mtx_neuro |> 
  select(any_of(c(neurotrans, glutr, gabar, "Gal", "Galr1"))) |> 
  dplyr::bind_cols(neuro_fin@meta.data)

sbs_mtx_neuro_full |> glimpse()
Rows: 182
Columns: 102
$ Slc17a6                       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Slc17a7                       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Slc1a1                        <dbl> 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0…
$ Slc1a2                        <dbl> 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1…
$ Slc1a6                        <dbl> 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 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, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Gria1                         <dbl> 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1…
$ Gria2                         <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Gria3                         <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Gria4                         <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Grid1                         <dbl> 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1…
$ Grid2                         <dbl> 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1…
$ Grik1                         <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0…
$ Grik2                         <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Grik3                         <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Grik4                         <dbl> 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1…
$ Grik5                         <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Grin1                         <dbl> 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0…
$ Grin2a                        <dbl> 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0…
$ Grin2b                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Grin2d                        <dbl> 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0…
$ Grin3a                        <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Grm1                          <dbl> 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1…
$ Grm5                          <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Grm2                          <dbl> 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Grm3                          <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Grm4                          <dbl> 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0…
$ Grm7                          <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1…
$ Grm8                          <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0…
$ Gabra1                        <dbl> 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Gabra2                        <dbl> 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1…
$ Gabra3                        <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1…
$ Gabra4                        <dbl> 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0…
$ Gabra5                        <dbl> 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0…
$ 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, 0, 0, 0, 0, 0, 0, 1…
$ Gabrb3                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Gabrg1                        <dbl> 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1…
$ Gabrg2                        <dbl> 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0…
$ Gabrg3                        <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Gabrd                         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ Gabbr1                        <dbl> 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Gabbr2                        <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1…
$ Gal                           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ nCount_RAW                    <dbl> 37619, 44705, 26662, 19861, 7835, 30715,…
$ nFeature_RAW                  <int> 7847, 8422, 7117, 5535, 3264, 6150, 1849…
$ nCount_SCT                    <dbl> 6740, 6680, 6723, 6418, 7213, 6791, 5390…
$ nFeature_SCT                  <int> 3279, 3367, 3466, 2643, 3237, 2698, 1964…
$ nCount_RNA                    <dbl> 37384, 44410, 26513, 19730, 7793, 30488,…
$ nFeature_RNA                  <int> 7842, 8397, 7110, 5524, 3256, 6132, 1843…
$ log10GenesPerUMI              <dbl> 0.8516717, 0.8443551, 0.8707823, 0.87127…
$ percent_mito                  <dbl> 0.018724588, 0.006755235, 0.000000000, 0…
$ percent_ribo                  <dbl> 0.3450674, 0.1959018, 0.3356844, 0.20273…
$ percent_hb                    <dbl> 0.016049647, 0.013510471, 0.007543469, 0…
$ var_regex                     <dbl> 3.635245, 3.341590, 4.692038, 3.938165, …
$ S.Score                       <dbl> -0.0117061756, 0.0006385497, -0.05347786…
$ G2M.Score                     <dbl> -0.039302759, -0.085392871, -0.049283519…
$ log_prob_doublet              <dbl> -1992.42534, -2481.72723, -1981.02186, -…
$ orig.ident                    <chr> "THP7", "THP7", "THP7", "THP7", "THP7", …
$ comb_clstr1                   <fct> 10, 10, 10, 10, 10, 10, 7, 10, 10, 10, 1…
$ comb_clstr2                   <fct> 8, 8, 8, 8, 8, 8, 10, 8, 8, 8, 8, 8, 8, …
$ QC                            <chr> "Pass", "Pass", "Pass", "Pass", "Pass", …
$ cell_name                     <chr> "THP7_ACTTTCAAGGATTTGA-1", "THP7_CATCCCA…
$ RNA_snn_res.0.2               <fct> 4, 1, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 3…
$ RNA_snn_res.0.226763010217232 <fct> 5, 1, 5, 5, 5, 5, 1, 5, 5, 5, 5, 5, 5, 3…
$ RNA_snn_res.0.254822164960175 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.284273960186496 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.315224714241019 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.347791850274373 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.382105384969072 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.41830966336087  <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.4565653885612   <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.49705200657103  <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.539970520838189 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.585546829701983 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.634035703678448 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.685725550422073 <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ RNA_snn_res.0.740944155569623 <fct> 5, 3, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 4…
$ RNA_snn_res.0.800065640881591 <fct> 5, 3, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 4…
$ RNA_snn_res.0.863518951850731 <fct> 5, 3, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 4…
$ RNA_snn_res.0.931798281916928 <fct> 5, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.00547596918591  <fct> 5, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.08521857800307  <fct> 5, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.17180712235645  <fct> 5, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.26616273144792  <fct> 5, 6, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.36937954624667  <fct> 5, 6, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 2…
$ RNA_snn_res.1.48278948455203  <fct> 4, 5, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, …
$ RNA_snn_res.1.60797961788652  <fct> 4, 5, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, …
$ RNA_snn_res.1.74695704064407  <fct> 4, 5, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, …
$ RNA_snn_res.1.90211850288799  <fct> 4, 5, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, …
$ RNA_snn_res.2.07648919562638  <fct> 3, 5, 3, 3, 3, 3, 10, 3, 3, 3, 3, 3, 3, …
$ RNA_snn_res.2.27407915710999  <fct> 3, 5, 3, 3, 3, 3, 10, 3, 3, 3, 3, 3, 3, …
$ RNA_snn_res.2.50001           <fct> 4, 5, 4, 4, 4, 4, 11, 4, 4, 4, 4, 4, 4, …
$ seurat_clusters               <fct> 4, 5, 4, 4, 4, 4, 11, 4, 4, 4, 4, 4, 4, …
$ k_tree                        <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ sep_clstr                     <fct> 6, 1, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 4…
$ gaba_status                   <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE…
$ gaba_expr                     <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE…
$ glut_status                   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
$ status                        <chr> "GABAergic", "GABAergic", "GABAergic", "…
sbs_mtx_neuro_full$Gal_sign <- 
  sbs_mtx_neuro_full %>%
  select(Gal) %>%
  mutate(Gal_sign = if_any(.fns = ~ .x > 0)) %>%
  .$Gal_sign

# for reproducibility
set.seed(reseed)
# plot
grouped_ggpiestats(
  # arguments relevant for `ggpiestats()`
  data = sbs_mtx_neuro_full,
  x = Gal_sign,
  grouping.var = status,
  perc.k = 1,
  package = "ggsci",
  palette = "category10_d3",
  # arguments relevant for `combine_plots()`
  title.text = "Molecular specification of thalamic neuronal lineages by Gal signalling and main neurotransmitter expression",
  caption.text = "Asterisks denote results from proportion tests; \n***: p < 0.001, ns: non-significant",
  plotgrid.args = list(nrow = 2)
)

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13
p1 <- FeaturePlot_scCustom(
  srt, "Slc17a6",
  pt.size = 2,
  order = TRUE,
  alpha_exp = 0.65,
  alpha_na_exp = 0.2,
  label = TRUE,
  repel = TRUE,
  colors_use = srt@misc$expr_Colour_Pal) + 
  ggtitle("Slc17a6(Vglut2): ") + theme(plot.title = element_text(size = 24))
p1

Version Author Date
263f215 Evgenii O. Tretiakov 2023-03-13
4ef209f Evgenii O. Tretiakov 2023-03-05
Plot_Density_Custom(
  seurat_object = srt,
  features = "Slc17a6",
  pt.size = 2) + 
  ggtitle("Slc17a6(Vglut2): ") + theme(plot.title = element_text(size = 24))

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
Plot_Density_Joint_Only(
  seurat_object = srt,
  features = c("Slc17a6", "Gal"),
  pt.size = 2) + 
  ggtitle("Slc17a6(Vglut2) + Gal ") + theme(plot.title = element_text(size = 24))

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
srt_vglut2 <- subset(srt, idents = c(2, 4, 5, 6, 7), invert = TRUE)
srt_vglut2 <- subset(srt_vglut2, subset = UMAP_1 > -15 & UMAP_1 < 2)
p2 <- FeaturePlot_scCustom(
  srt_vglut2, "Gal",
  pt.size = 5,
  order = TRUE,
  alpha_exp = 0.75,
  alpha_na_exp = 0.05,
  colors_use = srt@misc$expr_Colour_Pal) + 
  ggtitle("Gal in Vglut2+ populations") + theme(plot.title = element_text(size = 24))
p2

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
Plot_Density_Custom(
  seurat_object = srt_vglut2,
  features = "Gal",
  pt.size = 2) + 
  ggtitle("Gal across Vglut cell-populations only") + theme(plot.title = element_text(size = 24))

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
Plot_Density_Joint_Only(
  seurat_object = srt_vglut2,
  features = c("Slc17a6", "Gal"),
  pt.size = 2) + 
  ggtitle("Slc17a6 + Gal across Vglut cell-populations only") + theme(plot.title = element_text(size = 24))

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
DimPlot_scCustom(
  srt_vglut2,
  label = TRUE,
  repel = TRUE,
  pt.size = 3,
  figure_plot = TRUE
  ) + ggtitle("Vglut2+ clusters") + NoLegend()

Version Author Date
4ef209f Evgenii O. Tretiakov 2023-03-05
DoHeatmap(srt_vglut2, features = genes_present$found_features)

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
4ef209f Evgenii O. Tretiakov 2023-03-05
p3 <- DotPlot_scCustom(
  seurat_object = srt_vglut2,
  assay = "RNA",
  features = genes_present$found_features,
  flip_axes = TRUE,
  x_lab_rotate = TRUE,
  colors_use = viridis(n = 30, alpha = .75, direction = -1, option = "E"))
p3

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
4ef209f Evgenii O. Tretiakov 2023-03-05
p4 <- Stacked_VlnPlot(
  seurat_object = srt_vglut2,
  assay = "RNA",
  features = genes_present$found_features,
  x_lab_rotate = F
)
p4

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
p1 | p2 | p3

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17
4ef209f Evgenii O. Tretiakov 2023-03-05
(p1 / p2) | p4

Version Author Date
9014631 Evgenii O. Tretiakov 2023-08-17

sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] 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   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
 [1] gprofiler2_0.2.2        mrtree_0.0.0.9000       Nebulosa_1.10.0        
 [4] scCustomize_1.1.3       Scillus_0.5.0           qs_0.25.5              
 [7] ggstatsplot_0.12.0.9000 UpSetR_1.4.0            patchwork_1.1.3.9000   
[10] glmGamPoi_1.12.2        sctransform_0.3.5       SeuratDisk_0.0.0.9020  
[13] SeuratWrappers_0.3.1    SeuratObject_4.1.3      Seurat_4.3.0           
[16] reticulate_1.31         kableExtra_1.3.4        zeallot_0.1.0          
[19] future_1.33.0           skimr_2.1.5             magrittr_2.0.3         
[22] lubridate_1.9.2         forcats_1.0.0           stringr_1.5.0          
[25] dplyr_1.1.2             purrr_1.0.2             readr_2.1.4            
[28] tidyr_1.3.0             tibble_3.2.1            ggplot2_3.4.3          
[31] tidyverse_2.0.0.9000    viridis_0.6.4           viridisLite_0.4.2      
[34] RColorBrewer_1.1-3      here_1.0.1              workflowr_1.7.0        

loaded via a namespace (and not attached):
  [1] IRanges_2.34.1              R.methodsS3_1.8.2          
  [3] goftest_1.2-3               phytools_1.9-16            
  [5] TH.data_1.1-2               vctrs_0.6.3                
  [7] spatstat.random_3.1-5       RApiSerialize_0.1.2        
  [9] effectsize_0.8.5            digest_0.6.33              
 [11] png_0.1-8                   shape_1.4.6                
 [13] git2r_0.32.0                ggrepel_0.9.3              
 [15] bayestestR_0.13.1           correlation_0.8.4          
 [17] deldir_1.0-9                parallelly_1.36.0          
 [19] combinat_0.0-8              magick_2.7.5               
 [21] MASS_7.3-60                 reshape2_1.4.4             
 [23] httpuv_1.6.11               foreach_1.5.2              
 [25] BiocGenerics_0.46.0         withr_2.5.0                
 [27] ggrastr_1.0.2               xfun_0.40                  
 [29] ggfun_0.1.2                 ellipsis_0.3.2             
 [31] survival_3.5-7              memoise_2.0.1              
 [33] ggbeeswarm_0.7.2            clustree_0.5.0             
 [35] MatrixModels_0.5-2          janitor_2.2.0.9000         
 [37] emmeans_1.8.7               parameters_0.21.1          
 [39] systemfonts_1.0.4           tidytree_0.4.5             
 [41] zoo_1.8-12                  GlobalOptions_0.1.2        
 [43] pbapply_1.7-2               R.oo_1.25.0                
 [45] datawizard_0.8.0            rematch2_2.1.2             
 [47] promises_1.2.1              scatterplot3d_0.3-44       
 [49] httr_1.4.7                  globals_0.16.2             
 [51] fitdistrplus_1.1-11         ps_1.7.5                   
 [53] stringfish_0.15.8           rstudioapi_0.15.0          
 [55] miniUI_0.1.1.1              generics_0.1.3             
 [57] base64enc_0.1-3             processx_3.8.2             
 [59] S4Vectors_0.38.1            repr_1.1.6                 
 [61] zlibbioc_1.46.0             ggraph_2.1.0.9000          
 [63] polyclip_1.10-4             quadprog_1.5-8             
 [65] GenomeInfoDbData_1.2.10     xtable_1.8-4               
 [67] pracma_2.4.2                doParallel_1.0.17          
 [69] evaluate_0.21               S4Arrays_1.0.5             
 [71] hms_1.1.3                   GenomicRanges_1.52.0       
 [73] irlba_2.3.5.1               colorspace_2.1-0           
 [75] hdf5r_1.3.8                 ROCR_1.0-11                
 [77] spatstat.data_3.0-1         lmtest_0.9-40              
 [79] snakecase_0.11.0            ggtree_3.9.1               
 [81] later_1.3.1                 lattice_0.21-8             
 [83] spatstat.geom_3.2-4         future.apply_1.11.0        
 [85] getPass_0.2-2               scattermore_1.2            
 [87] cowplot_1.1.1               matrixStats_1.0.0          
 [89] RcppAnnoy_0.0.21            pillar_1.9.0               
 [91] nlme_3.1-163                iterators_1.0.14           
 [93] compiler_4.3.1              RSpectra_0.16-1            
 [95] stringi_1.7.12              dendextend_1.17.1          
 [97] tensor_1.5                  SummarizedExperiment_1.30.2
 [99] plyr_1.8.8                  crayon_1.5.2               
[101] abind_1.4-5                 gridGraphics_0.5-1         
[103] sp_2.0-0                    graphlayouts_1.0.0         
[105] bit_4.0.5                   sandwich_3.0-2             
[107] fastmatch_1.1-3             whisker_0.4.1              
[109] codetools_0.2-19            multcomp_1.4-25            
[111] bslib_0.5.1                 paletteer_1.5.0            
[113] GetoptLong_1.0.5            plotly_4.10.2              
[115] mime_0.12                   splines_4.3.1              
[117] circlize_0.4.16             Rcpp_1.0.11                
[119] prismatic_1.1.1             knitr_1.43                 
[121] utf8_1.2.3                  clue_0.3-64                
[123] fs_1.6.3                    listenv_0.9.0              
[125] checkmate_2.2.0             expm_0.999-7               
[127] ggplotify_0.1.2             estimability_1.4.1         
[129] Matrix_1.6-1                callr_3.7.3                
[131] tzdb_0.4.0                  svglite_2.1.1              
[133] tweenr_2.0.2                pkgconfig_2.0.3            
[135] tools_4.3.1                 cachem_1.0.8               
[137] numDeriv_2016.8-1.1         rvest_1.0.3                
[139] fastmap_1.1.1               rmarkdown_2.24             
[141] scales_1.2.1                grid_4.3.1                 
[143] ica_1.0-3                   sass_0.4.7                 
[145] coda_0.19-4                 ggprism_1.0.4              
[147] BiocManager_1.30.22         insight_0.19.3.2           
[149] RANN_2.6.1                  ggimage_0.3.3              
[151] farver_2.1.1                tidygraph_1.2.3            
[153] yaml_2.3.7                  MatrixGenerics_1.12.3      
[155] cli_3.6.1                   BayesFactor_0.9.12-4.4     
[157] stats4_4.3.1                webshot_0.5.5              
[159] leiden_0.4.3                lifecycle_1.0.3            
[161] uwot_0.1.16                 Biobase_2.60.0             
[163] mvtnorm_1.2-2               backports_1.4.1            
[165] timechange_0.2.0            gtable_0.3.3               
[167] rjson_0.2.21                ggridges_0.5.4             
[169] progressr_0.14.0            parallel_4.3.1             
[171] ape_5.7-1                   jsonlite_1.8.7             
[173] bitops_1.0-7                bit64_4.0.5                
[175] Rtsne_0.16                  yulab.utils_0.0.7          
[177] spatstat.utils_3.0-3        RcppParallel_5.1.7         
[179] formattable_0.2.1           highr_0.10                 
[181] jquerylib_0.1.4             R.utils_2.12.2             
[183] lazyeval_0.2.2              shiny_1.7.5                
[185] htmltools_0.5.6             data.tree_1.0.0            
[187] glue_1.6.2                  SymSim_0.0.0.9000          
[189] XVector_0.40.0              RCurl_1.98-1.12            
[191] treeio_1.25.3               rprojroot_2.0.3            
[193] mclust_6.0.0                ks_1.14.1                  
[195] mnormt_2.1.1                gridExtra_2.3              
[197] igraph_1.5.1                R6_2.5.1                   
[199] SingleCellExperiment_1.22.0 labeling_0.4.2             
[201] cluster_2.1.4               aplot_0.2.0                
[203] GenomeInfoDb_1.36.1         plotrix_3.8-2              
[205] DelayedArray_0.26.7         tidyselect_1.2.0           
[207] vipor_0.4.5                 maps_3.4.1                 
[209] ggforce_0.4.1.9000          xml2_1.3.5                 
[211] statsExpressions_1.5.1      rsvd_1.0.5                 
[213] munsell_0.5.0               KernSmooth_2.23-22         
[215] optimParallel_1.0-2         data.table_1.14.8          
[217] htmlwidgets_1.6.2           ComplexHeatmap_2.16.0      
[219] ggmin_0.0.0.9000            rlang_1.1.1                
[221] clusterGeneration_1.3.7     spatstat.sparse_3.0-2      
[223] spatstat.explore_3.2-1      remotes_2.4.2.1            
[225] phangorn_2.11.1             fansi_1.0.4                
[227] beeswarm_0.4.0