From 57d1b146729223da9daa286a1cc75db6f2923746 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 29 Jan 2024 12:35:46 -0700 Subject: [PATCH 1/3] 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 e23ef693ebcda4cfdde35c214a10d124e1e27ca6 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 1 Jul 2024 18:35:54 -0600 Subject: [PATCH 2/3] human_reads_filter_method --- qiita_db/artifact.py | 48 + qiita_db/support_files/patches/92.sql | 15 +- .../support_files/patches/test_db_sql/92.sql | 10 + qiita_db/support_files/qiita-db.dbs | 191 +- qiita_db/support_files/qiita-db.html | 2760 +++++++++-------- qiita_db/test/test_artifact.py | 19 + 6 files changed, 1569 insertions(+), 1474 deletions(-) diff --git a/qiita_db/artifact.py b/qiita_db/artifact.py index 94f335c94..cc308fb8d 100644 --- a/qiita_db/artifact.py +++ b/qiita_db/artifact.py @@ -1684,3 +1684,51 @@ def get_commands(self): cids = cmds & cids return [qdb.software.Command(cid) for cid in cids] + + @property + def human_reads_filter_method(self): + """The human_reads_filter_method of the artifact + + Returns + ------- + str + The artifact name + """ + with qdb.sql_connection.TRN: + sql = """SELECT human_reads_filter_method + FROM qiita.artifact + LEFT JOIN qiita.human_reads_filter_method + USING (human_reads_filter_method_id) + WHERE artifact_id = %s""" + qdb.sql_connection.TRN.add(sql, [self.id]) + return qdb.sql_connection.TRN.execute_fetchlast() + + @human_reads_filter_method.setter + def human_reads_filter_method(self, value): + """Set the human_reads_filter_method of the artifact + + Parameters + ---------- + value : str + The new artifact's human_reads_filter_method + + Raises + ------ + ValueError + If `value` doesn't exist in the database + """ + with qdb.sql_connection.TRN: + sql = """SELECT human_reads_filter_method_id + FROM qiita.human_reads_filter_method + WHERE human_reads_filter_method = %s""" + qdb.sql_connection.TRN.add(sql, [value]) + idx = qdb.sql_connection.TRN.execute_fetchflatten() + + if len(idx) == 0: + raise ValueError( + f'"{value}" is not a valid human_reads_filter_method') + + sql = """UPDATE qiita.artifact + SET human_reads_filter_method_id = %s + WHERE artifact_id = %s""" + qdb.sql_connection.TRN.add(sql, [idx[0], self.id]) diff --git a/qiita_db/support_files/patches/92.sql b/qiita_db/support_files/patches/92.sql index b618c3133..37576bca2 100644 --- a/qiita_db/support_files/patches/92.sql +++ b/qiita_db/support_files/patches/92.sql @@ -48,19 +48,18 @@ ALTER TABLE qiita.qiita_user ADD social_orcid character varying DEFAULT NULL; ALTER TABLE qiita.qiita_user ADD social_researchgate character varying DEFAULT NULL; ALTER TABLE qiita.qiita_user ADD social_googlescholar character varying DEFAULT NULL; +-- Jul 1, 2024 -- Add human_reads_filter_method so we can keep track of the available methods -- and link them to the preparations -CREATE TABLE qiita.human_reads_filter_method ( - human_reads_filter_method_id bigint NOT NULL, - human_reads_filter_method_method character varying NOT NULL, - CONSTRAINT pk_human_reads_filter_method_id PRIMARY KEY ( - human_reads_filter_method_id ) - ); +CREATE TABLE qiita.human_reads_filter_method ( + human_reads_filter_method_id SERIAL PRIMARY KEY, + human_reads_filter_method character varying NOT NULL +); -ALTER TABLE qiita.prep_template +ALTER TABLE qiita.artifact ADD human_reads_filter_method_id bigint DEFAULT NULL; -ALTER TABLE qiita.prep_template +ALTER TABLE qiita.artifact ADD CONSTRAINT fk_human_reads_filter_method FOREIGN KEY ( human_reads_filter_method_id ) REFERENCES qiita.human_reads_filter_method ( human_reads_filter_method_id ); diff --git a/qiita_db/support_files/patches/test_db_sql/92.sql b/qiita_db/support_files/patches/test_db_sql/92.sql index 8346b18e1..938b1bb2a 100644 --- a/qiita_db/support_files/patches/test_db_sql/92.sql +++ b/qiita_db/support_files/patches/test_db_sql/92.sql @@ -942,3 +942,13 @@ WHERE email = 'test@foo.bar'; INSERT INTO qiita.qiita_user VALUES ('justnow@nonvalidat.ed', 5, '$2a$12$gnUi8Qg.0tvW243v889BhOBhWLIHyIJjjgaG6dxuRJkUM8nXG9Efe', 'JustNow', 'NonVeriUser', '1634 Edgemont Avenue', '303-492-1984', NULL, NULL, NULL, false, NOW(), NULL, NULL, NULL); INSERT INTO qiita.qiita_user VALUES ('ayearago@nonvalidat.ed', 5, '$2a$12$gnUi8Qg.0tvW243v889BhOBhWLIHyIJjjgaG6dxuRJkUM8nXG9Efe', 'Oldie', 'NonVeriUser', '172 New Lane', '102-111-1984', NULL, NULL, NULL, false, NOW() - INTERVAL '1 YEAR', NULL, NULL, NULL); INSERT INTO qiita.qiita_user VALUES ('3Xdays@nonvalidat.ed', 5, '$2a$12$gnUi8Qg.0tvW243v889BhOBhWLIHyIJjjgaG6dxuRJkUM8nXG9Efe', 'TooLate', 'NonVeriUser', '564 C Street', '508-492-222', NULL, NULL, NULL, false, NOW() - INTERVAL '30 DAY', NULL, NULL, NULL); + +-- Jul 1, 2024 +-- Inserting a human_reads_filter_method and assigning it to the raw data in prep/artifact 1 +INSERT INTO qiita.human_reads_filter_method ( + human_reads_filter_method) + VALUES ( + 'The greatest human filtering method'); +UPDATE qiita.artifact + SET human_reads_filter_method_id = 1 + WHERE artifact_id = 1; diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index cf84177af..1a9d03043 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -221,6 +221,9 @@ + + + @@ -248,6 +251,9 @@ + + + @@ -1014,9 +1020,6 @@ - - - @@ -2093,97 +2096,97 @@ $function$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +