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

createGmatFromMat ERROR #258

Open
gengbaobao opened this issue Jan 12, 2024 · 1 comment
Open

createGmatFromMat ERROR #258

gengbaobao opened this issue Jan 12, 2024 · 1 comment

Comments

@gengbaobao
Copy link

Hello developer

I run "x.sp = createGmatFromMat(obj = x.sp, input.mat="bmat", genes=genes.sel.gr, do.par = T, num.cores = 2)", but get this error "Error in count.df[, 2] : subscript out of bounds".

How to fix it?

Thanks

@fancody
Copy link

fancody commented Mar 26, 2024

I've had this issue recently as well. I modified the line 96: count.i = data.use[,idx.bins.i,dropping=TRUE] to count.i = data.use[,idx.bins.i]; and the line 104: count.i = Matrix::rowSums(data.use[,idx.bins.i,dropping=TRUE]); to count.i = Matrix::rowSums(data.use[,idx.bins.i); in SnapATAC-master/R/createGmat.R.
After that, add before running createGmatFromMat
source('/SnapATAC-master/R/createGmat.R')
library(parallel)
This makes createGmatFromMat work successfully, but I'm not sure if this change will affect the result

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