tiledbsoma.ExperimentAxisQuery.to_anndata¶
- ExperimentAxisQuery.to_anndata(X_name: str | ~tiledbsoma._util.Sentinel | None = <tiledbsoma._util.Sentinel object>, *, column_names: ~somacore.query.query.AxisColumnNames | None = None, X_layers: ~collections.abc.Sequence[str] = (), obsm_layers: ~collections.abc.Sequence[str] = (), obsp_layers: ~collections.abc.Sequence[str] = (), varm_layers: ~collections.abc.Sequence[str] = (), varp_layers: ~collections.abc.Sequence[str] = (), drop_levels: bool = False, dask: ~tiledbsoma._dask.util.SOMADaskConfig | None = None, obs_id_name: str | None = None, var_id_name: str | None = None) AnnData¶
Exports the query to an in-memory
AnnDataobject.- Parameters:
X_name – The X layer to read and return in the
Xslot. If unspecified (default), and the measurement contains an X layer named"data", it will be used. IfNone, the returned AnnData will haveX=Noneandlayerswill be unpopulated. If a string, that layer must exist in the measurementXcollection.column_names – The columns in the
varandobsdataframes to read.X_layers – Additional X layers to read and return in the
layersslot.obsm_layers – Additional obsm layers to read and return in the obsm slot.
obsp_layers – Additional obsp layers to read and return in the obsp slot.
varm_layers – Additional varm layers to read and return in the varm slot.
varp_layers – Additional varp layers to read and return in the varp slot.
drop_levels – If true, drop unused categories from the
obsandvardataframes. Defaults toFalse.dask – If not
None, load the X layer as a Dask array. SeeDaskConfigfor details.obs_id_name – If specified, set this column as the index in the
obsdataframe. If not specified, the default index column (see Notes below) will be determined, and set as the dataframe index.var_id_name – If specified, set this column as the index in the
obsdataframe. If not specified, the default index column (see Notes below) will be determined, and set as the dataframe index.
Notes: The default index column for the
obsandvardataframes is determined with the following algorithm:if the index column name is explicitly specified (e.g., via
obs_id_name), it will be used as the index.if the original index column was written to the DataFrame metadata (e.g., during ingestion from AnnData), this will be used as the index.
if the dataframe contains a column named
obs_id(for obs) orvar_id(for var), this will be used as the index.otherwise, the default Pandas index will be used.
Lifecycle: experimental