r3fang / SnapATAC

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

runMagic step size hard-coded here, but also taken as input #149

Open suragnair opened 4 years ago

suragnair commented 4 years ago

https://github.com/r3fang/SnapATAC/blob/c3ab177558f0fe9c47cbd68969df7b06de5b07d9/R/runMagic.R#L61

suragnair commented 4 years ago

Also would it not be much faster to do this? Note this is slightly different since in your implementation step.size of 3 would compute A^8, whereas here it would compute A^3. On my end it seems to work much faster (few seconds for ~80k cells), and the outputs are the same (as you would expect).

data.use.smooth = A %*% data.use;
if(step.size > 1){
    for(i in 1:step.size-1){
        data.use.smooth = A %*% data.use.smooth;
    }
}