Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will executing the PCA and UMAP processes according to the cell type change the shape of the UMAP graph? #9486

Open
TangBluebird opened this issue Nov 15, 2024 · 2 comments

Comments

@TangBluebird
Copy link

##Code as Below######################################################
CD8Tmem<- SetIdent(CD8Tmem, value = "MainType")
CD8Tmem<- ScaleData(CD8Tmem)
CD8Tmem<- RunPCA(CD8Tmem, npcs = 15, verbose = FALSE)
CD8Tmem<- RunUMAP(CD8Tmem, dims = 1:15)
DimPlot(CD8Tmem, reduction = "umap", label = FALSE, group.by = "MainType")
###################################################################
After defining the cell type of CD8Tmem, I set the cell type of CD8Tmem according to SetIdent. On this basis, I re-execute the process of ScaleData, RunPCA and RunUMAP for CD8Tmem.

My question is::will the UMAP graph obtained in this way have a different shape from the UMAP graph formed before?

@samuel-marsh
Copy link
Collaborator

Hi,

Not member of dev team but hopefully can be helpful. I'm not sure I understand the process that you are going through here. Can you explain why you would need to re-run the processing pipeline after setting an ident?

All you are doing is changing all of the cells to have the ident of "MainType" but you haven't changed which cells are present in the object or any other characteristics of the object.

Best,
Sam

@rharao
Copy link

rharao commented Nov 15, 2024

No, the transform functions you applied to the object between SetIdent call and the DimPlot call do not use the cell idents at all, so choosing different idents for the cell will not affect the UMAP embeddings (but randomness might). Thus, you do not need to recalculate these transforms. You can simply set the idents on the transformed object to whatever you want.

(If experimental design indicates it, it is possible to supply cell metadata as latent data to be regressed out of the scaling step; this does not apply in your case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants