fetch
Fetch data from AnnData, flexibly.
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.
Uses the class: adata_query._core.AnnDataFetcher.
data = fetch(
adata: anndata.AnnData,
key: str,
groupby: Optional[str] = None,
torch: bool = False,
device: torch.device = autodevice.AutoDevice(),
as_dict: bool = True,
*args,
**kwargs,
)Source code: GitHub.com/mvinyard/AnnDataQuery/adata_query/_core/_fetcher.py
Last updated