Skip to content

Latest commit

 

History

History
 
 

AnalysisPaper

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Robust decomposition of cell type mixtures in spatial transcriptomics

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.

Obtaining Data

The data generated and/or used in this study may be accessed at the Broad Institute’s Single Cell Portal. 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.

Pre-processing

For each single-cell dataset, we generated a Seurat object and saved as an RDS file. For example, the script 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.

To cluster interneuron subtypes into three subtype classes, we ran the script 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. Configuration files used are located in 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 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):

We have also provided here 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. NMFreg on the Slide-seq cerebellum occurred using the NMFreg IPython notebook, and we did pre-processing and post-processing in R. Supplemental figures were generated with the supp.Rmd and supp_part2.Rmd R markdown files.