Skip to content
Merged

2022.07 #3206

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Qiita changelog

Version 2022.07
---------------

* Users can opt-in to get emails when their jobs change status in their User Information preferences.
* Added BIOM artifact archiving to the system; this unlinks artifacts from the main processing but leaves them in the system in case they are needed in the future.
* Added [qiime2.2022.02](https://github.com/qiita-spots/qp-qiime2/pull/68) to the system; which updated these plugins: qp-qiime2, qtp-biom, qtp-diversity, qtp-visualization
* Users can now select multiple artifacts for analysis [qp-qiime2](https://github.com/qiita-spots/qp-qiime2/pull/69), which gives access to new commands like PCoA biplots.
* [qtp-sequencing](https://github.com/qiita-spots/qtp-sequencing/pull/41/files) now uses fqtools to count the number of sequences in fastq/fastq.gz files as part as the artifact summary.
* Artifact summaries can now be updated [qiita-spots #3205](https://github.com/qiita-spots/qiita/pull/3205).
* Added to the internal (Sequence Processing Pipeline)[https://github.com/qiita-spots/qp-knight-lab-processing] the CHM13 genome so human studies are now filtered by GRCh38 genome + PhiX and CHM13 genome.

Version 2022.05
-----------------

Expand Down
2 changes: 1 addition & 1 deletion qiita_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

__version__ = "2022.04"
__version__ = "2022.07"
2 changes: 1 addition & 1 deletion qiita_db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from . import user
from . import processing_job

__version__ = "2022.04"
__version__ = "2022.07"

__all__ = ["analysis", "artifact", "archive", "base", "commands",
"environment_manager", "exceptions", "investigation", "logger",
Expand Down
33 changes: 23 additions & 10 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,14 +753,17 @@ def status(self):
qdb.sql_connection.TRN.add(sql, [self.id])
return qdb.sql_connection.TRN.execute_fetchlast()

def _set_status(self, value):
def _set_status(self, value, error_msg=None):
"""Sets the status of the job

Parameters
----------
value : str, {'queued', 'running', 'success', 'error',
'in_construction', 'waiting'}
The new status of the job
error_msg : str, optional
If not None this is the message that is going to be sent to the
user when the value is 'error'

Raises
------
Expand All @@ -781,14 +784,22 @@ def _set_status(self, value):
new_status = qdb.util.convert_to_id(
value, "processing_job_status")

if self.user.info['receive_processing_job_emails']:
# skip if software is internal
ignore_software = ('Qiita')
if self.command.software.name not in ignore_software:
subject = ('Job status change: %s (%s)' % (
self.command.name, self.id))
message = ('New status: %s' % (new_status))
qdb.util.send_email(self.user.email, subject, message)
if value not in {'waiting'}:
if self.user.info['receive_processing_job_emails']:
# skip if software is artifact definition
ignore_software = ('artifact definition', )
if self.command.software.name not in ignore_software:
ignore_commands = ('Validate', 'complete_job',
'release_validators')
if self.command.name not in ignore_commands:
subject = 'Job status change: %s (%s)' % (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to use %s myself when I have the choice. Just want to confirm that it's okay to use %s and not f'{}' in new code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed this is a matter of preference and what works well for placating flake8.

self.command.name, self.id)
message = 'New status: %s' % (value)

if value == 'error' and error_msg is not None:
message += f'\n\nError:\n{error_msg}'
qdb.util.send_email(
self.user.email, subject, message)

sql = """UPDATE qiita.processing_job
SET processing_job_status_id = %s
Expand Down Expand Up @@ -1463,7 +1474,6 @@ def _set_error(self, error):
raise qdb.exceptions.QiitaDBOperationNotPermittedError(
"Can only set up the log for jobs whose status is 'error'")

self._set_status('error')
log = qdb.logger.LogEntry.create('Runtime', error)

sql = """UPDATE qiita.processing_job
Expand All @@ -1476,6 +1486,9 @@ def _set_error(self, error):
for c in self.children:
c.complete(False, error="Parent job '%s' failed." % self.id)

# set as error after everything is in place
self._set_status('error', error_msg=error)

@property
def heartbeat(self):
"""The timestamp of the last heartbeat received from the job
Expand Down
6 changes: 3 additions & 3 deletions qiita_db/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Command(qdb.base.QiitaObject):
-------------
create
exists
get_commands_by_input_type(cls, artifact_types, active_only=True,
get_html_generator(cls, artifact_type):
get_validator(cls, artifact_type):
get_commands_by_input_type
get_html_generator
get_validator

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion qiita_db/sql_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def _raise_execution_error(self, sql, sql_args, error):
ec_lu = errorcodes.lookup(error.pgcode)
raise ValueError(
"Error running SQL: %s. MSG: %s\n" % (ec_lu, str(error)))
except (KeyError, AttributeError):
except (KeyError, AttributeError, TypeError):
raise ValueError("Error running SQL query: %s" % str(error))

@_checker
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

__version__ = "2022.04"
__version__ = "2022.07"
14 changes: 8 additions & 6 deletions qiita_pet/handlers/analysis_handlers/listing_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ def get(self):

# finding common metadata fields
metadata = analysis.metadata_categories
common = []
common = {'sample': set(), 'prep': set()}
for i, (_, m) in enumerate(metadata.items()):
if i == 0:
common = {'sample': set(m['sample']), 'prep': set(m['prep'])}
else:
common['sample'] = common['sample'] & set(m['sample'])
common['prep'] = common['prep'] & set(m['prep'])
svals = set(m['sample'])
pvals = set(m['prep'])
if i != 0:
svals = common['sample'] & svals
pvals = common['prep'] & pvals
common['sample'] = svals
common['prep'] = pvals

self.render("analysis_selected.html", sel_data=sel_data,
proc_info=proc_data_info, metadata=metadata, common=common)
2 changes: 1 addition & 1 deletion qiita_pet/handlers/api_proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from .user import (user_jobs_get_req)
from .util import check_access, check_fp

__version__ = "2022.04"
__version__ = "2022.07"

__all__ = ['prep_template_summary_get_req', 'data_types_get_req',
'study_get_req', 'sample_template_filepaths_get_req',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ Note that the command produces up to 6 output artifacts based on the aligner and
- Per genome Predictions: contains the per genome level taxonomic predictions BIOM table
- Per gene Predictions: Only WoLr1, contains the per gene level taxonomic predictions BIOM table

.. note::
Woltka provides easy transformations for the "per gene Prediction table" to generate functional
profiles, `more information <https://github.com/qiyunzhu/woltka/blob/master/doc/wol.md#comparison>`

Aligners
^^^^^^^^

Expand Down
3 changes: 3 additions & 0 deletions qiita_pet/templates/study_ajax/prep_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@
$('#new-prep-name').focus();
$('#new-prep-name').select();
});

qiita_websocket.init(window.location.host + '{% raw qiita_config.portal_dir %}/study/list/socket/', error, error);
qiita_websocket.add_callback('sel', show_alert);
});

function toggleCheckboxes(element){
Expand Down
2 changes: 1 addition & 1 deletion qiita_ware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

__version__ = "2022.04"
__version__ = "2022.07"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup
from glob import glob

__version__ = "2022.04"
__version__ = "2022.07"


classes = """
Expand Down