r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
301 stars 125 forks source link

Empty Rows Error in runDiffusionMaps #167

Open spietrzak opened 4 years ago

spietrzak commented 4 years ago

I have been working through the tutorial for analyzing 10X data using SnapATAC, but I ran into an error on the runDiffusionMaps command, saying there were empty rows in the input matrix. Here are the code and corresponding error that I see:

> snap = runDiffusionMaps(obj=snap, input.mat="bmat", num.eigs=50) Epoch: checking the inputs ... Error in runDiffusionMaps(obj = snap, input.mat = "bmat", num.eigs = 50) : input matrix contains empty rows, remove empty rows first

Does anyone know why I am getting this error or how to resolve it. I hadn't gotten any errors in the previous steps, but could something have been done wrong prior to this step that resulted in this error. Any help or advice would be much appreciated. Thank you.

spietrzak commented 4 years ago

Update: I was able to resolve this issue (I forgot to do the barcode selection for all of my samples that I combined together, so there were probably some empty barcodes included before). However, now when I try to run it, it runs for a while, but then a box pops up saying:

R Session Aborted R encountered a fatal error. The session was terminated.

To me, it appears that there is not enough memory on my computer, as I noticed that the storage space on my computer is approaching 0 before this message pops up. Below are the code and output messages that I see when I run it before R shuts down:

> x.sp = runDiffusionMaps(obj=x.sp, input.mat="bmat", num.eigs=50)
Epoch: checking the inputs ...
Epoch: computing jaccard similarity matrix ...
Epoch: fitting regression model ...
Epoch: performing normalization ...

Is there a way to get around this issue other than to free up more space on my computer? Again, any advice would be greatly appreciated. Thank you.

1221li commented 2 years ago

I'm sorry to bother you, but I have the same problem as you. How did you solve it? My code is as follows:

idx.landmark.ds = sort(sample(x = seq(nrow(x.sp_mat)), size = 10000, prob = sampling_prob)) x.landmark.sp = x.sp_mat[idx.landmark.ds,] x.query.sp = x.sp_mat[-idx.landmark.ds,] x.landmark.sp_run = runDiffusionMaps(obj= x.landmark.sp,input.mat="bmat",num.eigs=50) Epoch: checking the inputs ... Error in runDiffusionMaps(obj = x.landmark.sp, input.mat = "bmat", num.eigs = 50) : input matrix contains empty rows, remove empty rows first I am looking forward to your reply! With best wishes.