Skip to content

Commit 1711b83

Browse files
committed
Initial release: GPU-accelerated RCTD for spatial transcriptomics
JAX reimplementation of spacexr RCTD with 63x GPU speedup and 99.7% agreement with R on 58k Xenium pixels. Supports full, doublet, and multi deconvolution modes.
0 parents  commit 1711b83

36 files changed

Lines changed: 5211 additions & 0 deletions

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.12
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install ruff
22+
run: pip install ruff
23+
24+
- name: Check linting
25+
run: ruff check src/ tests/
26+
27+
- name: Check formatting
28+
run: ruff format --check src/ tests/

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: pypi
11+
permissions:
12+
id-token: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Python 3.12
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install build tools
25+
run: pip install build twine
26+
27+
- name: Build package
28+
run: python -m build
29+
30+
- name: Validate distribution
31+
run: twine check dist/*
32+
33+
- name: Publish to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: pip install ".[dev]"
26+
27+
- name: Run tests
28+
run: pytest tests/ -v --cov=rctd --cov-report=xml
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
files: ./coverage.xml

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Virtual environments
2+
.venv/
3+
.env/
4+
5+
# Python
6+
__pycache__/
7+
*.pyc
8+
*.pyo
9+
*.egg-info/
10+
dist/
11+
build/
12+
13+
# Testing
14+
.pytest_cache/
15+
htmlcov/
16+
.coverage
17+
coverage.xml
18+
19+
# Data (large reference/validation files)
20+
data/
21+
22+
# R reference validation data
23+
scripts/r_reference/
24+
25+
# Package data (generated at build time)
26+
src/rctd/data/
27+
28+
# IDE
29+
.vscode/
30+
.idea/
31+
32+
# OS
33+
.DS_Store
34+
Thumbs.db
35+
36+
# SLURM / HPC
37+
*.log
38+
*.err
39+
/scratch/
40+
41+
# Build artifacts
42+
*.knit.md
43+
*.html
44+
45+
# Lock files
46+
uv.lock
47+
48+
# Generated version file
49+
src/rctd/_version.py

CITATION.cff

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cff-version: 1.2.0
2+
title: "rctd-py: GPU-accelerated RCTD for spatial transcriptomics"
3+
message: >-
4+
If you use this software, please cite the original
5+
spacexr RCTD paper.
6+
type: software
7+
authors:
8+
- given-names: Paul
9+
family-names: Gueguen
10+
license: GPL-3.0-or-later
11+
repository-code: "https://github.com/p-gueguen/rctd-py"
12+
keywords:
13+
- spatial-transcriptomics
14+
- deconvolution
15+
- single-cell
16+
- JAX
17+
- GPU
18+
references:
19+
- type: article
20+
title: "Robust decomposition of cell type mixtures in spatial transcriptomics"
21+
authors:
22+
- given-names: Dylan M
23+
family-names: Cable
24+
- given-names: Evan
25+
family-names: Murray
26+
- given-names: Luli S
27+
family-names: Zou
28+
- given-names: Aleksandrina
29+
family-names: Goeva
30+
- given-names: Evan Z
31+
family-names: Macosko
32+
- given-names: Fei
33+
family-names: Chen
34+
journal: "Nature Biotechnology"
35+
volume: 40
36+
start: 517
37+
end: 526
38+
year: 2022
39+
doi: "10.1038/s41587-021-00830-w"

0 commit comments

Comments
 (0)