XuegongLab / HGC

fast hierarchical clustering for large-scale single-cell data
8 stars 5 forks source link

no applicable method for 'as.sparse' applied to an object of class "NULL" #1

Closed hk20013106 closed 3 years ago

hk20013106 commented 3 years ago

Hi,

I successfully run the demo, and I also successfully run the pipeline using the pbmc3k data from Seruatdata. But when running my own data, which is an integrated data set, it reports an error:

Bpl.rpca@active.assay [1] "integrated"

Bpl.rpca <- FindClusteringTree(object = Bpl.rpca, graph.type = "SNN")

Error in UseMethod(generic = "as.sparse", object = x) : no applicable method for 'as.sparse' applied to an object of class "NULL"

Then I realize that the function only uses RNA_snn graph (G = as.sparse(object@graphs$RNA_snn)) so I need to do: Bpl.rpca@graphs[["RNA_snn"]] <- Bpl.rpca@graphs[["integrated_snn"]]

and it works for me.

stevenhuakui commented 3 years ago

Dear Kai He,

Thanks for pointing out this bug. We have fixed it. Now HGC is able to select the graph according to the default assay in Seurat.

Kui