Skip to content

Sparse to dense conversion even when sparseOptimization is TRUE #165

Description

@dimalvovs

sparseOptimization is nice feature that reduces the memory footprint and allows faster computation in CoGAPS. To some reason, sparse matrix is not supported as input, proof:

mat <- Matrix::sparseMatrix(i = sample(1:20, 100, replace = TRUE),
                            j = sample(1:10, 100, replace = TRUE),
                            x = runif(100))

  params <- CogapsParams(seed = 42,
                         nIterations = 30,
                         nPatterns = 2,
                         sparseOptimization = as.logical(0),
                         distributed = "genome-wide")
  params <- setDistributedParams(params, nSets = 2)

  cg <- CoGAPS(mat,
         params = params,
         BPPARAM = BiocParallel::SerialParam(),
         messages = FALSE)

yields:

Error in convertDataToMatrix(data) : unsupported data type

Let's add native sparseMatrix support.

Thanks to Brian@IGS for heads up!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions