From 4316f03347efd1601ee8a91c057da2143628843f Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Tue, 8 Aug 2023 11:40:42 +0200 Subject: [PATCH 1/9] Added treat & control lists inputs and SE modifier --- modules/nf-core/genrich/main.nf | 34 ++++++++++++++++++-------------- modules/nf-core/genrich/meta.yml | 5 +++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/genrich/main.nf b/modules/nf-core/genrich/main.nf index 4adcd968f1fa..46b9088dbb3f 100644 --- a/modules/nf-core/genrich/main.nf +++ b/modules/nf-core/genrich/main.nf @@ -8,8 +8,7 @@ process GENRICH { 'biocontainers/genrich:0.6.1--h5bf99c6_1' }" input: - tuple val(meta), path(treatment_bam) - path control_bam + tuple val(meta), path(treatment_bam), path(control_bam) path blacklist_bed val save_pvalues val save_pileup @@ -17,25 +16,28 @@ process GENRICH { val save_duplicates output: - tuple val(meta), path("*narrowPeak") , emit: peaks + tuple val(meta), path("*.narrowPeak") , emit: peak tuple val(meta), path("*pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues - tuple val(meta), path("*pileup.bedGraph") , optional:true, emit: bedgraph_pileup - tuple val(meta), path("*intervals.bed") , optional:true, emit: bed_intervals - tuple val(meta), path("*duplicates.txt") , optional:true, emit: duplicates + tuple val(meta), path("*pileup.bedGraph"), optional:true, emit: bedgraph_pileup + tuple val(meta), path("*intervals.bed"), optional:true, emit: bed_intervals + tuple val(meta), path("*duplicates.txt"), optional:true, emit: duplicates path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def control = control_bam ? "-c $control_bam" : '' - def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" - def pvalues = save_pvalues ? "-f ${prefix}.pvalues.bedGraph" : "" - def pileup = save_pileup ? "-k ${prefix}.pileup.bedGraph" : "" - def bed = save_bed ? "-b ${prefix}.intervals.bed" : "" + def args = task.ext.args ?: "" + def prefix = task.ext.prefix ?: "${meta.id}" + def layout = meta.single_end ? "-y" : "" + def treatment = treatment_bam ? "-t ${treatment_bam.sort().join(',')}" : "" + def control = control_bam ? "-c ${control_bam.sort().join(',')}" : "" + def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" + def pvalues = save_pvalues ? "-f ${prefix}.pvalues.bedGraph" : "" + def pileup = save_pileup ? "-k ${prefix}.pileup.bedGraph" : "" + def bed = save_bed ? "-b ${prefix}.intervals.bed" : "" def duplicates = "" + if (save_duplicates) { if (args.contains('-r')) { duplicates = "-R ${prefix}.duplicates.txt" @@ -44,11 +46,12 @@ process GENRICH { duplicates = "-r -R ${prefix}.duplicates.txt" } } + """ Genrich \\ - -t $treatment_bam \\ + $treatment \\ $args \\ - $control \\ + $layout \\ $blacklist \\ -o ${prefix}.narrowPeak \\ $pvalues \\ @@ -62,4 +65,5 @@ process GENRICH { genrich: \$(echo \$(Genrich --version 2>&1) | sed 's/^Genrich, version //; s/ .*\$//') END_VERSIONS """ + } diff --git a/modules/nf-core/genrich/meta.yml b/modules/nf-core/genrich/meta.yml index adf69880bb73..387eca927248 100644 --- a/modules/nf-core/genrich/meta.yml +++ b/modules/nf-core/genrich/meta.yml @@ -23,11 +23,11 @@ input: e.g. [ id:'test', single_end:false ] - treatment_bam: type: file - description: Coordinate sorted BAM/SAM file from treatment sample + description: Coordinate sorted BAM/SAM file from treatment sample or list of BAM/SAM files from biological replicates pattern: "*.{bam,sam}" - control_bam: type: file - description: Coordinate sorted BAM/SAM file from control sample + description: Coordinate sorted BAM/SAM file from control sample or list of BAM/SAM files from controls pattern: "*.{bam,sam}" - blacklist_bed: type: file @@ -77,3 +77,4 @@ output: pattern: "*.{version.txt}" authors: - "@JoseEspinosa" + - "@samuelruizperez" From 32ea406cd9a946b2d01557ac831b48b7b3e7453b Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Tue, 8 Aug 2023 11:52:24 +0200 Subject: [PATCH 2/9] Added treat & control lists inputs and SE modifier --- modules/nf-core/genrich/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/genrich/meta.yml b/modules/nf-core/genrich/meta.yml index 387eca927248..414821f65d85 100644 --- a/modules/nf-core/genrich/meta.yml +++ b/modules/nf-core/genrich/meta.yml @@ -27,7 +27,7 @@ input: pattern: "*.{bam,sam}" - control_bam: type: file - description: Coordinate sorted BAM/SAM file from control sample or list of BAM/SAM files from controls + description: Coordinate sorted BAM/SAM file from control sample or list of BAM/SAM files from control samples pattern: "*.{bam,sam}" - blacklist_bed: type: file From 58e0bf74ae3c9e8dd1f03c6c4b8cf51ca2d67c13 Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Thu, 10 Aug 2023 14:09:40 +0200 Subject: [PATCH 3/9] Genrich: Added multiple reps and SE modifier --- tests/modules/nf-core/genrich/main.nf | 46 +++++++++++++------ tests/modules/nf-core/genrich/nextflow.config | 3 ++ tests/modules/nf-core/genrich/test.yml | 14 ++++++ 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/tests/modules/nf-core/genrich/main.nf b/tests/modules/nf-core/genrich/main.nf index 71f9b21ccbe0..2362b34838d0 100644 --- a/tests/modules/nf-core/genrich/main.nf +++ b/tests/modules/nf-core/genrich/main.nf @@ -6,11 +6,12 @@ include { GENRICH } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_CTRL } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_ALL } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_ATACSEQ } from '../../../../modules/nf-core/genrich/main.nf' +include { GENRICH as GENRICH_LIST } from '../../../../modules/nf-core/genrich/main.nf' workflow test_genrich { input = [ [ id:'test', single_end:false ], // meta map - [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] - control = [ ] + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ ]] blacklist = [ ] save_pvalues = false @@ -18,13 +19,13 @@ workflow test_genrich { save_bed = false save_duplicates = false - GENRICH ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) } workflow test_genrich_ctrl { input = [ [ id:'test', single_end:false ], // meta map - [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] - control = [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ] + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] blacklist = [ ] save_pvalues = false @@ -32,13 +33,13 @@ workflow test_genrich_ctrl { save_bed = false save_duplicates = false - GENRICH_CTRL ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_CTRL ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) } workflow test_genrich_all_outputs { input = [ [ id:'test', single_end:false ], // meta map - [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] - control = [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ] + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] blacklist = [ ] save_pvalues = true @@ -46,13 +47,13 @@ workflow test_genrich_all_outputs { save_bed = true save_duplicates = true - GENRICH_ALL ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_ALL ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) } workflow test_genrich_blacklist { input = [ [ id:'test', single_end:false ], // meta map - [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] - control = [ ] + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ ]] blacklist = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] save_pvalues = false @@ -60,13 +61,13 @@ workflow test_genrich_blacklist { save_bed = false save_duplicates = false - GENRICH ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) } workflow test_genrich_atacseq { input = [ [ id:'test', single_end:false ], // meta map - [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] - control = [ ] + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ ]] blacklist = [ ] save_pvalues = false @@ -74,6 +75,21 @@ workflow test_genrich_atacseq { save_bed = false save_duplicates = false - GENRICH_ATACSEQ ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_ATACSEQ ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + +workflow test_genrich_list { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true), + file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true)], + [ ]] + blacklist = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] + + save_pvalues = false + save_pileup = false + save_bed = false + save_duplicates = false + + GENRICH_LIST ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) } diff --git a/tests/modules/nf-core/genrich/nextflow.config b/tests/modules/nf-core/genrich/nextflow.config index 8f79d7be2e91..d4011a2fb256 100644 --- a/tests/modules/nf-core/genrich/nextflow.config +++ b/tests/modules/nf-core/genrich/nextflow.config @@ -18,4 +18,7 @@ process { ext.args = '-j -p 0.1' } + withName: GENRICH_LIST { + ext.args = '-p 1 -a 0' + } } diff --git a/tests/modules/nf-core/genrich/test.yml b/tests/modules/nf-core/genrich/test.yml index 6d9f21394448..ecd47eb508cb 100644 --- a/tests/modules/nf-core/genrich/test.yml +++ b/tests/modules/nf-core/genrich/test.yml @@ -5,6 +5,7 @@ files: - path: output/genrich/test.narrowPeak md5sum: 6afabdd3f691c7c84c66ff8a23984681 + - path: output/genrich/versions.yml - name: genrich test_genrich_ctrl command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config @@ -13,6 +14,7 @@ files: - path: output/genrich/test.narrowPeak md5sum: 2fcc392360b317f5ebee88cdbc149e05 + - path: output/genrich/versions.yml - name: genrich test_genrich_all_outputs command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_all_outputs -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config @@ -29,6 +31,7 @@ md5sum: 03e53848de695b5794f32f15b2709203 - path: output/genrich/test.pvalues.bedGraph md5sum: b14feef34b6d2379a173a734ca963cde + - path: output/genrich/versions.yml - name: genrich test_genrich_blacklist command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_blacklist -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config @@ -37,6 +40,7 @@ files: - path: output/genrich/test.narrowPeak md5sum: 6afabdd3f691c7c84c66ff8a23984681 + - path: output/genrich/versions.yml - name: genrich test_genrich_atacseq command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_atacseq -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config @@ -45,3 +49,13 @@ files: - path: output/genrich/test.narrowPeak md5sum: ddea556b820f8be3695ffdf6c6f70aff + - path: output/genrich/versions.yml + +- name: genrich test_genrich_list + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_list -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: b39f93c9525ed96745fa087ed558a533 + - path: output/genrich/versions.yml From 195f35e040eae1ca55da8605c267380f1c9a7b06 Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Thu, 10 Aug 2023 14:20:56 +0200 Subject: [PATCH 4/9] Genrich: Added multiple reps and SE modifier 2 --- tests/modules/nf-core/genrich/nextflow.config | 2 +- tests/modules/nf-core/genrich/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/modules/nf-core/genrich/nextflow.config b/tests/modules/nf-core/genrich/nextflow.config index d4011a2fb256..1f94da6d4453 100644 --- a/tests/modules/nf-core/genrich/nextflow.config +++ b/tests/modules/nf-core/genrich/nextflow.config @@ -19,6 +19,6 @@ process { } withName: GENRICH_LIST { - ext.args = '-p 1 -a 0' + ext.args = '-p 0.1' } } diff --git a/tests/modules/nf-core/genrich/test.yml b/tests/modules/nf-core/genrich/test.yml index ecd47eb508cb..a4696f30dbfc 100644 --- a/tests/modules/nf-core/genrich/test.yml +++ b/tests/modules/nf-core/genrich/test.yml @@ -57,5 +57,5 @@ - genrich files: - path: output/genrich/test.narrowPeak - md5sum: b39f93c9525ed96745fa087ed558a533 + md5sum: f793e0ff59274e6364151a7cd4eeeafd - path: output/genrich/versions.yml From 5179743897faf5c7fd9556e7c32b1e157c760e77 Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Thu, 10 Aug 2023 15:03:15 +0200 Subject: [PATCH 5/9] Genrich: simplified layout definition --- modules/nf-core/genrich/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/genrich/main.nf b/modules/nf-core/genrich/main.nf index 46b9088dbb3f..69a6bd8c5b9f 100644 --- a/modules/nf-core/genrich/main.nf +++ b/modules/nf-core/genrich/main.nf @@ -29,7 +29,7 @@ process GENRICH { script: def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" - def layout = meta.single_end ? "-y" : "" + def layout = (!args.contains("-y") && meta.single_end) ? "-y" : "" def treatment = treatment_bam ? "-t ${treatment_bam.sort().join(',')}" : "" def control = control_bam ? "-c ${control_bam.sort().join(',')}" : "" def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" From c56c22bfe4185aecaf3555e898da1be5d5aeaa89 Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Mon, 16 Oct 2023 23:06:36 +0200 Subject: [PATCH 6/9] Removing value channels --- modules/nf-core/genrich/main.nf | 55 +++++++------------ tests/modules/nf-core/genrich/main.nf | 51 ++++++----------- tests/modules/nf-core/genrich/nextflow.config | 14 ++++- tests/modules/nf-core/genrich/test.yml | 21 +++++-- 4 files changed, 64 insertions(+), 77 deletions(-) diff --git a/modules/nf-core/genrich/main.nf b/modules/nf-core/genrich/main.nf index 69a6bd8c5b9f..82aab0210b21 100644 --- a/modules/nf-core/genrich/main.nf +++ b/modules/nf-core/genrich/main.nf @@ -10,18 +10,15 @@ process GENRICH { input: tuple val(meta), path(treatment_bam), path(control_bam) path blacklist_bed - val save_pvalues - val save_pileup - val save_bed - val save_duplicates output: - tuple val(meta), path("*.narrowPeak") , emit: peak - tuple val(meta), path("*pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues - tuple val(meta), path("*pileup.bedGraph"), optional:true, emit: bedgraph_pileup - tuple val(meta), path("*intervals.bed"), optional:true, emit: bed_intervals - tuple val(meta), path("*duplicates.txt"), optional:true, emit: duplicates - path "versions.yml" , emit: versions + tuple val(meta), path("*.narrowPeak") , emit: peak + path "versions.yml" , emit: versions + + tuple val(meta), path("*.pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues + tuple val(meta), path("*.pileup.bedGraph"), optional:true, emit: bedgraph_pileup + tuple val(meta), path("*.intervals.bed"), optional:true, emit: bed_intervals + tuple val(meta), path("*.duplicates.txt"), optional:true, emit: duplicates when: task.ext.when == null || task.ext.when @@ -29,41 +26,29 @@ process GENRICH { script: def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" - def layout = (!args.contains("-y") && meta.single_end) ? "-y" : "" - def treatment = treatment_bam ? "-t ${treatment_bam.sort().join(',')}" : "" - def control = control_bam ? "-c ${control_bam.sort().join(',')}" : "" - def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" - def pvalues = save_pvalues ? "-f ${prefix}.pvalues.bedGraph" : "" - def pileup = save_pileup ? "-k ${prefix}.pileup.bedGraph" : "" - def bed = save_bed ? "-b ${prefix}.intervals.bed" : "" - def duplicates = "" + def treatment = treatment_bam ? "-t ${treatment_bam.join(',')}" : "" + def control = control_bam ? "-c ${control_bam.join(',')}" : "" + def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" - if (save_duplicates) { - if (args.contains('-r')) { - duplicates = "-R ${prefix}.duplicates.txt" - } else { - log.info '[Genrich] Duplicates can only be saved if they are filtered, defaulting to -r option (Remove PCR duplicates).' - duplicates = "-r -R ${prefix}.duplicates.txt" - } + if (meta.single_end && (!args.contains("-y") && !args.contains("-w"))) { + log.info '[Genrich] Single-end data can only be analyzed if unpaired alignments are kept (-y or -w ), defaulting to -y option.' + args = "-y ${args}" + } + if (args.contains("-R") && !args.contains("-r")) { + log.info '[Genrich] Duplicates can only be saved if they are filtered out, defaulting to -r option (Remove PCR duplicates).' + args = "-r ${args}" } - """ Genrich \\ - $treatment \\ $args \\ - $layout \\ + $treatment \\ + $control \\ $blacklist \\ - -o ${prefix}.narrowPeak \\ - $pvalues \\ - $pileup \\ - $bed \\ - $duplicates \\ - $control + -o ${prefix}.narrowPeak cat <<-END_VERSIONS > versions.yml "${task.process}": genrich: \$(echo \$(Genrich --version 2>&1) | sed 's/^Genrich, version //; s/ .*\$//') END_VERSIONS """ - } diff --git a/tests/modules/nf-core/genrich/main.nf b/tests/modules/nf-core/genrich/main.nf index 2362b34838d0..a1cb9f0f8da3 100644 --- a/tests/modules/nf-core/genrich/main.nf +++ b/tests/modules/nf-core/genrich/main.nf @@ -4,6 +4,7 @@ nextflow.enable.dsl = 2 include { GENRICH } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_CTRL } from '../../../../modules/nf-core/genrich/main.nf' +include { GENRICH as GENRICH_SE } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_ALL } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_ATACSEQ } from '../../../../modules/nf-core/genrich/main.nf' include { GENRICH as GENRICH_LIST } from '../../../../modules/nf-core/genrich/main.nf' @@ -14,12 +15,7 @@ workflow test_genrich { [ ]] blacklist = [ ] - save_pvalues = false - save_pileup = false - save_bed = false - save_duplicates = false - - GENRICH ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH ( input, blacklist ) } workflow test_genrich_ctrl { @@ -28,26 +24,26 @@ workflow test_genrich_ctrl { [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] blacklist = [ ] - save_pvalues = false - save_pileup = false - save_bed = false - save_duplicates = false + GENRICH_CTRL ( input, blacklist ) +} + +workflow test_genrich_se { + input = [ [ id:'test', single_end:true ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] + blacklist = [ ] - GENRICH_CTRL ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_SE ( input, blacklist ) } + workflow test_genrich_all_outputs { input = [ [ id:'test', single_end:false ], // meta map [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] blacklist = [ ] - save_pvalues = true - save_pileup = true - save_bed = true - save_duplicates = true - - GENRICH_ALL ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_ALL ( input, blacklist ) } workflow test_genrich_blacklist { @@ -56,12 +52,7 @@ workflow test_genrich_blacklist { [ ]] blacklist = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] - save_pvalues = false - save_pileup = false - save_bed = false - save_duplicates = false - - GENRICH ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH ( input, blacklist ) } workflow test_genrich_atacseq { @@ -70,12 +61,7 @@ workflow test_genrich_atacseq { [ ]] blacklist = [ ] - save_pvalues = false - save_pileup = false - save_bed = false - save_duplicates = false - - GENRICH_ATACSEQ ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_ATACSEQ ( input, blacklist ) } workflow test_genrich_list { @@ -85,11 +71,6 @@ workflow test_genrich_list { [ ]] blacklist = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] - save_pvalues = false - save_pileup = false - save_bed = false - save_duplicates = false - - GENRICH_LIST ( input, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) + GENRICH_LIST ( input, blacklist ) } diff --git a/tests/modules/nf-core/genrich/nextflow.config b/tests/modules/nf-core/genrich/nextflow.config index 1f94da6d4453..cbfbb927c6ec 100644 --- a/tests/modules/nf-core/genrich/nextflow.config +++ b/tests/modules/nf-core/genrich/nextflow.config @@ -10,8 +10,20 @@ process { ext.args = '-p 0.9' } + withName: GENRICH_SE { + ext.args = '-p 0.9' + } + withName: GENRICH_ALL { - ext.args = '-r -p 0.1' + ext.args = { + [ + "-p 0.1", + "-k ${meta.id}.pileup.bedGraph", + "-f ${meta.id}.pvalues.bedGraph", + "-b ${meta.id}.intervals.bed", + "-R ${meta.id}.duplicates.txt" + ].join(' ').trim() + } } withName: GENRICH_ATACSEQ { diff --git a/tests/modules/nf-core/genrich/test.yml b/tests/modules/nf-core/genrich/test.yml index a4696f30dbfc..3472c7a8ee39 100644 --- a/tests/modules/nf-core/genrich/test.yml +++ b/tests/modules/nf-core/genrich/test.yml @@ -1,5 +1,5 @@ - name: genrich test_genrich - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich -c ./tests/config/nextflow.config tags: - genrich files: @@ -8,7 +8,7 @@ - path: output/genrich/versions.yml - name: genrich test_genrich_ctrl - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_ctrl -c ./tests/config/nextflow.config tags: - genrich files: @@ -16,8 +16,17 @@ md5sum: 2fcc392360b317f5ebee88cdbc149e05 - path: output/genrich/versions.yml +- name: genrich test_genrich_se + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_se -c ./tests/config/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: 1a835e303b090b5eea91b8e4f5cc1df6 + - path: output/genrich/versions.yml + - name: genrich test_genrich_all_outputs - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_all_outputs -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_all_outputs -c ./tests/config/nextflow.config tags: - genrich files: @@ -34,7 +43,7 @@ - path: output/genrich/versions.yml - name: genrich test_genrich_blacklist - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_blacklist -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_blacklist -c ./tests/config/nextflow.config tags: - genrich files: @@ -43,7 +52,7 @@ - path: output/genrich/versions.yml - name: genrich test_genrich_atacseq - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_atacseq -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_atacseq -c ./tests/config/nextflow.config tags: - genrich files: @@ -52,7 +61,7 @@ - path: output/genrich/versions.yml - name: genrich test_genrich_list - command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_list -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genrich/nextflow.config + command: nextflow run ./tests/modules/nf-core/genrich -entry test_genrich_list -c ./tests/config/nextflow.config tags: - genrich files: From ef1518e9486561a2c38fa0932dc2158852969694 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:56:58 +0100 Subject: [PATCH 7/9] Line up commas --- modules/nf-core/genrich/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/genrich/main.nf b/modules/nf-core/genrich/main.nf index 82aab0210b21..66525b147f41 100644 --- a/modules/nf-core/genrich/main.nf +++ b/modules/nf-core/genrich/main.nf @@ -16,9 +16,9 @@ process GENRICH { path "versions.yml" , emit: versions tuple val(meta), path("*.pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues - tuple val(meta), path("*.pileup.bedGraph"), optional:true, emit: bedgraph_pileup - tuple val(meta), path("*.intervals.bed"), optional:true, emit: bed_intervals - tuple val(meta), path("*.duplicates.txt"), optional:true, emit: duplicates + tuple val(meta), path("*.pileup.bedGraph") , optional:true, emit: bedgraph_pileup + tuple val(meta), path("*.intervals.bed") , optional:true, emit: bed_intervals + tuple val(meta), path("*.duplicates.txt") , optional:true, emit: duplicates when: task.ext.when == null || task.ext.when From 384f4f97f628c0cfd5e1e3d87a9845b1fde6fa3a Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:57:53 +0100 Subject: [PATCH 8/9] Align commas --- modules/nf-core/genrich/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/genrich/main.nf b/modules/nf-core/genrich/main.nf index 66525b147f41..a5580ff11a21 100644 --- a/modules/nf-core/genrich/main.nf +++ b/modules/nf-core/genrich/main.nf @@ -16,9 +16,9 @@ process GENRICH { path "versions.yml" , emit: versions tuple val(meta), path("*.pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues - tuple val(meta), path("*.pileup.bedGraph") , optional:true, emit: bedgraph_pileup - tuple val(meta), path("*.intervals.bed") , optional:true, emit: bed_intervals - tuple val(meta), path("*.duplicates.txt") , optional:true, emit: duplicates + tuple val(meta), path("*.pileup.bedGraph") , optional:true, emit: bedgraph_pileup + tuple val(meta), path("*.intervals.bed") , optional:true, emit: bed_intervals + tuple val(meta), path("*.duplicates.txt") , optional:true, emit: duplicates when: task.ext.when == null || task.ext.when From 5ac97dcba97a04964b9848aacb5673368a1ec9b9 Mon Sep 17 00:00:00 2001 From: samuelruizperez Date: Tue, 17 Oct 2023 20:44:22 +0200 Subject: [PATCH 9/9] Increase test -p to avoid empty file --- tests/modules/nf-core/genrich/nextflow.config | 2 +- tests/modules/nf-core/genrich/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modules/nf-core/genrich/nextflow.config b/tests/modules/nf-core/genrich/nextflow.config index cbfbb927c6ec..a9372b44707e 100644 --- a/tests/modules/nf-core/genrich/nextflow.config +++ b/tests/modules/nf-core/genrich/nextflow.config @@ -17,7 +17,7 @@ process { withName: GENRICH_ALL { ext.args = { [ - "-p 0.1", + "-p 0.9", "-k ${meta.id}.pileup.bedGraph", "-f ${meta.id}.pvalues.bedGraph", "-b ${meta.id}.intervals.bed", diff --git a/tests/modules/nf-core/genrich/test.yml b/tests/modules/nf-core/genrich/test.yml index 3472c7a8ee39..f6a6a56c8c37 100644 --- a/tests/modules/nf-core/genrich/test.yml +++ b/tests/modules/nf-core/genrich/test.yml @@ -35,11 +35,11 @@ - path: output/genrich/test.intervals.bed md5sum: 4bea65caa3f4043d703af4b57161112e - path: output/genrich/test.narrowPeak - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: 82bc06c2e44e4d91152a6ac6557a2c6e - path: output/genrich/test.pileup.bedGraph md5sum: 03e53848de695b5794f32f15b2709203 - path: output/genrich/test.pvalues.bedGraph - md5sum: b14feef34b6d2379a173a734ca963cde + md5sum: 21ad9731340e9bedc30c4d34f7db7751 - path: output/genrich/versions.yml - name: genrich test_genrich_blacklist