diff --git a/abruijn/polish.py b/abruijn/polish.py index 98fa46b7b..010a05f90 100644 --- a/abruijn/polish.py +++ b/abruijn/polish.py @@ -27,6 +27,9 @@ class PolishException(Exception): pass +def get_root(): + return os.path.dirname(__file__) + def check_binaries(): if not which(POLISH_BIN): @@ -42,10 +45,12 @@ def check_binaries(): def polish(bubbles, num_proc, err_mode, work_dir, iter_id): logger.info("Correcting bubbles") + + _ROOT = get_root() - subs_matrix = os.path.join(os.environ["ABRUIJN_RES"], + subs_matrix = os.path.join(_ROOT, 'resource', config.vals["err_modes"][err_mode]["subs_matrix"]) - hopo_matrix = os.path.join(os.environ["ABRUIJN_RES"], + hopo_matrix = os.path.join(_ROOT, 'resource', config.vals["err_modes"][err_mode]["hopo_matrix"]) bubbles_file = os.path.join(work_dir, "bubbles_{0}.fasta".format(iter_id)) diff --git a/resource/nano_homopolymers.mat b/abruijn/resource/nano_homopolymers.mat similarity index 100% rename from resource/nano_homopolymers.mat rename to abruijn/resource/nano_homopolymers.mat diff --git a/resource/nano_substitutions.mat b/abruijn/resource/nano_substitutions.mat similarity index 100% rename from resource/nano_substitutions.mat rename to abruijn/resource/nano_substitutions.mat diff --git a/resource/p6c4_homopolymers.mat b/abruijn/resource/p6c4_homopolymers.mat similarity index 100% rename from resource/p6c4_homopolymers.mat rename to abruijn/resource/p6c4_homopolymers.mat diff --git a/resource/p6c4_substitutions.mat b/abruijn/resource/p6c4_substitutions.mat similarity index 100% rename from resource/p6c4_substitutions.mat rename to abruijn/resource/p6c4_substitutions.mat diff --git a/resource/pacbio_homopolymers.mat b/abruijn/resource/pacbio_homopolymers.mat similarity index 100% rename from resource/pacbio_homopolymers.mat rename to abruijn/resource/pacbio_homopolymers.mat diff --git a/resource/pacbio_substitutions.mat b/abruijn/resource/pacbio_substitutions.mat similarity index 100% rename from resource/pacbio_substitutions.mat rename to abruijn/resource/pacbio_substitutions.mat diff --git a/setup.py b/setup.py index 54dd73fa0..06f593753 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,10 @@ author='Mikhail Kolmogorov', author_email = '', license='BSD-3-Clause', - packages=find_packages(), + packages=['abruijn'], + package_data={'abruijn': ['resource/*.mat']}, scripts = ['bin/abruijn-assemble', 'bin/abruijn-polish', 'scripts/abruijn'], - data_files=['resource/nano_homopolymers.mat', 'resource/nano_substitutions.mat', 'resource/p6c4_homopolymers.mat', - 'resource/p6c4_substitutions.mat', 'resource/pacbio_homopolymers.mat', 'resource/pacbio_substitutions.mat'] + #data_files=['resource/nano_homopolymers.mat', 'resource/nano_substitutions.mat', 'resource/p6c4_homopolymers.mat', + # 'resource/p6c4_substitutions.mat', 'resource/pacbio_homopolymers.mat', 'resource/pacbio_substitutions.mat'] )