Skip to content

Commit

Permalink
Merge pull request #454 from ssjunnebo/fix_missing_samplesheet
Browse files Browse the repository at this point in the history
Fix missing samplesheet issue
  • Loading branch information
ssjunnebo authored Dec 16, 2024
2 parents 160479c + 8187c3c commit 97ed033
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
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

## 20241216.1

Email user instead of craching if unable to create Illumina runobject

## 20241212.2

Fix for ONT demultiplexing status in bioinfo deliveries script
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.5.0"
__version__ = "1.5.1"
23 changes: 18 additions & 5 deletions taca/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from taca.illumina.NextSeq_Runs import NextSeq_Run
from taca.illumina.NovaSeq_Runs import NovaSeq_Run
from taca.illumina.NovaSeqXPlus_Runs import NovaSeqXPlus_Run
from taca.utils import statusdb
from taca.utils import misc, statusdb
from taca.utils.config import CONFIG
from taca.utils.transfer import RsyncAgent

Expand Down Expand Up @@ -514,20 +514,33 @@ def _process(run):
_process(runObj)
else:
data_dirs = CONFIG.get("analysis").get("data_dirs")
mail_recipients = CONFIG.get("mail", {}).get("recipients")
for data_dir in data_dirs:
# Run folder looks like DATE_*_*_*, the last section is the FC name.
runs = glob.glob(os.path.join(data_dir, "[1-9]*_*_*_*"))
for _run in runs:
runObj = get_runObj(_run, software)
if not runObj:
try:
runObj = get_runObj(_run, software)
except:
# This might throw an exception e.g. if the samplesheet is missing.
# It is better to continue processing other runs
logger.warning(
f"Unrecognized instrument type or incorrect run folder {run}"
f"There was an error setting up a run object for {_run}"
)
if mail_recipients:
subject = f"Error setting up a run object for {_run}"
message = f"""There was an error setting up a run object for {_run}. It is possible that the sample sheet is missing."""
misc.send_mail(subject, message, mail_recipients)
pass
else:
try:
_process(runObj)
except:
# This function might throw and exception,
# it is better to continue processing other runs
logger.warning(f"There was an error processing the run {run}")
logger.warning(f"There was an error processing the run {_run}")
if mail_recipients:
subject = f"Error processing {_run}"
message = f"""There was an error processing {_run}. Please check the TACA log file on preproc for more information."""
misc.send_mail(subject, message, mail_recipients)
pass
7 changes: 4 additions & 3 deletions taca/illumina/Runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ def _get_samplesheet(self):
if os.path.exists(ssname):
return ssname
else:
logger.warning(
f"Not able to find samplesheet {self.flowcell_id}.csv in {self.CONFIG['samplesheets_dir']}"
)
raise RuntimeError(
"not able to find samplesheet {}.csv in {}".format(
self.flowcell_id, self.CONFIG["samplesheets_dir"]
)
f"Not able to find samplesheet {self.flowcell_id}.csv in {self.CONFIG['samplesheets_dir']}"
)

def _is_demultiplexing_done(self):
Expand Down

0 comments on commit 97ed033

Please sign in to comment.