Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Speed up Binarize #14

Open
moi-taiga opened this issue Aug 4, 2023 · 1 comment
Open

TODO: Speed up Binarize #14

moi-taiga opened this issue Aug 4, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@moi-taiga
Copy link
Owner

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)

@moi-taiga moi-taiga added the enhancement New feature or request label Aug 4, 2023
@moi-taiga moi-taiga self-assigned this Aug 4, 2023
@moi-taiga
Copy link
Owner Author

Other than metadata generation, the effect of binarize_exp(fix_cutoff=TRUE) can be achieved with something like:
ifelse(as.matrix(assays(sce)$expdata) > 0, 1, 0)

consider this when producing a simpler more efficient binarize_exp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant