Skip to contents

After this call, get_matrix(columns_axis, rows_axis, name) skips the transpose-on-the-fly path.

Usage

relayout_matrix(daf, rows_axis, columns_axis, name, overwrite = FALSE)

Arguments

daf

A DafReader.

rows_axis

Row-axis name.

columns_axis

Column-axis name.

name

Matrix name.

overwrite

If TRUE, replace any existing matrix at the transposed (columns_axis, rows_axis, name) location. If FALSE (default), raise when such a matrix already exists.

Value

Invisibly the input daf.

Examples

d <- memory_daf()
add_axis(d, "cell", c("c1", "c2"))
add_axis(d, "gene", c("g1", "g2", "g3"))
m <- matrix(1:6, nrow = 2, ncol = 3)
set_matrix(d, "cell", "gene", "counts", m)
relayout_matrix(d, "cell", "gene", "counts")
has_matrix(d, "gene", "cell", "counts")
#> [1] TRUE