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#


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

  • torchaudio >= 2.2.1

  • torchvision >= 0.17.1

  • scikit-learn >= 1.4.1.post1

  • biopython >= 1.83

  • matplotlib >= 3.8.3

  • matplotlib-inline >= 0.1.7

  • psutil >= 5.9.2

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.

conda install -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 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

# For GPU support (Conda packages are no longer available):
pip3 install torch torchvision torchaudio --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:


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.