Skip to content

Starting from an Anndata object #428

@yitengfei120011

Description

@yitengfei120011

Starting from an Anndata object

library(anndata)
ad <- read_h5ad("integration_cellType.h5ad")
normalized_data <- t(as.matrix(ad$X))
library(Matrix)
data.input <- as(normalized_data, "dgCMatrix")

Error in .m2sparse(from, "dgC"): attempt to construct sparseMatrix with more than 2^31-1 nonzero entries
Traceback:

  1. asMethod(object)
  2. .m2sparse(from, "dgC")
  3. .handleSimpleError(function (cnd)
    . {
    . watcher$capture_plot_and_output()
    . cnd <- sanitize_call(cnd)
    . watcher$push(cnd)
    . switch(on_error, continue = invokeRestart("eval_continue"),
    . stop = invokeRestart("eval_stop"), error = NULL)
    . }, "attempt to construct sparseMatrix with more than 2^31-1 nonzero entries",
    . base::quote(.m2sparse(from, "dgC")))

When I run data.input <- as(normalized_data, "dgCMatrix"), the following error occurs. How can I solve it?
Image

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