Skip to content

Commit aa6d435

Browse files
committed
remove bin_path
1 parent fdde880 commit aa6d435

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

mtsv/mtsv_prep/main.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from mtsv.parsing import make_sub_parser, get_global_config, ACTIONS, TYPES, add_default_arguments
1515
from mtsv.mtsv_prep.MTSv_prune import *
1616

17-
from mtsv.utils import error, bin_path, specfile_path, specfile_read
17+
from mtsv.utils import error, specfile_path, specfile_read
1818

1919
from snakemake.workflow import Workflow, Rules, expand
2020
import snakemake.workflow
@@ -111,7 +111,8 @@ def oneclickbuild(args):
111111

112112
def tree_make(in_path):
113113
out_path = os.path.abspath(os.path.join(os.path.dirname(in_path), "tree.index"))
114-
subprocess.run("{0} --index {1} --dump {2}".format(bin_path('mtsv-tree-build'), out_path, os.path.abspath(in_path) ).split())
114+
subprocess.run("mtsv-tree-build --index {0} --dump {1}".format(
115+
out_path, os.path.abspath(in_path) ).split())
115116

116117
def partition(args):
117118
partition_list = []
@@ -160,13 +161,13 @@ def chunk(file_list, args):
160161
db = os.path.basename(os.path.dirname(fp))
161162
out_dir = os.path.abspath(os.path.join(args.path, "indices", db,os.path.basename(fp).rsplit(".",1)[0] ))
162163
if not os.path.isfile( os.path.join(out_dir,"_0.".join(os.path.basename(fp).rsplit(".", 1))+"ta" ) ):
163-
subprocess.run("{2} --input {0} --output {1} --gb {3}".format(fp, out_dir, bin_path('mtsv-chunk'), args.chunk_size).split() )
164+
subprocess.run("{2} --input {0} --output {1} --gb {3}".format(fp, out_dir, 'mtsv-chunk', args.chunk_size).split() )
164165
dir_set.add(out_dir)
165166
return list(dir_set)
166167

167168
def snake(args):
168-
chunk_path = bin_path('mtsv-chunk')
169-
fm_build_path = bin_path('mtsv-build')
169+
chunk_path = 'mtsv-chunk'
170+
fm_build_path = 'mtsv-build'
170171
print(chunk_path)
171172
print(fm_build_path)
172173
print(args)
@@ -214,7 +215,11 @@ def fm_build(dir_list):
214215
for fp in iglob(os.path.join(directory, "*.fasta")):
215216
out_file = os.path.join(directory, "{0}.index".format(os.path.basename(fp).split(".")[0]))
216217
if not os.path.isfile(out_file):
217-
result = subprocess.run("{2} --fasta {0} --index {1}".format(os.path.abspath(fp), out_file, bin_path('mtsv-build')).split() )
218+
result = subprocess.run(
219+
"{2} --fasta {0} --index {1}".format(
220+
os.path.abspath(fp),
221+
out_file,
222+
'mtsv-build').split() )
218223
if result.returncode == 0:
219224
os.remove(os.path.abspath(fp))
220225
fm_list.append(out_file)

0 commit comments

Comments
 (0)