`qc_scATAC()` can try to quantify negative ranges
Hi,
I've been getting this error when running qc_scATAC(): Peaks are not in sorted order by (chr, end, start). This was a rather confusing error message, and it took some digging before I found the cause is due to qc_scATAC() generating negative ranges if input ranges are, for example, below 2000:
https://github.com/bnprks/BPCells/blob/93f16ffe4c56dad9e7187183a1e6f22a41b8f73a/r/R/atac_utils.R#L208-L221
As a result, when these ranges are eventually passed to the PeakMatrix::PeakMatrix function, the negative ranges get turned into very large unsigned values and thus trigger the 'not in sorted order' error (as the following ranges will be smaller).
Good catch. I'll try to get a fix either today or tomorrow. Thanks!
Let me know if this has fixed the problem.
Immanuel