constantAmateur / SoupX

R package to quantify and remove cell free mRNAs from droplet based scRNA-seq data
255 stars 34 forks source link

[Question] Is it possible to feed data into a SoupChannel list besides by using Read10X Function? #25

Closed cswoboda closed 4 years ago

cswoboda commented 4 years ago

Hello!

With the new update of SoupX, I noticed that since the soup channel objects get data directly from the cell_ranger_output, if you create a Seurat object to get cell embeddings that has a filtering step like in the standard Seurat pipeline, you get an error when trying to run plotMarkerMap() with useToEst because the sc object and Seurat_DR will have different cell counts. This can be fixed by removing filtering steps in the Seurat pipeline, however that leaves in low quality cells that I'm unaware if they will impact the global contamination.

Thanks! Casey

constantAmateur commented 4 years ago

If you look at the code for load10X you'll see that really all it does is call SoupChannel which is the direct way of creating a SoupChannel object. I hope to update the documentation and perhaps add some more helper functions for people not using the cellranger defaults at some point.

But basically all you need to do is supply SoupChannel with three things:

  1. A matrix containing counts for all droplets (including those not containing cells)
  2. A matrix that is a subset of the one above, containing just the columns that contain cells (this is what you would want to modify).
  3. Optionally a meta-data data.frame, which contains the dimension reduction to use for plotting (e.g. tSNE, UMAP,...) and clustering as a column named 'cluster'.
  4. If you want everything to be plotted automatically then should also set the DR parameter to the column names of the dimension reduction of the meta-data.

Look at the help for SoupChannel for more details.