Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,48 @@ sphinx:
# install:
# - requirements: docs/requirements.txt

# Declare the Python requirements required to build your documentation
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt

# Declare the Python requirements required to build your documentation
python:
install:
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Code License: Apache 2.0](https://img.shields.io/badge/license-Apache%20License%202.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)
[![PyPI version](https://badge.fury.io/py/cell2sentence.svg)](https://badge.fury.io/py/cell2sentence)
[![DOI:10.1101/2025.04.14.648850](http://img.shields.io/badge/DOI-10.1101/2025.04.14.648850-B31B1B.svg)](https://doi.org/10.1101/2025.04.14.648850)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/release/python-310020/)

![cell2sentence workflow image](c2s_overview_figure.png)

Expand Down Expand Up @@ -47,7 +47,7 @@ git clone https://github.com/vandijklab/cell2sentence.git

Navigate a terminal into the root of the repository. Next, create an Anaconda environment using `python3` using [anaconda](https://docs.anaconda.com/anaconda/install/) with:
```bash
conda create -n cell2sentence python=3.8
conda create -n cell2sentence python=3.10
```

Next, activate the environment:
Expand All @@ -62,7 +62,7 @@ make install

This will install the latest development environment of cell2sentence, along with other pacakge dependendies. You can also install cell2sentence itself using `pip`:
```bash
pip install cell2sentence==1.1.0
pip install cell2sentence==1.2.0
```

The C2S package will allow usage of the core functionalities of C2S, including inference using existing C2S models and finetuning your own C2S models on your own datasets.
Expand All @@ -86,6 +86,10 @@ The following notebooks provide guides on common workflows with C2S models. For
| [c2s_tutorial_4_cell_type_prediction.ipynb](tutorials/c2s_tutorial_4_cell_type_prediction.ipynb) | Cell type prediction using C2S models
| [c2s_tutorial_5_cell_generation.ipynb](tutorials/c2s_tutorial_5_cell_generation.ipynb) | Cell generation conditioned on cell type
| [c2s_tutorial_6_cell_annotation_with_foundation_model.ipynb](tutorials/c2s_tutorial_6_cell_annotation_with_foundation_model.ipynb) | Cell type annotation with foundation model
| [c2s_tutorial_7_custom_prompt_templates.ipynb](tutorials/c2s_tutorials_7_custom_prompt_templates.ipynb) | Custom Prompt Templates with C2S PromptFormatter class
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

| [c2s_tutorial_8_multi_cell_tissue_prediction.ipynb](tutorials/c2s_tutorial_8_multi_cell_tissue_prediction.ipynb) | Classifying the Tissue based on Multiple cell sentences
| [c2s_tutorial_9_natural_language_interpretation.ipynb](tutorials/c2s_tutorial_9_natural_language_interpretation.ipynb) | Use the C2S model to generate insightful summaries for different sets of cells
| [c2s_tutorial_10_perturbation_response_prediction.ipynb](tutorials/c2s_tutorial_10_perturbation_response_prediction.ipynb)|


## Model Zoo
Expand All @@ -111,7 +115,7 @@ each explain which model they use.
- [x] Add tutorial notebooks for main C2S workflows: cell type prediction, cell generation
- [x] Add multi-cell prompt formatting
- [ ] Add support for legacy C2S-GPT-2 model prompts
- [ ] Add parameter-efficient finetuning methods (LoRA)
- [x] Add parameter-efficient finetuning methods (LoRA)


## License
Expand Down
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ help:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Example: sphinx-build -M html docs/source/ docs/build/

1 change: 1 addition & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ goto end

:end
popd

23 changes: 23 additions & 0 deletions docs/source/csmodel.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@

A CSModel object is a wrapper around a Cell2Sentence model, which tracks the path of the model
saved on disk. When needed, the model is loaded from the path on disk for inference or finetuning.
The class contains utilities for model generation and cell embedding with a Huggingface backend.

.. autofunction:: csmodel.CSModel

.. autofunction:: csmodel.CSModel.__init__

.. autofunction:: csmodel.CSModel.__str__

.. autofunction:: csmodel.CSModel.fine_tune

.. autofunction:: csmodel.CSModel.generate_from_prompt

.. autofunction:: csmodel.CSModel.generate_from_prompt_batched

.. autofunction:: csmodel.CSModel.embed_cell

.. autofunction:: csmodel.CSModel.embed_cells_batched

.. autofunction:: csmodel.CSModel.push_model_to_hub
=======
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This is resolved in latest commit

CSModel
=======

Expand Down
91 changes: 48 additions & 43 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
[metadata]
name = cell2sentence
version = 1.2.0
author = Syed Asad Rizvi
author_email = [email protected]
description = Cell2Sentence: Single-cell Analysis With LLMs
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/vandijklab/cell2sentence
license = 'BY-NC-ND'
project_urls =
Bug Tracker = https://github.com/vandijklab/cell2sentence/issues
classifiers =
Programming Language :: Python :: 3
Development Status :: 2 - Pre-Alpha
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.7
install_requires =
torch
transformers
datasets
anndata
scanpy
numpy
pandas
scipy
tqdm
scikit-learn
jupyterlab
accelerate
plotnine
sphinx
sphinx-rtd-theme

[options.packages.find]
where = src

[options.package_data]
[metadata]
name = cell2sentence
version = 1.2.0
author = Syed Asad Rizvi
author_email = [email protected]
description = Cell2Sentence: Single-cell Analysis With LLMs
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/vandijklab/cell2sentence
license = 'BY-NC-ND'
project_urls =
Bug Tracker = https://github.com/vandijklab/cell2sentence/issues
classifiers =
Programming Language :: Python :: 3
Development Status :: 2 - Pre-Alpha
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.10
install_requires =
torch
transformers
peft
bitsandbytes
datasets
anndata
Comment on lines +23 to +29
scanpy
numpy
pandas
scipy
tqdm
scikit-learn
jupyterlab
accelerate
plotnine
sphinx
sphinx-rtd-theme
tiktoken
sentencepiece
protobuf

[options.packages.find]
where = src

[options.package_data]
* = *.json
Loading
Loading