anndata.acc.GraphAcc#
- class anndata.acc.GraphAcc(dim, k, *, ref_class)[source]#
Bases:
RefAcc[R,Idx2D,MuData|AnnData]Reference accessor for arrays from graph containers (
A.obsp/A.varp).Examples
>>> from anndata.acc import A, GraphAcc >>> assert isinstance(A.obsp["distances"], GraphAcc) >>> A.obsp["distances"][:, "cell-1"] A.obsp['distances'][:, 'cell-1']
Attributes
Methods
- dims(idx, /)[source]#
Get along which dimensions the referenced array is.
- Return type:
Collection[Literal['obs','var']]
- get(data, idx=NO_IDX, /)[source]#
- Overloads:
self, data (MuData | AnnData) → _XDataType
self, data (MuData | AnnData), idx (Idx2D) → InMemoryArray
Get the indexed array from the AnnData object at
idx.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.