wsidata.concat_feature_anndata#

concat_feature_anndata(slides_table, feature_key, tile_key, wsi_col=None, store_col=None, pbar=False, error='raise', as_anncollection=False)#

Aggregates features from multiple slides into an AnnData or AnnCollection object.

This function collects and combines data from slide datasets specified in a given table, allowing flexible aggregation by feature and tile keys.

Parameters:
slides_tablepandas.DataFrame

The dataframe specifying slides to aggregate, their feature and tile keys, as well as optional storage or WSI column information.

feature_keystr

Key or identifier for the feature within the datasets. Details should be specific to the slide data format.

tile_keystr

Key or identifier for the tile data within the datasets. Details should be specific to the data structure.

wsi_colstr, optional

Optional name of the column in the table that contains whole slide image (WSI) paths. Either wsi_col or store_col must be provided.

store_colstr, optional

Optional name of the column specifying storage information for slides. Either store_col or wsi_col is required.

pbarbool, default False

A flag to toggle progress bar visibility during processing.

error{“raise”, “skip”}, default “raise”

Policy for error handling during individual slide aggregation. Valid options are “raise” to terminate on error or “skip” to skip files with errors.

as_anncollectionbool, default False

Flag to determine if the return type is an AnnCollection object instead of a concatenated AnnData object. If True, returns AnnCollection.

Returns:
AnnData or AnnCollection

Aggregated data from slides either as an AnnData or AnnCollection object, depending on the value of as_anncollection.