1
1
---
2
- title : " Seurat : Spatial Transcriptomics"
2
+ title : " Scater/Scran: : Spatial Transcriptomics"
3
3
author : " Åsa Björklund & Paulo Czarnewski"
4
4
date : ' `r format(Sys.Date(), "%B %d, %Y")`'
5
5
output :
@@ -23,7 +23,7 @@ output:
23
23
collapsed : false
24
24
smooth_scroll : true
25
25
toc_depth : 3
26
- editor_options :
26
+ editor_options :
27
27
chunk_output_type : console
28
28
---
29
29
@@ -39,7 +39,6 @@ p.caption {font-size: 0.9em;font-style: italic;color: grey;margin-right: 10%;mar
39
39
# Spatial transcriptomics
40
40
***
41
41
42
- This tutorial is adapted from the Seurat vignette: https://satijalab.org/seurat/v3.2/spatial_vignette.html
43
42
44
43
Spatial transcriptomic data with the Visium platform is in many ways similar to scRNAseq data. It contains UMI counts for 5-20 cells instead of single cells, but is still quite sparse in the same way as scRNAseq data is, but with the additional information about spatial location in the tissue.
45
44
@@ -97,9 +96,9 @@ suppressPackageStartupMessages(require(cowplot))
97
96
We can first load and merge the objects into one SCE object.
98
97
99
98
``` {r}
100
- sce.a <- Spaniel::createVisiumSCE(tenXDir="data/visium/Anterior",
99
+ sce.a <- Spaniel::createVisiumSCE(tenXDir="data/visium/Anterior",
101
100
resolution="Low")
102
- sce.p <- Spaniel::createVisiumSCE(tenXDir="data/visium/Posterior",
101
+ sce.p <- Spaniel::createVisiumSCE(tenXDir="data/visium/Posterior",
103
102
resolution="Low")
104
103
105
104
sce <- cbind(sce.a , sce.p)
@@ -191,8 +190,8 @@ Select all spots with less than 25% mitocondrial reads, less than 20% hb-reads a
191
190
192
191
193
192
``` {r}
194
- sce <- sce[ , sce$detected > 500 &
195
- sce$subsets_mt_percent < 25 &
193
+ sce <- sce[ , sce$detected > 500 &
194
+ sce$subsets_mt_percent < 25 &
196
195
sce$subsets_hb_percent < 20]
197
196
dim(sce)
198
197
```
@@ -339,7 +338,7 @@ plot_grid(ncol=2, plotlist = plist)
339
338
340
339
Quite often there are strong batch effects between different ST sections, so it may be a good idea to integrate the data across sections.
341
340
342
- We will do a similar integration as in the Data Integration lab.
341
+ We will do a similar integration as in the Data Integration lab.
343
342
344
343
``` {r}
345
344
mnn_out <- batchelor::fastMNN(sce, subset.row = hvgs,
@@ -513,7 +512,7 @@ Next, we select the highly variable genes that are present in both datasets.
513
512
#Find common highly variable genes
514
513
common_hvgs <- allen.hvgs[allen.hvgs %in% hvgs]
515
514
516
- #Predict cell classes
515
+ #Predict cell classes
517
516
pred.grun <- SingleR(test=sce.anterior[common_hvgs,],
518
517
de.n = 20,
519
518
ref=allen_reference_sce[common_hvgs,],
@@ -522,7 +521,7 @@ pred.grun <- SingleR(test=sce.anterior[common_hvgs,],
522
521
523
522
#Transfer the classes to the SCE object
524
523
sce.anterior$cell_prediction <- pred.grun$labels
525
- sce.anterior@colData <- cbind(sce.anterior@colData,
524
+ sce.anterior@colData <- cbind(sce.anterior@colData,
526
525
as.data.frame.matrix(table(list(1:ncol(sce.anterior),sce.anterior$cell_prediction))))
527
526
```
528
527
0 commit comments