Installation

We recommend installing Snekmer using Python’s venv module. Before installing Snekmer, check that you have Python 3.11 or later installed using the command:

python --version

The next step is to create and activate a new virtual environment that will contain Snekmer and its dependencies. Ubuntu users should install additional dependencies after creating the virtual environment.

python -m venv ~/snekmer_env
source ~/snekmer_env/bin/activate

Once the virtual environment has been created and activated, clone and install Snekmer using the following commands.

# Download from Github Main Branch
git clone https://github.com/PNNL-CompBio/Snekmer.git
# Alternatively, download a specific branch:
# git clone -b pre_paper_updates https://github.com/PNNL-CompBio/Snekmer.git
cd Snekmer
pip install --no-cache -r requirements.txt
pip install .

Verify the installation succeeded:

snekmer --version

You should see the current version number printed (e.g. 1.4.1). If the command is not found, ensure your virtual environment is activated.

Testing Installation

A quick test of the installation can be performed by running the following commands.

To test Learn/Apply, run from the root of the Snekmer repository:

snekmer easy \
    --train  resources/demo_sequences/learn_apply_inputs/learn \
    --query  resources/demo_sequences/learn_apply_inputs/apply/test_sequences_1.fasta \
    --ann    resources/demo_sequences/learn_apply_inputs/annotations/TIGRFAMs_annotation.ann \
    --output test_results

Alternatively, a scripted demo that runs snekmer learn then snekmer apply step-by-step is available:

cd resources/learn_apply_demo
python3 run_demo.py

To test Model/Cluster/Search:

cd resources/model_cluster_search_demo
python3 run_demo.py

Troubleshooting Notes

The full version of Snakemake is incompatible with Windows. On Windows, you will need to use mamba to create the environment from the minimal Snakemake specification. If you do not have mamba installed, install it first from miniforge (recommended) or via conda install -n base -c conda-forge mamba. Then:

mamba env create -f environment_Windows.yml

Install Snekmer via Docker

Snekmer has been installed into a public docker image hosted on Dockerhub. Usage requires the installation of Docker Desktop.

To download the image from Dockerhub:

docker pull jjacobson95/snekmer:latest

To use the command line interface within the container:

docker run --rm -v "$(pwd)":/work jjacobson95/snekmer:latest {mode} {args}

The Docker image accepts the same modes (cluster, model, search, learn, apply, and easy) and command line arguments as the Snekmer command line interface.

Optional: Blazing Signature Filter (BSF)

BSF is an optional performance dependency for snekmer cluster. It is not optional; Snekmer works without it. See Advanced / Optional Dependencies for installation instructions.