seurat
seurat copied to clipboard
Error in UseMethod(generic = "DefaultAssay", object = object) : no applicable method for 'DefaultAssay' applied to an object of class "c('data.frame', 'list', 'oldClass', 'vector', 'OptionalList')"
I am getting an error after adding a column to meta data and UpdateSeuratObject as suggested (https://github.com/satijalab/seurat/issues/1946) did not work.
meta<- tibble::tribble(~orig.ident, ~sample_name,1, "dn1",2, "d14", 3, "d28",4, "d90")
meta$orig.ident <- as.factor(meta$orig.ident)
OBJ_meta <- [email protected] %>% select(orig.ident) %>% rownames_to_column("barcodes")
full_new_meta <- full_join(x = OBJ_meta, y = meta) %>% column_to_rownames("barcodes") %>% select(-orig.ident)
DimPlot(OBJ_meta, group.by = "sample_name")
Error in UseMethod(generic = "DefaultAssay", object = object) :
no applicable method for 'DefaultAssay' applied to an object of class "c('data.frame', 'list', 'oldClass', 'vector', 'OptionalList')"
Hi,
Not member of dev team but hopefully can be helpful. According to code you pasted above OBJ_meta is a dataframe:
OBJ_meta <- [email protected] %>% select(orig.ident) %>% rownames_to_column("barcodes")
Therefore, you can plot using DimPlot
. Furthermore according the code you posted you didn't actually add the new meta data information to the object so plotting by sample name also wouldn't work. If there is more code that you did not post please include all so issue can be diagnosed.
Thanks! Sam
Hi,
Just confirming if this is still an issue or whether it is solved?
Best, Sam
Thanks- apologies yes!
From: Samuel Marsh @.> Sent: Friday, April 14, 2023 3:32 PM To: satijalab/seurat @.> Cc: Maggie Linn Bartlett @.>; Author @.> Subject: Re: [satijalab/seurat] Error in UseMethod(generic = "DefaultAssay", object = object) : no applicable method for 'DefaultAssay' applied to an object of class "c('data.frame', 'list', 'oldClass', 'vector', 'OptionalList')" (Issue #5882)
External Email - Use Caution
Hi,
Just confirming if this is still an issue or whether it is solved?
Best, Sam
— Reply to this email directly, view it on GitHubhttps://github.com/satijalab/seurat/issues/5882#issuecomment-1509123614, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARPWQ5GUQ5HX2N7BL43R4ZLXBGQ3JANCNFSM5UI6CJPA. You are receiving this because you authored the thread.Message ID: @.***>
No worries! Thanks for responding!!