sparse2dense: Convert sparse matrix to dense matrix

View source: R/utility_functions.R

sparse2denseR Documentation

Convert sparse matrix to dense matrix

Description

Convert sparse matrix to dense matrix. Developed to handle large datasets, by constructing dense matrix block-by-block.

Usage

sparse2dense(mat.sparse, block.size = 10000, transpose = F, verbose.error = F)

Arguments

mat.sparse

Sparse matrix.

block.size

If large dataset, construct dense matrix column-wise block-by-block, where block size is specified by numeric block.size parameter. Default is 10000.

transpose

Logical specifying whether to transpose data.

verbose.error

Logical specifying whether to print error message in case of large dataset which requires block-by-block construction.

Value

dense matrix

Author(s)

Nicholas Mikolajewicz

See Also

sparse2df

Examples


# Get sparse matrix
exp.mat <- so@assays[[current.assay]]@data

# convert to dense matrix
mat.dense <- sparse2dense(mat.sparse, transpose = T)


NMikolajewicz/scMiko documentation built on June 28, 2023, 1:41 p.m.