From 0eebaf4c93648d8cca9e1f3c2ae34ff26452d8d0 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 15 Dec 2023 06:10:20 -0700 Subject: [PATCH 1/2] init commits --- qp_woltka/tests/test_woltka.py | 6 ++++-- qp_woltka/woltka.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/qp_woltka/tests/test_woltka.py b/qp_woltka/tests/test_woltka.py index e46bfab..adba0ef 100644 --- a/qp_woltka/tests/test_woltka.py +++ b/qp_woltka/tests/test_woltka.py @@ -577,11 +577,13 @@ def test_calculate_cell_counts(self): 'SKB8.640193': { 'run_prefix': 'S22205_S104', 'syndna_pool_number': 1, 'raw_reads_r1r2': 10000, 'mass_syndna_input_ng': 120, - 'minipico_dna_concentration_ng_ul': 10, 'vol_elute_ul': 5}, + 'extracted_gdna_concentration_ng_ul': 10, + 'vol_extracted_elution_ul': 5}, 'SKD8.640184': { 'run_prefix': 'S22282_S102', 'syndna_pool_number': 1, 'raw_reads_r1r2': 10002, 'mass_syndna_input_ng': 120, - 'minipico_dna_concentration_ng_ul': 11, 'vol_elute_ul': 6}} + 'extracted_gdna_concentration_ng_ul': 11, + 'vol_extracted_elution_ul': 6}} data = {'prep_info': dumps(prep_info_dict), 'study': 1, 'data_type': 'Metagenomic'} diff --git a/qp_woltka/woltka.py b/qp_woltka/woltka.py index 0309578..57ec54e 100644 --- a/qp_woltka/woltka.py +++ b/qp_woltka/woltka.py @@ -504,7 +504,7 @@ def woltka_syndna(qclient, job_id, parameters, out_dir): prep = pd.read_csv( f'{out_dir}/prep_info.tsv', index_col=None, sep='\t') output = fit_linear_regression_models_for_qiita( - prep, load_table(fp_biom), parameters['min_sample_counts']) + prep, load_table(fp_biom), int(parameters['min_sample_counts'])) # saving results to disk lin_regress_results_fp = f'{out_dir}/lin_regress_by_sample_id.yaml' fit_syndna_models_log_fp = f'{out_dir}/fit_syndna_models_log.txt' From 01f1d02ec124a084be491ca3aaf18750ce30912e Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 20 Dec 2023 06:02:23 -0700 Subject: [PATCH 2/2] workarund for qiita/issues/3340 --- scripts/start_woltka | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/start_woltka b/scripts/start_woltka index 8054841..b732c6b 100755 --- a/scripts/start_woltka +++ b/scripts/start_woltka @@ -34,6 +34,20 @@ def execute(url, job_id, out_dir): qclient.update_job_step( job_id, "Step 1 of 4: Collecting info and generating submission") + + # these were defined in qp_woltka/__init.py__ while defining the + # available commands for this plugin + valid_commands = [ + 'Woltka v0.1.4', 'SynDNA Woltka', 'Calculate Cell Counts'] + + # this if/elif is the current solution for + # https://github.com/qiita-spots/qiita/issues/3340 + if command not in valid_commands: + raise ValueError(f'Not a valid command: "{command}"') + elif command == 'Calculate Cell Counts': + plugin(url, job_id, out_dir) + exit(0) + artifact_id = parameters['input'] del parameters['input'] files, prep = qclient.artifact_and_preparation_files(artifact_id) @@ -47,14 +61,6 @@ def execute(url, job_id, out_dir): else: directory = directory.pop() - # these were defined in qp_woltka/__init.py__ while defining the - # available commands for this plugin - valid_commands = [ - 'Woltka v0.1.4', 'SynDNA Woltka', 'Calculate Cell Counts'] - - if command not in valid_commands: - raise ValueError(f'Not a valid command: "{command}"') - if command == 'Woltka v0.1.4': main_fp, merge_fp = woltka_to_array( files, out_dir, parameters['Database'], prep, url, job_id)