Skip to content

Commit a5deb83

Browse files
authored
Merge pull request #10 from jlab/auth_oidc_merged
Auth OIDC merged
2 parents 79e794a + c9aacec commit a5deb83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3522
-1899
lines changed

.github/workflows/qiita-ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ jobs:
104104
- name: Install plugins
105105
shell: bash -l {0}
106106
run: |
107-
wget https://data.qiime2.org/distro/core/qiime2-2022.11-py38-linux-conda.yml
108-
conda env create --quiet -n qtp-biom --file qiime2-2022.11-py38-linux-conda.yml
109-
rm qiime2-2022.11-py38-linux-conda.yml
107+
conda env create -n qtp-biom --file https://data.qiime2.org/distro/amplicon/qiime2-amplicon-2024.5-py39-linux-conda.yml
110108
export QIITA_ROOTCA_CERT=`pwd`/qiita_core/support_files/ci_rootca.crt
111109
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
112110
export REDBIOM_HOST="http://localhost:7379"
@@ -181,7 +179,7 @@ jobs:
181179
echo "Connecting as $USER@localhost"
182180
# this line (and the -o StrictHostKeyChecking=no) is so the server
183181
# is added to the list of known servers
184-
scp -o StrictHostKeyChecking=no -i $PWD/qiita_ware/test/test_data/test_key $USER@localhost:/home/runner/work/qiita/qiita/qiita_ware/test/test_data/random_key /home/runner/work/qiita/qiita/qiita_ware/test/test_data/random_key_copy_1
182+
scp -O -o StrictHostKeyChecking=no -i $PWD/qiita_ware/test/test_data/test_key $USER@localhost:/home/runner/work/qiita/qiita/qiita_ware/test/test_data/random_key /home/runner/work/qiita/qiita/qiita_ware/test/test_data/random_key_copy_1
185183
186184
- name: Main tests
187185
shell: bash -l {0}

CHANGELOG.md

+68-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,72 @@
11
# Qiita changelog
22

3+
Version 2025.02
4+
---------------
5+
6+
Deployed on February 24th, 2025
7+
8+
* Replaced os.rename for shutil.move in the code to fix [#3455](https://github.com/qiita-spots/qiita/issues/3455).
9+
* Via qp-spades, replaced the legacy `spades` command for `cloudSPAdes` for TellSeq.
10+
* `FASTA_preprocessed` within qtp-sequencing now allows for results to be named using their sample-name, extra from run-prefix.
11+
* `Remove SynDNA inserts & plasmid reads` superseded `Remove SynDNA reads`, which now removes SynDna inserts and plasmids.
12+
* `update_resource_allocation_redis` now relies on using equations stored in the database vs. hardcoded; thank you @Gossty!
13+
* SPP: Updated prep-info file generation to identify and report filtered fastq files that could not be matched to a sample-id instead of silently ignoring them.
14+
* SPP: Removed legacy test code and example files for amplicon processing. Some other tests updated and repurposed.
15+
* SPP: jobs are now easier to restart.
16+
* SPP: MultiQC report generation is now a separate slurm job & use jinja2 templates; also FastQC use jinja2 templates.
17+
18+
19+
Version 2025.01
20+
---------------
21+
22+
Deployed on January 15th, 2025
23+
24+
* The Analysis owner is now displayed in the analysis list and the individual analysis page.
25+
* Admins can now use the per-preparation "Download Data Release" button to get a "BIOM" release; this version is focus on NPH data releases.
26+
* Improved complete_job creation time, which should result in Qiita jobs ([multiple steps](https://qiita.ucsd.edu/static/doc/html/dev/resource_allocation.html) finishing faster; for bencharks visit [patch 93.sql](https://github.com/qiita-spots/qiita/blob/master/qiita_db/support_files/patches/93.sql).
27+
* SPP improvements: TellSeq support added; plugin refactored to allow for easier additions like TellSeq in the future. Job restart greatly improved. Much improved handling of sample-names and ids that contain substrings like ‘I1’ and ‘R2’. New SequenceCount job can count sequences and base-pairs in parallel for any list of fastq files.
28+
* Other general fixes [#3440](https://github.com/qiita-spots/qiita/pull/3440), [#3445](https://github.com/qiita-spots/qiita/pull/3445), [#3446](https://github.com/qiita-spots/qiita/pull/3446),
29+
30+
31+
Version 2024.10
32+
---------------
33+
34+
Deployed on October 14th, 2024
35+
36+
* Added update_resource_allocation_redis and companion code, so resource allocations summaries are available for review. Thank you @Gossty!
37+
* Now is possible to have default workflows with only one step.
38+
* `qiita_client.update_job_step` now accepts an ignore_error optional parameter. Thank you @charles-cowart!
39+
* Initial changes in `qiita_client` to have more accurate variable names: `QIITA_SERVER_CERT` -> `QIITA_ROOTCA_CERT`. Thank you @charles-cowart!
40+
* Added `get_artifact_html_summary` to `qiita_client` to retrieve the summary file of an artifact.
41+
* Re-added github actions to `https://github.com/qiita-spots/qiita_client`.
42+
* `SortMeRNA v4.3.7` superseded `Sortmerna v2.1b`, which relies on Silva 138 and now produced even mates. Thank you @ekopylova and @biocodz for the support.
43+
* `Remove SynDNA reads` superseded `SynDNA Woltka`, which now generates even mates.
44+
* `Woltka v0.1.7, paired-end` superseded `Woltka v0.1.6` in `qp-woltka`; [more information](https://qiita.ucsd.edu/static/doc/html/processingdata/woltka_pairedend.html). Thank you to @qiyunzhu for the benchmarks!
45+
* Other general fixes, like [#3424](https://github.com/qiita-spots/qiita/pull/3424), [#3425](https://github.com/qiita-spots/qiita/pull/3425), [#3439](https://github.com/qiita-spots/qiita/pull/3439), [#3440](https://github.com/qiita-spots/qiita/pull/3440).
46+
* General SPP improvements, like: [NuQC modified to preserve metadata in fastq files](https://github.com/biocore/mg-scripts/pull/155), [use squeue instead of sacct](https://github.com/biocore/mg-scripts/pull/152), , [job aborts if Qiita study contains sample metadata columns reserved for prep-infos](https://github.com/biocore/mg-scripts/pull/151), [metapool generates OverrideCycles value](https://github.com/biocore/metagenomics_pooling_notebook/pull/225).
47+
* We updated the available parameters for `Filter features against reference [filter_features]`, `Non V4 16S sequence assessment [non_v4_16s]` and all the phylogenetic analytical commands so they can use `Greengenes2 2024.09`.
48+
49+
50+
51+
Version 2024.07
52+
---------------
53+
54+
Deployed on July 15th, 2024
55+
56+
* 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.
57+
* 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.
58+
* Fully removed Qiimp from Qiita.
59+
* 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.
60+
* Admins can now track and purge non-confirmed users from the database via the GUI (`/admin/purge_users/`). Thank you @jlab.
61+
* Added `qiita.slurm_resource_allocations` to store general job resource usage, which can be populated by `qiita_db.util.update_resource_allocation_table`.
62+
* 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 !
63+
* 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 !
64+
* ``Sequel IIe``, ``Revio``, and ``Onso`` are now valid instruments for the ``PacBio_SMRT`` platform.
65+
* 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.
66+
* Added `reprocess_job_id` to the prep-information so we keep track if a preparation has been reprocessed with another job.
67+
* 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).
68+
69+
370
Version 2024.02
471
---------------
572

@@ -167,7 +234,7 @@ Version 2021.11
167234
* Allow chucked download of metadata files in analyses; this allows to process large meta-analysis (like those for The Microsetta Initiative) without worker blockage.
168235
* Added to the qp-qiime2 plugin the possibility of filtering tables based on system available "FeatureData[Sequence]"; to start we added 90/100/150 bps bloom tables.
169236
* Now we can instantiate a study via their title (Study.from_title); this will facilitate orchestration with qebil.
170-
* Speed up Study listing for admins and general users; the admin study display came down from 20 to 2 seconds.
237+
* Speed up Study listing for admins and general users; the admin study display came down from 20 to 2 seconds.
171238
* Fixed the following issues: [3142](https://github.com/qiita-spots/qiita/issues/3142), [3149](https://github.com/qiita-spots/qiita/issues/3149), [3150](https://github.com/qiita-spots/qiita/issues/3150), [3119](https://github.com/qiita-spots/qiita/issues/3119), and [3160](https://github.com/qiita-spots/qiita/issues/3160).
172239

173240

qiita_core/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
__version__ = "2024.02"
9+
__version__ = "2025.02"

qiita_db/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from . import user
2828
from . import processing_job
2929

30-
__version__ = "2024.02"
30+
__version__ = "2025.02"
3131

3232
__all__ = ["analysis", "artifact", "archive", "base", "commands",
3333
"environment_manager", "exceptions", "investigation", "logger",

qiita_db/analysis.py

+16
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,22 @@ def create(cls, owner, name, description, from_default=False,
215215
job.submit()
216216
return instance
217217

218+
@classmethod
219+
def delete_analysis_artifacts(cls, _id):
220+
"""Deletes the artifacts linked to an artifact and then the analysis
221+
222+
Parameters
223+
----------
224+
_id : int
225+
The analysis id
226+
"""
227+
analysis = cls(_id)
228+
aids = [a.id for a in analysis.artifacts if not a.parents]
229+
aids.sort(reverse=True)
230+
for aid in aids:
231+
qdb.artifact.Artifact.delete(aid)
232+
cls.delete(analysis.id)
233+
218234
@classmethod
219235
def delete(cls, _id):
220236
"""Deletes an analysis

qiita_db/archive.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def get_merging_scheme_from_job(cls, job):
116116
acmd = job.command
117117
parent = job.input_artifacts[0]
118118
parent_pparameters = parent.processing_parameters
119+
phms = None
119120
if parent_pparameters is None:
120121
parent_cmd_name = None
121122
parent_parameters = None
@@ -125,12 +126,26 @@ def get_merging_scheme_from_job(cls, job):
125126
parent_cmd_name = pcmd.name
126127
parent_parameters = parent_pparameters.values
127128
parent_merging_scheme = pcmd.merging_scheme
128-
129-
return qdb.util.human_merging_scheme(
129+
if not parent_merging_scheme['ignore_parent_command']:
130+
gp = parent.parents[0]
131+
gp_params = gp.processing_parameters
132+
if gp_params is not None:
133+
gp_cmd = gp_params.command
134+
phms = qdb.util.human_merging_scheme(
135+
parent_cmd_name, parent_merging_scheme,
136+
gp_cmd.name, gp_cmd.merging_scheme,
137+
parent_parameters, [], gp_params.values)
138+
139+
hms = qdb.util.human_merging_scheme(
130140
acmd.name, acmd.merging_scheme,
131141
parent_cmd_name, parent_merging_scheme,
132142
job.parameters.values, [], parent_parameters)
133143

144+
if phms is not None:
145+
hms = qdb.util.merge_overlapping_strings(hms, phms)
146+
147+
return hms
148+
134149
@classmethod
135150
def retrieve_feature_values(cls, archive_merging_scheme=None,
136151
features=None):

qiita_db/artifact.py

+78-18
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,8 @@ def can_be_submitted_to_ebi(self):
929929
# words has more that one processing step behind it
930930
fine_to_send = []
931931
fine_to_send.extend([pt.artifact for pt in self.prep_templates])
932-
fine_to_send.extend([c for a in fine_to_send for c in a.children])
932+
fine_to_send.extend([c for a in fine_to_send if a is not None
933+
for c in a.children])
933934
if self not in fine_to_send:
934935
return False
935936

@@ -1342,23 +1343,6 @@ def _helper(sql_edges, edges, nodes):
13421343
# If the job is in success we don't need to do anything
13431344
# else since it would've been added by the code above
13441345
if jstatus != 'success':
1345-
# Connect the job with his input artifacts, the
1346-
# input artifacts may or may not exist yet, so we
1347-
# need to check both the input_artifacts and the
1348-
# pending properties
1349-
for in_art in n_obj.input_artifacts:
1350-
iid = in_art.id
1351-
if iid not in nodes and iid in extra_nodes:
1352-
nodes[iid] = extra_nodes[iid]
1353-
_add_edge(edges, nodes[iid], nodes[n_obj.id])
1354-
1355-
pending = n_obj.pending
1356-
for pred_id in pending:
1357-
for pname in pending[pred_id]:
1358-
in_node_id = '%s:%s' % (
1359-
pred_id, pending[pred_id][pname])
1360-
_add_edge(edges, nodes[in_node_id],
1361-
nodes[n_obj.id])
13621346

13631347
if jstatus != 'error':
13641348
# If the job is not errored, we can add the
@@ -1380,6 +1364,34 @@ def _helper(sql_edges, edges, nodes):
13801364
queue.append(cjob.id)
13811365
if cjob.id not in nodes:
13821366
nodes[cjob.id] = ('job', cjob)
1367+
1368+
# including the outputs
1369+
for o_name, o_type in cjob.command.outputs:
1370+
node_id = '%s:%s' % (cjob.id, o_name)
1371+
node = TypeNode(
1372+
id=node_id, job_id=cjob.id,
1373+
name=o_name, type=o_type)
1374+
if node_id not in nodes:
1375+
nodes[node_id] = ('type', node)
1376+
1377+
# Connect the job with his input artifacts, the
1378+
# input artifacts may or may not exist yet, so we
1379+
# need to check both the input_artifacts and the
1380+
# pending properties
1381+
for in_art in n_obj.input_artifacts:
1382+
iid = in_art.id
1383+
if iid not in nodes and iid in extra_nodes:
1384+
nodes[iid] = extra_nodes[iid]
1385+
_add_edge(edges, nodes[iid], nodes[n_obj.id])
1386+
1387+
pending = n_obj.pending
1388+
for pred_id in pending:
1389+
for pname in pending[pred_id]:
1390+
in_node_id = '%s:%s' % (
1391+
pred_id, pending[pred_id][pname])
1392+
_add_edge(edges, nodes[in_node_id],
1393+
nodes[n_obj.id])
1394+
13831395
elif n_type == 'type':
13841396
# Connect this 'future artifact' with the job that will
13851397
# generate it
@@ -1684,3 +1696,51 @@ def get_commands(self):
16841696
cids = cmds & cids
16851697

16861698
return [qdb.software.Command(cid) for cid in cids]
1699+
1700+
@property
1701+
def human_reads_filter_method(self):
1702+
"""The human_reads_filter_method of the artifact
1703+
1704+
Returns
1705+
-------
1706+
str
1707+
The human_reads_filter_method name
1708+
"""
1709+
with qdb.sql_connection.TRN:
1710+
sql = """SELECT human_reads_filter_method
1711+
FROM qiita.artifact
1712+
LEFT JOIN qiita.human_reads_filter_method
1713+
USING (human_reads_filter_method_id)
1714+
WHERE artifact_id = %s"""
1715+
qdb.sql_connection.TRN.add(sql, [self.id])
1716+
return qdb.sql_connection.TRN.execute_fetchlast()
1717+
1718+
@human_reads_filter_method.setter
1719+
def human_reads_filter_method(self, value):
1720+
"""Set the human_reads_filter_method of the artifact
1721+
1722+
Parameters
1723+
----------
1724+
value : str
1725+
The new artifact's human_reads_filter_method
1726+
1727+
Raises
1728+
------
1729+
ValueError
1730+
If `value` doesn't exist in the database
1731+
"""
1732+
with qdb.sql_connection.TRN:
1733+
sql = """SELECT human_reads_filter_method_id
1734+
FROM qiita.human_reads_filter_method
1735+
WHERE human_reads_filter_method = %s"""
1736+
qdb.sql_connection.TRN.add(sql, [value])
1737+
idx = qdb.sql_connection.TRN.execute_fetchflatten()
1738+
1739+
if len(idx) == 0:
1740+
raise ValueError(
1741+
f'"{value}" is not a valid human_reads_filter_method')
1742+
1743+
sql = """UPDATE qiita.artifact
1744+
SET human_reads_filter_method_id = %s
1745+
WHERE artifact_id = %s"""
1746+
qdb.sql_connection.TRN.add(sql, [idx[0], self.id])

qiita_db/handlers/processing_job.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ def post(self, job_id):
146146
cmd, values_dict={'job_id': job_id,
147147
'payload': self.request.body.decode(
148148
'ascii')})
149-
job = qdb.processing_job.ProcessingJob.create(job.user, params)
149+
# complete_job are unique so it is fine to force them to be created
150+
job = qdb.processing_job.ProcessingJob.create(
151+
job.user, params, force=True)
150152
job.submit()
151153

152154
self.finish()

qiita_db/handlers/tests/test_processing_job.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ def test_post_job_success(self):
233233
self.assertIsNotNone(cj)
234234
# additionally we can test that job.print_trace is correct
235235
self.assertEqual(job.trace, [
236-
f'{job.id} [Not Available]: Validate | '
236+
f'{job.id} [Not Available] (success): Validate | '
237237
'-p qiita -N 1 -n 1 --mem 90gb --time 150:00:00 --nice=10000',
238-
f' {cj.id} [{cj.external_id}] | '
238+
f' {cj.id} [{cj.external_id}] (success)| '
239239
'-p qiita -N 1 -n 1 --mem 16gb --time 10:00:00 --nice=10000'])
240240

241241
def test_post_job_success_with_archive(self):

0 commit comments

Comments
 (0)