Giter Club home page Giter Club logo

Comments (4)

linqiaozhi avatar linqiaozhi commented on May 29, 2024 2

Got it.

Just run imputation on the subset of rows that are non-zero and then set the appropriate rows of the larger matrix to the result of imputation on the subset.

For example, something like this:

# Make a matrix that has a row of all zeros
A <- matrix(1,nrow=10,ncol = 5)
A[2,] <- 0 
print(A)

totalUMIPerCell <- rowSums(A)
toKeep <- which(totalUMIPerCell >0)
A_subset <- A[toKeep, ]

# Run imputation on A_subset. Here I'll just add the number 1, just for demo
A_subset <- A_subset + 1

A[toKeep, ]  <- A_subset
print(A)

from alra.

linqiaozhi avatar linqiaozhi commented on May 29, 2024

Not sure I fully understand your question. Are you saying the normalize_data() function is too slow for large datasets?

Or are you saying that after you run normalize_data() and you want to merge the resulting matrix back into the original matrix, you do this via a loop that is very slow?

from alra.

deforder avatar deforder commented on May 29, 2024

Not sure I fully understand your question. Are you saying the normalize_data() function is too slow for large datasets?

Or are you saying that after you run normalize_data() and you want to merge the resulting matrix back into the original matrix, you do this via a loop that is very slow?

What I mean is that, when normalizing with this function. every gene that has 0 count in every cell will be removed in if (any(totalUMIPerCell == 0)) condition

For example, I use data set that have 20,000 genes but only 3,000 genes express with at least one cell. after using provided normalized function, 17,000 genes will be removed.

I hope to know the way that efficiently merge imputation result of 3,000 genes back to original data. (20,000 genes with zero count)

from alra.

deforder avatar deforder commented on May 29, 2024

That's helpful, Thanks.

from alra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.