r3fang / SnapATAC

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

Potential predictGenePeakPair bug #146

Open dbetel opened 4 years ago

dbetel commented 4 years ago

Hi I believe there may be a bug in predictGenePeakPair function (line 87) data.use = data.use[,idy];. If idy is only a single value (i.e. one match) this line will return a numeric vector. Then the following call in line 90: idy = which(Matrix::colSums(data.use) > 0); will throw an error since colSums is expecting a data.use to be two-dimensions. Changing to: data.use = data.use[, idy, drop=FALSE]; will prevent subsetting from coercing the result to lower dimension.