diff --git a/VERSIONLOG.md b/VERSIONLOG.md index 14ed2542..29c618bc 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -1,5 +1,9 @@ # TACA Version Log +##20260127.1 + +Email when MismatchThreshold is set to 0 for AVITI runs + ##20251127.1 Enable archiving of Aviti Teton runs to PDC diff --git a/taca/__init__.py b/taca/__init__.py index 2cc41b5c..35d2b951 100644 --- a/taca/__init__.py +++ b/taca/__init__.py @@ -1,3 +1,3 @@ """Main TACA module""" -__version__ = "1.6.14" +__version__ = "1.6.15" diff --git a/taca/analysis/analysis_element.py b/taca/analysis/analysis_element.py index c46c0a77..04f85b7c 100755 --- a/taca/analysis/analysis_element.py +++ b/taca/analysis/analysis_element.py @@ -153,7 +153,7 @@ def _process(run_to_process): email_subject = f"{run} has been transferred to the analysis cluster" email_message = ( f"Rsync of data for run {run} to the analysis cluster has finished!\n" - f"The run is available at https://genomics-status.scilifelab.se/flowcells_element/{run}" + f"The run is available at https://genomics-status.scilifelab.se/flowcells_element/{run.NGI_run_id}" ) send_mail(email_subject, email_message, CONFIG["mail"]["recipients"]) diff --git a/taca/element/Element_Runs.py b/taca/element/Element_Runs.py index 0ac1a5d0..e3c64445 100644 --- a/taca/element/Element_Runs.py +++ b/taca/element/Element_Runs.py @@ -13,7 +13,9 @@ import pandas as pd from Levenshtein import distance +from taca.utils.config import CONFIG from taca.utils.filesystem import chdir +from taca.utils.misc import send_mail from taca.utils.statusdb import ElementRunsConnection logger = logging.getLogger(__name__) @@ -724,7 +726,22 @@ def make_demux_manifests( ) settings_kvs["I1MismatchThreshold"] = str(i1_mm_threshold) settings_kvs["I2MismatchThreshold"] = str(i2_mm_threshold) - + if i1_mm_threshold == 0 or i2_mm_threshold == 0: + email_subject = ( + f"MismatchThreshold(s) set to 0 for {self.NGI_run_id}" + ) + email_message = ( + f"During demultiplexing manifest generation for run {self.NGI_run_id}, " + "the minimum distance between some index sequences was at or below 2. " + "As a result, the I1MismatchThreshold and/or I2MismatchThreshold was set to 0.\n\n" + f"Lanes: {', '.join(map(str, group['Lane'].unique()))}\n" + f"I1MismatchThreshold: {i1_mm_threshold}\n" + f"I2MismatchThreshold: {i2_mm_threshold}\n\n" + "Please check that this is acceptable and inform the user." + ) + send_mail( + email_subject, email_message, CONFIG["mail"]["recipients"] + ) # Add PhiX to group group = pd.concat([group, group_controls], axis=0, ignore_index=True) diff --git a/tests/analysis/test_analysis_element.py b/tests/analysis/test_analysis_element.py index cf9a33c5..489786ae 100644 --- a/tests/analysis/test_analysis_element.py +++ b/tests/analysis/test_analysis_element.py @@ -154,6 +154,14 @@ def test_process_on_finished_run(aviti_fixture): # Sub-mock configuration mocks["mock_db"].return_value.check_db_run_status.return_value = "ongoing" mocks["mock_db"].return_value.upload_to_statusdb.return_value = None + # set mocks["mock_mail"] to mock taca.element.Element_Runs.send_mail instead + # of taca.analysis.analysis_element.send_mail + mocks["mock_mail"].stop() + mocks["mock_mail"] = patch("taca.element.Element_Runs.send_mail").start() + patch( + "taca.element.Element_Runs.CONFIG", + new={**get_config(tmp), "mail": {"recipients": [""]}}, + ).start() # Add metadata files run_dir = create_element_run_dir(