constantAmateur / SoupX

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

Vignette correction #98

Closed Sergio-ote closed 2 years ago

Sergio-ote commented 2 years ago

Dear Matthew, I found an issue with the vignette of SoupX found here: https://rawcdn.githack.com/constantAmateur/SoupX/204b602418df12e9fdb4b68775a8b486c6504fe4/inst/doc/pbmcTutorial.html and here: https://cran.r-project.org/web/packages/SoupX/vignettes/pbmcTutorial.html

The issue is that when you load the PBMC_metadata in the Visual sanity checks, the rownames are not exactly the same as in the sc object that you have created previously (Seurat adds a "-1" in all cell ids), so you cannot reproduce the code below. I solved it using gsub() on the lines of code that were not working: sc = setDR(sc, PBMC_metaData[gsub("-1", "", colnames(sc$toc)), c("RD1", "RD2")]) dd = PBMC_metaData[gsub("-1", "", colnames(sc$toc)), ]

But this might be a bit messy to read for unexperienced users, so the best solution would be to reformat sc cell ids. Also, I noticed that in the text you refer to the function soupMarkerMap, although the chunk is run using the final name of the function plotMarkerMap.

Hope this helped you improve the documentation :)

Cheers, Sergio

constantAmateur commented 2 years ago

Thank you Sergio. The Seurat Read10X function (which SoupX uses internally) changed its default behaviour from stripping the '-1' to not stripping it. So the vignette will be correct or not depending on the version of Seurat used.

It is probably time to change the vignette to assume the 'keeping -1' behaviour is the one most users will be experiencing. Thanks for taking the time to point this issue out!