Annsel is a user-friendly library that brings familiar dataframe-style operations to AnnData
objects.
It's built on the narwhals compatibility layer for dataframes.
Take a look at the GitHub Projects board for features and future plans: Annsel Features
Please refer to the documentation, in particular, the API documentation.
You need to have Python 3.10 or newer installed on your system. If you don't have
Python installed, we recommend installing uv.
There are several ways to install annsel
:
-
Install the most recent release:
With
uv
:uv add annsel
With
pip
:pip install annsel
-
Install the latest development version:
With
uv
:uv add git+https://github.com/srivarra/annsel
With
pip
:pip install git+https://github.com/srivarra/annsel.git@main
import annsel as an
adata=an.datasets.leukemic_bone_marrow_dataset()
adata.an.filter(
obs=(
an.col(["Cell_label"]).is_in(["Classical Monocytes", "CD8+CD103+ tissue resident memory T cells"]),
an.col(["sex"]) == "male",
),
var=an.col(["vst.mean"]) >= 3,
)
adata.an.select(
obs=an.col(["Cell_label"]),
var=an.col(["vst.mean", "vst.std"]),
)
adata.an.group_by(
obs=an.col(["Cell_label"]),
var=an.col(["feature_type"]),
return_group_names=True,
)
See the changelog.
For questions and help requests, you can reach out in the scverse discourse or the discussions tab. If you found a bug, please use the issue tracker.
Varra, S. R. annsel [Computer software]. https://github.com/srivarra/annsel