You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CellAnnotator is an [scverse ecosystem package](https://scverse.org/packages/#ecosystem), designed to annotate cell types in scRNA-seq data based on marker genes using OpenAI models.
20
19
21
-
## Key features
20
+
🧬 CellAnnotator is an [scverse ecosystem package](https://scverse.org/packages/#ecosystem), designed to annotate cell types in scRNA-seq data based on marker genes using large language models (LLMs). It supports OpenAI, Google Gemini, and Anthropic Claude models out of the box, with more providers planned for the future.
22
21
23
-
- Automatically annotate cells including type, state and confidence fields.
24
-
- Generate consistent annotations across samples of your study.
25
-
- Optionally infuse prior knowledge by providing information about your biological system.
26
-
- Retrieve reliable results thanks to [OpenAI structured outputs](https://platform.openai.com/docs/guides/structured-outputs)
27
-
- Use this tool to quickly generate pre-integration cell type labels to either score your integration quality (e.g. [scIB metrics](https://scib-metrics.readthedocs.io/en/stable/)) or to guide your integration effort (e.g. [scPoli](https://docs.scarches.org/en/latest/), [scANVI](https://docs.scvi-tools.org/en/stable/api/reference/scvi.model.SCANVI.html)).
28
22
29
-
Note that this package is based on output generated by large language models and might **sometimes make mistakes**. We use some safeguards, like anchoring the tool in a multi-step process, and using structured output predictions, but mistakes are still possible. We recommend using this tool as a first step in an annotation workflow to generate an initial, coarse set of annotations that must be further refined.
23
+
## ✨ Key Features
30
24
31
-
## Installation
25
+
- 🤖 **LLM-agnostic backend**: Seamlessly use models from OpenAI, Anthropic (Claude), and Gemini (Google) — just set your provider and API key.
26
+
- 🧬 **Automatically annotate cells** including type, state, and confidence fields.
27
+
- 🔄 **Consistent annotations** across all samples in your study.
28
+
- 🧠 **Infuse prior knowledge** by providing information about your biological system.
29
+
- 📦 **Structured outputs** for reliable results (see e.g. [OpenAI structured outputs](https://platform.openai.com/docs/guides/structured-outputs)).
30
+
- 🧩 **Supports datasets with limited feature sets** (e.g., imaging-based spatial transcriptomics): marker gene lists are filtered to the actual gene set in your data.
31
+
- ⚡ **Quickly generate pre-integration cell type labels** to score or guide your integration (e.g. [scIB metrics](https://scib-metrics.readthedocs.io/en/stable/), [scPoli](https://docs.scarches.org/en/latest/), [scANVI](https://docs.scvi-tools.org/en/stable/api/reference/scvi.model.SCANVI.html)).
32
32
33
-
You need to have Python 3.10 or newer installed on your system.
33
+
> ℹ️ **Note:** This package is based on output generated by large language models and might **sometimes make mistakes**. We use some safeguards, like anchoring the tool in a multi-step process, and using structured output predictions, but mistakes are still possible. We recommend using this tool as a first step in an annotation workflow to generate an initial, coarse set of annotations that must be further refined.
34
+
35
+
36
+
## 📦 Installation
37
+
You need to have 🐍 Python 3.10 or newer installed on your system.
34
38
If you don't have Python installed, we recommend installing [Mambaforge][].
35
39
36
-
### PyPI
37
40
41
+
### 🚀 PyPI
38
42
Install by running:
39
43
40
44
```bash
41
45
pip install cell-annotator
42
46
```
43
47
44
-
### Development version
45
48
49
+
### 🛠️ Development version
46
50
To install the latest development version from [GitHub](https://github.com/quadbio/cell-annotator), run
🔒 Keep this key private and don't share it with anyone. `CellAnnotator` will try to read the key as an environmental variable - either expose it to the environment yourself, or store it as an `.env` file anywhere within the repository where you conduct your analysis and plan to run `CellAnnotator`. The package will then use [dotenv](https://pypi.org/project/python-dotenv/) to export the key from the `env` file as an environmental variable.
55
66
56
-
Keep this key private and don't share it with anyone. `CellAnnotator` will try to read the key as an environmental variable - either expose it to the environment yourself, or store it as an `.env` file anywhere within the repository where you conduct your analysis and plan to run `CellAnnotator`. The package will then use [dotenv](https://pypi.org/project/python-dotenv/) to export the key from the `env` file as an environmental variable.
57
67
58
68
Here's the simplest way to annotate your data:
59
69
@@ -65,25 +75,39 @@ cell_ann = CellAnnotator(
65
75
).annotate_clusters()
66
76
```
67
77
68
-
By default, this will store annotations in `adata.obs['cell_type_predicted']`. Head over to our [tutorials](https://cell-annotator.readthedocs.io/en/latest/notebooks/tutorials/index.html) to see more advanced use cases, and learn how to adapt this to your own data. You can run `CellAnnotator` for just a single sample of data, or across multiple samples. In the latter case, it will attempt to harmonize annotations across samples.
69
78
70
-
## Costs and models
79
+
By default, this will store annotations in `adata.obs['cell_type_predicted']`. Head over to our 📚 [tutorials](https://cell-annotator.readthedocs.io/en/latest/notebooks/tutorials/index.html) to see more advanced use cases, and learn how to adapt this to your own data. You can run `CellAnnotator` for just a single sample of data, or across multiple samples. In the latter case, it will attempt to harmonize annotations across samples.
80
+
81
+
71
82
72
-
The default model is currently `gpt-4o-mini`, which is included in [OpenAI's Free Usage Tier](https://platform.openai.com/docs/guides/rate-limits). Thus, you can get started for free and experiment with our [tutorials](https://cell-annotator.readthedocs.io/en/latest/notebooks/tutorials/index.html) and with your own data. If you want to get accurate cell type labels for complex tissues, we strongly recommend using more powerful models, like `gpt-4o`, `gpt-4.1`, etc, or reasoning models like `o3-mini`, for which you will have to pay a small fee to OpenAI. As an orientation, running both tutorials with `o3-mini` will cost around 1 USD. Take a look at the [OpenAI API docs](https://platform.openai.com/docs/models) to learn more about the different available models.
83
+
## 💸 Costs and models
84
+
CellAnnotator is LLM-agnostic and works with multiple providers:
73
85
74
-
## Data privacy
86
+
-**OpenAI (GPT models):** The default model is currently `gpt-4o-mini`, which is included in [OpenAI's Free Usage Tier](https://platform.openai.com/docs/guides/rate-limits). You can get started for free and experiment with our 📚 [tutorials](https://cell-annotator.readthedocs.io/en/latest/notebooks/tutorials/index.html) and your own data. For more accurate cell type labels in complex tissues, we recommend more powerful models like `gpt-4o`, `gpt-4.1`, or reasoning models like `o3-mini` (these may incur a small fee; e.g., running both tutorials with `o3-mini` costs around 1 USD). See the [OpenAI API docs](https://platform.openai.com/docs/models) for details.
75
87
76
-
This package sends cluster marker genes to OpenAI, but no actual gene expression values. In addition, it sends the `species` and `tissue` you define. Make sure your usage of this package aligns with your institutions guidelines on data privacy and AI models.
88
+
-**Google Gemini:** Gemini models are supported and have their own free tier and pricing. See the [Gemini API docs](https://ai.google.dev/gemini-api/docs/models) for available models and costs.
77
89
78
-
## Credits
90
+
-**Anthropic Claude:** Claude models are supported. See the [Anthropic pricing page](https://docs.anthropic.com/claude/docs/pricing) for details.
79
91
92
+
You can select your provider and model by setting the appropriate parameters. More providers may be supported in the future as the LLM ecosystem evolves.
93
+
94
+
95
+
96
+
## 🔐 Data privacy
97
+
This package sends cluster marker genes, and the `species` and `tissue` you define, to the selected LLM provider (e.g., OpenAI, Google, or Anthropic). **No actual gene expression values are sent.**
98
+
99
+
Please ensure your usage of this package aligns with your institution's guidelines on data privacy and the use of external AI models. Each provider has its own privacy policy and terms of service. Review these carefully before using CellAnnotator with sensitive or regulated data.
100
+
101
+
102
+
## 🙏 Credits
80
103
This tool was inspired by [Hou et al., Nature Methods 2024](https://www.nature.com/articles/s41592-024-02235-4) and [https://github.com/VPetukhov/GPTCellAnnotator](https://github.com/VPetukhov/GPTCellAnnotator).
81
104
82
-
## Contact
83
105
106
+
## 📬 Contact
84
107
If you found a bug, please use the [issue tracker][].
85
108
86
-
## Citation
109
+
110
+
## 📖 Citation
87
111
Please use our [zenodo][] entry to cite this software.
0 commit comments