read_npz: Reads npz file with matrices and converts them sparse...

Description Usage Arguments Value See Also Examples

Description

Reads npz file with matrices and converts them sparse matrices.

Usage

1
read_npz(path, mtx.names = "all", sparse.format = TRUE)

Arguments

path

character, string specifying path to npz file

mtx.names

character vector specyfing subset of matrices names to read from npz dict like file; by default all matrices are loaded

sparse.format

logical if FALSE then this function is equivalent to read_dense function

Value

list with matrices in sparse format

See Also

dense2sparse for conversion of dense matrix to sparse format, read_dense on reading npz files

Examples

1
2
3
4
# get sample npz file name
mtx.fname <- system.file("extdata", "MSC-HindIII-1_40kb-raw.npz", package = "DIADEM", mustWork = TRUE)
mtx.sparse.list <- read_npz(mtx.fname) # reads all chromosomes
mtx.sparse.sublist <- read_npz(mtx.fname, mtx.names = c("18","19")) # only read chromosome 18 and 19

rz6/CopulaHiC documentation built on Dec. 31, 2019, 9:19 a.m.