ETH-NEXUS / scROSHI

Other
1 stars 3 forks source link

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

Open flalom opened 1 year ago

flalom commented 1 year ago

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:

Code:


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