get_descriptive_stats
Compute descriptive statistics like count, mean, std, min, max for AnnData attributes, with optional filtering and value counts for categorical columns.
Instructions
Provide basic descriptive statistics (e.g., count, mean, std, min, max, etc. or value counts) for an attribute or attribute value of an optionally filtered AnnData object.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | The key of the attribute value to explore. Can be a single string or a list of strings for nested key retrieval (e.g., ['key1', 'key2'] to access attr_obj['key1']['key2']). Should be None for attributes X, obs, and var. | |
| path | Yes | Absolute path or URL to the AnnData file (.h5ad or .zarr) | |
| attribute | Yes | The attribute to describe | |
| filter_value | No | The value(s) to filter by. | |
| filter_column | No | The column name of the obs or var dataframe to filter by. | |
| filter_operator | No | The operator to use for the filter. | |
| columns_or_genes | No | The columns or genes to describe. For pandas.DataFrame attributes (e.g., obs, var), these are column names. For 'X' or 'layers' attributes, these are gene names (from var_names). If None, the entire dataset is considered. Also accepts glob-like patterns as input, e.g. ['RE*', 'CD4*']. | |
| filter_attribute | No | The attribute to filter by. One of 'obs' or 'var' or None for no filtering. Has to be provided TOGETHER with filter_column, filter_operator, and filter_value. | |
| return_value_counts_for_categorical | No | Whether to return the value counts for categorical columns. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | Yes | Any error message | |
| description | Yes | The description of the attribute value | |
| value_counts | Yes | The value counts for the attribute value |