-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExtra_figures_Velmeshev.R
134 lines (92 loc) · 4.81 KB
/
Extra_figures_Velmeshev.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
library(Seurat)
library(SeuratObject)
library(stringr)
main <- "UCSC/outputs/"
rds_path <- "UCSC/Seurat_UCSC"
rds_files <- list.files(rds_path, "Velmeshev_2022", full.names = T)
names(rds_files) <- str_remove_all(rds_files, paste0(rds_path, "/Velmeshev_2022_"))
names(rds_files) <- str_remove_all(names(rds_files), ".rds")
#####
####################################################################################################
#
# 3RD TRIMESTER
#
####################################################################################################
velm_rds <- readRDS(rds_files[["3rd_trimester"]])
DimPlot(velm_rds, reduction="umap")
ggsave(paste0(main, velm_rds@project.name, "_UMAP_cluster.pdf"))
VlnPlot(velm_rds, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(main, "TMSB4_RNA_expression_",velm_rds@project.name, ".pdf"), width = 10, height = 8)
rm(velm_rds)
####################################################################################################
#
# 0-1 YEARS
#
####################################################################################################
velm_rds <- readRDS(rds_files[["0_1_years"]])
DimPlot(velm_rds, reduction="umap")
ggsave(paste0(main, velm_rds@project.name, "_UMAP_cluster.pdf"))
VlnPlot(velm_rds, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(main, "TMSB4_RNA_expression_",velm_rds@project.name, ".pdf"), width = 10, height = 8)
rm(velm_rds)
####################################################################################################
#
# 1-2- YEARS
#
####################################################################################################
velm_rds <- readRDS(rds_files[["1_2_years"]])
DimPlot(velm_rds, reduction="umap")
ggsave(paste0(main, velm_rds@project.name, "_UMAP_cluster.pdf"))
VlnPlot(velm_rds, features = "XIST", group.by = "id_sex_age") + NoLegend()
# one sample is actually F and not M -> change that into metadata as well
velm_rds@meta.data[which(velm_rds@meta.data$samples=="1-1547-BA24"), "sex"] <- "Female"
velm_rds@meta.data$sex_age <- paste(velm_rds@meta.data$sex, velm_rds@meta.data$age, sep="_")
velm_rds@meta.data$proj <- rep(velm_rds@project.name, nrow(velm_rds@meta.data))
velm_rds@meta.data$id_sex_age <- paste(velm_rds@meta.data$samples, velm_rds@meta.data$sex, velm_rds@meta.data$age, sep="_")
VlnPlot(velm_rds, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(main, "TMSB4_RNA_expression_",velm_rds@project.name, ".pdf"), width = 10, height = 8)
rm(velm_rds)
####################################################################################################
#
# 2-4 YEARS
#
####################################################################################################
velm_rds <- readRDS(rds_files[["2_4_years"]])
DimPlot(velm_rds, reduction="umap")
ggsave(paste0(main, velm_rds@project.name, "_UMAP_cluster.pdf"))
VlnPlot(velm_rds, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(main, "TMSB4_RNA_expression_",velm_rds@project.name, ".pdf"), width = 10, height = 8)
rm(velm_rds)
####################################################################################################
#
# ADULT
#
####################################################################################################
velm_rds <- readRDS(rds_files[["Adult"]])
DimPlot(velm_rds, reduction="umap")
ggsave(paste0(main, velm_rds@project.name, "_UMAP_cluster.pdf"))
VlnPlot(velm_rds, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(main, "TMSB4_RNA_expression_",velm_rds@project.name, ".pdf"), width = 10, height = 8)
rm(velm_rds)
####################################################################################################
#
# 2ND TRIMESTER
#
####################################################################################################
out_path <- "/Home/ii/auraz/data/UCSC"
rds_path <- paste0(out_path, "/Seurat_UCSC/Velmeshev/")
output_2nd_trim <- paste0(out_path, "/outputs/Velmeshev_2nd_trimester/")
velm_2nd_trim <- readRDS(paste0(rds_path, "Velmeshev_2022_2nd_trimester.rds"))
VlnPlot(velm_2nd_trim, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(output_2nd_trim, "TMSB4_RNA_expression_",velm_2nd_trim@project.name, ".pdf"), width = 10, height = 8)
rm(velm_2nd_trim)
####################################################################################################
#
# 10-20 YEARS
#
####################################################################################################
output_10_20_yo <- paste0(out_path, "/outputs/Velmeshev_10_20_years")
velm_10_20_years <- readRDS(paste0(rds_path, "Velmeshev_2022_10_20_years.rds"))
VlnPlot(velm_10_20_years, features = c("TMSB4X", "TMSB4Y"), group.by = "sex" )
ggsave(paste0(output_10_20_yo, "TMSB4_RNA_expression_", velm_10_20_years@project.name, ".pdf"), width = 10, height = 8)
rm(velm_10_20_years)