combine_cds: Combine a list of cell_data_set objects

View source: R/utils.R

combine_cdsR Documentation

Combine a list of cell_data_set objects

Description

This function will combine a list of cell_data_set objects into a new cell_data_set object.

Usage

combine_cds(
  cds_list,
  keep_all_genes = TRUE,
  cell_names_unique = FALSE,
  sample_col_name = "sample",
  keep_reduced_dims = FALSE,
  matrix_control = list(),
  verbose = FALSE
)

Arguments

cds_list

List of cds objects to be combined.

keep_all_genes

Logical indicating what to do if there is a mismatch in the gene sets of the CDSs. If TRUE, all genes are kept and cells from CDSs missing a given gene will be filled in with zeroes. If FALSE, only the genes in common among all of the CDSs will be kept. Default is TRUE.

cell_names_unique

Logical indicating whether all of the cell IDs across all of the CDSs are unique. If FALSE, the CDS name is appended to each cell ID to prevent collisions. These cell IDs are used as count matrix column names and colData(cds) row names. Cell names stored in other cds locations are not modified so you will need to modify them manually for consistency. Default is FALSE.

sample_col_name

A string to be the column name for the colData column that indicates which original cds the cell derives from. Default is "sample".

keep_reduced_dims

Logical indicating whether to keep the reduced dimension matrices. Do not keep the reduced dimensions unless you know that the reduced dimensions are the same in each CDS. This is true for projected data sets, for example. Default is FALSE.

matrix_control

A list used to control how the counts matrix is is stored in the CDS. By default, combine_cds stores the counts matrix as an in-memory, sparse (dgCMatrix), unless (a) at least one of the cdses in cds_list uses a BPCells counts matrix, or (b) you specify matrix_control=list(matrix_class='BPCells').

verbose

Whether to emit verbose output while running combine_cds. Default is FALSE.

Details

If any of the counts matrices is BPCells class, the combined counts matrix will be BPCells class.

Value

A combined cell_data_set object.


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