Skip to content

Commit

Permalink
create human-readable error message if build dependencies are not ful…
Browse files Browse the repository at this point in the history
…filled
  • Loading branch information
alpae committed Oct 31, 2023
1 parent bfe42d9 commit f90ce8b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions omamer/_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def mkdb_oma(args):
from .index import Index
import os

_ensure_db_build_dependencies_available()

assert args.k < 8, "Max k-mer size is 7."
LOG.info("Create database from OMA build")
LOG.info("arguments for build:")
Expand Down Expand Up @@ -203,6 +205,15 @@ def search(args):
goodbye(args, time() - t0, search_rate)


def _ensure_db_build_dependencies_available():
try:
from pysais import sais
except ImportError:
LOG.error("To build OMAmer databases, pysais must be installed. Please ensure you installed omamer with the 'build' extra, e.g. `pip install omamer[build]`")
import sys
sys.exit(1)


def _ensure_data_loaded(ms):
from alive_progress import alive_bar
import sys
Expand Down

0 comments on commit f90ce8b

Please sign in to comment.