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

predict_celltype.Seurat performance improvement #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeehio
Copy link

@zeehio zeehio commented May 24, 2019

Hi,

I was doing a quick check of your package and I have a quick fix for using less RAM when dealing with sparse matrices, such as the ones given by the Seurat package.

predict_celltype.Seurat was converting the full data matrix from sparse to dense. Then the predict_celltype.matrix method filtered only the genes present in the db. This is not optimal as it
generates a potentially huge matrix to later on keep a much smaller number of rows.

Instead, a method for predicting sparse matrices predict_celltype.dgCMatrix is given, that
first filters the genes present in the db and then converts the filtered matrix from sparse to dense.

It's also a good solution to close #1, as SingleCellExperiments that have the matrix defined as a dgCMatrix will use the given method as well.

Closes #1

predict_celltype.Seurat was converting the full data matrix from
sparse to dense. Then the predict_celltype.matrix method filtered
only the genes present in the db. This is not optimal as it
generates a potentially huge matrix to later on keep a much smaller
number of rows.

Instead, a method for predicting sparse matrices is given, that
first filters the genes and then converts the matrix from sparse
to dense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use predict_celltype for sce converted from Seurat
1 participant