scllm
A Python package for annotating single-cell RNA sequencing data using Large Language Models.
Overview: LangChain 🤝 scanpy
scllm leverages the power of Large Language Models to automatically annotate cell types in single-cell RNA sequencing data. It integrates seamlessly with scanpy and provides an intuitive interface for cell type annotation, factor analalysis and differential expression analysis based on marker gene expression.
Installation
You can install scllm using pip:
pip install scllm
Or using uv 🚀:
uv pip install scllm
Quick Start
import os
# Enter your API key for ChatGPT
os.environ["OPENAI_API_KEY"] = "Enter your API key here."
import scanpy as sc
import scllm
# Load your data
adata = sc.read_h5ad('your_data.h5ad')
# Perform clustering if not already done
sc.tl.leiden(adata)
# Initialize your LLM (example with OpenAI)
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(temperature=0.0, model="gpt-4o-mini")
# Annotate clusters
adata = scllm.annotate_cluster(adata, 'leiden', llm)
# Access annotations
print(adata.obs['leiden_annotated'])
Features
- Automatic cell type annotation using LLMs
- Seamless integration with scanpy
- Support for multiple LLM providers
- Interactive Jupyter notebook examples
- Customizable annotation parameters
Documentation
For detailed documentation and examples, visit our documentation page.
Check out our example notebooks:
Requirements
- Python ≥ 3.10
- scanpy ≥ 1.11.0
- langchain ≥ 0.3.7
- And other dependencies listed in pyproject.toml
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use scllm in your research, please cite:
@software{vohringer2024scllm,
author = {Vöhringer, Harald},
title = {scllm: Single-Cell Annotation with Large Language Models},
year = {2024},
publisher = {GitHub},
url = {https://github.com/sagar87/scllm}
}
Contact
Harald Vöhringer - harald.voeh@gmail.com
Project Link: https://github.com/sagar87/scllm
Release files for scllm 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scllm-0.2.1.tar.gz | 7.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scllm-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 MB
Release files / scllm-0.2.1.tar.gz
| Download URL | scllm-0.2.1.tar.gz |
|---|---|
| Size | 7.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c53ae3ed6c94934d0d591eeb1c727df0118e2ff739eb0b3442b2dbf9b7b67e94
|
|
BLAKE2b-256 checksum How to use checksums |
ae1a414ee8c01021083b881fef2747529b5a308fe547ba86595047a5a70e4776
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Release files / scllm-0.2.1-py3-none-any.whl
| Download URL | scllm-0.2.1-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0fc06f1bae5381ce21234961bff5e1ad59251c0daadfa91da5786344fd60c77
|
|
BLAKE2b-256 checksum How to use checksums |
62be7f431314c95cbbc7d4de10a06c596f082c2e7e625c974749d1d08cfc75ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|