set_matrix_control: Verify and set the matrix_control parameter list.

View source: R/matrix.R

set_matrix_controlR Documentation

Verify and set the matrix_control parameter list.

Description

Verifies and sets the list of parameter values that is used to make the count matrix that is stored in the cell_data_set or certain other matrices that are used during the Monocle3 run. To see the default values, call "set_matrix_control(matrix_control=list(matrix_class='BPCells', show_values=TRUE))". "show_values=TRUE" can be used in functions that have the matrix_control list parameter, in which case the function will show the matrix_control values to be used and then stop.

Usage

set_matrix_control(
  matrix_control = list(),
  matrix_control_default = list(),
  control_type = c("unrestricted", "pca")
)

Arguments

matrix_control

Input control list.

matrix_control_default

Input default control list.

control_type

A string of either "unrestricted" or "pca". A control_type of "pca" restricts certain list parameters.

Value

matrix_control Output control list.

matrix_control list values

matrix_class

A string that specifies the matrix class to use for matrix storage. The acceptable values are "dgCMatrix" and "BPCells". matrix_class is required.

matrix_type

A string that specifies whether to store the matrix values as single precision "floats" (matrix_type="float") or double precision "doubles" (matrix_type="double"). The default is "double". "matrix_type" is used only for BPCells class matrices.

matrix_mode

A string that specifies whether to store the BPCells class matrix in memory (matrix_mode="mem") or on disk (matrix_mode="dir"). "matrix_mode" is used only for BPCells class matrices. At this time, only "dir" is allowed.

matrix_path

A string that specifies the directory where the BPCells on-disk matrix data are stored in a sub-directory with a randomized name. The default is in the directory where R is running. "matrix_path" is used only for BPCells class matrices with matrix_mode="dir". For example, if matrix_path is set to "my_dir" Monocle3 will create a directory with a name that has the form "monocle.bpcells.*.tmp" in "my_dir". The asterisk represents a random string that makes the name unique.

matrix_compress

A logical that specifies whether to use bit-packing compression to store BPCells matrix values. Only the matrix indices are compressed for matrix_types "float" and "double". "matrix_compress" is used only for BPCells class matrices. The default is FALSE, which improves processing speed.

matrix_buffer_size

An integer that specifies how many items of data to buffer in memory before flushing to disk. This is used for matrix_class="BPCells" with matrix_mode="dir". The default is 8192L.

matrix_bpcells_copy

A logical that specifies whether the input BPCells matrix is to be copied. This is relevant only when the input matrix and the desired output matrix are the same; that is, have the same matrix_mode, matrix_path, matrix_compress, and matrix_buffer_size values. If matrix_bpcells_copy is TRUE, the queued operations are applied to a new on-disk copy of of the input matrix and the operation queue is emptied. If FALSE, the queued operations are not applied and the on-disk storage is unaltered.


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