locate#

adata_query._core._locator.locate(adata: AnnData, key: str) str[source]#

Given adata and a key that points to a specific matrix stored in adata, return the data, formatted either as np.ndarray or torch.Tensor. If formatted as torch.Tensor, device may be specified based on available devices.

Parameters:
  • adata (anndata.AnnData) – The [annotated] single-cell data matrix of shape: [n_obs × n_vars]. Rows correspond to cells and columns to genes. [1].

  • key (str) – Key to access a matrix in adata. For example, if you wanted to access adata.obsm['X_pca'], you would pass: "X_pca".

Returns:

Attribute of adata containing the passed key.

Return type:

str

References#

  1. https://anndata.readthedocs.io/en/latest/.