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

Error in as(object@graphs$RNA_snn, "dgCMatrix") #25

Closed
trueth1206 opened this issue Aug 23, 2019 · 4 comments
Closed

Error in as(object@graphs$RNA_snn, "dgCMatrix") #25

trueth1206 opened this issue Aug 23, 2019 · 4 comments

Comments

@trueth1206
Copy link

Thank you for creating this package. I tried to run it using a Seurat objet.

library(Seurat)
library(swne)
obj <- readRDS(file = "obj.rds")
clusters <- obj$seurat_clusters
genes.embed <- c("ENSMUSG00000031766", "ENSMUSG00000041644", "ENSMUSG00000001025", "ENSMUSG00000030963", "ENSMUSG00000032060", "ENSMUSG00000026726", "ENSMUSG00000027202", "ENSMUSG00000062209", "ENSMUSG00000054640", "ENSMUSG00000027070", "ENSMUSG00000041959", "ENSMUSG00000060803", "ENSMUSG00000097830")
swne.embedding <- RunSWNE(obj, k = 16, genes.embed = genes.embed)

Then I've got the following error:
Error in as(object@graphs$RNA_snn, "dgCMatrix") :
no method or default for coercing “NULL” to “dgCMatrix”

Is there anyway to solve this issue? Thank you very much!

@yanwu2014
Copy link
Owner

Hi, can you check if your Seurat object was generated with Seurat V3?

Also, make sure that the SNN was actually built with FindNeighbors. Something like:

obj <- FindNeighbors(obj, dims = 1:20)

Let me know if that works!

@trueth1206
Copy link
Author

Hi, Thank you for you replay.
Yes I am using Seurat V3.
The issue occurred while I used a V3 object generated by integrating 4 samples (after FindIntegrationAnchors, IntegrateData, RunUMAP, FindNeighbors and FindClusters).
If I use a V3 object generated by analyzing one sample, the swne run smoothly and showed good picture.
Is there any way to apply swne on a Seurat object with integrated samples?
Thank you very much.

@yanwu2014
Copy link
Owner

Ah so RunSWNE doesn't work on integrated Seurat objects yet, hopefully I'll have that functionality up soon.

For now, try using this walkthrough: https://yanwu2014.github.io/swne/Examples/multiple_pancreas_alignment_swne.html

@trueth1206
Copy link
Author

Hi, it works well with the workflow you provided. Thank you very much for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants