Skip to content
Merged
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
4 changes: 4 additions & 0 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion taca/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Main TACA module"""

__version__ = "1.6.14"
__version__ = "1.6.15"
2 changes: 1 addition & 1 deletion taca/analysis/analysis_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down
19 changes: 18 additions & 1 deletion taca/element/Element_Runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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:

Choose a reason for hiding this comment

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

I think this would send the email even if the mismatch threshold was predetermined to be 0 and there is no index collision (for example when we only have single indexes.

Copy link
Author

Choose a reason for hiding this comment

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

Hm, I can't see that it does that anywhere. I'm not sure it would send it for those cases anyway, since i1_mm_threshold and i2_mm_threshold come from get_custom_mistmatch_thresholds that only looks at the distance.

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)

Expand Down
8 changes: 8 additions & 0 deletions tests/analysis/test_analysis_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ["<EMAIL>"]}},
).start()

# Add metadata files
run_dir = create_element_run_dir(
Expand Down
Loading