Is your feature request related to a problem? Please describe.
Some analytical pipelines, specially those that relate to visualizations rely on the categories of pandas.Categorical. In the case of large SOMAExperiments, many times a query will result on unused categories for potentially many columns of obs or var, thus the user needs to always iterate on all columns and perform a cat.remove_unused_categories() operation.
Is your feature request related to a problem? Please describe. Some analytical pipelines, specially those that relate to visualizations rely on the categories of
pandas.Categorical
. In the case of large SOMAExperiments, many times a query will result on unused categories for potentially many columns ofobs
orvar
, thus the user needs to always iterate on all columns and perform acat.remove_unused_categories()
operation.See for example this reproducible example
Only one
"tissue"
was selected but all hundreds of tissues are drawn in the umapDescribe the solution you'd like
ExperimentAxisQuery.to_anndata()
returns an anndata with unused categories already removed in the axis data frames