set_cds_row_order_matrix: Set the row-major order counts matrix in the assays slot of...

View source: R/matrix.R

set_cds_row_order_matrixR Documentation

Set the row-major order counts matrix in the assays slot of the CDS when the CDS has a BPCells counts matrix.

Description

By default, BPCells stores matrices as one-dimensional vectors in column-major order, as does R. As a result, column access is fast and row access is slow. We use BPCell's ability to also store and access matrices in row-major order, which gives fast row access. The function set_cds_row_order_matrix creates the row-major order matrix and stores it in the assays slot of the CDS with the name "counts_row_order". The two copies of the counts matrix must have the same count values so if you replace or change the CDS's counts matrix, you must also update the counts_row_order matrix, which you can do using this function set_cds_row_order_matrix.

Usage

set_cds_row_order_matrix(cds)

Arguments

cds

cell_data_set A cell_data_set.

Value

cell_data_set The cell_data_set with the additional row-major order counts matrix.

Examples

   cds <- load_a549(matrix_control=list(matrix_class='BPCells'))
   cds <- set_cds_row_order_matrix(cds)
   str(cds)


cole-trapnell-lab/monocle3 documentation built on June 11, 2025, 11:22 p.m.