Installation¤
DiffBio requires Python 3.11+ and works on Linux, macOS, and Windows (via WSL).
Quick Install¤
Install DiffBio from PyPI:
Install from Source¤
For the latest development version:
Using uv (Recommended)¤
If you use uv for faster package management:
Or for development:
Dependencies¤
DiffBio depends on the following core packages:
| Package | Purpose |
|---|---|
| JAX | Automatic differentiation and XLA compilation |
| Flax | Neural network library for JAX |
| Datarax | Composable data pipeline framework |
| jaxtyping | Type annotations for JAX arrays |
GPU Support¤
For GPU acceleration, install JAX with CUDA support:
Verify GPU is available:
Verify Installation¤
import diffbio
from diffbio.operators.alignment import SmoothSmithWaterman, SmithWatermanConfig
from diffbio.operators.alignment import create_dna_scoring_matrix
print(f"DiffBio version: {diffbio.__version__}")
# Test operator creation
config = SmithWatermanConfig(temperature=1.0)
scoring = create_dna_scoring_matrix(match=2.0, mismatch=-1.0)
aligner = SmoothSmithWaterman(config, scoring_matrix=scoring)
print("Installation successful!")
Development Installation¤
For contributing to DiffBio:
git clone https://github.com/avitai/DiffBio.git
cd DiffBio
# Install with all development dependencies
pip install -e ".[dev,docs]"
# Install pre-commit hooks
pre-commit install
Running Tests¤
Building Documentation¤
Troubleshooting¤
Common Issues¤
JAX not using GPU:
Check that CUDA is properly installed and JAX can see it:
Import errors:
Ensure all dependencies are installed:
Memory issues with large sequences:
DiffBio operators use JAX's XLA compilation which can be memory-intensive for very long sequences. Consider:
- Using smaller batch sizes
- Chunking long sequences
- Enabling memory-efficient attention patterns
For additional help, please open an issue on GitHub.