anndata.acc.GraphMapAcc#

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

Bases: MapAcc[GraphAcc, PairwiseArrays | PairwiseArraysView]

Accessor for graph containers (A.obsp/A.varp).

Attributes

scope: ScopeAcc | None = None#

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

dim: Literal['obs', 'var']#

Axis this accessor refers to, e.g. A.obsp.dim == 'obs'.

ref_class: type[R]#

Methods

__getitem__(k, /)[source]#

Get a reference accessor for a graph, e.g. A.obsp["distances"].

Parameters:
k str

The graph’s key.

Return type:

GraphAcc[R]

get(adata)[source]#

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

Return type:

PairwiseArrays | PairwiseArraysView