Skip to content
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

No applicable method for 'DefaultAssay' applied to an object of class "seurat" #1946

Closed
briankalish opened this issue Aug 7, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@briankalish
Copy link

Hello,
I created a seurat object (seurat_mat) and I am trying to use Seurat v3 to create QC plots. I keep receiving an error when trying to use the VlnPlot function (see below - no applicable method for 'DefaultAssay' applied to an object of class "seurat"). I tried using UpdateSeuratObject, which validates that seurat_mat is a seurat object, but I still receive the error. Any suggestions?

Thanks very much,
Brian

load(paste(data_dir,"/","seurat_mat.Robj",sep = ""))
head(seurat_mat@meta.data, n=5)
nGene nUMI orig.ident percent.mito res.1
1.1_bcEPPY 8270 55128 1.1 0.0057503583 16
1.1_bcFIBN 2656 4567 1.1 0.0013137727 4
1.1_bcCRBD 2428 4437 1.1 0.0006761325 4
1.1_bcDDUU 1962 3076 1.1 0.0000000000 2
1.1_bcBTAN 2089 3694 1.1 0.0005414185 5
pdf("QCfeatures.pdf")
VlnPlot(seurat_mat, features = c("nUMI", "nGene", "percent.mito"), pt.size.use = 0.1, group.by="orig.ident")
Error in UseMethod(generic = "DefaultAssay", object = object) :
no applicable method for 'DefaultAssay' applied to an object of class "seurat"
UpdateSeuratObject(seurat_mat)
Validating object structure
Ensuring keys are in the proper strucutre
Ensuring feature names don't have underscores
Object representation is consistent with the most current Seurat version
An object of class Seurat
24389 features across 17284 samples within 1 assay
Active assay: RNA (24389 features)
2 dimensional reductions calculated: pca, tsne
pdf("QCfeatures.pdf")
VlnPlot(seurat_mat, features = c("nUMI", "nGene", "percent.mito"), pt.size.use = 0.1, group.by="orig.ident")
Error in UseMethod(generic = "DefaultAssay", object = object) :
no applicable method for 'DefaultAssay' applied to an object of class "seurat"

@mojaveazure
Copy link
Member

Your object is a v2 object, not a v3 object. When you ran UpdateSeuratObject, you didn't save the object, so it didn't get updated. Please see #990 (comment) for more details about v2 vs v3 objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants