-
Notifications
You must be signed in to change notification settings - Fork 908
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
Error with IntegrateLayers #9366
Comments
If you need to perform sc[['Integrated']] <- split(sc[['RNA']], f = sc$sample) # Split based on sample type in the metadata
DefaultAssay(sc) <- 'Integrated'
sc <- SCTransform(sc, assay = 'Integrated') # SCTransform defaults to using 'RNA' if the assay is not specified, so you need to set 'Integrated' here. DefaultAssay(sc) # After SCTransform, the default assay is set to 'SCT', so I recommend explicitly specifying the assay in all function parameters if you're unsure about the default behavior.
DefaultAssay(sc) <- 'SCT'
sc <- RunPCA(sc, npcs = 30, verbose = F, assay = 'SCT') options(future.globals.maxSize = 3e+09) # Adjust based on your actual needs sc <- IntegrateLayers(
object = sc,
method = RPCAIntegration, # Or you can use CCA or Harmony as the method
normalization.method = "SCT",
verbose = F,
assay = 'SCT'
) I hope this helps resolve your issue. |
Hi, I already tried that the problem is that my layers are already split. From the start I had two seurat objects since they are two independent replicates from one another. |
Please follow my code order and parameters strictly as instructed. |
I can't read chinese characters and the code above I can't follow since my Seurat object is from the start already split. |
Having the same |
Hi, It seems like there is something going wrong with the structure of your object, as I haven't encountered this issue before. Could you please provide the code on how you're constructing |
Hi,
It seems that I can't use the IntegrateLayers function. I have two layers in my object however I'm getting the following error codes:
test <- IntegrateLayers(
object = seurat_soup_doublet_remove_mito, method = CCAIntegration,
orig.reduction = "pca", new.reduction = "integrated.cca", assay = "SCT",
verbose = FALSE
)
| 0 % ~calculating Error in UseMethod(generic = "Assays", object = object) :
no applicable method for 'Assays' applied to an object of class "NULL"
seurat_soup_doublet_remove_mito <- IntegrateLayers(
object = seurat_soup_doublet_remove_mito, method = HarmonyIntegration,
orig.reduction = "pca", new.reduction = "harmony",
verbose = FALSE)
Error in validObject(object = x) :
invalid class “Seurat” object: 1: all cells in assays must be in the same order as the Seurat object
invalid class “Seurat” object: 2: all cells in assays must be in the same order as the Seurat object
invalid class “Seurat” object: 3: all cells in reductions must be in the same order as the Seurat object
invalid class “Seurat” object: 4: all cells in reductions must be in the same order as the Seurat object
invalid class “Seurat” object: 5: all cells in graphs must be in the same order as the Seurat object (offending: SCT_nn)
invalid class “Seurat” object: 6: all cells in graphs must be in the same order as the Seurat object (offending: SCT_snn)
In addition: Warning messages:
1: In harmony::HarmonyMatrix(data_mat = Embeddings(object = orig), :
HarmonyMatrix is deprecated and will be removed in the future from the API in the future
2: Quick-TRANSfer stage steps exceeded maximum (= 4536250)
In all honesty, I have no idea what goes wrong over here. I will attach an image on how my seurat object looks like.
Before integration, I filtered the data, SCTransform, RunPCA, RunUMAP, FindNeighbors, FindClusters.
The text was updated successfully, but these errors were encountered: