moi-taiga / PathPinpointR

A method of identifying the position of a sample upon a trajectory.
Other
0 stars 0 forks source link

TODO: Speed up Binarize #14

Open moi-taiga opened 1 year ago

moi-taiga commented 1 year ago

Check how effective this is:

calculate zero percentage

zerop_g <- c()

zerop_g <- c()

expdata <- assays(sce)$expdata for (i in 1:nrow(expdata)) { zp <- length(which(expdata[i, ] == 0))/ncol(expdata) zerop_g <- c(zerop_g, zp) }

for (i in 1:nrow(expdata)) {

zp <- length(which(expdata[i, ] == 0))/ncol(expdata)

zerop_g <- c(zerop_g, zp)

}

zerop_g <- apply(expdata==0, 1, sum) zerop_g <- zerop_g/ncol(expdata)