Skip to content

Commit

Permalink
Merge pull request #162 from openvax/change-fm-index-path
Browse files Browse the repository at this point in the history
Using an environment variable to set where the reference peptide index lives.
  • Loading branch information
julia326 committed May 17, 2018
2 parents df7a6bf + 900de14 commit 3915c5f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ before_install:
- mkdir tmp
- export NETMHC_BUNDLE_TMPDIR=$PWD/tmp
- export PATH=$PATH:$NETMHC_BUNDLE_HOME/bin
# tells vaxrank where to install the reference peptide cache
- export VAXRANK_REF_PEPTIDES_DIR=$HOME/.cache/vaxrank
env:
global:
# MHC_BUNDLE_PASS
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ xlrd
xvfbwrapper
future>=0.16.0 # needed by pylint
astropy
datacache
2 changes: 1 addition & 1 deletion vaxrank/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.11"
__version__ = "0.7.12"
5 changes: 3 additions & 2 deletions vaxrank/epitope_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import logging
import os

from appdirs import user_cache_dir
import numpy as np
import shellinford
import six

from datacache import get_data_dir

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -76,7 +76,8 @@ def fm_index_path(genome):
"""
Returns a path for cached reference peptides, for the given genome.
"""
cache_dir = user_cache_dir('vaxrank')
# if $VAXRANK_REF_PEPTIDES_DIR is set, that'll be the location of the cache
cache_dir = get_data_dir(envkey='VAXRANK_REF_PEPTIDES_DIR')
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)

Expand Down

0 comments on commit 3915c5f

Please sign in to comment.