Thank you so much! This clarified everything for me and I was wondering if there was a way to not overwrite the embeddings so your answer was super helpful!!
• 0 views
•
link
Hello,
I am new to scRNASeq analysis. All of this is in R, and all functions were run in default.
I am trying to use fastMNN only till data integration for a comparative study with other tools. I am following a very standard workflow that I found through the example codes in documentation:
scelogNormCounts()modelGeneVar()getTopHVGs() runPCA() and runUMAP(). This info I believe is stored in "PCA" and "UMAP" of the sce. plotReducedDim(), which I believe to be the same as the likes of plotUMAP(), except dimred is a requirement (which I set to "UMAP").fastMNN() after subsetting using the chosen hvgs. dimred HAS to equal "corrected'. I don't understand this.plotReducedDim(). I was not sure if dimred should equal "UMAP" or "corrected", since I believe the embeddings are stored in "corrected", so shouldn't "corrected" be used for visualisation as well? However when I plot dimred="UMAP", the UMAP is different from the UMAP earlier, which means the embeddings get overwritten?Summary of doubts:
dimred="corrected" needed for runPCA after data integration? (earlier sce <- runPCA(sce, ncomponents = 50) worked).dimred="corrected" be used after data integration?Thanks for all your help~ Sorry about the long post, I wanted to provide as much context as possible.
A few clarifications.
runPCA() and runUMAP() don't have to be run before fastMNN() - it just makes sense to do so that you have a pre-integration set of dimensionality reductions to compare to.fastMNN(), you run UMAP again to see the effects of the integration. And yes, you want to do this on the corrected embeddings, which are already PCA components (so you don't have to run PCA again). Read the details of ?fastMNN for more info. If you didn't provide "corrected" to dimred, you'd just be running it on the original PCA (or it might throw an error if the original PCA isn't retained after fastMNN, I can't remember if it is).runUMAP() again, you should specify the name parameter, e.g. name="corrected_UMAP" so that you can easily compare between the original and integrated UMAP. This can then be specified during plotting.runUMAP multiple times, yes, it will overwrite the embeddings in "UMAP", but as specified in point 3, you can name the embeddings whatever you want and specify them as such during plotting. You can carry along as many embeddings as you want, which is useful for comparing sets of parameters, e.g. different n_neighbors or min_dist for multiple runs of runUMAP.Thank you so much! This clarified everything for me and I was wondering if there was a way to not overwrite the embeddings so your answer was super helpful!!
Log in to answer this question.