|
14 | 14 | from mtsv.parsing import make_sub_parser, get_global_config, ACTIONS, TYPES, add_default_arguments |
15 | 15 | from mtsv.mtsv_prep.MTSv_prune import * |
16 | 16 |
|
17 | | -from mtsv.utils import error, bin_path, specfile_path, specfile_read |
| 17 | +from mtsv.utils import error, specfile_path, specfile_read |
18 | 18 |
|
19 | 19 | from snakemake.workflow import Workflow, Rules, expand |
20 | 20 | import snakemake.workflow |
@@ -111,7 +111,8 @@ def oneclickbuild(args): |
111 | 111 |
|
112 | 112 | def tree_make(in_path): |
113 | 113 | 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()) |
115 | 116 |
|
116 | 117 | def partition(args): |
117 | 118 | partition_list = [] |
@@ -160,13 +161,13 @@ def chunk(file_list, args): |
160 | 161 | db = os.path.basename(os.path.dirname(fp)) |
161 | 162 | out_dir = os.path.abspath(os.path.join(args.path, "indices", db,os.path.basename(fp).rsplit(".",1)[0] )) |
162 | 163 | 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() ) |
164 | 165 | dir_set.add(out_dir) |
165 | 166 | return list(dir_set) |
166 | 167 |
|
167 | 168 | 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' |
170 | 171 | print(chunk_path) |
171 | 172 | print(fm_build_path) |
172 | 173 | print(args) |
@@ -214,7 +215,11 @@ def fm_build(dir_list): |
214 | 215 | for fp in iglob(os.path.join(directory, "*.fasta")): |
215 | 216 | out_file = os.path.join(directory, "{0}.index".format(os.path.basename(fp).split(".")[0])) |
216 | 217 | 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() ) |
218 | 223 | if result.returncode == 0: |
219 | 224 | os.remove(os.path.abspath(fp)) |
220 | 225 | fm_list.append(out_file) |
|
0 commit comments