read_h5ad(as = "AnnData") returns one of these instead of a
SingleCellExperiment. It holds what the Rust reader produced and builds R
objects only when a component is actually touched.
Value
$ returns the field; dim() the number of genes and cells;
dimnames() a list of gene and cell names; print() returns x
invisibly.
Details
The reason this exists is measured, not aesthetic. Building a
SingleCellExperiment costs a constant ~3.3 seconds on this machine
regardless of dataset size — 0.05s vs 3.19s for a thousand cells, 3.72s vs
7.09s for a hundred thousand. That cost is S4 method-table and Bioconductor
namespace warm-up, not work proportional to the data, so it cannot be
optimised away inside the conversion; it can only be deferred until someone
asks for an SingleCellExperiment.
Fields are reached with $, and each is built on first access and cached:
$X, $obs, $var, $obsm, $layers, $obs_names, $var_names,
$n_obs, $n_vars. Convert with as_sce() or as_seurat().
dim() and dimnames() answer from what the reader already returned,
genes by cells as in a SingleCellExperiment, without building anything.
print() lists the components and which of them have been built so far.