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 GRN inference #36

Open
Usamahussein551980 opened this issue Mar 1, 2023 · 2 comments
Open

ERROR in GRN inference #36

Usamahussein551980 opened this issue Mar 1, 2023 · 2 comments

Comments

@Usamahussein551980
Copy link

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
Copy link

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

@GouQiao
Copy link

GouQiao commented Aug 2, 2023

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?

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

3 participants