-
Notifications
You must be signed in to change notification settings - Fork 0
/
interstitial_report7_population_timeline.Rmd
583 lines (444 loc) · 16.6 KB
/
interstitial_report7_population_timeline.Rmd
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
---
title: "scRNAseq Interstitial cells : What happens over time?"
author: "Marion Hardy"
date: "`r Sys.Date()`"
output:
html_document:
toc: yes
theme: spacelab
highlight: monochrome
editor_options:
chunk_output_type: console
markdown:
wrap: 72
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(message = FALSE, cache = T, echo = FALSE, warning = F, cache.lazy = F)
knitr::opts_chunk$set(fig.width=8, fig.height=6)
library(tidyverse)
library(openxlsx)
library(Seurat)
library(scCustomize)
library(ggpubr)
```
# Introduction
Data from our collaborator Panagiotis rds file for a
SingleCellExperiment object containing the single cell data for **the
interstitial cells** of *Hydra Vulgaris* during multiples stages of
regeneration after bisection:
<https://www.dropbox.com/scl/fi/dg76sigjnj5u6qr06xk79/sce_interstitial_Juliano.rds?rlkey=f0y3lqt0wdcwq652zisnrpf9t&dl=0>
BUT they mapped it to *Hydra Magnipapillata (102 version of 105)* "Quantification of the generated single cell libraries was performed using the Salmon-Alevin software suite
(Salmon version 1.6.0) against the ncbi Hydra 102 transcriptome."
The coldata of the object contain cell annotation including
- quality metrics: nFeature nCount (not MT percentage interestingly)
- batch info: either 2869 (3162 barcodes), 3113 (10352 barcodes), 3271
(13279 barcodes), 3357 (3875 barcodes)
- originating experiments (head or foot regeneration)
- experimental time points
- pseudo-axis assignment (vals.axis ranging from 0-1, increasing in
the foot-tentacle direction)
- mitotic and apoptotic signatures indices from 0 to 1
The rowdata contains gene annotation, using Entrez-gene identifiers. I
have also noticed that in the sce objects there's
- PCA, tSNE and UMAP coordinates for reduced dimensions + corrected
for batch values
- assay metafeatures hold gene_id, product, gene, is.rib.prot.gene
(T/F), HypoMarkers (T/F), ccyle (T/F), apopt (T/F) etc
I converted the sce objects 6.6gb into a seurat object 2.2 gb and
checked that all cited parameters could be found in it.
# Summary of 3/06 meeting with Hannah and Celina
- check myb as a marker for bipotential progenitors
- relabel some of the clusters (ec3, Gc, endodermal neurons)
- plot cell cycle scores
- plot pseudo-axis
# Data loading and upate on the project
This report is a repeat of report 5 but addresses the above-mentioned comments from the meeting with Celina and Hannah.
In this report we're gonna plot transcription factors of interest over the different timepoints.
I also wanted to add cell population counts over time.
Maybe I could learn to plot gene expression over time too?
Anyway, we're exploring gene expression programs and cell populations over time.
```{r}
# seurat objects
seurat_f = readRDS("./data_output/interstitial/seurat_filtered.rds")
# transcription factors of interest
tr = read.xlsx("./data/mcbi_dataset_MH_annotated.xlsx", sheet = "transcription")
# reorder the timepoints
seurat_f$Timepoint <- factor(seurat_f$Timepoint,
levels=c("REG_HEAD_t0",
"REG_HEAD_t06",
"REG_HEAD_t12",
"REG_HEAD_t24",
"REG_HEAD_t48",
"REG_HEAD_t96",
"REG_FOOT_t0",
"REG_FOOT_t06",
"REG_FOOT_t12",
"REG_FOOT_t24",
"REG_FOOT_t48",
"REG_FOOT_t96"))
seurat_f$vals.axis_k25 <- as.numeric(seurat_f$vals.axis_k25)
seurat_f$vals.ccycle <- as.numeric(seurat_f$vals.ccycle)
seurat_f$vals.apopt <- as.numeric(seurat_f$vals.apopt)
```
## Changing UMAP resolution
```{r}
Idents(seurat_f) = "seurat_clusters"
DimPlot(seurat_f, label = TRUE)+
labs(title = "Resolution = 0.1")
```
```{r, echo=TRUE}
target <- c("NSP4","midasin","mini-COL8","SP-D-like","FH20-X3","CAII",
"CELA3B","zinc-carboxypeptidase","ANO39","TYN1","H2A.2.2","nas2-X2",
"Lwamide-X1","DMRT1","TUBA4A-X1","HTRA3","polRF-X1","ec3A","ec3B",
"nop58-X1","OTP","MEP1A","rhammosyl-O-methyltransferase","hywnt3",
"PPOD1","ks1","hyAlx","ELAV2","POU4","MUC2", "ec3", "grm1","myc",
"myc1","wnt3","ec2","ec1B","ec4","ec1A","en1","en1_NDF1_DANRE",
"ec5","en1","en2A","en2B","myb")
```
I founda myb by ctrl+f in the annotation file.
However, in Stefan's supplementary analysis, myb is described as "g27424"
after blasting, I only got a 32% hit (80% cover) in the 102 annotation file...
Uncharacterized protein LOC105848384 [Hydra vulgaris] Hydra vulgaris 243 243 82% 2e-68 32.09% 1023 XP_047129678.1
```{r}
Idents(seurat_f) = "seurat_clusters"
p1 = Clustered_DotPlot(seurat_f, features = target, k = 6)
```
```{r}
mutate(attr_clusters=
ifelse(seurat_clusters == "0", "ISC",
ifelse(seurat_clusters == "1", "Nb",
ifelse(seurat_clusters == "2", "GranG/ZymoG",
ifelse(seurat_clusters == "3", "earlyGc",
ifelse(seurat_clusters == "4", "Nb",
ifelse(seurat_clusters == "5", "earlyNem",
ifelse(seurat_clusters == "6", "Nb",
ifelse(seurat_clusters == "7", "Nb",
ifelse(seurat_clusters == "8", "earlyNeur",
ifelse(seurat_clusters == "9", "Gc",
ifelse(seurat_clusters == "10", "Nb",
ifelse(seurat_clusters == "11", "ec1A",
ifelse(seurat_clusters == "12", "ec3",
ifelse(seurat_clusters == "13", "Nb",
ifelse(seurat_clusters == "14", "ec2",
ifelse(seurat_clusters == "15", "Nb",
ifelse(seurat_clusters == "16", "ec1A/ec1B",
ifelse(seurat_clusters == "17", "ec3",
ifelse(seurat_clusters == "18", "en",
ifelse(seurat_clusters == "19", "ec4",
ifelse(seurat_clusters == "20", "Nb",
NA))))))))))))))))))))))
```
```{r}
Idents(seurat_f) = "attr_clusters"
DimPlot(seurat_f, label = TRUE)+
labs(title = "Labelled UMAP")
```
## Subsetting by head/foot and timepoint
```{r}
Idents(seurat_f) = "Timepoint"
DimPlot(seurat_f, label = FALSE)
# Creating the head and foot data subset
hfootf = subset(seurat_f, subset = EXP == "REG_FOOT")
hheadf = subset(seurat_f, subset = EXP == "REG_HEAD")
```
```{r, fig.width=30, fig.height=6}
# Plotting conditions separately
Idents(hfootf) = "attr_clusters"
DimPlot(hfootf, reduction = "umap", split.by = "Timepoint", pt.size = 0.5)
Idents(hheadf) = "attr_clusters"
DimPlot(hheadf, reduction = "umap", split.by = "Timepoint", pt.size = 0.5)
```
### Pseudo axis values
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hheadf,
features = "vals.axis_k25",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hfootf,
features = "vals.axis_k25",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
### Cell cycle values
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hheadf,
features = "vals.ccycle",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hfootf,
features = "vals.ccycle",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
### Apoptosis score
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hheadf,
features = "vals.apopt",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
```{r, fig.height=7, fig.width=35}
#annot run this for some reason my computer gets a conniption
FeaturePlot(object = hfootf,
features = "vals.apopt",
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
```{r, eval=FALSE}
write_rds(seurat_f, "./data_output/interstitial/seurat_filtered_res01.rds")
```
## Cell population evolution over time
### Regenerating a head
#### "Raw" cell numbers
```{r General statistics levels}
aa = table(hheadf$attr_clusters, hheadf$Timepoint)
aa = rbind(aa, Sum = colSums(aa))
aa = aa[,1:6]
aa %>%
knitr::kable()
```
```{r, fig.height=6, fig.width=12}
aadf =
aa %>% as.data.frame()
aadf$celltype = rownames(aadf)
aadf =
aadf %>%
pivot_longer(names_to = "Timepoint",
values_to = "N_cells",
cols = 1:6)
p1 =
aadf %>%
filter(celltype != "Sum") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a head", subtitle = "Cell number per population over time")
p2 =
aadf %>%
filter(celltype != "Sum", celltype != "Nb") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a head", subtitle = "Removed nematoblasts")
p1+p2
```
#### Relative number of cells
```{r, fig.width=12, fig.height=6}
vec = colSums(aa[1:13,])
vec = vec[vec!=0]
percent = round(sweep(aa,2,vec, '/')*100,2)
percent %>%
knitr::kable()
percentdf = as.data.frame(percent)
percentdf$celltype = rownames(percentdf)
percentdf =
percentdf %>%
pivot_longer(names_to = "Timepoint",
values_to = "N_cells",
cols = 1:6)
p1 =
percentdf %>%
filter(celltype != "Sum") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
ylab("% cell population")+
labs(title = "Regenerating a head", subtitle = "Relative cell % per population over time")
p2=
percentdf %>%
filter(!celltype %in% c("Sum", "Nb", "ec2","ec3n/en1n","ec4","doublets/triplets",
"unknown/ZymoG?","ec1A","ec1A/ec1B")) %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
ylab("% cell population")+
labs(title = "Regenerating a head", subtitle = "Removed multiple cell types")
ggarrange(p1,p2,ncol = 2, nrow = 1)
```
Notice how early Gc decrease almost 5x between 12-24 hours while ISC, GranG and early neurons spike up 2 to 3X. I think that population is called upon to create not only gland cells but can help support other progenitors.
### Regenerating a foot
#### "Raw" cell numbers
```{r}
ab = table(hfootf$attr_clusters, hfootf$Timepoint)
ab = rbind(ab, Sum = colSums(ab))
ab = ab[,7:12]
ab %>%
knitr::kable()
```
```{r, fig.height=6, fig.width=12}
abdf =
ab %>% as.data.frame()
abdf$celltype = rownames(abdf)
abdf =
abdf %>%
pivot_longer(names_to = "Timepoint",
values_to = "N_cells",
cols = 1:6)
p1 =
abdf %>%
filter(celltype != "Sum") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a foot", subtitle = "Cell number per population over time")
p2 =
abdf %>%
filter(celltype != "Sum", celltype != "Nb") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a foot", subtitle = "Removed nematoblasts")
ggarrange(p1,p2,ncol = 2, nrow = 1)
```
#### Relative number of cells
```{r, fig.width=12, fig.height=6}
vec = colSums(ab[1:13,])
vec = vec[vec!=0]
percent = round(sweep(ab,2,vec, '/')*100,2)
percent %>%
knitr::kable()
percentdf = as.data.frame(percent)
percentdf$celltype = rownames(percentdf)
percentdf =
percentdf %>%
pivot_longer(names_to = "Timepoint",
values_to = "N_cells",
cols = 1:6)
p1 =
percentdf %>%
filter(celltype != "Sum") %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
ylab("% cell population")+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a foot", subtitle = "Relative cell % per population over time")
p2=
percentdf %>%
filter(!celltype %in% c("Sum", "Nb", "ec2","ec3n/en1n","ec4","doublets/triplets",
"unknown/ZymoG?","ec1A","ec1A/ec1B")) %>%
ggplot(aes(x = Timepoint,
y = N_cells, group = celltype, color = celltype))+
geom_line(linewidth = 1)+
theme_bw()+
ylab("% cell population")+
theme(axis.text.x = element_text(angle = 70, vjust = 1, hjust=1))+
labs(title = "Regenerating a foot", subtitle = "Removed multiple cell types")
ggarrange(p1,p2,ncol = 2, nrow = 1)
```
Notice how early neurons only go up after a spike in earlGc. Is the opposite happening here?
## Transcription factors
We are looking at transcription factors of interest that, based on bulk RNAseq, appeared active only in the injured animal, not the homeostatic one.
### Dotplot
```{r}
Idents(hfootf) = "Timepoint"
Idents(hheadf) = "Timepoint"
DotPlot_scCustom(hfootf, features = tr$Symbol_updated,
colors_use = viridis_plasma_dark_high,
x_lab_rotate = T)+
coord_flip()
```
```{r}
DotPlot_scCustom(hheadf, features = tr$Symbol_updated,
colors_use = viridis_plasma_dark_high,
x_lab_rotate = T)+
coord_flip()
```
### Feature plot
```{r, fig.height=10, fig.width=15}
FeaturePlot(object = seurat_f,
features = tr$Symbol_updated,
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 0.75)
```
### Regenerating a head
```{r, fig.height=45, fig.width=30}
FeaturePlot(object = hheadf,
features = tr$Symbol_updated,
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
It looks like the appearing cells might be the one with the transcription factor activity
### Regenerating a foot
```{r, fig.height=45, fig.width=30}
FeaturePlot(object = hfootf,
features = tr$Symbol_updated,
reduction = "umap",
order = TRUE,
min.cutoff = 'q10',
label = F,
repel = TRUE,
pt.size = 1.2,
split.by = "Timepoint")
```
```{r, eval = FALSE}
write_rds(seurat_f, "./data_output/interstitial/seurat_filtered.rds")
write_rds(neurons, "./data_output/interstitial/neurons.rds")
```
# Session info
```{r}
sessionInfo()
```