Amartya101 / Piccolo

An R package for processing and analyzing single-cell transcriptomic data
GNU General Public License v3.0
2 stars 2 forks source link

Does the HVG selection would work with an SCTransform v2 normalization ? #1

Closed reJELIN closed 1 year ago

reJELIN commented 1 year ago

Hello,

Nice package thank you for it.

Infortunately i need Seurat for most of my pipeline so it would take too much time to adapt it (Seurat V5 is integrating a lot of tools also).

Do you think it is statistically viable to use your selection tools and then normalize my data using seurat SCTransform normalisation in order to analyse my single-cell data ?

Amartya101 commented 1 year ago

Hello, Thanks for your interest in Piccolo, and for considering its use for your single cell analysis. While I'm working on extending its utility beyond the basic scRNAseq analysis, I do recognize that Seurat already offers a comprehensive array of tools and it would be more practical to integrate the outputs we obtain from Piccolo into Seurat for further downstream analysis. Specifically regarding your question, while it isn't viable to select features and then normalize using SCTransform, one can take one of the following approaches:

  1. Perform normalization using SCTransform for all the genes (by specifying variable.features.n to be the total number of genes present in your counts data). Subsequently, use Piccolo to shortlist the HVGs and filter the residuals matrix obtained using SCTransform (stored as scale.data in the SCT assay of the Seurat object) to only contain the residuals for these HVGs.
  2. Perform feature selection and normalization using Piccolo and then replace the scale.data in the Seurat object with the residuals matrix obtained using Piccolo for the HVGs shortlisted by Piccolo. I would recommend this approach.

To illustrate the two approaches discussed above, I've relied on the SCTransform v2 vignette and the data set discussed there: https://satijalab.org/seurat/articles/sctransform_v2_vignette.html

The attached .txt file contains the R script (can't attach .R file here) showing how you can set up the analysis for the example provided in the vignette. Example_UsingSeuratWithPiccolo.txt

I hope you find this helpful.

Amartya101 commented 1 year ago

Please use the following updated example script: Example_UsingSeuratWithPiccolo.txt