Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches: [master, main, rust-optimization]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Create virtualenv and install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install maturin pytest pytest-cov
pip install numpy "pandas>=1.5,<2.0" "polars>=0.19" scipy pysam pybedtools "anndata>=0.8,<0.10" typer rich

- name: Build Rust extension
run: |
source .venv/bin/activate
maturin develop --release -m rust/Cargo.toml

- name: Run tests with coverage
run: |
source .venv/bin/activate
pytest tests/ --cov=src --cov-report=xml --cov-report=term-missing
env:
PYTHONPATH: ${{ github.workspace }}/src

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install linters
run: |
pip install black flake8

- name: Check formatting
run: black --check src/ tests/ || true

- name: Lint
run: flake8 src/ tests/ --max-line-length=120 --ignore=E501,W503 || true

rust-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Check Rust
run: |
cd rust
cargo check
cargo clippy -- -D warnings || true
cargo fmt --check || true
57 changes: 57 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Deploy Docs

on:
push:
branches: [master, main, v1.2.0-transfer]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc

- name: Install dependencies
run: |
pip install sphinx pydata-sphinx-theme sphinx-autodoc-typehints
pip install numpy pandas polars scipy typer rich

- name: Build docs
run: |
cd docs
make html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
130 changes: 130 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: WASP2 Tests

on:
push:
branches: [main, claude/**]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
bcftools \
bedtools \
samtools \
time

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov mypy
pip install numpy pandas polars scipy
pip install pysam pybedtools anndata scanpy
pip install typer rich
pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
pip install build twine

- name: Verify installations
run: |
python --version
bcftools --version | head -1
bedtools --version
samtools --version | head -1
mypy --version
pytest --version

- name: Run mypy type checking
run: |
echo "Type checking counting module..."
mypy src/counting/ --ignore-missing-imports
echo "Type checking mapping module..."
mypy src/mapping/ --ignore-missing-imports
echo "Type checking analysis module..."
mypy src/analysis/ --ignore-missing-imports
echo "✅ All type checks passed!"

- name: Run regression tests
run: |
echo "Running WASP2 regression test suite..."
python -m pytest tests/regression/ -v --tb=short

- name: Run full pipeline validation
run: |
echo "Validating full WASP2 pipeline..."
bash scripts/run_full_pipeline_baseline.sh
echo "✅ Full pipeline validation complete!"

- name: Check test coverage
run: |
pytest tests/regression/ --cov=src --cov-report=term-missing --cov-report=xml

- name: Upload coverage to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml
retention-days: 7

- name: Test package installation
run: |
echo "Testing pip installation..."
pip install -e .
wasp2-count --version
wasp2-map --version
wasp2-analyze --version
echo "✅ Package installation successful!"

- name: Build package
run: |
echo "Building distribution packages..."
python -m build
twine check dist/*
echo "✅ Package build successful!"

- name: Build documentation
run: |
echo "Building Sphinx documentation..."
cd docs
make clean html
echo "✅ Documentation build successful!"

- name: Check docs for warnings
run: |
echo "Checking documentation for warnings..."
cd docs
make clean html 2>&1 | tee build.log
# Count warnings (excluding network-related intersphinx warnings)
warning_count=$(grep -i "WARNING" build.log | grep -v "intersphinx" | wc -l)
error_count=$(grep -i "ERROR" build.log | wc -l)
if [ "$error_count" -gt 0 ]; then
echo "❌ Documentation has $error_count errors!"
exit 1
fi
if [ "$warning_count" -gt 0 ]; then
echo "⚠️ Documentation has $warning_count warnings (excluding intersphinx)"
echo "Warnings:"
grep -i "WARNING" build.log | grep -v "intersphinx"
else
echo "✅ Documentation has no warnings!"
fi
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

All notable changes to WASP2 will be documented in this file.

## [1.1.0] - 2024-11-24

### Added
- **Rust acceleration** for counting, mapping, and analysis modules (10-50x speedup)
- PyO3 bindings for seamless Python-Rust integration
- Multi-threaded BAM processing via `WASP2_RUST_THREADS` env var
- GitHub Pages documentation with PyData theme
- Validation scripts for parity testing

### Changed
- CLI now routes through Rust by default (no Python fallback for core operations)
- Updated to maturin-based build system for wheel packaging
- Modernized Sphinx docs with autodoc API generation

### Fixed
- Memory efficiency improvements in large BAM processing
- Consistent allele counting behavior across threads

## [1.0.0] - 2024-09-01

### Added
- Initial release
- Allele-specific read counting from BAM files
- WASP mapping bias correction algorithm
- Beta-binomial allelic imbalance analysis
- Single-cell allele counting support
- CLI tools: `wasp2-count`, `wasp2-map`, `wasp2-analyze`
Loading
Loading