anndata.acc.RefAcc#
- class anndata.acc.RefAcc[R: AdRef, I: Hashable, D: MuData | AnnData](*, ref_class)[source]#
Bases:
ABCAbstract base class for reference accessors.
See reference accessors for all existing subclasses.
Attributes
Methods
- __getitem__(idx, /)[source]#
Get a reference to an array.
- Parameters:
- idx
Any Index into the referenced element. Subclasses define which indices are valid.
- idx
- Return type:
R
- abstractmethod __repr__()[source]#
Get a display representation of the accessor.
This is not a simplified representation supported by
AdAcc.resolve(), but instead the code used to create the accessor, e.g.A.layers['counts'].- Return type:
- abstractmethod dims(idx, /)[source]#
Get along which dimensions the referenced array is.
- Return type:
Collection[Literal['obs','var']]
- abstractmethod get(data, idx=NO_IDX, /)[source]#
Get the indexed array from the AnnData object at
idx.- Overloads:
data (
D), / →AlignedArraydata (
D), idx (I), / →InMemoryArray|ExtensionArray|Variable
When
idxis omitted (i.e.,idxisNO_IDX), return the full array one level up instead. This has the same semantics as theAdRefpath but one level up:adata[A.obs]returns the fullDataFrameandadata[A.obsm["pca"]]the fullnumpy.ndarray. These both have definedshape-like properties (orawkward.Array), unlike, for example,obsmor similar.