quadbio / Pando

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

ERROR in GRN inference #36

Open Usamahussein551980 opened 1 year ago

Usamahussein551980 commented 1 year ago

Hello Jonas, Thank you for your very interesting tool. After omitting the genome frokm my code and kept on regions = StringToGRanges(Links(object[['ATAC']])$peak), it was successfully executed. The next step of TF motifs scanning was successfully executed, but my problem started when I get to infer the GRN. The below code I used:

library(Pando) library(BSgenome.Mmusculus.UCSC.mm10) library(doParallel) registerDoParallel(10)

Object[['RNA']] # 332285 features for 31159 cells Object[['ATAC']] # 123749 features for 31159 cells

Object<- Seurat::FindVariableFeatures(Object, assay='RNA') Object<- RegionStats(Object, genome = BSgenome.Mmusculus.UCSC.mm10) Object<- LinkPeaks(Object,peak.assay = "ATAC", expression.assay = "RNA")

Object<- initiate_grn(Object, rna_assay = 'RNA', peak_assay = 'ATAC', regions = StringToGRanges(Links(new_oro_palate[["ATAC"]])$peak))

data('motifs') data('motif2tf')

Object<- find_motifs(Object, pfm = motifs, motif_tfs = motif2tf, genome = BSgenome.Mmusculus.UCSC.mm10)

regions <- NetworkRegions(Object) head(regions@motifs@data)

10 x 10 sparse Matrix of class "lgCMatrix" [[ suppressing 10 column names 'M07783_2.00', 'M07784_2.00', 'M02651_2.00' ... ]]

chr3-34196454-34197381 . . . . . . . . . . chr3-34197854-34198710 . . . . . . . . . . chr3-34411379-34412323 . . . . . . . . . . chr3-34456546-34457573 . . | . . . . . . . chr3-34559907-34560786 . . . . . . . . . . chr3-34649492-34650004 . . . . . . . . . . chr3-34663838-34664692 . . . . . . . . . . chr3-34726732-34727587 . . . . . . . . | . chr3-34747412-34748320 | | | . . . . . . . chr3-34773556-34774396 . . . | . . . . . |

Hvg_genes <- read.csv("../HVG.csv", header = T, sep = ",")

Object<- infer_grn(Object, peak_to_gene_method = 'GREAT', genes = Hvg_genes$gene, parallel = T)

ERROR: Selecting candidate regulatory regions near genes Error in .subset2(x, i, exact = exact) : attempt to select less than one element in integerOneIndex

Could you please try to help me to solve this issue??

Harrison-Q-Ma commented 1 year ago

I ran into the same issue and solved it by first calling FindVariableFeatures() on my object.

GouQiao commented 11 months ago

I ran into the same issue and solved it by first calling FindVariableFeatures() on my object.

Hi , I also met the same problem. And I ran obj<-FindVariableFeatures(obj) before infer_grn(), I still got the error: Error in .subset2(x, i, exact = exact) : attempt to select less than one element in integerOneIndex

Do you know how to fix it?