seurat icon indicating copy to clipboard operation
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')"

Open mbartl13 opened this issue 2 years ago • 1 comments

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')"

mbartl13 avatar Apr 25 '22 15:04 mbartl13

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

samuel-marsh avatar Apr 25 '22 17:04 samuel-marsh

Hi,

Just confirming if this is still an issue or whether it is solved?

Best, Sam

samuel-marsh avatar Apr 14 '23 19:04 samuel-marsh

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: @.***>

mbartl13 avatar Apr 14 '23 19:04 mbartl13

No worries! Thanks for responding!!

samuel-marsh avatar Apr 14 '23 19:04 samuel-marsh