From 6aa10cc515e1fdd279d0f674837ae5c9f135c092 Mon Sep 17 00:00:00 2001 From: "mareike.janiak@computationalgenomics.ca" Date: Tue, 7 Jan 2025 09:35:33 -0500 Subject: [PATCH 1/3] access year from runinfo, instead of using wild card for FinalSync --- workflows/freezeman/monitor.nf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/workflows/freezeman/monitor.nf b/workflows/freezeman/monitor.nf index d8a5296..fefdbdc 100644 --- a/workflows/freezeman/monitor.nf +++ b/workflows/freezeman/monitor.nf @@ -74,10 +74,17 @@ process FinalSync { script: def run_dir = multiqc.analysis_dir.toString() + def db = new MetadataDB(params.db, log) + def runinf = db.latestRunInfofile(multiqc.flowcell) """ rundir=\$( echo $run_dir | sed 's/\\[//' | sed 's/\\]//' ) - rsync -av /nb/Research/freezeman-processing/${multiqc.seqtype}/*/\${rundir}/report/multiqc_* /lb/robot/research/freezeman-processing/${multiqc.seqtype}/*/\${rundir}/report + rsync -av /nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report/multiqc_* \\ + /lb/robot/research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report + curl -k -X POST https://dashrunr.c3g-app.sd4h.ca/update \\ + -H "descrambler-key: \$(cat ~/assets/run-processing-update-headers)" \\ + -H "Content-Type: application/json" \\ + -d @/nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report/multiqc_data/multiqc_data.json """ } From d74f77aa100324dc2621cf6b54dd298d4cce07c7 Mon Sep 17 00:00:00 2001 From: "mareike.janiak@computationalgenomics.ca" Date: Tue, 7 Jan 2025 10:10:58 -0500 Subject: [PATCH 2/3] import analysis dir as element of list instead of whole list, update FinalSync and finish template accordingly --- assets/email_run_finish.groovy | 2 +- lib/MultiQC.groovy | 4 ++-- workflows/freezeman/monitor.nf | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/email_run_finish.groovy b/assets/email_run_finish.groovy index 81da529..a1a92f9 100644 --- a/assets/email_run_finish.groovy +++ b/assets/email_run_finish.groovy @@ -40,7 +40,7 @@ html(lang:'en') { body { div(style:"font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 900px; margin: 0 auto;") { h3 "Run: ${event.data.run_name} (${run.flowcell})" - h3 "Folder: ${run.analysis_dir}" + h3 "Folder: [${run.analysis_dir}]" p { span "Run processing finished. Full report attached to this email, but also available " a ( href:"https://datahub-297-p25.p.genap.ca/Freezeman_validation/${event.year}/${event.data.run_name}.report.html", "on GenAP" ) diff --git a/lib/MultiQC.groovy b/lib/MultiQC.groovy index eee17a9..1470e8a 100644 --- a/lib/MultiQC.groovy +++ b/lib/MultiQC.groovy @@ -13,7 +13,7 @@ class MultiQC { def file = new File(path) def jsonSlurper = new JsonSlurper().setType( JsonParserType.LAX ) this.data = jsonSlurper.parseText(file.text) - this.analysis_dir = data?.config_analysis_dir + this.analysis_dir = data?.config_analysis_dir[0] def config_report_header_info = data?.config_report_header_info this.flowcell = config_report_header_info.find { it.containsKey("Flowcell") }.Flowcell this.run = config_report_header_info.find { it.containsKey("Run") }.Run @@ -22,7 +22,7 @@ class MultiQC { MultiQC(Path path) { def jsonSlurper = new JsonSlurper().setType( JsonParserType.LAX ) this.data = jsonSlurper.parseText(path.getText()) - this.analysis_dir = data?.config_analysis_dir + this.analysis_dir = data?.config_analysis_dir[0] def config_report_header_info = data?.config_report_header_info this.flowcell = config_report_header_info.find { it.containsKey("Flowcell") }.Flowcell this.run = config_report_header_info.find { it.containsKey("Run") }.Run diff --git a/workflows/freezeman/monitor.nf b/workflows/freezeman/monitor.nf index fefdbdc..1e7b388 100644 --- a/workflows/freezeman/monitor.nf +++ b/workflows/freezeman/monitor.nf @@ -73,18 +73,18 @@ process FinalSync { tuple val(multiqc_html), val(multiqc) script: - def run_dir = multiqc.analysis_dir.toString() + def rundir = multiqc.analysis_dir def db = new MetadataDB(params.db, log) def runinf = db.latestRunInfofile(multiqc.flowcell) """ - rundir=\$( echo $run_dir | sed 's/\\[//' | sed 's/\\]//' ) - rsync -av /nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report/multiqc_* \\ - /lb/robot/research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report + echo $rundir + rsync -av /nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/${rundir}/report/multiqc_* \\ + /lb/robot/research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/${rundir}/report curl -k -X POST https://dashrunr.c3g-app.sd4h.ca/update \\ -H "descrambler-key: \$(cat ~/assets/run-processing-update-headers)" \\ -H "Content-Type: application/json" \\ - -d @/nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/\${rundir}/report/multiqc_data/multiqc_data.json + -d @/nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/${rundir}/report/multiqc_data/multiqc_data.json """ } From f128b642719ae68b9de6999765b34fa6f49cc59c Mon Sep 17 00:00:00 2001 From: "mareike.janiak@computationalgenomics.ca" Date: Tue, 7 Jan 2025 12:15:16 -0500 Subject: [PATCH 3/3] clean up FinalSync for PR --- workflows/freezeman/monitor.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/workflows/freezeman/monitor.nf b/workflows/freezeman/monitor.nf index 1e7b388..846a1a1 100644 --- a/workflows/freezeman/monitor.nf +++ b/workflows/freezeman/monitor.nf @@ -78,7 +78,6 @@ process FinalSync { def runinf = db.latestRunInfofile(multiqc.flowcell) """ - echo $rundir rsync -av /nb/Research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/${rundir}/report/multiqc_* \\ /lb/robot/research/freezeman-processing/${multiqc.seqtype}/${runinf.year}/${rundir}/report curl -k -X POST https://dashrunr.c3g-app.sd4h.ca/update \\