-
Notifications
You must be signed in to change notification settings - Fork 70
/
README.Rmd
70 lines (50 loc) · 5.32 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Robust decomposition of cell type mixtures in spatial transcriptomics
<!-- badges: start -->
<!-- badges: end -->
Here, we will explain how the analysis occurred for our paper 'Robust decomposition of cell type mixtures in spatial transcriptomics',
which introduces and validates the RCTD algorithm. You may access RCTD in our open-source R package [here](https://github.com/dmcable/spacexr).
### Obtaining Data
The data generated and/or used in this study may be accessed at the [Broad Institute's Single Cell Portal](https://singlecell.broadinstitute.org/single_cell/study/SCP948). This repository contains
both the Slide-seq datasets used in this study, and the single-cell RNA-sequencing references. Additional files necessary to run the following R-markdown scripts are located at the following [Dropbox Repository](https://www.dropbox.com/sh/6klgiz1f9rimzqb/AAA2PrAgPfgPFz4yNDBPEWqYa?dl=0).
### Pre-processing
For each single-cell dataset, we generated a Seurat object and saved as an RDS file. For example, the script
[dropSeqProcess.R](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/dropSeqProcess.R) is used to
convert the hippocampus single-cell dataset to a Seurat object.
To obtain a simulated doublet dataset from each of the single-cell and single-nucleus references, we ran the script
[doubletsimulation.R](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/doubletsimulation.R).
To cluster interneuron subtypes into three subtype classes, we ran the script [subcluster.R](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/subcluster.R). This script additionally
creates a Seurat object for the interneuron subtypes and computes average cell type profiles.
### Running RCTD
For each dataset, RCTD was run according to the instructions for the [spacexr package](https://github.com/dmcable/spacexr). Configuration
files used are located in [conf](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/conf). Specifically, 'datasetCerPuck.yml' was
used for the Cerebellum Slide-seq dataset, 'datasetHippoPuck.yml' was used for the hippocampus Slide-seq dataset, 'datasetCross.yml' was used
for the simulated Cerebellum doublet dataset, and 'datasetInterneuronCoarse.yml' and 'datasetHippoInterneuron.yml' were used for running RCTD on
interneruon subtypes.
On the simulated doublets dataset, in addition to running RCTD with the typical pipeline, the script [weightDecompose.R](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/weightDecompose.R) was used to evaluate RCTD's ability to predict
cell type proportion.
### Generating Main Figures
We provide R Markdown files that were used to create the main figures (warning: code in `eval = FALSE` blocks should not be run):
* [Unsupervised clustering on the Slide-seq cerebellum](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure1.html) (Figure 1)
* [Platform Effect Prediction](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure2-platform-effect.html) (Figure 1,2)
* [Comparison of Ordinary Least Squares and RCTD](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure2.html) (Figure 1,2)
* [Validation of RCTD on decomposition of simulated doublets](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure3.html) (Figure 3)
* [RCTD on the Slide-seq cerebellum](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure4.html) (Figure 4)
* [Spatially localizing 27 interneuron subtypes](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure5-all.html) (Figure 5)
* [RCTD on the Hippocampus and spatially localizing three interneuron subclasses](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure5-interneurons.html) (Figure 5)
* [Finding Astrocyte Genes Dependent on Cellular Colocalization](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure6-astrocytes.html) (Figure 6)
* [Finding Spatially Variable Genes](https://raw.githack.com/dmcable/spacexr/master/AnalysisPaper/MainFigures/figure6-spatialgenes.html) (Figure 6)
We have also provided [here](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/MainFigures/Updated-Compatability) additional R Markdown files to update these analyses to be compatible with the current version of spacexr:
### Supplemental Figures
Preprocessing of the Visium dataset occurred using [processVisium.R](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/processVisium.R). NMFreg on the Slide-seq cerebellum occurred using the NMFreg IPython notebook, and we did [pre-processing](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/prepareNMF.R) and [post-processing](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/Rscripts/processNMF.R) in R. Supplemental figures were generated with the [supp.Rmd](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/SuppFigures/supp.Rmd) and [supp_part2.Rmd](https://github.com/dmcable/spacexr/tree/master/AnalysisPaper/SuppFigures/supp_part2.Rmd) R markdown files.