A benchmarking pipeline for spatial deconvolution methods.
Spatial deconvolution is the prediction of cell type identities and fractions within each spot of spatially resolved transcriptomic datasets, either involving direct statistical inference or machine learning to produce a signature matrix or to directy predict cell fractions. Here we provide a benchmarking pipeline to test the performance of different spatial deconvolution methods with a focus on tumour specific metrics.
Please see Understanding_the_Immune_Tumour_Microenvironment_by_Integrating_Single-Cell_and_Spatial_Transcriptomics.pdf for full dissertation.
- Pipeline takes annotated single cell RNAseq datasets and each splits sample into two: a)synthetic scRNA dataset (testing dataset) and b)training dataset with each containing the same number of cell types.
- The synthic scRNA dataset is used to produce synthetic spatial transcriptomic datasets with known ground truth fractions using Synthspot (Sangaram et al., 2024) to produce the testing dataset.
- The training dataset is used to train relevent deconvolution methods.
- The synthetic spatial transcriptomic datasets are then deconvoluting via the different methods. (RCTD, SPOTlight, CARD are used by default. See below for adding new methods.)
- Predicted cell fractions are compared with ground truth fractions via various metrics.
- Install using steps below
(Optional): Modify 10X genomics spot coordinates in ./data/spot_coords/out1.csv to set spatial transciptomic plate size
(Optional): Modify mintest spots to set spot locations of known cell fractions for testing minimum cell density for identification in ./data/spot_coords/out1_mintest.csv
- Gather annotated single cell RNAseq data. Requires count matrix barcodes, genes, counts in a sparse matrix, and metadata of cell annotations.
- Run run.R (see --help for flags) for importing data, generating synthetic datasets, deconvolution, and generating preliminary statistics.
- Run run_stats.R (see --help for flags) to generate statistics across experiments.
- Use run_hpc.sh to run in a high performance computing enviornment for parallelization. Current settings follow disseratation experiments.
- run run_stats.R (see --help for flags) to collect all HPC runs and generate statistics.
Results and statsitcs will be reported in data/results unless specified by --outdir.
- Place deconvolution steps in the run.R ##DECONOVLUTION section
- Add deconovlution name into method_names variable in same section
- Add deconvolution result output dataframe variable into method_list variable in same section
All proceding steps will now take into account the new deconvolution method.
See .yaml and R_installation.R for packages.
- Clone repository into workspace
- Use benchdeconv.yaml to install dependencies into a conda environment
- Run R_installation.R to install additional R packages into the conda environment
- Installation done!
Dr. Florent Petitprez (Supervisor)
- 0.1
- Initial Release
This project is licensed under the MIT License
