library(Seurat)
library(scrattch.hicat)
library(monocle)
library(Matrix)
library(dplyr)
library(RColorBrewer)
library(ggplot2)
library(ggExtra)
library(cowplot)
library(wesanderson)
library(MoMAColors)
library(princurve)
library(gprofiler2)
#Set ggplot theme as classic
theme_set(theme_classic())
<- readRDS("Pidd1KO.cells.RDS")
Pidd1.data
DimPlot(object = Pidd1.data,
group.by = "Cell.ident",
reduction = "spring",
cols = c("grey40","#4cabdc","#046c9a", "#7293c8", "#31b6bd", "#ebcb2e", "#9ec22f", "#a9961b", "#cc3a1b", wes_palette("FantasticFox1")),
pt.size = 0.5) & NoAxes()
<- subset(Pidd1.data,
ChP.data subset = Cell.ident %in% c("Progenitors_ChP", "Choroid_Plexus"))
DimPlot(object = ChP.data,
group.by = "Cell.ident",
reduction = "spring",
cols = c("grey40","#9ec22f"),
pt.size = 0.5) & NoAxes()
DimPlot(object = ChP.data,
group.by = "Genotype",
reduction = "spring",
cols = c("#7293c8", "#cc3a1b"),
pt.size = 1) & NoAxes()
<- SCTransform(ChP.data,
ChP.data method = "glmGamPoi",
vars.to.regress = c("percent.mito", "CC.Difference", "nCount_RNA"),
verbose = T)
##
|
| | 0%
|
|================== | 25%
|
|=================================== | 50%
|
|==================================================== | 75%
|
|======================================================================| 100%
##
|
| | 0%
|
|== | 3%
|
|==== | 6%
|
|====== | 9%
|
|======== | 12%
|
|=========== | 15%
|
|============= | 18%
|
|=============== | 21%
|
|================= | 24%
|
|=================== | 27%
|
|===================== | 30%
|
|======================= | 33%
|
|========================= | 36%
|
|============================ | 39%
|
|============================== | 42%
|
|================================ | 45%
|
|================================== | 48%
|
|==================================== | 52%
|
|====================================== | 55%
|
|======================================== | 58%
|
|========================================== | 61%
|
|============================================= | 64%
|
|=============================================== | 67%
|
|================================================= | 70%
|
|=================================================== | 73%
|
|===================================================== | 76%
|
|======================================================= | 79%
|
|========================================================= | 82%
|
|=========================================================== | 85%
|
|============================================================== | 88%
|
|================================================================ | 91%
|
|================================================================== | 94%
|
|==================================================================== | 97%
|
|======================================================================| 100%
##
|
| | 0%
|
|== | 3%
|
|==== | 6%
|
|====== | 9%
|
|======== | 12%
|
|=========== | 15%
|
|============= | 18%
|
|=============== | 21%
|
|================= | 24%
|
|=================== | 27%
|
|===================== | 30%
|
|======================= | 33%
|
|========================= | 36%
|
|============================ | 39%
|
|============================== | 42%
|
|================================ | 45%
|
|================================== | 48%
|
|==================================== | 52%
|
|====================================== | 55%
|
|======================================== | 58%
|
|========================================== | 61%
|
|============================================= | 64%
|
|=============================================== | 67%
|
|================================================= | 70%
|
|=================================================== | 73%
|
|===================================================== | 76%
|
|======================================================= | 79%
|
|========================================================= | 82%
|
|=========================================================== | 85%
|
|============================================================== | 88%
|
|================================================================ | 91%
|
|================================================================== | 94%
|
|==================================================================== | 97%
|
|======================================================================| 100%
<- FindVariableFeatures(ChP.data, selection.method = "vst", nfeatures = 1000)
ChP.data
<- RunPCA(ChP.data, verbose = FALSE)
ChP.data
<- RunUMAP(ChP.data, dims = 1:5)
ChP.data
<- FindNeighbors(ChP.data,
ChP.data dims = 1:5,
k.param = 8)
<- FindClusters(ChP.data, resolution = 0.3) ChP.data
## Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
##
## Number of nodes: 1106
## Number of edges: 17811
##
## Running Louvain algorithm...
## Maximum modularity in 10 random starts: 0.8782
## Number of communities: 6
## Elapsed time: 0 seconds
DimPlot(ChP.data,
split.by = "Genotype",
reduction = "umap",
#cols = colors,
pt.size = 1.5) & NoAxes()
DimPlot(ChP.data,
split.by = "Genotype",
reduction = "spring",
#cols = colors,
pt.size = 1.5) & NoAxes()
<- principal_curve(as.matrix(ChP.data@reductions$umap@cell.embeddings[,]),
fit smoother='lowess',
trace=TRUE,
f = 1,
stretch=0)
## Starting curve---distance^2: 5785820
## Iteration 1---distance^2: 5175.631
## Iteration 2---distance^2: 5131.868
## Iteration 3---distance^2: 5111.309
## Iteration 4---distance^2: 5102.4
## Iteration 5---distance^2: 5099.856
<- fit$lambda/max(fit$lambda)
PseudotimeScore
if (cor(PseudotimeScore, ChP.data@assays$RNA@data['Sulf1', ]) > 0) {
$PseudotimeScore <- -(PseudotimeScore - max(PseudotimeScore))
ChP.dataelse { ChP.data$PseudotimeScore <- PseudotimeScore } }
FeaturePlot(object = ChP.data,
features = "PseudotimeScore",
pt.size = 1.5,
cols = rev(brewer.pal(n =11, name = "Spectral")),
reduction = "umap",
order = T) & NoAxes()
<- NormalizeData(ChP.data, assay = "RNA", normalization.method = "LogNormalize", scale.factor = 10000)
ChP.data saveRDS(ChP.data, "ChP.Traj.Pidd1KO.RDS")
# Define functions
<- function (Dataset, gene, show.pt = T, x.intercept = NULL)
Plot.gene.trend
{<- data.frame(Genotype = as.character(Dataset@meta.data$Genotype), Pseudotime = Dataset@meta.data$PseudotimeScore)
data $Gene <- Dataset@assays[["RNA"]]@data[gene, ]
data<- ggplot(data = data, aes(x = Pseudotime, y = Gene, color = Genotype)) +
p geom_point(size=1, alpha = ifelse(show.pt == T, 0.5, 0)) +
scale_color_manual(values = moma.colors("Ernst", 6)[c(6,4)]) +
geom_smooth(method = "loess", n = 30, size = 2) +
ggtitle(gene) +
ylim(0, NA) +
theme(legend.position = "none",
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.ticks.x = element_blank(),
axis.text.x = element_blank(),
axis.title.y = element_blank(),
axis.line = element_line(size = 1))
if (!is.null(x.intercept)) {
<- p + geom_vline(xintercept = x.intercept, colour = "red",
p linetype = 2)
}return(p)
}
<- function (Dataset, genes, show.pt=T, x.intercept = NULL)
Plot.genes.trend
{<- mapply(FUN = Plot.gene.trend, gene = genes, MoreArgs = list(Dataset = Dataset,
pList show.pt = show.pt, x.intercept = x.intercept), SIMPLIFY = FALSE)
print(x = cowplot::plot_grid(plotlist = pList, ncol = 3))
}
Plot.gene.trend(ChP.data, "Trp73") + theme(legend.position = "top")
Plot.genes.trend(ChP.data, c("Pidd1", "eYFP", "Ttc34"))
<- SetIdent(ChP.data, value = ChP.data@meta.data$Cell.ident)
ChP.data <- FindMarkers(ChP.data, subset.ident = "Choroid_Plexus", group.by = "Genotype", ident.1 = "Pidd1.KO")
KO.DEG
Plot.genes.trend(ChP.data, rownames(KO.DEG)[1:9])
Plot.genes.trend(ChP.data, rownames(KO.DEG)[10:18])
Plot.genes.trend(ChP.data, rownames(KO.DEG)[19:27])
Plot.genes.trend(ChP.data, rownames(KO.DEG)[28:36])
Plot.genes.trend(ChP.data, rownames(KO.DEG)[37:45])
Plot.genes.trend(ChP.data, rownames(KO.DEG)[46:54])
#date
format(Sys.time(), "%d %B, %Y, %H,%M")
## [1] "05 November, 2023, 17,36"
#Packages used
sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-conda-linux-gnu (64-bit)
## Running under: CentOS Linux 7 (Core)
##
## Matrix products: default
## BLAS/LAPACK: /shared/ifbstor1/software/miniconda/envs/r-4.1.1/lib/libopenblasp-r0.3.18.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] splines stats4 stats graphics grDevices utils datasets
## [8] methods base
##
## other attached packages:
## [1] gprofiler2_0.2.1 princurve_2.1.6 MoMAColors_0.0.0.9000
## [4] wesanderson_0.3.6 cowplot_1.1.1 ggExtra_0.9
## [7] RColorBrewer_1.1-3 dplyr_1.0.10 monocle_2.22.0
## [10] DDRTree_0.1.5 irlba_2.3.5.1 VGAM_1.1-5
## [13] ggplot2_3.3.6 Biobase_2.54.0 BiocGenerics_0.40.0
## [16] Matrix_1.3-4 scrattch.hicat_1.0.0 sp_1.4-7
## [19] SeuratObject_4.1.0 Seurat_4.1.1
##
## loaded via a namespace (and not attached):
## [1] plyr_1.8.7 igraph_1.3.1
## [3] lazyeval_0.2.2 densityClust_0.3
## [5] listenv_0.8.0 scattermore_0.8
## [7] GenomeInfoDb_1.30.1 fastICA_1.2-3
## [9] digest_0.6.30 htmltools_0.5.2
## [11] viridis_0.6.2 fansi_1.0.3
## [13] magrittr_2.0.3 tensor_1.5
## [15] cluster_2.1.2 ROCR_1.0-11
## [17] limma_3.50.0 globals_0.14.0
## [19] matrixStats_0.62.0 docopt_0.7.1
## [21] spatstat.sparse_2.1-1 colorspace_2.0-3
## [23] ggrepel_0.9.1 xfun_0.34
## [25] rgdal_1.5-23 RCurl_1.98-1.9
## [27] crayon_1.5.2 sparsesvd_0.2
## [29] jsonlite_1.8.2 progressr_0.10.0
## [31] spatstat.data_2.2-0 survival_3.2-13
## [33] zoo_1.8-10 glue_1.6.2
## [35] polyclip_1.10-0 gtable_0.3.1
## [37] zlibbioc_1.40.0 XVector_0.34.0
## [39] leiden_0.3.10 DelayedArray_0.20.0
## [41] future.apply_1.9.0 abind_1.4-5
## [43] scales_1.2.1 pheatmap_1.0.12
## [45] DBI_1.1.2 spatstat.random_2.2-0
## [47] miniUI_0.1.1.1 Rcpp_1.0.9
## [49] viridisLite_0.4.1 xtable_1.8-4
## [51] reticulate_1.24 spatstat.core_2.4-2
## [53] htmlwidgets_1.5.4 httr_1.4.4
## [55] FNN_1.1.3.1 ellipsis_0.3.2
## [57] ica_1.0-2 farver_2.1.1
## [59] pkgconfig_2.0.3 sass_0.4.1
## [61] uwot_0.1.11 deldir_1.0-6
## [63] utf8_1.2.2 labeling_0.4.2
## [65] tidyselect_1.2.0 rlang_1.0.6
## [67] reshape2_1.4.4 later_1.3.0
## [69] munsell_0.5.0 tools_4.1.1
## [71] cli_3.4.1 generics_0.1.3
## [73] ggridges_0.5.3 evaluate_0.17
## [75] stringr_1.4.1 fastmap_1.1.0
## [77] yaml_2.3.6 goftest_1.2-3
## [79] knitr_1.40 fitdistrplus_1.1-8
## [81] purrr_0.3.5 RANN_2.6.1
## [83] sparseMatrixStats_1.6.0 pbapply_1.5-0
## [85] future_1.25.0 nlme_3.1-153
## [87] mime_0.12 slam_0.1-49
## [89] compiler_4.1.1 rstudioapi_0.13
## [91] plotly_4.10.0 png_0.1-7
## [93] spatstat.utils_2.3-0 tibble_3.1.8
## [95] glmGamPoi_1.6.0 bslib_0.3.1
## [97] stringi_1.7.8 highr_0.9
## [99] RSpectra_0.16-1 rgeos_0.5-9
## [101] lattice_0.20-45 HSMMSingleCell_1.14.0
## [103] vctrs_0.4.2 pillar_1.8.1
## [105] lifecycle_1.0.3 spatstat.geom_2.4-0
## [107] combinat_0.0-8 lmtest_0.9-40
## [109] jquerylib_0.1.4 RcppAnnoy_0.0.19
## [111] bitops_1.0-7 data.table_1.14.2
## [113] GenomicRanges_1.46.1 httpuv_1.6.5
## [115] patchwork_1.1.1 R6_2.5.1
## [117] promises_1.2.0.1 KernSmooth_2.23-20
## [119] gridExtra_2.3 IRanges_2.28.0
## [121] parallelly_1.31.1 codetools_0.2-18
## [123] MASS_7.3-54 assertthat_0.2.1
## [125] SummarizedExperiment_1.24.0 ggstream_0.1.0
## [127] withr_2.5.0 qlcMatrix_0.9.7
## [129] sctransform_0.3.3 GenomeInfoDbData_1.2.7
## [131] S4Vectors_0.32.4 mgcv_1.8-38
## [133] parallel_4.1.1 grid_4.1.1
## [135] rpart_4.1-15 tidyr_1.2.1
## [137] DelayedMatrixStats_1.16.0 rmarkdown_2.11
## [139] MatrixGenerics_1.6.0 Rtsne_0.16
## [141] shiny_1.7.1
IPNP & Imagine Institute, Paris, France, frederic.causeret@inserm.fr↩︎