Thank you for your interest in contributing to VariDex! This document provides guidelines for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Code Standards
- Testing
- Submitting Changes
- Licensing
Please be respectful and constructive in all interactions. We're building a professional tool for genomic analysis.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/VariDex.git cd VariDex - Create a branch for your changes:
git checkout -b feature/your-feature-name
- Python 3.9 or higher
- pip and setuptools
- Git
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e .
pip install -r requirements-test.txt
# Install pre-commit hooks (optional)
pip install pre-commit
pre-commit install- Black for code formatting (88-character line limit)
- Flake8 for style checking
- mypy for type checking
# Format code
black varidex/ tests/
# Check formatting
black --check varidex/ tests/
# Run linter
flake8 varidex/ tests/
# Type check
mypy varidex/- Type Hints: All new functions must have type hints
- Docstrings: Use Google-style docstrings for all public functions
- Line Length: Maximum 88 characters (Black standard)
- Imports: Organize imports alphabetically, standard library first
- Naming:
- Classes:
PascalCase - Functions/variables:
snake_case - Constants:
UPPER_SNAKE_CASE
- Classes:
def classify_variant(
variant: Variant,
evidence: Dict[str, Any],
config: ClassifierConfig,
) -> ClassificationResult:
"""Classify a variant using ACMG guidelines.
Args:
variant: Variant to classify
evidence: Dictionary of evidence criteria
config: Classifier configuration
Returns:
Classification result with pathogenicity and evidence
Raises:
ValidationError: If variant data is invalid
"""
# Implementation here
pass# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=varidex --cov-report=term --cov-report=html
# Run specific test file
pytest tests/test_classifier.py
# Run specific test
pytest tests/test_classifier.py::test_variant_classification- Location: Place tests in
tests/directory - Naming: Test files must start with
test_ - Coverage: Aim for 90%+ coverage for new code
- Types of Tests:
- Unit tests (fast, isolated)
- Integration tests (with markers)
- Property-based tests (Hypothesis)
import pytest
from varidex.core.classifier import ACMGClassifier
def test_pathogenic_classification():
"""Test classification of known pathogenic variant."""
classifier = ACMGClassifier()
variant = create_test_variant("pathogenic")
result = classifier.classify(variant)
assert result.classification == "Pathogenic"
assert "PVS1" in result.evidence- Run all tests:
pytest tests/ - Check formatting:
black --check varidex/ tests/ - Check types:
mypy varidex/ - Update documentation if needed
- Add tests for new features
- Push your branch to your fork
- Create a Pull Request on GitHub
- Fill out the PR template completely
- Wait for CI/CD checks to pass
- Respond to review feedback
<type>: <description>
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- test: Test additions/changes
- refactor: Code restructuring
- perf: Performance improvements
- ci: CI/CD changes
feat: Add PP3 computational prediction criteriafix: Correct gnomAD allele frequency thresholddocs: Update ACMG implementation guidetest: Add edge case tests for ClinVar loader
By contributing to VariDex, you agree that your contributions will be licensed under:
- AGPL-3.0-or-later for open-source use
- Available under Commercial License for proprietary use
See LICENSE and COMMERCIAL_LICENSE.md for details.
For significant contributions, you may be asked to sign a CLA to ensure:
- Your right to contribute the code
- Our right to distribute your contributions under our dual license
If you have questions about contributing:
- Check existing Issues
- Review project Documentation
- Open a new issue with the
questionlabel
# 1. Setup
git checkout -b feature/my-feature
pip install -e .
pip install -r requirements-test.txt
# 2. Develop
# ... write code ...
# 3. Format & Check
black varidex/ tests/
flake8 varidex/ tests/
mypy varidex/
# 4. Test
pytest tests/ --cov=varidex
# 5. Commit & Push
git add .
git commit -m "feat: Add new feature"
git push origin feature/my-feature
# 6. Create PR on GitHubThank you for contributing to VariDex! 🧬