From 7b667fec7f9e2c92a817fd5bf4157f296e92880b Mon Sep 17 00:00:00 2001 From: Andrea Talenti <23279528+RenzoTale88@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:42:08 +0000 Subject: [PATCH] Prepare new release --- CHANGELOG.md | 3 +++ modules/processes/GSAlign/main.nf | 9 --------- modules/processes/blat/main.nf | 21 +++++++-------------- modules/processes/lastz/main.nf | 11 +---------- modules/processes/minimap2/main.nf | 7 +------ modules/subworkflows/GSAlign.nf | 11 +++++++++++ modules/subworkflows/blat.nf | 9 +++++++++ modules/subworkflows/minimap2.nf | 10 ++++++++++ nextflow.config | 2 +- 9 files changed, 43 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e53a3f9..5ddba75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## [v1.8.6] +- Fix bugs originated after the workflow simplification. + ## [v1.8.5] - Upkeep release. diff --git a/modules/processes/GSAlign/main.nf b/modules/processes/GSAlign/main.nf index 63122c9..07ca48e 100644 --- a/modules/processes/GSAlign/main.nf +++ b/modules/processes/GSAlign/main.nf @@ -23,17 +23,8 @@ process gsalign{ command = "GSAlign -i ${srcname} -q ${tgtfile} -sen -t ${task.cpus} -idy 75 -no_vcf -o ${srcname}.${tgtname}.tmp" } else if (params.distance == 'far') { command = "GSAlign -i ${srcname} -q ${tgtfile} -sen -t ${task.cpus} -idy 70 -no_vcf -o ${srcname}.${tgtname}.tmp" - } else if (params.distance == 'same') { - command = "GSAlign -i ${srcname} -q ${tgtfile} -sen -t ${task.cpus} -no_vcf -o ${srcname}.${tgtname}.tmp" } else { command = "GSAlign -i ${srcname} -q ${tgtfile} -sen -t ${task.cpus} -no_vcf -o ${srcname}.${tgtname}.tmp" - log.info"""Preset ${params.distance} not available for GSAlign""" - log.info"""The software will use the same instead.""" - log.info"""If it is not ok for you, re-run selecting among the following options:""" - log.info""" 1 - near""" - log.info""" 2 - medium""" - log.info""" 3 - far""" - log.info""" 4 - same""" } """ ${command} diff --git a/modules/processes/blat/main.nf b/modules/processes/blat/main.nf index e8f83dc..19605e6 100644 --- a/modules/processes/blat/main.nf +++ b/modules/processes/blat/main.nf @@ -15,29 +15,22 @@ process blat { tuple val(srcname), val(tgtname), file("${srcname}.${tgtname}.psl"), emit: al_files_ch script: - def blat_args = "-fastMap -tileSize=12 -minIdentity=98" + def blat_args = "-fastMap -tileSize=12 -minIdentity=98 -ooc=${ooc12}" if (params.custom) { blat_args = params.custom } else if (params.distance == 'near'){ - blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=11 -minScore=100 -minIdentity=98" + blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=11 -minScore=100 -minIdentity=98 -ooc=${ooc11}" } else if (params.distance == 'medium'){ - blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=11 -stepSize=11 -oneOff=0 -minMatch=2 -minScore=30 -minIdentity=90 -maxGap=2 -maxIntron=75000" + blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=11 -stepSize=11 -oneOff=0 -minMatch=2 -minScore=30 -minIdentity=90 -maxGap=2 -maxIntron=75000 -ooc=${ooc11}" } else if (params.distance == 'far') { - blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=12 -oneOff=1 -minMatch=1 -minScore=30 -minIdentity=80 -maxGap=3 -maxIntron=75000" + blat_args = "-t=dna -q=dna -fastMap -noHead -tileSize=12 -oneOff=1 -minMatch=1 -minScore=30 -minIdentity=80 -maxGap=3 -maxIntron=75000 -ooc=${ooc12}" } else if (params.distance == 'balanced') { - blat_args = "-fastMap -tileSize=12 -minIdentity=98" + blat_args = "-fastMap -tileSize=12 -minIdentity=98 -ooc=${ooc12}" } else { - blat_args = "-fastMap -tileSize=12 -minIdentity=98" - log.info"""Preset ${params.distance} not available for blat""" - log.info"""The software will use the balanced instead.""" - log.info"""If it is not ok for you, re-run selecting among the following options:""" - log.info""" 1 - near""" - log.info""" 2 - medium""" - log.info""" 3 - far""" - log.info""" 4 - balanced""" + blat_args = "-fastMap -tileSize=12 -minIdentity=98 -ooc=${ooc12}" } """ - blat ${srcfile} ${tgtfile} ${blat_args} -ooc=${ooc12} -out=psl tmp.psl + blat ${srcfile} ${tgtfile} ${blat_args} -out=psl tmp.psl liftUp -type=.psl stdout $srclift warn tmp.psl | liftUp -type=.psl -pslQ ${srcname}.${tgtname}.psl $tgtlift warn stdin """ diff --git a/modules/processes/lastz/main.nf b/modules/processes/lastz/main.nf index 4a6c783..04f5d50 100644 --- a/modules/processes/lastz/main.nf +++ b/modules/processes/lastz/main.nf @@ -62,17 +62,8 @@ process lastz{ lastz_args = "B=0 C=0 E=30 H=2000 K=2200 L=6000 M=50 O=400 T=2 Y=3400" } else if (params.distance == 'primate') { lastz_args = "E=30 H=3000 K=5000 L=5000 M=10 O=400 T=1 ‑‑allocate:traceback=2048.0M" - } else if (params.distance == 'general') { - lastz_args = "E=30 H=2200 K=3000 L=3000 O=400 T=1 ‑‑allocate:traceback=2048.0M" } else { - log.info"""Preset ${params.distance} not available for lastz""" - log.info"""The software will use general instead.""" - log.info"""If it is not ok for you, re-run selecting among the following options:""" - log.info""" 1 - near""" - log.info""" 2 - medium""" - log.info""" 3 - far""" - log.info""" 4 - primate""" - log.info""" 5 - general""" + lastz_args = "E=30 H=2200 K=3000 L=3000 O=400 T=1 ‑‑allocate:traceback=2048.0M" } def qscores = qmatrix.simpleName != "OPTIONAL_FILE" ? "Q=${qmatrix}" : "" """ diff --git a/modules/processes/minimap2/main.nf b/modules/processes/minimap2/main.nf index d62432e..763bbb6 100644 --- a/modules/processes/minimap2/main.nf +++ b/modules/processes/minimap2/main.nf @@ -22,12 +22,7 @@ process minimap2 { } else if (params.distance == 'far') { mm2_args = "-cx asm20" } else { - log.info"""Preset ${params.distance} not available for minimap2""" - log.info"""The software will use the medium instead.""" - log.info"""If it is not ok for you, re-run selecting among the following options:""" - log.info""" 1 - near""" - log.info""" 2 - medium""" - log.info""" 3 - far""" + mm2_args = "-cx asm10" } """ minimap2 -t ${task.cpus} ${mm2_args} --cap-kalloc 100m --cap-sw-mem 50m --cs=long ${srcfile} ${tgtfile} | diff --git a/modules/subworkflows/GSAlign.nf b/modules/subworkflows/GSAlign.nf index 5f7c7aa..a68a0e1 100644 --- a/modules/subworkflows/GSAlign.nf +++ b/modules/subworkflows/GSAlign.nf @@ -18,6 +18,17 @@ workflow GSALIGN { twoBitTN main: + // Log if the preset is not available + if (params.distance != "near" && params.distance != "medium" && params.distance != "far" && params.distance != "same" && params.distance != "custom"){ + log.info"""Preset ${params.distance} not available for GSAlign""" + log.info"""The software will use the same instead.""" + log.info"""If it is not ok for you, re-run selecting among the following options:""" + log.info""" 1 - near""" + log.info""" 2 - medium""" + log.info""" 3 - far""" + log.info""" 4 - same""" + } + // make index bwt_index( pairspath_ch.groupTuple(by: [0, 1] ).unique() ) diff --git a/modules/subworkflows/blat.nf b/modules/subworkflows/blat.nf index c3ce8cf..addff51 100644 --- a/modules/subworkflows/blat.nf +++ b/modules/subworkflows/blat.nf @@ -20,6 +20,15 @@ workflow BLAT { main: // Check that preset is among the available ones + if (params.distance != "near" && params.distance != "medium" && params.distance != "far" && params.distance != "balanced" && params.distance != "custom"){ + log.info"""Preset ${params.distance} not available for blat""" + log.info"""The software will use the balanced instead.""" + log.info"""If it is not ok for you, re-run selecting among the following options:""" + log.info""" 1 - near""" + log.info""" 2 - medium""" + log.info""" 3 - far""" + log.info""" 4 - balanced""" + } // Prepare Ooc files diff --git a/modules/subworkflows/minimap2.nf b/modules/subworkflows/minimap2.nf index 0eadbfd..f612e52 100644 --- a/modules/subworkflows/minimap2.nf +++ b/modules/subworkflows/minimap2.nf @@ -18,6 +18,16 @@ workflow MINIMAP2 { twoBitTN main: + // Log if the preset is not available + if (params.distance != "near" && params.distance != "medium" && params.distance != "far" && params.distance != "custom"){ + log.info"""Preset ${params.distance} not available for minimap2""" + log.info"""The software will use the medium instead.""" + log.info"""If it is not ok for you, re-run selecting among the following options:""" + log.info""" 1 - near""" + log.info""" 2 - medium""" + log.info""" 3 - far""" + } + // Run minimap2 minimap2(pairspath_ch, tgt_lift, src_lift) axtChain( minimap2.out.al_files_ch, twoBitS, twoBitT) diff --git a/nextflow.config b/nextflow.config index e3155ac..891b0cc 100644 --- a/nextflow.config +++ b/nextflow.config @@ -187,5 +187,5 @@ manifest { mainScript = 'main.nf' nextflowVersion = '>=21.10.0' defaultBranch = 'main' - version = '1.8.5' + version = '1.8.6' }