From 53a2d9bcf517126759c203e6b5d03580870a4fc7 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 12 Apr 2022 18:06:38 -0600 Subject: [PATCH 1/4] updates after GUI review --- qiita_pet/templates/analysis_selected.html | 2 +- qiita_pet/templates/study_base.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qiita_pet/templates/analysis_selected.html b/qiita_pet/templates/analysis_selected.html index 9543a81b8..5cc5da4ce 100644 --- a/qiita_pet/templates/analysis_selected.html +++ b/qiita_pet/templates/analysis_selected.html @@ -218,7 +218,7 @@ {% end %}
-

Metadata Selection Common fields for all studies are preselected

+

Metadata Selection Common fields for all studies are preselected. Click to view/add unique fields from each dataset.

diff --git a/qiita_pet/templates/study_base.html b/qiita_pet/templates/study_base.html index de3bbc1fc..b459eb7bc 100644 --- a/qiita_pet/templates/study_base.html +++ b/qiita_pet/templates/study_base.html @@ -95,7 +95,7 @@ {% if editable %} Upload Files - + {% end %} {% if study_info['show_biom_download_button'] %} All QIIME maps and BIOMs From 37b9559dd3edb73a7c993d3b4125d322cc1ffa6e Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 13 Apr 2022 08:07:30 -0600 Subject: [PATCH 2/4] add extra validation for workflows artifact_type --- qiita_db/metadata_template/prep_template.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qiita_db/metadata_template/prep_template.py b/qiita_db/metadata_template/prep_template.py index 26ef5ca52..e97984252 100644 --- a/qiita_db/metadata_template/prep_template.py +++ b/qiita_db/metadata_template/prep_template.py @@ -809,12 +809,15 @@ def _get_predecessors(workflow, node): # 2. pt_dt = self.data_type() + pt_artifact = self.artifact.artifact_type workflows = [wk for wk in qdb.software.DefaultWorkflow.iter() - if pt_dt in wk.data_type] + if wk.artifact_type == pt_artifact and + pt_dt in wk.data_type] if not workflows: # raises option a. - raise ValueError(f'This preparation data type: "{pt_dt}" does not ' - 'have valid workflows') + msg = (f'This preparation data type: "{pt_dt}" and/or artifact ' + f'type "{pt_artifact}" does not have valid workflows') + raise ValueError(msg) missing_artifacts = dict() for wk in workflows: missing_artifacts[wk] = dict() From 550c9ac80b588d5859f4572dd23d1a317de8182f Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 13 Apr 2022 08:36:45 -0600 Subject: [PATCH 3/4] checking redbiom_samples before retrieving samples --- qiita_pet/handlers/qiita_redbiom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiita_pet/handlers/qiita_redbiom.py b/qiita_pet/handlers/qiita_redbiom.py index a60a8f684..f18d5593e 100644 --- a/qiita_pet/handlers/qiita_redbiom.py +++ b/qiita_pet/handlers/qiita_redbiom.py @@ -56,7 +56,7 @@ def _redbiom_metadata_search(self, query, contexts): 'The query ("%s") did not work and may be malformed. Please ' 'check the search help for more information on the queries.' % query) - if not message: + if not message and redbiom_samples: study_artifacts = defaultdict(lambda: defaultdict(list)) for ctx in contexts: # redbiom.fetch.data_from_samples returns a biom, which we From d265b0565581d2ad65c52be05cd3982cf674b6ec Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 13 Apr 2022 10:11:37 -0600 Subject: [PATCH 4/4] fix test --- qiita_db/metadata_template/test/test_prep_template.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qiita_db/metadata_template/test/test_prep_template.py b/qiita_db/metadata_template/test/test_prep_template.py index 4cc3c73b9..28447a665 100644 --- a/qiita_db/metadata_template/test/test_prep_template.py +++ b/qiita_db/metadata_template/test/test_prep_template.py @@ -1417,8 +1417,9 @@ def test_artifact_setter(self): qdb.sql_connection.perform_as_transaction( 'UPDATE qiita.default_workflow SET artifact_type_id = 10 WHERE ' 'default_workflow_id = 1') - with self.assertRaisesRegex(ValueError, 'taxa_summary is not part of ' - 'this preparation and cannot be applied'): + with self.assertRaisesRegex(ValueError, 'This preparation data type: ' + '"16S" and/or artifact type "FASTQ" does ' + 'not have valid workflows'): pt.add_default_workflow(qdb.user.User('test@foo.bar')) # cleaning