Installation¶
Overview¶
There are three ways to install OpenSpliceAI: via pip, through conda, or from source. OpenSpliceAI requires Python 3.9 or higher and depends on several third‐party packages, including:
PyTorch – used for deep learning model training and inference. See the PyTorch website for more details.
mappy – provides Python bindings for minimap2, enabling fast genomic alignments. Visit its page on PyPI for further information.
Prerequisites¶
Python: Version 3.9 or higher.
Ensure that your system has the necessary compilers.
For GPU acceleration (when using PyTorch), install the required NVIDIA drivers and CUDA toolkit:
NVIDIA GPU Drivers: Visit the official NVIDIA Driver Downloads page:
CUDA Toolkit: Download the latest CUDA Toolkit from the official CUDA downloads page. For detailed installation instructions, please refer to the CUDA Installation Guide.
Installation Methods¶
Install through pip¶
OpenSpliceAI is available on PyPI. Pip automatically resolves and installs all required dependencies.
pip install openspliceai
This command installs third‐party libraries including:
Software dependency
python >= 3.9.0
h5py >= 3.9.0
numpy >= 1.24.4
gffutils >= 0.12
pysam >= 0.22.0
pandas >= 1.5.3
pyfaidx >= 0.8.1.1
tqdm >= 4.65.2
torch >= 2.2.1
scikit-learn >= 1.4.1.post1
biopython >= 1.83
matplotlib >= 3.8.3
psutil >= 5.9.2
mappy >= 2.28
Version Warning
If your numpy version is >= 1.25.0, it requires Python >= 3.9. For further guidance, please refer to the scientific python ecosystem coordination guideline SPEC 0.
Install through conda¶
Installing via conda is the easiest way to set up a sandboxed environment with all dependencies.
OpenSpliceAI is distributed on the Bioconda channel, so make sure
both the conda-forge and bioconda channels are enabled:
conda install -c conda-forge -c bioconda openspliceai
This command installs OpenSpliceAI and its dependencies, including PyTorch and mappy. To install or update these packages individually, you can use:
For PyTorch:
# CPU-only version (Conda packages are no longer available):
pip3 install torch --index-url https://download.pytorch.org/whl/cpu
# For GPU support (Conda packages are no longer available):
pip3 install torch --index-url https://download.pytorch.org/whl/cu126
For mappy:
conda install -c bioconda mappy
Install from source¶
Alternatively, install OpenSpliceAI from source by cloning the GitHub repository:
git clone https://github.com/Kuanhao-Chao/OpenSpliceAI.git
cd OpenSpliceAI
python setup.py install
Detailed Installation for PyTorch and mappy¶
PyTorch:
Recommended Version: 2.2.1 or later.
Usage: Essential for model training and inference in OpenSpliceAI.
Installation Tips:
For GPU acceleration, ensure your NVIDIA drivers and CUDA toolkit are installed.
Visit the PyTorch official site to select the appropriate command for your operating system.
mappy:
Recommended Version: 2.28.
Usage: Provides Python bindings for minimap2 for rapid genomic alignments.
Installation Tips:
To install via pip:
pip install mappy
Or via conda:
conda install -c bioconda mappy
For advanced usage (e.g., multithreading), refer to the mappy GitHub repository or the Bioconda mappy recipe.
Check OpenSpliceAI Installation¶
After installing, verify that OpenSpliceAI is properly set up by running:
openspliceai -h
You should see the usage information and version details printed in your terminal.
Terminal Output Example¶
Next Steps¶
Once installation is complete, please proceed to the Quick Start Guide to begin working with OpenSpliceAI for data creation, model training, prediction, calibration, and variant analysis.