Skip to main content

scllm is a Python package for single-cell analysis using LLMs.

Project description

scllm

A Python package for annotating single-cell RNA sequencing data using Large Language Models.

PyPI version Documentation License: MIT

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scllm-0.1.4.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scllm-0.1.4-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file scllm-0.1.4.tar.gz.

File metadata

  • Download URL: scllm-0.1.4.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for scllm-0.1.4.tar.gz
Algorithm Hash digest
SHA256 19377920a162cdc4d936078aac471d2bca6a397a88f5196fb4f867e236efe8a5
MD5 18732c9e864a1d5e8892b63d830b0511
BLAKE2b-256 07e69f7a6282f76e6be88d318341dee8b8024854f8426438d77fd240386e041f

See more details on using hashes here.

File details

Details for the file scllm-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: scllm-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for scllm-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f780cc0283d5b25d8fbc53d8aa30ac0ad78511adf6b55b01dce71404d9fed07
MD5 87a9379ea67bfecfb5544445ab176214
BLAKE2b-256 9d4bb3b64048e72744148b9d40f7cf47b817ebd33942d36e8c039541d6130472

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page