Development Guide#

Contributing to WASP2#

We welcome contributions! This guide helps you get started.

Development Setup#

Clone Repository#

git clone https://github.com/Jaureguy760/WASP2-exp
cd WASP2-exp

Install Development Dependencies#

pip install -e ".[dev]"

This installs: * pytest (testing) * mypy (type checking) * black (code formatting) * flake8 (linting) * pre-commit (git hooks)

Install Pre-commit Hooks#

pre-commit install

Hooks run automatically before each commit: * Black formatting * Flake8 linting * mypy type checking * Quick tests

Code Standards#

Type Hints#

WASP2 has 100% type hint coverage. All new code must include type hints:

def count_alleles(
    bam_file: str,
    vcf_file: str,
    min_count: int = 10
) -> pd.DataFrame:
    """Count alleles from BAM file."""
    ...

Formatting#

Use Black with 100-character lines:

black src/ --line-length=100

Linting#

Pass Flake8 checks:

flake8 src/ --max-line-length=100

Testing#

Run Tests Locally#

# All tests
pytest tests/ -v

# Fast tests only (skip slow integration tests)
pytest tests/ -v -m "not slow"

# With coverage
pytest tests/ --cov=src --cov-report=html

Test Requirements#

  • All new features need tests

  • Maintain >80% code coverage

  • Tests must pass in CI before merge

Type Checking#

Run mypy:

mypy src/counting/ src/mapping/ src/analysis/

All code must pass mypy with 0 errors.

CI/CD Pipeline#

GitHub Actions#

Tests run automatically on every push: * Python 3.10 and 3.11 * Type checking (mypy) * Unit tests (pytest) * Full pipeline validation * Documentation build

CI must pass before PR can be merged.

Pre-commit Hooks#

Local checks before commit: * Code formatting * Type checking * Quick tests

To bypass (not recommended):

git commit --no-verify

Pull Request Process#

1. Fork & Branch#

git checkout -b feature/my-feature

2. Develop & Test#

# Make changes
vim src/analysis/my_feature.py

# Add type hints
# Write tests
# Run locally
pytest tests/ -v
mypy src/

3. Commit#

git add src/analysis/my_feature.py tests/test_my_feature.py
git commit -m "Add my feature"

# Pre-commit hooks run automatically

4. Push & PR#

git push origin feature/my-feature

# Open PR on GitHub
# CI will run automatically
# Request review

Code Review#

PRs are reviewed for: * Correctness * Type safety * Test coverage * Documentation * Code style

Project Structure#

WASP2-exp/
├── src/
│   ├── counting/       # Allele counting
│   ├── mapping/        # WASP remapping
│   └── analysis/       # Statistical analysis
├── tests/
│   └── regression/     # Regression tests
├── docs/               # Sphinx documentation
├── scripts/            # Utility scripts
├── baselines/          # Test baselines
└── test_data/          # Example data

Building Documentation#

cd docs
make html
open build/html/index.html

Documentation must build without warnings.

Release Process#

  1. Update version in pyproject.toml

  2. Update docs/source/changelog.rst

  3. Merge to main

  4. Tag release: git tag v1.1.0

  5. Push tag: git push origin v1.1.0

  6. Publish to PyPI: python -m build && twine upload dist/*

AI-Assisted Development#

WASP2 pipeline development benefits from AI tooling. See the full integration guide: Seqera AI Development Integration

Tool Selection#

  • Architecture and design → Claude Code

  • Nextflow DSL2 syntax → Seqera AI

  • nf-test generation → Seqera AI

  • Environment validationnextflow run . -profile test -preview

Getting Help#

License#

WASP2 is released under the MIT License. See LICENSE file.