Skip to content

BUG: Error in integration with Seurat v5 after subsetting specific cluster #9870

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

Open
K-S-J-P opened this issue May 4, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@K-S-J-P
Copy link

K-S-J-P commented May 4, 2025

Issue Description

Hi, I'm working on the analysis with Seurat v5 and have an issue on integrative analysis in Seurat v5.
I have a large Seurat object consisting multiple cell types and want to try to subset a specific cluster (CD4T) and do subclustering.
When I try to do IntegrateLayers on this subset after doing NormalizeData/FindVariableFeatures/ScaleData/RunPCA on this subcluster, I get an error message like
"The 'features' argument is ignored by 'HarmonyIntegration'.
This message is displayed once per session.
Error in names (groups) <- "group" : attempt to set an attribute on NULL."

Image

When I used the same code 2 weeks ago, it worked but now it does not. The only change is that I used different seurat cluster number information from meta.data for this subcluster. I used cluster number in "seurat_cluster" within metadata 2 weeks ago, but now I want to use the cluster number from another cluster information (this case is "RNA_snn_res0.3"). So before I extract the subcluster, I changed active.ident from "seurat_cluster" to "RNA_snn_res0.3". Could this be the reason for this error? I've attached the error message and sessionInfo.

Image

If someone has an idea on that, I would greatly appreciate it in advance. Thank you for your help.

Reproducing Code Example

Idents(merged_seurat) <- "RNA_snn_res.0.3"
CD4T <- subset(x = merged_seurat, idents = c('3'))

#Normalizing the data
CD4T <- NormalizeData(CD4T, normalization.method = "LogNormalize", scale.factor = 10000)

#Identification of highly variable features (feature selection)
CD4T <- FindVariableFeatures(CD4T)
CD4T <- ScaleData(CD4T, verbose = FALSE)
CD4T <- RunPCA(CD4T)

#Integration
CD4T <- IntegrateLayers(CD4T, method = HarmonyIntegration, orig.reduction = "pca", new.reduction = "harmony", verbose = FALSE)

Error Message

"The 'features' argument is ignored by 'HarmonyIntegration'. 
This message is displayed once per session. 

Error in names (groups) <- "group" : attempt to set an attribute on NULL."

Additional Comments

No response

Session Info

please see attached file
@K-S-J-P K-S-J-P added the bug Something isn't working label May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant