diff --git a/modules/seacr/callpeak/main.nf b/modules/seacr/callpeak/main.nf index 4c3fd922..97bf1c0b 100644 --- a/modules/seacr/callpeak/main.nf +++ b/modules/seacr/callpeak/main.nf @@ -13,29 +13,30 @@ process SEACR_CALLPEAK { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } - conda (params.enable_conda ? "bioconda::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.29.2" : null) + conda (params.enable_conda ? "bioconda::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.30.0" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0" + container "https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0" } else { - container 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0' + container 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0' } input: tuple val(meta), path(bedgraph), path(ctrlbedgraph) + val (threshold) output: tuple val(meta), path("*.bed"), emit: bed path "versions.yml" , emit: versions script: - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def function_switch = ctrlbedgraph ? "$ctrlbedgraph" : "$threshold" """ SEACR_1.3.sh \\ $bedgraph \\ - $ctrlbedgraph \\ + $function_switch \\ $options.args \\ $prefix - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo $VERSION) diff --git a/modules/seacr/callpeak/meta.yml b/modules/seacr/callpeak/meta.yml index 43044c2f..22db567d 100644 --- a/modules/seacr/callpeak/meta.yml +++ b/modules/seacr/callpeak/meta.yml @@ -1,3 +1,4 @@ + name: seacr_callpeak description: Call peaks using SEACR on sequenced reads in bedgraph format keywords: @@ -30,6 +31,10 @@ input: type: file description: | Control (IgG) data bedgraph file to generate an empirical threshold for peak calling. + - threshold: + type: value + description: | + Threshold value used to call peaks if the ctrlbedgraph input is set to []. Set to 1 if using a control bedgraph output: - meta: type: map diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 6abfa4f8..744282cc 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -200,6 +200,9 @@ params { test_yak = "${test_data_dir}/genomics/homo_sapiens/illumina/yak/test.yak" test2_yak = "${test_data_dir}/genomics/homo_sapiens/illumina/yak/test2.yak" + + cutandrun_bedgraph_test_1 = "${test_data_dir}/genomics/homo_sapiens/illumina/bedgraph/cutandtag_h3k27me3_test_1.bedGraph" + cutandrun_bedgraph_test_2 = "${test_data_dir}/genomics/homo_sapiens/illumina/bedgraph/cutandtag_igg_test_1.bedGraph" } 'pacbio' { primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta" diff --git a/tests/modules/seacr/callpeak/main.nf b/tests/modules/seacr/callpeak/main.nf index 7e9cef8a..a1aeb76e 100644 --- a/tests/modules/seacr/callpeak/main.nf +++ b/tests/modules/seacr/callpeak/main.nf @@ -5,11 +5,19 @@ nextflow.enable.dsl = 2 include { SEACR_CALLPEAK } from '../../../../modules/seacr/callpeak/main.nf' addParams( options: [ args:'norm stringent' ] ) workflow test_seacr_callpeak { - input = [ - [ id:'test_1'], - file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/bedgraph/K27me3_1_to_chr20.bedgraph", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/bedgraph/IgG_1_to_chr20.bedgraph", checkIfExists: true) - ] + input = [ [ id:'test_1'], + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_1'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_2'], checkIfExists: true) + ] - SEACR_CALLPEAK ( input ) + SEACR_CALLPEAK ( input, 0.05 ) } + +workflow test_seacr_callpeak_threshold { + input = [ [ id:'test_1'], + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_1'], checkIfExists: true), + [] + ] + + SEACR_CALLPEAK ( input, 0.05 ) +} \ No newline at end of file diff --git a/tests/modules/seacr/callpeak/test.yml b/tests/modules/seacr/callpeak/test.yml index 4b9790a4..2cf75b06 100644 --- a/tests/modules/seacr/callpeak/test.yml +++ b/tests/modules/seacr/callpeak/test.yml @@ -5,4 +5,13 @@ - seacr/callpeak files: - path: output/seacr/test_1.stringent.bed - md5sum: 3ac70475669eb6a7b8ca89e19a08a28e \ No newline at end of file + md5sum: a3cb0c7c4ffa895788da3f0d6371b7df + +- name: seacr callpeak threshold + command: nextflow run ./tests/modules/seacr/callpeak -entry test_seacr_callpeak_threshold -c tests/config/nextflow.config + tags: + - seacr + - seacr/callpeak + files: + - path: output/seacr/test_1.stringent.bed + md5sum: 1d23015c7087f7b48cc3139d53fd3463 \ No newline at end of file