
bixverse meta cell class
MetaCells.RdThis is the bixverse-based meta cell class. It is generated by running
meta-cell generating functions on top of the main class. Due to the
aggregation of the count matrices to a way smaller number of meta cells,
the data is held in memory for this class specifically. Additional methods
that make specific usage of meta cells (especially co-expression module
detection ones will be made available).
Arguments
- meta_cell_data
Named list. Output of meta-cell generation Rust functions. Will contain the aggregated raw and normalised counts, plus additional information on the origin of the meta cells.
- var_data
data.table with the variable/feature informations.
- meta_cell_method
String describing the origin of the metacell.
- obs_ids
Optional character vector of length
n_metacellswith the meta cell identifiers. Defaults tometa_cell_0001,meta_cell_0002, ... Used bymerge_meta_cells()so that the count matrices get their final row names at construction time rather than via arownames<-that would duplicate them.- cells_to_keep
Optional integer vector. The source's
get_cells_to_keep(), i.e. 0-indexed positions in its full obs table, in the row order its cached artefacts use. Recorded so that the meta cell memberships, which are positions in the full obs space, can be resolved against embeddings, kNN graphs and diffusion maps, whose rows only cover the QC-passing cells.
Properties
- obs_table
The meta cell observation table.
- var_table
The meta cell variable table.
- data
List with the raw and normalised counts.
- sc_cache
Class with embeddings, kNN/sNN graphs, etc. Shared with
SingleCells().- original_assignment
List with original assignment information.
- dims
Dimensions of the new meta cell matrices.
- other_data
Potential other data returned from the meta-cell generating methods.
- is_merged
Boolean.
TRUEfor objects returned bymerge_meta_cells(). Methods that need to resolveoriginal_cell_idxagainst the source single cell data use this to bail out early.
Examples
# the class is produced by the aggregation functions, not built by hand
sc <- demo_single_cells()
mc <- generate_bt_meta_cells_sc(
sc,
sc_meta_cell_params = params_sc_bt_metacells(target_no_metacells = 50L),
.verbose = FALSE
)
mc
#> Single cell experiment (Meta Cells).
#> Meta cell method: meta_cells_hdwgcna
#> Merged: FALSE
#> No meta cells: 50
#> No genes: 50
#> No cells aggregated: 366
#> No obs rows in source: 500
#> HVG calculated: FALSE
#> PCA calculated: FALSE
#> Other embeddings: none
#> KNN generated: FALSE
#> SNN generated: FALSE
#> Stale artefacts: none
unlink(sc@dir_data, recursive = TRUE, force = TRUE)