Browse code

Add integration with Seurat

yuan-yin-truly authored on 24/03/2022 20:29:11
Showing 1 changed files

... ...
@@ -65,7 +65,7 @@ A SingleCellExperiment (SCE) object or a sparse matrix containing the counts for
65 65
 sce <- decontX(sce, background = raw)
66 66
 ```
67 67
 
68
-We would like to stress that `background` input was designed to contain only empty droplets. In case the `background` input contains both cell and empty droplets, for example the raw output from 10X Genomics, the software will try to look up for the cell/column names in the raw matrix (`background`) that are also found in the filtered counts matrix (`x`), and exclude them from the raw matrix. When cell/column names are not available for the input objects, the software will treat the entire raw matrix as empty droplets. This will render incorrect estimation of the ambient RNA profile.
68
+We would like to stress that `background` input was designed to contain only empty droplets. In case the `background` input contains both cell and empty droplets, for example the raw output from 10X Genomics, the software will try to look up for the cell/column names in the raw matrix (`background`) that are also found in the filtered counts matrix (`x`), and exclude them from the raw matrix. When cell/column names are not available for the input objects, the software will treat the entire `background` input as empty droplets. This will render incorrect estimation of the ambient RNA profile.
69 69
 
70 70
 If the raw matrix is not available, then `decontX` will estimate the contamination distribution for each cell cluster based on the profiles of the other cell clusters in the filtered dataset:
71 71
 
... ...
@@ -204,6 +204,26 @@ plot(sce$decontX_contamination, sce.delta$decontX_contamination,
204 204
 abline(0, 1, col = "red", lwd = 2)
205 205
 ```
206 206
 
207
+## Integration with other packages such as Seurat and singleCellTK
208
+You can integrate decontX into your scRNA-seq analysis pipelines, such as one provided by  [Seurat](https://cran.r-project.org/web/packages/Seurat/index.html).
209
+
210
+```{r seuratIntegration, eval=FALSE}
211
+library(Seurat)
212
+
213
+counts <- Read10X("path/to/file")
214
+
215
+# Convert count matrix to SingleCellExperiment to run on decontX
216
+sce <- SingleCellExperiment(list(counts = counts)). 
217
+sce <- decontX(sce)
218
+
219
+# Retrieve decontaminated matrix, round to integer, and convert to Seurat object
220
+countsDecontaminated <- decontXcounts(sce)
221
+seuratObject <- CreateSeuratObject(round(countsDecontaminated))
222
+
223
+```
224
+
225
+
226
+
207 227
 # Session Information
208 228
 
209 229
 ```{r}