anndata.acc.LayerMapAcc#

class anndata.acc.LayerMapAcc[R: AdRef](*, ref_acc_cls=<class 'anndata.acc.LayerAcc'>, scope=None, ref_class)[source]#

Bases: MapAcc[LayerAcc, MutableMapping[str | None, AlignedArray]]

Accessor for layers (A.layers).

Attributes

scope: ScopeAcc | None = None#

Accessor for the element whose .AD cast the mapping is in, see anndata.acc.RefAcc.scope.

ref_class: type[R]#

Methods

__getitem__(k, /)[source]#

Get a reference accessor for a layer.

Parameters:
k str | None

The layer’s key, or None for X (see AdAcc.X).

Return type:

LayerAcc[R]

get(adata)[source]#

Get the referenced mapping from the AnnData object, e.g. adata.obsm for A.obsm.

Return type:

MutableMapping[str | None, AlignedArray]

isin(data, /)[source]#

Check if the referenced mapping is in the AnnData object and has entries.

E.g. A.obsm.isin(adata) is True if adata.obsm isn’t empty. Returns False if scope isn’t in data or isn’t an AnnData object.

Return type:

bool