From 13952358b38be4b9e3274bcd40ee2ff59a85d6e4 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Thu, 25 Jul 2019 11:59:19 +0200 Subject: [PATCH] Fixed a bug where some commands wouldn't work if the input DMS was not in the current directory --- python/obitools3/commands/align.pyx | 2 +- python/obitools3/commands/build_ref_db.pyx | 2 +- python/obitools3/commands/clean.pyx | 2 +- python/obitools3/commands/ecopcr.pyx | 4 ++-- python/obitools3/commands/ecotag.pyx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/obitools3/commands/align.pyx b/python/obitools3/commands/align.pyx index 8f2396d..fa6e640 100644 --- a/python/obitools3/commands/align.pyx +++ b/python/obitools3/commands/align.pyx @@ -229,7 +229,7 @@ def run(config): # Call cython alignment function # Using default ID columns of the view. TODO discuss adding option - align_columns(i_dms_name, \ + align_columns(i_dms.full_path, \ i_view_name, \ o_view_name, \ input_view_2_n = i_view_name_2, \ diff --git a/python/obitools3/commands/build_ref_db.pyx b/python/obitools3/commands/build_ref_db.pyx index 6e541a2..f171bb5 100755 --- a/python/obitools3/commands/build_ref_db.pyx +++ b/python/obitools3/commands/build_ref_db.pyx @@ -81,7 +81,7 @@ def run(config): input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1]) comments = View.print_config(config, "build_ref_db", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) - if build_reference_db(tobytes(i_dms_name), tobytes(i_view_name), tobytes(taxonomy_name), tobytes(o_view_name), comments, config['build_ref_db']['threshold']) < 0: + if build_reference_db(i_dms.full_path, tobytes(i_view_name), tobytes(taxonomy_name), tobytes(o_view_name), comments, config['build_ref_db']['threshold']) < 0: raise Exception("Error building a reference database") # If the input and output DMS are not the same, export result view to output DMS diff --git a/python/obitools3/commands/clean.pyx b/python/obitools3/commands/clean.pyx index f908294..00ed4bc 100755 --- a/python/obitools3/commands/clean.pyx +++ b/python/obitools3/commands/clean.pyx @@ -107,7 +107,7 @@ def run(config): command_line = " ".join(sys.argv[1:]) comments = View.print_config(config, "clean", command_line, input_dms_name=[i_dms_name], input_view_name=[i_view_name]) - if obi_clean(tobytes(i_dms_name), tobytes(i_view_name), tobytes(config['clean']['sample-tag-name']), tobytes(o_view_name), comments, \ + if obi_clean(i_dms.full_path, tobytes(i_view_name), tobytes(config['clean']['sample-tag-name']), tobytes(o_view_name), comments, \ config['clean']['distance'], config['clean']['ratio'], config['clean']['heads-only'], config['clean']['thread-count']) < 0: raise Exception("Error running obiclean") diff --git a/python/obitools3/commands/ecopcr.pyx b/python/obitools3/commands/ecopcr.pyx index 0e93562..65f8a8b 100755 --- a/python/obitools3/commands/ecopcr.pyx +++ b/python/obitools3/commands/ecopcr.pyx @@ -178,8 +178,8 @@ def run(config): # TODO: primers in comments? - if obi_ecopcr(tobytes(i_dms_name), tobytes(i_view_name), tobytes(taxonomy_name), \ - tobytes(o_dms_name), tobytes(o_view_name), comments, \ + if obi_ecopcr(i_dms.full_path, tobytes(i_view_name), tobytes(taxonomy_name), \ + o_dms.full_path, tobytes(o_view_name), comments, \ tobytes(config['ecopcr']['primer1']), tobytes(config['ecopcr']['primer2']), \ config['ecopcr']['error'], \ config['ecopcr']['min-length'], config['ecopcr']['max-length'], \ diff --git a/python/obitools3/commands/ecotag.pyx b/python/obitools3/commands/ecotag.pyx index 3417bd9..d6326d2 100755 --- a/python/obitools3/commands/ecotag.pyx +++ b/python/obitools3/commands/ecotag.pyx @@ -101,7 +101,7 @@ def run(config): input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1]) comments = View.print_config(config, "ecotag", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) - if obi_ecotag(tobytes(i_dms_name), tobytes(i_view_name), \ + if obi_ecotag(i_dms.full_path, tobytes(i_view_name), \ tobytes(ref_dms_name), tobytes(ref_view_name), \ tobytes(taxo_dms_name), tobytes(taxonomy_name), \ tobytes(o_view_name), comments,