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

Added support for sparse matrix input in UMAP function in scROSHI #2

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

Conversation

flalom
Copy link

@flalom flalom commented Oct 11, 2023

Title: Added Support for Sparse Matrix Input in UMAP function in scROSHI

Description:
This pull request aims to add support for sparse matrices when using the uwot::umap function. The original implementation did not handle sparse matrices from SingleCellExperiment.
This in response to the error:

Error in uwot(X = X, n_neighbors = n_neighbors, n_components = n_components,  : 
  Sparse matrices are only supported as distance matrices

Changes:

  • Converted sparse matrix to dense matrix before passing it to uwot::umap.

Code:

 # Fix sparse matrix
  if (is(tmp, "sparseMatrix")) {
    tmp <- Matrix::as.matrix(tmp)
  }

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.

1 participant