Skip to content

Commit

Permalink
Merge pull request #4 from c3g/freezeman_finalSync
Browse files Browse the repository at this point in the history
Freezeman final sync
  • Loading branch information
MareikeJaniak authored Jan 7, 2025
2 parents 6be71e8 + f128b64 commit 325f853
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/email_run_finish.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
4 changes: 2 additions & 2 deletions lib/MultiQC.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 9 additions & 3 deletions workflows/freezeman/monitor.nf
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@ 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}/*/\${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
"""
}

Expand Down

0 comments on commit 325f853

Please sign in to comment.