quadbio / Pando

Multiome GRN inference.
https://quadbio.github.io/Pando/
MIT License
106 stars 21 forks source link

infer_grn error: Error in as(groupings2, "data.frame") : no method or default for coercing "NULL" to "data.frame" #7

Closed andrewjkwok closed 2 years ago

andrewjkwok commented 2 years ago

Hi,

Thanks for this piece of software which looks very exciting. I have some multi-ome data that I would like to try this on and in preparing the scripts, I was using some publicly available data from 10X, but was running into problems early on. After processing my seurat object to have the required RNA and peak assays, I run initiate_grn and find_motifs as instructed on the Pando website, both of which complete.

However, I then move on to the infer_grn step and immediately get an error:

> seurat_object <- infer_grn(
+   seurat_object,
+   peak_to_gene_method = 'Signac',
+   method = 'glm'
+ )
Selecting candidate regulatory regions near genes
Error in as(groupings2, "data.frame") : 
  no method or default for coercing "NULL" to "data.frame"

The traceback is as follows:

> traceback()
6: stop(gettextf("no method or default for coercing %s to %s", dQuote(thisClass), 
       dQuote(Class)), domain = NA)
5: as(groupings2, "data.frame")
4: Matrix.utils::aggregate.Matrix(x = x, groupings = groups, fun = fun)
3: aggregate_matrix(t(peaks_near_gene), groups = colnames(peaks_near_gene), 
       fun = "sum")
2: infer_grn.SeuratPlus(seurat_object, peak_to_gene_method = "Signac", 
       method = "glm")
1: infer_grn(seurat_object, peak_to_gene_method = "Signac", method = "glm")

I have checked that I have the latest version of Pando installed.

I saw the previous issue #2 and tried the solution of adding the RNA assay to the peak object, but to no avail.

Is there any clear reason why I may be running into such an error? Many thanks in advance.

andrewjkwok commented 2 years ago

Inexplicably it is now working with my real data once I follow the advice of #2 by adding the RNA assay to an object with the chromatin data, but it would be good to know why this issue might sometimes happen!

I am nevertheless facing the same issues as in #5 but will wait for them to be resolved in that thread.