The goal of this script is to explore Ptcra expression in our dataset. This gene has been described by Toto et al. (once).
We load the libraries of interest :
library(Seurat)
library(ggplot2)
.libPaths()
## [1] "/shared/ifbstor1/home/aonfroy/R/x86_64-conda-linux-gnu-library/4.1"
## [2] "/shared/ifbstor1/software/miniconda/envs/r-4.2.1/lib/R/library"
## [3] "/shared/ifbstor1/software/miniconda/envs/r-4.2.3/lib/R/library"
## [4] "/shared/home/aonfroy/R/x86_64-conda-linux-gnu-library/4.1"
Note ! Data were previously prepared using the following code :
sobj = readRDS("/shared/projects/2325_ebaii/SingleCell/TD_DATA/DATA_START/CLUSTERING/TD3A.TDCT_Scal2K.IntH20.RDS")
sobj = Seurat::RunPCA(sobj)
sobj = Seurat::RunTSNE(sobj)
sobj = sobj[, 1:200]
saveRDS(sobj, file = "/shared/projects/2325_ebaii/SingleCell/TD_RMDs/Introduction_Rmd/sobj.RDS")
We load data :
sobj = readRDS("/shared/projects/2325_ebaii/SingleCell/TD_RMDs/Introduction_Rmd/sobj.RDS")
sobj
## An object of class Seurat
## 12926 features across 200 samples within 1 assay
## Active assay: RNA (12926 features, 2000 variable features)
## 3 dimensional reductions calculated: pca, harmony, tsne
We visualize our favorite gene :
Seurat::FeaturePlot(sobj, reduction = "tsne", features = "Ptcra") +
ggplot2::theme(aspect.ratio = 1)
Which cells are positive for Ptcra ?
sobj$is_Ptcra_pos = (Seurat::FetchData(sobj, "Ptcra")[, 1] > 0)
head(sobj$is_Ptcra_pos)
## AAACCTGAGACGCTTT.1_1 AAACCTGAGGCATTGG.1_1 AAACCTGGTCAACATC.1_1
## FALSE FALSE FALSE
## AAACCTGTCGAGGTAG.1_1 AAACCTGTCGATCCCT.1_1 AAACGGGCACTTACGA.1_1
## TRUE FALSE FALSE
We visualize the positive and negative cells :
Seurat::DimPlot(sobj, reduction = "tsne", group.by = "is_Ptcra_pos") +
ggplot2::theme(aspect.ratio = 1)
How many cells are positive ?
table(sobj$is_Ptcra_pos)
##
## FALSE TRUE
## 110 90
Half of cells are Ptcra+.
Eventually here, we can save the dataset that has been processed through this notebook.
saveRDS(sobj, file = "/shared/projects/2325_ebaii/SingleCell/TD_RMDs/Introduction_Rmd/sobj_processed.rds")
## R version 4.2.3 (2023-03-15)
## Platform: x86_64-conda-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.6 LTS
##
## Matrix products: default
## BLAS/LAPACK: /shared/ifbstor1/software/miniconda/envs/r-4.2.3/lib/libopenblasp-r0.3.21.so
##
## 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
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_3.4.0 SeuratObject_4.1.3 Seurat_4.2.1
##
## loaded via a namespace (and not attached):
## [1] Rtsne_0.16 colorspace_2.0-3 deldir_1.0-6
## [4] ellipsis_0.3.2 ggridges_0.5.4 rstudioapi_0.14
## [7] spatstat.data_3.0-0 farver_2.1.1 leiden_0.4.3
## [10] listenv_0.8.0 ggrepel_0.9.2 fansi_1.0.3
## [13] codetools_0.2-18 splines_4.2.3 cachem_1.0.6
## [16] knitr_1.40 polyclip_1.10-4 jsonlite_1.8.3
## [19] ica_1.0-3 cluster_2.1.4 png_0.1-7
## [22] uwot_0.1.14 shiny_1.7.3 sctransform_0.3.5
## [25] spatstat.sparse_3.0-0 compiler_4.2.3 httr_1.4.4
## [28] assertthat_0.2.1 Matrix_1.5-3 fastmap_1.1.0
## [31] lazyeval_0.2.2 cli_3.4.1 later_1.3.0
## [34] htmltools_0.5.3 tools_4.2.3 igraph_1.3.5
## [37] gtable_0.3.1 glue_1.6.2 RANN_2.6.1
## [40] reshape2_1.4.4 dplyr_1.0.10 Rcpp_1.0.9
## [43] scattermore_0.8 jquerylib_0.1.4 vctrs_0.5.0
## [46] nlme_3.1-160 spatstat.explore_3.0-5 progressr_0.11.0
## [49] lmtest_0.9-40 spatstat.random_3.0-1 xfun_0.34
## [52] stringr_1.4.1 globals_0.16.1 mime_0.12
## [55] miniUI_0.1.1.1 lifecycle_1.0.3 irlba_2.3.5.1
## [58] goftest_1.2-3 future_1.29.0 MASS_7.3-58.1
## [61] zoo_1.8-11 scales_1.2.1 promises_1.2.0.1
## [64] spatstat.utils_3.0-1 parallel_4.2.3 RColorBrewer_1.1-3
## [67] yaml_2.3.6 reticulate_1.26 pbapply_1.5-0
## [70] gridExtra_2.3 sass_0.4.2 stringi_1.7.8
## [73] highr_0.9 rlang_1.0.6 pkgconfig_2.0.3
## [76] matrixStats_0.62.0 evaluate_0.18 lattice_0.20-45
## [79] tensor_1.5 ROCR_1.0-11 purrr_0.3.5
## [82] labeling_0.4.2 patchwork_1.1.2 htmlwidgets_1.5.4
## [85] cowplot_1.1.1 tidyselect_1.2.0 parallelly_1.32.1
## [88] RcppAnnoy_0.0.20 plyr_1.8.8 magrittr_2.0.3
## [91] R6_2.5.1 generics_0.1.3 DBI_1.1.3
## [94] withr_2.5.0 pillar_1.8.1 fitdistrplus_1.1-8
## [97] survival_3.4-0 abind_1.4-5 sp_1.5-1
## [100] tibble_3.1.8 future.apply_1.10.0 KernSmooth_2.23-20
## [103] utf8_1.2.2 spatstat.geom_3.0-3 plotly_4.10.1
## [106] rmarkdown_2.18 grid_4.2.3 data.table_1.14.4
## [109] digest_0.6.30 xtable_1.8-4 tidyr_1.2.1
## [112] httpuv_1.6.6 munsell_0.5.0 viridisLite_0.4.1
## [115] bslib_0.4.1