Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/qiita-spots/qiita into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Gossty committed Jul 9, 2024
2 parents 3afba3a + e00ccf4 commit a36dc8a
Show file tree
Hide file tree
Showing 14 changed files with 1,649 additions and 1,506 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Qiita changelog

Version 2024.07
---------------

Deployed on July 15th, 2024

* On June 14th, 2024 we modified the SPP to use ["fastp & minimap2 against GRCh38.p14 + Phi X 174 + T2T-CHM13v2.0, then Movi against GRCh38.p14, T2T-CHM13v2.0 + Human Pangenome Reference Consortium release 2023"](https://github.com/cguccione/human_host_filtration) to filter human-reads.
* Full refactor of the [DB patching system](https://github.com/qiita-spots/qiita/blob/master/CONTRIBUTING.md#patch-91sql) to make sure that a new production deployment has a fully empty database.
* Fully removed Qiimp from Qiita.
* Users can now add `ORCID`, `ResearchGate` and/or `GoogleScholar` information to their profile and the creation (registration) timestamp is kept in the database. Thank you @jlab.
* Admins can now track and purge non-confirmed users from the database via the GUI (`/admin/purge_users/`). Thank you @jlab.
* Added `qiita.slurm_resource_allocations` to store general job resource usage, which can be populated by `qiita_db.util.update_resource_allocation_table`.
* Added `qiita_db.util.resource_allocation_plot` to generate different models to allocate resources from a given software command based on previous jobs, thank you @Gossty !
* The stats page map can be centered via the configuration file; additionally, the Help and Admin emails are defined also via the configuration files, thank you @jlab !
* ``Sequel IIe``, ``Revio``, and ``Onso`` are now valid instruments for the ``PacBio_SMRT`` platform.
* Added `current_human_filtering` to the prep-information and `human_reads_filter_method` to the artifact to keep track of the method that it was used to human reads filter the raw artifact and know if it's up to date with what is expected via the best practices.
* Added `reprocess_job_id` to the prep-information so we keep track if a preparation has been reprocessed with another job.
* Other general fixes, like [#3385](https://github.com/qiita-spots/qiita/pull/3385), [#3397](https://github.com/qiita-spots/qiita/pull/3397), [#3399](https://github.com/qiita-spots/qiita/pull/3399), [#3400](https://github.com/qiita-spots/qiita/pull/3400), [#3409](https://github.com/qiita-spots/qiita/pull/3409), [#3410](https://github.com/qiita-spots/qiita/pull/3410).


Version 2024.02
---------------

Expand Down
48 changes: 48 additions & 0 deletions qiita_db/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 human_reads_filter_method 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])
15 changes: 7 additions & 8 deletions qiita_db/support_files/patches/92.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
3 changes: 3 additions & 0 deletions qiita_db/support_files/patches/test_db_sql/91.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Just an empty SQL to allow the changes implemented in
-- https://github.com/qiita-spots/qiita/pull/3403 to take effect
SELECT 1;
10 changes: 10 additions & 0 deletions qiita_db/support_files/patches/test_db_sql/92.sql
Original file line number Diff line number Diff line change
Expand Up @@ -942,3 +942,13 @@ WHERE email = '[email protected]';
INSERT INTO qiita.qiita_user VALUES ('[email protected]', 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 ('[email protected]', 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 ('[email protected]', 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;
Loading

0 comments on commit a36dc8a

Please sign in to comment.