Modifies cell identifiers of each element in a list of matrices, Seurat objects, or SingleCellExperiment objects by appending a unique matrix index (e.g., "-m1", "-m2", etc.). After renaming, the datasets are merged into a single object.
Arguments
- input_list
A list of matrices, Seurat objects, or SingleCellExperiment objects. All elements must be of the same class.
- rowg
Logical. If
TRUE
(default), genes are assumed to be rows and cells columns. IfFALSE
, matrices are transposed before renaming and combining.
Value
A combined matrix, Seurat object, or SingleCellExperiment object with modified (unique) cell names.
Details
For matrices, this function optionally transposes the input before combining.
For Seurat
and SingleCellExperiment
objects, only features
(genes) common across all input datasets are retained before merging.
The cell names are suffixed with "-m1", "-m2", etc., according to their
original list position.
Examples
data(count_matrices)
earlym <- earlyj(count_matrices)
head(earlym)
#> class: SingleCellExperiment
#> dim: 6 120
#> metadata(0):
#> assays(1): counts
#> rownames(6): ACTG1 ARPC2 ... CD3D CD3E
#> rowData names(0):
#> colnames(120): cell_1-m1 cell_2-m1 ... cell_39-m3 cell_40-m3
#> colData names(1): CELL_TYPE
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):