--- title: "Exploration" author: "Audrey" date: "`r format(Sys.time(), '%Y-%m-%d')`" output: html_document: code_folding: show code_download: true toc: true toc_float: true --- The goal of this script is to explore *Ptcra* expression in our dataset. This gene has been described by [Toto et al. (once)](https://the_link). # Environment ## Libraries We load the libraries of interest : ```{r library, message = FALSE, warning = FALSE} library(Seurat) library(ggplot2) .libPaths() ``` ## Data **Note** ! Data were previously prepared using the following code : ```{r prepare_data, eval = FALSE} 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 : ```{r load_sobj} sobj = readRDS("/shared/projects/2325_ebaii/SingleCell/TD_RMDs/Introduction_Rmd/sobj.RDS") sobj ``` # Analysis We visualize our favorite gene : ```{r see_ptcra, fig.width = 8, fig.height = 8} Seurat::FeaturePlot(sobj, reduction = "tsne", features = "Ptcra") + ggplot2::theme(aspect.ratio = 1) ``` Which cells are positive for Ptcra ? ```{r binarize_ptcra} sobj$is_Ptcra_pos = (Seurat::FetchData(sobj, "Ptcra")[, 1] > 0) head(sobj$is_Ptcra_pos) ``` We visualize the positive and negative cells : ```{r see_bin_ptcra, fig.width = 8, fig.height = 8} Seurat::DimPlot(sobj, reduction = "tsne", group.by = "is_Ptcra_pos") + ggplot2::theme(aspect.ratio = 1) ``` How many cells are positive ? ```{r count_bin_ptcra} table(sobj$is_Ptcra_pos) ``` Half of cells are *Ptcra*+. # Save Eventually here, we can save the dataset that has been processed through this notebook. ```{r save_sobj, eval = FALSE} saveRDS(sobj, file = "/shared/projects/2325_ebaii/SingleCell/TD_RMDs/Introduction_Rmd/sobj_processed.rds") ``` # R Session ```{r sessioninfo, echo = FALSE} sessionInfo() ```