Skip to content

Commit 018f34d

Browse files
sjanssen2antgonza
andauthored
Fix cmdname qp target gene (#3364)
* Update CHANGELOG.md * update QIIME name to QIIMEq2 * update plugin name * rename QIIME to QIIMEq2 * rename QIIME * more renaming of QIIME to QIIMEq2 for qiita_db tests * arg, forgot to save changes in other files * another renaming of QIIME to QIIMEq2 * codestyle * adding q2 * another instance of renaming --------- Co-authored-by: Antonio Gonzalez <[email protected]>
1 parent 1c3a473 commit 018f34d

File tree

10 files changed

+67
-50
lines changed

10 files changed

+67
-50
lines changed

qiita_db/handlers/tests/test_plugin.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class UtilTests(TestCase):
2020
def test_get_plugin(self):
21-
obs = _get_plugin("QIIME", "1.9.1")
21+
obs = _get_plugin("QIIMEq2", "1.9.1")
2222
exp = qdb.software.Software(1)
2323
self.assertEqual(obs, exp)
2424

@@ -27,7 +27,7 @@ def test_get_plugin(self):
2727
_get_plugin("QiIME", "1.9.1")
2828

2929
def test_get_command(self):
30-
obs = _get_command('QIIME', '1.9.1', 'Split libraries FASTQ')
30+
obs = _get_command('QIIMEq2', '1.9.1', 'Split libraries FASTQ')
3131
exp = qdb.software.Command(1)
3232
self.assertEqual(obs, exp)
3333

@@ -38,18 +38,18 @@ def test_get_command(self):
3838

3939
class PluginHandlerTests(OauthTestingBase):
4040
def test_get_plugin_does_not_exist(self):
41-
obs = self.get('/qiita_db/plugins/QIIME/1.9.0/', headers=self.header)
41+
obs = self.get('/qiita_db/plugins/QIIMEq2/1.9.0/', headers=self.header)
4242
self.assertEqual(obs.code, 404)
4343

4444
def test_get_no_header(self):
45-
obs = self.get('/qiita_db/plugins/QIIME/1.9.0/')
45+
obs = self.get('/qiita_db/plugins/QIIMEq2/1.9.0/')
4646
self.assertEqual(obs.code, 400)
4747

4848
def test_get(self):
49-
obs = self.get('/qiita_db/plugins/QIIME/1.9.1/', headers=self.header)
49+
obs = self.get('/qiita_db/plugins/QIIMEq2/1.9.1/', headers=self.header)
5050
self.assertEqual(obs.code, 200)
5151
exp = {
52-
'name': 'QIIME',
52+
'name': 'QIIMEq2',
5353
'version': '1.9.1',
5454
'description': 'Quantitative Insights Into Microbial Ecology '
5555
'(QIIME) is an open-source bioinformatics pipeline '
@@ -85,10 +85,10 @@ def test_post(self):
8585
'param2': '2.4',
8686
'param3': 'False'}})
8787
}
88-
obs = self.post('/qiita_db/plugins/QIIME/1.9.1/commands/', data=data,
88+
obs = self.post('/qiita_db/plugins/QIIMEq2/1.9.1/commands/', data=data,
8989
headers=self.header)
9090
self.assertEqual(obs.code, 200)
91-
obs = _get_command('QIIME', '1.9.1', 'New Command')
91+
obs = _get_command('QIIMEq2', '1.9.1', 'New Command')
9292
self.assertEqual(obs.name, 'New Command')
9393
self.assertFalse(obs.analysis_only)
9494

@@ -106,10 +106,10 @@ def test_post(self):
106106
'default_parameter_sets': dumps({'dflt1': {'param1': 'test'}}),
107107
'analysis_only': True
108108
}
109-
obs = self.post('/qiita_db/plugins/QIIME/1.9.1/commands/', data=data,
109+
obs = self.post('/qiita_db/plugins/QIIMEq2/1.9.1/commands/', data=data,
110110
headers=self.header)
111111
self.assertEqual(obs.code, 200)
112-
obs = _get_command('QIIME', '1.9.1', 'New analysis command')
112+
obs = _get_command('QIIMEq2', '1.9.1', 'New analysis command')
113113
self.assertEqual(obs.name, 'New analysis command')
114114
self.assertTrue(obs.analysis_only)
115115
self.assertEqual(obs.merging_scheme,
@@ -125,12 +125,12 @@ def test_get_command_does_not_exist(self):
125125

126126
def test_get_no_header(self):
127127
obs = self.get(
128-
'/qiita_db/plugins/QIIME/1.9.1/commands/Split%20libraries/')
128+
'/qiita_db/plugins/QIIMEq2/1.9.1/commands/Split%20libraries/')
129129
self.assertEqual(obs.code, 400)
130130

131131
def test_get(self):
132132
obs = self.get(
133-
'/qiita_db/plugins/QIIME/1.9.1/commands/Split%20libraries/',
133+
'/qiita_db/plugins/QIIMEq2/1.9.1/commands/Split%20libraries/',
134134
headers=self.header)
135135
self.assertEqual(obs.code, 200)
136136
exp = {'name': 'Split libraries',
@@ -195,20 +195,20 @@ def test_get(self):
195195

196196
class CommandActivateHandlerTests(OauthTestingBase):
197197
def test_post_command_does_not_exist(self):
198-
obs = self.post('/qiita_db/plugins/QIIME/1.9.1/commands/'
198+
obs = self.post('/qiita_db/plugins/QIIMEq2/1.9.1/commands/'
199199
'UNKNOWN/activate/',
200200
headers=self.header, data={})
201201
self.assertEqual(obs.code, 404)
202202

203203
def test_post_no_header(self):
204-
obs = self.post('/qiita_db/plugins/QIIME/1.9.1/commands/'
204+
obs = self.post('/qiita_db/plugins/QIIMEq2/1.9.1/commands/'
205205
'Split%20libraries/activate/', data={})
206206
self.assertEqual(obs.code, 400)
207207

208208
def test_post(self):
209209
qdb.software.Software.deactivate_all()
210210
self.assertFalse(qdb.software.Command(2).active)
211-
obs = self.post('/qiita_db/plugins/QIIME/1.9.1/commands/'
211+
obs = self.post('/qiita_db/plugins/QIIMEq2/1.9.1/commands/'
212212
'Split%20libraries/activate/', headers=self.header,
213213
data={})
214214
self.assertEqual(obs.code, 200)

qiita_db/handlers/tests/test_processing_job.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ class ProcessingJobAPItestHandlerTests(OauthTestingBase):
277277
def test_post_processing_job(self):
278278
data = {
279279
'user': '[email protected]',
280-
'command': dumps(['QIIME', '1.9.1', 'Pick closed-reference OTUs']),
280+
'command': dumps(['QIIMEq2', '1.9.1',
281+
'Pick closed-reference OTUs']),
281282
'parameters': dumps({"reference": 1,
282283
"sortmerna_e_value": 1,
283284
"sortmerna_max_pos": 10000,
@@ -298,7 +299,8 @@ def test_post_processing_job(self):
298299
def test_post_processing_job_status(self):
299300
data = {
300301
'user': '[email protected]',
301-
'command': dumps(['QIIME', '1.9.1', 'Pick closed-reference OTUs']),
302+
'command': dumps(['QIIMEq2', '1.9.1',
303+
'Pick closed-reference OTUs']),
302304
'status': 'running',
303305
'parameters': dumps({"reference": 1,
304306
"sortmerna_e_value": 1,

qiita_db/support_files/patches/91.sql

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Feb 19, 2024
2+
-- update qp-target-gene command name to "QIIMEq2" to be in sync with plugin repo
3+
-- When setting up a new instance of Qiita, we end up using qiita-env make
4+
-- which creates entries in the postgress database, also for qiita.software.
5+
-- One of these entries belongs to the qp-target-gene plugin with name "QIIME"
6+
-- and version "1.9.1". However, with
7+
-- qp_target_gene/support_files/patches/171029_QIIME_v191_to_QIIMEq2_v191.sql
8+
-- the plugin was renamed into QIIMEq2, but this change was not relected in
9+
-- the qiita.software table. Thus, updating plugin information finds a mismatch
10+
-- between old (QIIME) and new (QIIMEq2) names and therefor creates a new
11+
-- command. However, the also provided default workflows hold command_ids to
12+
-- the old version and subsequently the commands for artifact processing
13+
-- will result in an empty list, even though the plugin is available.
14+
-- Therefore, this patch updates the name of QIIME.
15+
UPDATE qiita.software SET name = 'QIIMEq2' WHERE name = 'QIIME';

qiita_db/test/test_artifact.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,10 @@ def test_merging_scheme(self):
469469
('Split libraries FASTQ | N/A', 'N/A'))
470470
self.assertEqual(qdb.artifact.Artifact(4).merging_scheme,
471471
('Pick closed-reference OTUs | Split libraries FASTQ',
472-
'QIIME v1.9.1'))
472+
'QIIMEq2 v1.9.1'))
473473
self.assertEqual(qdb.artifact.Artifact(5).merging_scheme,
474474
('Pick closed-reference OTUs | Split libraries FASTQ',
475-
'QIIME v1.9.1'))
475+
'QIIMEq2 v1.9.1'))
476476

477477
def test_jobs(self):
478478
# Returning all jobs

qiita_db/test/test_meta_util.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,15 @@ def test_generate_biom_and_metadata_release(self):
381381
'processed_data/1_study_1001_closed_reference_otu_table.biom\t'
382382
'%s\t%s\t4\tIllumina\t16S rRNA\t'
383383
'Pick closed-reference OTUs | Split libraries FASTQ\t'
384-
'QIIME v1.9.1\tQIIME v1.9.1\n' % (fn_sample, fn_prep),
384+
'QIIMEq2 v1.9.1\tQIIMEq2 v1.9.1\n' % (fn_sample, fn_prep),
385385
'processed_data/1_study_1001_closed_reference_otu_table.biom\t'
386386
'%s\t%s\t5\tIllumina\t16S rRNA\t'
387387
'Pick closed-reference OTUs | Split libraries FASTQ\t'
388-
'QIIME v1.9.1\tQIIME v1.9.1\n' % (fn_sample, fn_prep),
388+
'QIIMEq2 v1.9.1\tQIIMEq2 v1.9.1\n' % (fn_sample, fn_prep),
389389
'processed_data/1_study_1001_closed_reference_otu_table_Silva.bio'
390390
'm\t%s\t%s\t6\tIllumina\t16S rRNA\t'
391391
'Pick closed-reference OTUs | Split libraries FASTQ\t'
392-
'QIIME v1.9.1\tQIIME v1.9.1' % (fn_sample, fn_prep)]
392+
'QIIMEq2 v1.9.1\tQIIMEq2 v1.9.1' % (fn_sample, fn_prep)]
393393
self.assertEqual(txt_obs, txt_exp)
394394

395395
# whatever the configuration was, we will change to settings so we can
@@ -465,15 +465,15 @@ def test_generate_biom_and_metadata_release(self):
465465
'processed_data/1_study_1001_closed_reference_otu_table.biom\t'
466466
'%s\t%s\t4\tIllumina\t16S rRNA\t'
467467
'Pick closed-reference OTUs | Split libraries FASTQ\t'
468-
'QIIME v1.9.1\tQIIME v1.9.1\n' % (fn_sample, fn_prep),
468+
'QIIMEq2 v1.9.1\tQIIMEq2 v1.9.1\n' % (fn_sample, fn_prep),
469469
'processed_data/1_study_1001_closed_reference_otu_table.biom\t'
470470
'%s\t%s\t5\tIllumina\t16S rRNA\t'
471471
'Pick closed-reference OTUs | Split libraries FASTQ\t'
472-
'QIIME v1.9.1\tQIIME v1.9.1\n' % (fn_sample, fn_prep),
472+
'QIIMEq2 v1.9.1\tQIIMEq2 v1.9.1\n' % (fn_sample, fn_prep),
473473
'processed_data/1_study_1001_closed_reference_otu_table_Silva.bio'
474474
'm\t%s\t%s\t6\tIllumina\t16S rRNA\t'
475475
'Pick closed-reference OTUs | Split libraries FASTQ'
476-
'\tQIIME v1.9.1\tQIIME v1.9.1' % (fn_sample, fn_prep)]
476+
'\tQIIMEq2 v1.9.1\tQIIMEq2 v1.9.1' % (fn_sample, fn_prep)]
477477
self.assertEqual(txt_obs, txt_exp)
478478

479479
# returning configuration

qiita_db/test/test_software.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ def test_create_error(self):
342342
self.outputs)
343343

344344
# the output type doesn't exist
345-
with self.assertRaisesRegex(ValueError, "Error creating QIIME, Split "
346-
"libraries - wrong output, This is a "
345+
with self.assertRaisesRegex(ValueError, "Error creating QIIMEq2, Split"
346+
" libraries - wrong output, This is a "
347347
"command for testing - Unknown "
348348
"artifact_type: BLA!"):
349349
qdb.software.Command.create(
@@ -567,7 +567,7 @@ def tearDown(self):
567567
remove(f)
568568

569569
def test_from_name_and_version(self):
570-
obs = qdb.software.Software.from_name_and_version('QIIME', '1.9.1')
570+
obs = qdb.software.Software.from_name_and_version('QIIMEq2', '1.9.1')
571571
exp = qdb.software.Software(1)
572572
self.assertEqual(obs, exp)
573573

@@ -578,13 +578,13 @@ def test_from_name_and_version(self):
578578

579579
# Wrong name
580580
with self.assertRaises(qdb.exceptions.QiitaDBUnknownIDError):
581-
qdb.software.Software.from_name_and_version('QiIME', '1.9.1')
581+
qdb.software.Software.from_name_and_version('QiIMEq2', '1.9.1')
582582
# Wrong version
583583
with self.assertRaises(qdb.exceptions.QiitaDBUnknownIDError):
584-
qdb.software.Software.from_name_and_version('QIIME', '1.9.0')
584+
qdb.software.Software.from_name_and_version('QIIMEq2', '1.9.0')
585585

586586
def test_name(self):
587-
self.assertEqual(qdb.software.Software(1).name, "QIIME")
587+
self.assertEqual(qdb.software.Software(1).name, "QIIMEq2")
588588

589589
def test_version(self):
590590
self.assertEqual(qdb.software.Software(1).version, "1.9.1")
@@ -694,7 +694,7 @@ def test_from_file(self):
694694
self._clean_up_files.append(fp)
695695
with open(fp, 'w') as f:
696696
f.write(CONF_TEMPLATE %
697-
('QIIME', '1.9.1',
697+
('QIIMEq2', '1.9.1',
698698
'Quantitative Insights Into Microbial Ecology (QIIME) '
699699
'is an open-source bioinformatics pipeline for '
700700
'performing microbiome analysis from raw DNA '
@@ -711,18 +711,18 @@ def test_from_file(self):
711711
self._clean_up_files.append(fp)
712712
with open(fp, 'w') as f:
713713
f.write(CONF_TEMPLATE %
714-
('QIIME', '1.9.1', 'Different description',
714+
('QIIMEq2', '1.9.1', 'Different description',
715715
'source activate qiime', 'start_qiime',
716716
'artifact transformation',
717717
'[["10.1038/nmeth.f.303", "20383131"]]', client_id,
718718
client_secret))
719719
with warnings.catch_warnings(record=True) as warns:
720720
obs = qdb.software.Software.from_file(fp)
721721
obs_warns = [str(w.message) for w in warns]
722-
exp_warns = ['Plugin "QIIME" version "1.9.1" config file does not '
723-
'match with stored information. Check the config file'
724-
' or run "qiita plugin update" to update the plugin '
725-
'information. Offending values: description, '
722+
exp_warns = ['Plugin "QIIMEq2" version "1.9.1" config file does '
723+
'not match with stored information. Check the config '
724+
'file or run "qiita plugin update" to update the '
725+
'plugin information. Offending values: description, '
726726
'environment_script, start_script']
727727
self.assertCountEqual(obs_warns, exp_warns)
728728

@@ -829,7 +829,7 @@ def test_from_file(self):
829829
self.assertEqual(obs.client_secret, 'client_secret')
830830

831831
def test_exists(self):
832-
self.assertTrue(qdb.software.Software.exists("QIIME", "1.9.1"))
832+
self.assertTrue(qdb.software.Software.exists("QIIMEq2", "1.9.1"))
833833
self.assertFalse(qdb.software.Software.exists("NewPlugin", "1.9.1"))
834834
self.assertFalse(qdb.software.Software.exists("QIIME", "2.0.0"))
835835

qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ def test_analysis_description_handler_get_request(self):
4343
'artifacts': {
4444
4: (1, 'Identification of the Microbiomes for Cannabis '
4545
'Soils', ('Pick closed-reference OTUs | Split '
46-
'libraries FASTQ', 'QIIME v1.9.1'), [
46+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
4747
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
4848
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
4949
5: (1, 'Identification of the Microbiomes for Cannabis '
5050
'Soils', ('Pick closed-reference OTUs | Split '
51-
'libraries FASTQ', 'QIIME v1.9.1'), [
51+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
5252
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
5353
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
5454
6: (1, 'Identification of the Microbiomes for Cannabis '
5555
'Soils', ('Pick closed-reference OTUs | Split '
56-
'libraries FASTQ', 'QIIME v1.9.1'), [
56+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
5757
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
5858
'1.SKM4.640180', '1.SKM9.640192'], {'1'})},
5959
'analysis_reservation': '',
@@ -72,17 +72,17 @@ def test_analysis_description_handler_get_request(self):
7272
'artifacts': {
7373
4: (1, 'Identification of the Microbiomes for Cannabis '
7474
'Soils', ('Pick closed-reference OTUs | Split '
75-
'libraries FASTQ', 'QIIME v1.9.1'), [
75+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
7676
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
7777
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
7878
5: (1, 'Identification of the Microbiomes for Cannabis '
7979
'Soils', ('Pick closed-reference OTUs | Split '
80-
'libraries FASTQ', 'QIIME v1.9.1'), [
80+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
8181
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
8282
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
8383
6: (1, 'Identification of the Microbiomes for Cannabis '
8484
'Soils', ('Pick closed-reference OTUs | Split '
85-
'libraries FASTQ', 'QIIME v1.9.1'), [
85+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
8686
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
8787
'1.SKM4.640180', '1.SKM9.640192'], {'1'})},
8888
'alert_msg': 'An artifact is being deleted from this analysis',
@@ -103,17 +103,17 @@ def test_analysis_description_handler_get_request(self):
103103
'artifacts': {
104104
4: (1, 'Identification of the Microbiomes for Cannabis '
105105
'Soils', ('Pick closed-reference OTUs | Split '
106-
'libraries FASTQ', 'QIIME v1.9.1'), [
106+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
107107
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
108108
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
109109
5: (1, 'Identification of the Microbiomes for Cannabis '
110110
'Soils', ('Pick closed-reference OTUs | Split '
111-
'libraries FASTQ', 'QIIME v1.9.1'), [
111+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
112112
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
113113
'1.SKM4.640180', '1.SKM9.640192'], {'1'}),
114114
6: (1, 'Identification of the Microbiomes for Cannabis '
115115
'Soils', ('Pick closed-reference OTUs | Split '
116-
'libraries FASTQ', 'QIIME v1.9.1'), [
116+
'libraries FASTQ', 'QIIMEq2 v1.9.1'), [
117117
'1.SKB7.640196', '1.SKB8.640193', '1.SKD8.640184',
118118
'1.SKM4.640180', '1.SKM9.640192'], {'1'})},
119119
'alert_msg': 'Error deleting artifact',

qiita_pet/handlers/api_proxy/tests/test_processing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_job_ajax_get_req(self):
103103
'command': 'Split libraries FASTQ',
104104
'command_description': 'Demultiplexes and applies quality '
105105
'control to FASTQ data',
106-
'software': 'QIIME',
106+
'software': 'QIIMEq2',
107107
'software_version': '1.9.1'}
108108
self.assertEqual(obs, exp)
109109

qiita_pet/handlers/artifact_handlers/tests/test_base_handlers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test_artifact_summary_get_request(self):
258258
'rev_comp_mapping_barcodes': 'False',
259259
'min_per_read_length_fraction': '0.75',
260260
'barcode_type': 'golay_12'},
261-
'software_version': '1.9.1', 'software': 'QIIME'},
261+
'software_version': '1.9.1', 'software': 'QIIMEq2'},
262262
'files': exp_files,
263263
'is_from_analysis': False,
264264
'summary': None,

qiita_pet/handlers/study_handlers/tests/test_processing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_get(self):
9999
'command': 'Split libraries FASTQ',
100100
'command_description': 'Demultiplexes and applies quality '
101101
'control to FASTQ data',
102-
'software': 'QIIME',
102+
'software': 'QIIMEq2',
103103
'software_version': '1.9.1'}
104104
self.assertEqual(loads(response.body), exp)
105105

0 commit comments

Comments
 (0)