Skip to content

Question about MetacellsByGroups #416

@bprager5

Description

@bprager5

I have a seurat object that has been integrated with harmony, but when I try to run MetacellsByGroups using the harmony reduction, I get the following error:

Warning in (function (seurat_obj, name = "agg", ident.group = "seurat_clusters", :
Metacell failed
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': no applicable method for @ applied to an object of class "NULL"

traceback()
7: h(simpleError(msg, call))
6: .handleSimpleError(function (cond)
.Internal(C_tryCatchHelper(addr, 1L, cond)), "no applicable method for @ applied to an object of class "NULL"",
base::quote(x@misc))
5: FUN(X[[i]], ...)
4: lapply(metacell_list, function(x) {
x@misc$run_stats
})
3: do.call(rbind, lapply(metacell_list, function(x) {
x@misc$run_stats
}))
2: as.data.frame(do.call(rbind, lapply(metacell_list, function(x) {
x@misc$run_stats
})))
1: MetacellsByGroups(seurat_obj = x, reduction = "harmony", group.by = c("sample"),
k = 25, max_shared = 10, min_cells = 30, ident.group = "sample")

The 'harmony' reduction is in my seurat object and can be plotted, etc.

Reductions(x)
[1] "pca" "harmony" "umap"

It appears that MetacellsByGroups is looking for something in the @misc slot, which is empty in the newer seurat integration workflows. When I use other reductions it works, but there is very strong separation of metacells by sample, despite harmonizing metacells, so I am hesitant to proceed using the seurat object pca reduction.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions