From 57d1b146729223da9daa286a1cc75db6f2923746 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 29 Jan 2024 12:35:46 -0700 Subject: [PATCH 1/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1756c7238..24ad9a78a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Deployed on January 8th, 2024 * Workflow definitions can now use sample or preparation information columns/values to differentiate between them. * Updated the Adapter and host filtering plugin (qp-fastp-minimap2) to v2023.12 addressing a bug in adapter filtering; [more information](https://qiita.ucsd.edu/static/doc/html/processingdata/qp-fastp-minimap2.html). * Other fixes: [3334](https://github.com/qiita-spots/qiita/pull/3334), [3338](https://github.com/qiita-spots/qiita/pull/3338). Thank you @sjanssen2. -* The internal Sequence Processing Pipeline is now using the human pan-genome reference, together with the GRCh38 genome + PhiX and CHM13 genome for human host filtering. +* The internal Sequence Processing Pipeline is now using the human pan-genome reference, together with the GRCh38 genome + PhiX and T2T-CHM13v2.0 genome for human host filtering. Version 2023.10 From d0995c7a8037414d0131503d89cbd68f36e06aac Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 23 Apr 2024 07:33:58 -0600 Subject: [PATCH 2/2] add reprocess_job_id to PrepTemplate --- qiita_db/metadata_template/prep_template.py | 25 ++ .../test/test_prep_template.py | 15 + qiita_db/support_files/patches/92.sql | 5 + qiita_db/support_files/qiita-db.dbs | 9 +- qiita_db/support_files/qiita-db.html | 346 +++++++++--------- 5 files changed, 228 insertions(+), 172 deletions(-) diff --git a/qiita_db/metadata_template/prep_template.py b/qiita_db/metadata_template/prep_template.py index 77884db17..9899cf729 100644 --- a/qiita_db/metadata_template/prep_template.py +++ b/qiita_db/metadata_template/prep_template.py @@ -1107,3 +1107,28 @@ def current_human_filtering(self, current_human_filtering): WHERE prep_template_id = %s""" qdb.sql_connection.TRN.add(sql, [current_human_filtering, self.id]) qdb.sql_connection.TRN.execute() + + @property + def reprocess_job_id(self): + """The job that was created to reprocess this prep info file + + Returns + ------- + bool or None + The reprocess_job_id of the prep file info + """ + with qdb.sql_connection.TRN: + sql = """SELECT reprocess_job_id + FROM qiita.prep_template + WHERE prep_template_id = %s""" + qdb.sql_connection.TRN.add(sql, [self.id]) + return qdb.sql_connection.TRN.execute_fetchlast() + + @reprocess_job_id.setter + def reprocess_job_id(self, reprocess_job_id): + with qdb.sql_connection.TRN: + sql = """UPDATE qiita.prep_template + SET reprocess_job_id = %s + WHERE prep_template_id = %s""" + qdb.sql_connection.TRN.add(sql, [reprocess_job_id, self.id]) + qdb.sql_connection.TRN.execute() diff --git a/qiita_db/metadata_template/test/test_prep_template.py b/qiita_db/metadata_template/test/test_prep_template.py index bfc72ad62..ea41694fe 100644 --- a/qiita_db/metadata_template/test/test_prep_template.py +++ b/qiita_db/metadata_template/test/test_prep_template.py @@ -1914,6 +1914,21 @@ def test_current_human_filtering(self): pt.current_human_filtering = False self.assertFalse(pt.current_human_filtering) + def test_reprocess_job_id(self): + pt = qdb.metadata_template.prep_template.PrepTemplate(1) + # by default it should be None + self.assertIsNone(pt.reprocess_job_id) + # it should not accept an external_job_id + with self.assertRaises(ValueError): + pt.reprocess_job_id = '124567' + # but it should work fine with an uuid + jid = '6d368e16-2242-4cf8-87b4-a5dc40bb890b' + pt.reprocess_job_id = jid + self.assertEqual(pt.reprocess_job_id, jid) + # and it should be fine to return to its default value + pt.reprocess_job_id = None + self.assertIsNone(pt.reprocess_job_id) + EXP_PREP_TEMPLATE = ( 'sample_name\tbarcode\tcenter_name\tcenter_project_name\t' diff --git a/qiita_db/support_files/patches/92.sql b/qiita_db/support_files/patches/92.sql index 0c2ad5034..a8a7d8bb0 100644 --- a/qiita_db/support_files/patches/92.sql +++ b/qiita_db/support_files/patches/92.sql @@ -22,3 +22,8 @@ ALTER TABLE qiita.slurm_resource_allocations -- Apr 21, 2024 -- Adding a new column: current_human_filtering to qiita.prep_template ALTER TABLE qiita.prep_template ADD current_human_filtering boolean DEFAULT False; + +-- Apr 22, 2024 +-- Adding a new column: reprocess_job_id to qiita.prep_template to keep track of +-- the job that reprocessed this prep +ALTER TABLE qiita.prep_template ADD reprocess_job_id uuid DEFAULT NULL; diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index 7e9a970ca..d2cb68131 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -1001,9 +1001,12 @@ - + + + + @@ -2109,7 +2112,7 @@ $function$ - + @@ -2157,4 +2160,4 @@ FROM qiita.artifact t;]]> - + \ No newline at end of file diff --git a/qiita_db/support_files/qiita-db.html b/qiita_db/support_files/qiita-db.html index 942c14ae8..38d3fe23b 100644 --- a/qiita_db/support_files/qiita-db.html +++ b/qiita_db/support_files/qiita-db.html @@ -2,7 +2,7 @@ -Qiita DB +Qiita Db @@ -65,9 +65,9 @@ +