diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 79b7846..20f267a 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -46,7 +46,7 @@ jobs: - name: Install NodeJS uses: actions/setup-node@v1 with: - node-version: "10" + node-version: "12.9.0" - name: Install yaml-lint run: npm install -g yaml-lint diff --git a/.github/workflows/lint-nf-core.yml b/.github/workflows/lint-nf-core.yml index 3d9d2ab..7a1796a 100644 --- a/.github/workflows/lint-nf-core.yml +++ b/.github/workflows/lint-nf-core.yml @@ -57,7 +57,7 @@ jobs: # FIXME: Remove this when nf-core modules lint stabilizes and install stable release - name: Install nf-core tools development version - run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@2.1 + run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@2.3.2 - name: Install Nextflow env: diff --git a/.github/workflows/test-modules.yml b/.github/workflows/test-modules.yml index 86e656e..60bd6f1 100644 --- a/.github/workflows/test-modules.yml +++ b/.github/workflows/test-modules.yml @@ -91,13 +91,13 @@ jobs: # Test the module - name: Run pytest-workflow # only use one thread for pytest-workflow to avoid race condition on conda cache. - run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof + run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof --git-aware - name: Upload logs on failure if: failure() uses: actions/upload-artifact@v2 with: - name: logs-${{ matrix.tags }}-${{ matrix.profile }}-${{ matrix.nxf_version }} + name: logs-${{ matrix.profile }}-${{ matrix.nxf_version }} path: | /home/runner/pytest_workflow_*/*/.nextflow.log /home/runner/pytest_workflow_*/*/log.out diff --git a/.nf-core.yml b/.nf-core.yml new file mode 100644 index 0000000..f0b1075 --- /dev/null +++ b/.nf-core.yml @@ -0,0 +1 @@ +repository_type: modules diff --git a/modules/clippy/functions.nf b/modules/clippy/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/clippy/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/clippy/main.nf b/modules/clippy/main.nf index 5a1f39a..b039dd1 100644 --- a/modules/clippy/main.nf +++ b/modules/clippy/main.nf @@ -1,23 +1,13 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process CLIPPY { tag "$meta.id" label "avg_cores" - label "high_mem" + label "avg_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::clippy=1.3.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/clippy:1.3.1--pyhdfd78af_2" - } else { - container "quay.io/biocontainers/clippy:1.3.1--pyhdfd78af_2" - } + conda (params.enable_conda ? "bioconda::clippy=1.4.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/clippy:1.4.1--pyhdfd78af_1' : + 'quay.io/biocontainers/clippy:1.4.1--pyhdfd78af_1' }" input: tuple val(meta), path(crosslinks) @@ -25,22 +15,29 @@ process CLIPPY { path(fai) output: - tuple val(meta), path("*_broadPeaks.bed.gz"), emit: peaks - tuple val(meta), path("*[0-9].bed.gz"), emit: summits - path "*.version.txt", emit: version + tuple val(meta), path("*_Peaks.bed.gz"), emit: peaks + tuple val(meta), path("*_Summits.bed.gz"), emit: summits + tuple val(meta), path("*_intergenic_regions.gtf"), emit: intergenic_gtf, optional: true + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ clippy -i $crosslinks \ -o $prefix \ -a $gtf \ -g $fai \ -t ${task.cpus} \ - $options.args - gzip -n *_broadPeaks.bed - gzip -n *[0-9].bed - echo \$(clippy -v) > ${software}.version.txt + $args + gzip -n *_Peaks.bed + gzip -n *_Summits.bed + cat <<-END_VERSIONS > versions.yml + "${task.process}": + clippy: \$(clippy -v) + END_VERSIONS """ } diff --git a/modules/crosslinks/coverage/functions.nf b/modules/crosslinks/coverage/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/crosslinks/coverage/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/crosslinks/coverage/main.nf b/modules/crosslinks/coverage/main.nf index 892c872..434c952 100644 --- a/modules/crosslinks/coverage/main.nf +++ b/modules/crosslinks/coverage/main.nf @@ -1,40 +1,35 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' -params.options = [:] -options = initOptions(params.options) - process CROSSLINKS_COVERAGE { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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 ? "conda-forge::sed=4.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" - } else { - container "biocontainers/biocontainers:v1.2.0_cv1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: tuple val(meta), path(crosslinks) output: - tuple val(meta), path("*.bedgraph.gz"), emit: bedgraph - path "*.version.txt", emit: version + tuple val(meta), path("$prefix*.bedgraph.gz"), emit: bedgraph + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ gzip -d -c $crosslinks | \ awk '{OFS = "\t"}{if (\$6 == "+") {print \$1, \$2, \$3, \$5} else {print \$1, \$2, \$3, -\$5}}' | \ gzip > ${prefix}.bedgraph.gz - echo \$(awk --version 2>&1) | sed 's/^.*awk version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/crosslinks/normcoverage/functions.nf b/modules/crosslinks/normcoverage/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/crosslinks/normcoverage/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/crosslinks/normcoverage/main.nf b/modules/crosslinks/normcoverage/main.nf index c0fa540..300513a 100644 --- a/modules/crosslinks/normcoverage/main.nf +++ b/modules/crosslinks/normcoverage/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' -params.options = [:] -options = initOptions(params.options) - process CROSSLINKS_NORMCOVERAGE { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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 ? "conda-forge::sed=4.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" - } else { - container "biocontainers/biocontainers:v1.2.0_cv1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: tuple val(meta), path(crosslinks) output: - tuple val(meta), path("*.bedgraph.gz"), emit: bedgraph - path "*.version.txt", emit: version + tuple val(meta), path("$prefix*.bedgraph.gz"), emit: bedgraph + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ TOTAL=`gunzip -c $crosslinks | awk 'BEGIN {total=0} {total=total+\$5} END {print total}'` @@ -39,6 +31,9 @@ process CROSSLINKS_NORMCOVERAGE { sort -k1,1 -k2,2n | \ gzip > ${prefix}.norm.bedgraph.gz - echo \$(awk --version 2>&1) | sed 's/^.*awk version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/htseq/count/functions.nf b/modules/htseq/count/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/htseq/count/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/htseq/count/main.nf b/modules/htseq/count/main.nf index 7eb1d96..a8b412b 100644 --- a/modules/htseq/count/main.nf +++ b/modules/htseq/count/main.nf @@ -1,48 +1,39 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process HTSEQ_COUNT { tag "$meta.id" label "min_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::htseq=0.13.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/htseq:0.13.5--py39h70b41aa_1" - } else { - container "quay.io/biocontainers/htseq:0.13.5--py39h70b41aa_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/htseq:0.13.5--py39h70b41aa_1' : + 'quay.io/biocontainers/htseq:0.13.5--py39h70b41aa_1' }" input: tuple val(meta), path(bam), path (bai) path gtf output: - tuple val(meta), path("*.tsv"), emit: counts - path "*.version.txt" , emit: version + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ htseq-count \\ - ${options.args} \\ + $args \\ ${bam} \\ ${gtf} \\ --nprocesses $task.cpus \\ - > \\ - ${prefix}.tsv - + > ${prefix}.tsv - htseq-count --version > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + htseq-count: \$(htseq-count --version) + END_VERSIONS """ } diff --git a/modules/icount/peaks/functions.nf b/modules/icount/peaks/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/icount/peaks/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/icount/peaks/main.nf b/modules/icount/peaks/main.nf deleted file mode 100644 index e35d345..0000000 --- a/modules/icount/peaks/main.nf +++ /dev/null @@ -1,43 +0,0 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -process ICOUNT_PEAKS { - tag "$meta.id" - label "low_cores" - label "low_mem" - label "regular_queue" - publishDir "${params.outdir}", - 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::icount=2.0.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/icount:2.0.0--py_1" - } else { - container "quay.io/biocontainers/icount:2.0.0--py_1" - } - - input: - tuple val(meta), path(bed) - path(segmentation) - - output: - tuple val(meta), path("*.peaks.bed.gz"), emit: peaks - tuple val(meta), path("*.scores.tsv") , emit: scores - path "*.version.txt" , emit: version - - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - """ - iCount peaks \\ - $segmentation \\ - $bed \\ - ${prefix}.peaks.bed.gz \\ - --scores ${prefix}.scores.tsv \\ - $options.args - echo \$(iCount -v) > ${software}.version.txt - """ -} diff --git a/modules/icount/segment/functions.nf b/modules/icount/segment/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/icount/segment/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/icount/segment/main.nf b/modules/icount/segment/main.nf index 64211ac..a5d6978 100644 --- a/modules/icount/segment/main.nf +++ b/modules/icount/segment/main.nf @@ -1,41 +1,37 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ICOUNT_SEGMENT { tag "$gtf" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::icount=2.0.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/icount:2.0.0--py_1" - } else { - container "quay.io/biocontainers/icount:2.0.0--py_1" - } + conda (params.enable_conda ? "bioconda::icount-mini=2.0.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/icount-mini:2.0.3--pyh5e36f6f_0' : + 'quay.io/biocontainers/icount-mini:2.0.3--pyh5e36f6f_0' }" input: path(gtf) path(fai) output: - path("*.gtf") , emit: gtf - path "*.version.txt", emit: version + path("${prefix}.gtf"), emit: gtf + path("regions.gtf.gz"), emit: regions + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when script: - def software = getSoftwareName(task.process) def filename = "icount_segmentation" - def prefix = options.suffix ? "${filename}${options.suffix}" : "${filename}" + prefix = task.ext.prefix ? "${filename}${options.suffix}" : "${filename}" """ - iCount segment \\ + iCount-Mini segment \\ $gtf \\ ${prefix}.gtf \\ $fai - echo \$(iCount -v) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iCount-Mini: \$(iCount-Mini -v) + END_VERSIONS """ } diff --git a/modules/icount/segment/meta.yml b/modules/icount/segment/meta.yml index 3168b0a..6637d93 100644 --- a/modules/icount/segment/meta.yml +++ b/modules/icount/segment/meta.yml @@ -1,5 +1,5 @@ name: icount_segment -description: Formats a GTF file for use with iCount peaks +description: Formats a GTF file for use with iCount sigxls keywords: - iCLIP tools: @@ -25,7 +25,7 @@ input: output: - gtf: type: file - description: Segmented GTF file for use with iCount peaks + description: Segmented GTF file for use with iCount sigxls pattern: "*.{gtf}" - version: type: file diff --git a/modules/icount/sigxls/main.nf b/modules/icount/sigxls/main.nf new file mode 100644 index 0000000..71df13c --- /dev/null +++ b/modules/icount/sigxls/main.nf @@ -0,0 +1,39 @@ +process ICOUNT_SIGXLS { + tag "$meta.id" + label "low_cores" + label "low_mem" + label "regular_queue" + + conda (params.enable_conda ? "bioconda::icount-mini=2.0.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/icount-mini:2.0.3--pyh5e36f6f_0' : + 'quay.io/biocontainers/icount-mini:2.0.3--pyh5e36f6f_0' }" + + input: + tuple val(meta), path(bed) + path(segmentation) + + output: + tuple val(meta), path("*.sigxls.bed.gz"), emit: sigxls + tuple val(meta), path("*.scores.tsv"), emit: scores + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + iCount-Mini sigxls \\ + $segmentation \\ + $bed \\ + ${prefix}.sigxls.bed.gz \\ + --scores ${prefix}.scores.tsv \\ + $args + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iCount-Mini: \$(iCount-Mini -v) + END_VERSIONS + """ +} diff --git a/modules/icount/peaks/meta.yml b/modules/icount/sigxls/meta.yml similarity index 98% rename from modules/icount/peaks/meta.yml rename to modules/icount/sigxls/meta.yml index 3b10c06..b1f6417 100644 --- a/modules/icount/peaks/meta.yml +++ b/modules/icount/sigxls/meta.yml @@ -1,4 +1,4 @@ -name: icount_peaks +name: icount_sigxls description: Runs iCount peaks on a BED file of crosslinks keywords: - iCLIP diff --git a/modules/paraclu/convert/functions.nf b/modules/paraclu/convert/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/paraclu/convert/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/paraclu/convert/main.nf b/modules/paraclu/convert/main.nf index 22a9657..46ef2b0 100644 --- a/modules/paraclu/convert/main.nf +++ b/modules/paraclu/convert/main.nf @@ -1,44 +1,35 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '10' - process PARACLU_CONVERT { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::paraclu=10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1" - } else { - container "quay.io/biocontainers/paraclu:10--h9a82719_1" - } + conda (params.enable_conda ? "conda-forge::sed=4.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: tuple val(meta), path(peaks) output: - tuple val(meta), path("*.peaks.bed.gz"), emit: peaks - path "*.version.txt", emit: version + tuple val(meta), path("*.peaks.bed.gz"), emit: peaks + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + prefix = task.ext.prefix ?: "${meta.id}" """ gzip -d -c $peaks | \ awk '{OFS = "\t"}{print \$1, \$3-1, \$4, ".", \$6, \$2}' | sort -k1,1 -k2,2n | \ gzip > ${prefix}.peaks.bed.gz - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/paraclu/cut/functions.nf b/modules/paraclu/cut/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/paraclu/cut/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/paraclu/cut/main.nf b/modules/paraclu/cut/main.nf index e06b55d..622b6fc 100644 --- a/modules/paraclu/cut/main.nf +++ b/modules/paraclu/cut/main.nf @@ -1,46 +1,38 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '10' - process PARACLU_CUT { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::paraclu=10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1" - } else { - container "quay.io/biocontainers/paraclu:10--h9a82719_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1' : + 'quay.io/biocontainers/paraclu:10--h9a82719_1' }" input: tuple val(meta), path(sigxls) output: - tuple val(meta), path("*.peaks.tsv.gz"), emit: peaks - path "*.version.txt", emit: version + tuple val(meta), path("*.peaks.tsv.gz"), emit: peaks + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def paraclu_version = '10' """ gzip -d -c $sigxls | \ paraclu-cut \ - ${options.args} | \ + $args | \ gzip > ${prefix}.peaks.tsv.gz - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + paraclu: $paraclu_version + END_VERSIONS """ } - - diff --git a/modules/paraclu/paraclu/functions.nf b/modules/paraclu/paraclu/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/paraclu/paraclu/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/paraclu/paraclu/main.nf b/modules/paraclu/paraclu/main.nf index 02144da..18b7dc9 100644 --- a/modules/paraclu/paraclu/main.nf +++ b/modules/paraclu/paraclu/main.nf @@ -1,48 +1,42 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '10' - process PARACLU_PARACLU { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::paraclu=10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1" - } else { - container "quay.io/biocontainers/paraclu:10--h9a82719_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1' : + 'quay.io/biocontainers/paraclu:10--h9a82719_1' }" input: tuple val(meta), path(crosslinks) output: - tuple val(meta), path("*.sigxls.tsv.gz"), emit: sigxls - path "*.version.txt", emit: version + tuple val(meta), path("*.sigxls.tsv.gz"), emit: sigxls + path "versions.yml", emit: versions - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + when: + task.ext.when == null || task.ext.when + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def paraclu_version = '10' """ gzip -d -c $crosslinks | \ awk '{OFS = "\t"}{print \$1, \$6, \$2+1, \$5}' | \ sort -k1,1 -k2,2 -k3,3n > paraclu_input.tsv paraclu \ - ${options.args} \ + $args \ paraclu_input.tsv | \ gzip > ${prefix}.sigxls.tsv.gz - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + paraclu: $paraclu_version + END_VERSIONS """ } diff --git a/modules/peka/functions.nf b/modules/peka/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/peka/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/peka/main.nf b/modules/peka/main.nf index 398bb27..688a27a 100644 --- a/modules/peka/main.nf +++ b/modules/peka/main.nf @@ -1,23 +1,13 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PEKA { tag "$meta.id" label "low_cores" label "low_mem" label "regular_queue" - publishDir "${params.outdir}", - 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::peka=0.1.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/peka:0.1.6--pyhdfd78af_0" - } else { - container "quay.io/biocontainers/peka:0.1.6--pyhdfd78af_0" - } + conda (params.enable_conda ? "bioconda::peka=1.0.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/peka:1.0.0--pyhdfd78af_0' : + 'quay.io/biocontainers/peka:1.0.0--pyhdfd78af_0' }" input: tuple val(meta), path(peaks) @@ -27,14 +17,16 @@ process PEKA { path(gtf) output: - tuple val(meta), path("*mer_cluster_distribution*"), emit: cluster - tuple val(meta), path("*mer_distribution*"), emit: distribution - tuple val(meta), path("*.pdf"), emit: pdf - path "*.version.txt", emit: version + tuple val(meta), path("*mer_cluster_distribution*"), emit: cluster, optional: true + tuple val(meta), path("*mer_distribution*"), emit: distribution, optional: true + tuple val(meta), path("*.pdf"), emit: pdf, optional: true + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' """ # If the modification date and time of the fai is before the fasta then # there will be an error. Touching the file first avoids that. @@ -46,7 +38,10 @@ process PEKA { -g $genome \ -gi $fai \ -r $gtf \ - $options.args - echo "0.1.6" > ${software}.version.txt + $args + cat <<-END_VERSIONS > versions.yml + "${task.process}": + peka: 1.0.0 + END_VERSIONS """ } diff --git a/modules/ultraplex/functions.nf b/modules/ultraplex/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/ultraplex/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/ultraplex/main.nf b/modules/ultraplex/main.nf index 9bf8290..f9b26f8 100644 --- a/modules/ultraplex/main.nf +++ b/modules/ultraplex/main.nf @@ -1,42 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ULTRAPLEX { tag "${meta.id}" label "max_cores" label "max_memory" label "regular_queue" - publishDir "${params.outdir}", - 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::ultraplex=1.1.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ultraplex:1.1.5--py36hc5360cc_0" - } else { - container "quay.io/biocontainers/ultraplex:1.1.5--py36hc5360cc_0" - } + conda (params.enable_conda ? "bioconda::ultraplex=1.2.5" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ultraplex:1.2.5--py38h4a8c8d9_0' : + 'quay.io/biocontainers/ultraplex:1.2.5--py38h4a8c8d9_0' }" input: tuple val(meta), path(reads) path(barcode_file) output: - tuple val(meta), path("*[!no_match].fastq.gz") , emit: fastq + tuple val(meta), path("*[!no_match].fastq.gz"), emit: fastq tuple val(meta), path("*no_match.fastq.gz"), optional: true, emit: no_match_fastq - path "*.log" , emit: report - path "*.version.txt" , emit: version + path "*.log", emit: report + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when script: - def software = getSoftwareName(task.process) - args = "" - if(options.args && options.args != '') { - ext_args = options.args - args += ext_args.trim() - } + def ultraplex_version = "1.2.5" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" read_list = reads.collect{it.toString()} if (read_list.size > 1){ ultraplex_command = """ultraplex \\ @@ -50,12 +39,13 @@ process ULTRAPLEX { --barcodes $barcode_file \\ --threads ${task.cpus} ${args}""" } - if (params.verbose){ - println ("[MODULE] ultraplex command: " + ultraplex_command) - } """ ${ultraplex_command} - echo \$(ultraplex --version 2>&1) | sed 's/^.*ultraplex //; s/Using.*\$//' > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ultraplex: $ultraplex_version + END_VERSIONS """ } diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index f0ee7e7..139fe91 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -27,4 +27,13 @@ conda { createTimeout = "120 min" } manifest { nextflowVersion = '!>=21.04.0' -} \ No newline at end of file +} + +process { + // Default publishDir for all processes + publishDir = [ + path: { "${params.outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 7abb7b6..2c07470 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -14,9 +14,9 @@ htseq/count: - modules/htseq/count/** - tests/modules/htseq/count/** -icount/peaks: - - modules/icount/peaks/** - - tests/modules/icount/peaks/** +icount/sigxls: + - modules/icount/sigxls/** + - tests/modules/icount/sigxls/** icount/segment: - modules/icount/segment/** diff --git a/tests/modules/clippy/main.nf b/tests/modules/clippy/main.nf index 3bbcf42..c035c92 100644 --- a/tests/modules/clippy/main.nf +++ b/tests/modules/clippy/main.nf @@ -14,7 +14,7 @@ log.info ("Starting tests for Clippy...") /* Module inclusions --------------------------------------------------------------------------------------*/ -include {CLIPPY} from '../../../modules/clippy/main.nf' addParams( options: [args: ""] ) +include {CLIPPY} from '../../../modules/clippy/main.nf' include { ASSERT_CHANNEL_COUNT; ASSERT_LINE_NUMBER as ASSERT_PEAKS_LINE_NUMBER; @@ -58,23 +58,23 @@ Channel .set {ch_bed} expected_peak_line_counts = [ - sample1: 2, + sample1: 1, sample4: 1 ] expected_summits_line_counts = [ sample1: 26, - sample4: 12 + sample4: 13 ] expected_peak_hashes = [ - sample1: "6a085d080615c47c5460be340f8d73f4", - sample4: "235ebe1d97ea960ae5b7851996386d1e" + sample1: "4d2c3fab6ce49cae7cc56e94e5cc20b0", + sample4: "1bd965210ff9d6d523fd0bdf46bb137b" ] expected_summits_hashes = [ - sample1: "1ce87295742299f7d3c649360c798abc", - sample4: "aaf7cf02c2406fed0ded98d965d503a1" + sample1: "6047b4a5e14021a9d4e61fd97b04ae9a", + sample4: "58ab0d9fb902851e0f0dbb9c7dc3fdce" ] /*------------------------------------------------------------------------------------*/ @@ -86,7 +86,7 @@ workflow { ASSERT_CHANNEL_COUNT( CLIPPY.out.peaks, "peaks", 2) ASSERT_CHANNEL_COUNT( CLIPPY.out.summits, "summits", 2) - ASSERT_CHANNEL_COUNT( CLIPPY.out.version, "version", 2) + ASSERT_CHANNEL_COUNT( CLIPPY.out.versions, "versions", 2) ASSERT_PEAKS_LINE_NUMBER( CLIPPY.out.peaks, "peaks", expected_peak_line_counts) ASSERT_SUMMITS_LINE_NUMBER( CLIPPY.out.summits, "summits", expected_summits_line_counts) diff --git a/tests/modules/clippy/test.yml b/tests/modules/clippy/test.yml index 5308215..e16d0e5 100644 --- a/tests/modules/clippy/test.yml +++ b/tests/modules/clippy/test.yml @@ -3,11 +3,11 @@ tags: - clippy files: - - path: results/clippy/sample1_rollmean15_stdev1_minGeneCount5.bed.gz - md5sum: cf7a1422ad82321aa4caf1fb315b46b4 - - path: results/clippy/sample1_rollmean15_stdev1_minGeneCount5_broadPeaks.bed.gz - md5sum: 734a3fe68bbcf2520822295da0f9dbdc - - path: results/clippy/sample4_rollmean15_stdev1_minGeneCount5.bed.gz - md5sum: acc7804c29aa45e22526e2a9eb455628 - - path: results/clippy/sample4_rollmean15_stdev1_minGeneCount5_broadPeaks.bed.gz - md5sum: a41cb1bc2189881a6014b1af316fdfe7 + - path: results/clippy/sample1_rollmean10_stdev1_minGeneCount5_Summits.bed.gz + md5sum: 965f828d267f0e6b36b9e2dbcc6c00b2 + - path: results/clippy/sample1_rollmean10_stdev1_minGeneCount5_Peaks.bed.gz + md5sum: 5d8dbfbfc90fff49a473d1a4c572f059 + - path: results/clippy/sample4_rollmean10_stdev1_minGeneCount5_Summits.bed.gz + md5sum: 6e45028dbcf6d99c3c5b79dfbf26010d + - path: results/clippy/sample4_rollmean10_stdev1_minGeneCount5_Peaks.bed.gz + md5sum: ce294ccd9e178451b14dedb02b423d2a diff --git a/tests/modules/crosslinks/coverage/main.nf b/tests/modules/crosslinks/coverage/main.nf index e9aa657..55cc99d 100644 --- a/tests/modules/crosslinks/coverage/main.nf +++ b/tests/modules/crosslinks/coverage/main.nf @@ -51,7 +51,7 @@ workflow { CROSSLINKS_COVERAGE { ch_crosslinks } ASSERT_CHANNEL_COUNT_COVERAGE( CROSSLINKS_COVERAGE.out.bedgraph, "CROSSLINKS_CONVERT", 2 ) - ASSERT_CHANNEL_COUNT_VERSION( CROSSLINKS_COVERAGE.out.version, "CROSSLINKS_VERSION", 2 ) + ASSERT_CHANNEL_COUNT_VERSION( CROSSLINKS_COVERAGE.out.versions, "CROSSLINKS_VERSIONS", 2 ) ASSERT_LINE_NUMBER( CROSSLINKS_COVERAGE.out.bedgraph, "CROSSLINKS_CONVERT", expected_line_counts ) ASSERT_MD5( CROSSLINKS_COVERAGE.out.bedgraph, "CROSSLINKS_CONVERT", expected_md5_hashes ) diff --git a/tests/modules/crosslinks/coverage/test.yml b/tests/modules/crosslinks/coverage/test.yml index bcd740e..8a712a3 100644 --- a/tests/modules/crosslinks/coverage/test.yml +++ b/tests/modules/crosslinks/coverage/test.yml @@ -4,7 +4,7 @@ - crosslinks - crosslinks/coverage files: - - path: results/crosslinks/sample1.bedgraph.gz + - path: results/crosslinks_coverage/sample1.bedgraph.gz md5sum: 1e464cc578cc0eb06a479dc5b4301b6a - - path: results/crosslinks/sample4.bedgraph.gz + - path: results/crosslinks_coverage/sample4.bedgraph.gz md5sum: 2ccefa356ba2bb940bcebc28b0f9dc59 diff --git a/tests/modules/crosslinks/normcoverage/main.nf b/tests/modules/crosslinks/normcoverage/main.nf index 47b29d1..efba5c8 100644 --- a/tests/modules/crosslinks/normcoverage/main.nf +++ b/tests/modules/crosslinks/normcoverage/main.nf @@ -47,7 +47,7 @@ workflow { CROSSLINKS_NORMCOVERAGE { ch_crosslinks } ASSERT_CHANNEL_COUNT_NORMCOVERAGE( CROSSLINKS_NORMCOVERAGE.out.bedgraph, "CROSSLINKS_NORMCOVERAGE", 2 ) - ASSERT_CHANNEL_COUNT_VERSION( CROSSLINKS_NORMCOVERAGE.out.version, "CROSSLINKS_VERSION", 2 ) + ASSERT_CHANNEL_COUNT_VERSION( CROSSLINKS_NORMCOVERAGE.out.versions, "CROSSLINKS_VERSIONS", 2 ) ASSERT_LINE_NUMBER( CROSSLINKS_NORMCOVERAGE.out.bedgraph, "CROSSLINKS_NORMCOVERAGE", expected_line_counts ) ASSERT_MD5( CROSSLINKS_NORMCOVERAGE.out.bedgraph, "CROSSLINKS_NORMCOVERAGE", expected_md5_hashes ) diff --git a/tests/modules/crosslinks/normcoverage/test.yml b/tests/modules/crosslinks/normcoverage/test.yml index be87858..7d4312d 100644 --- a/tests/modules/crosslinks/normcoverage/test.yml +++ b/tests/modules/crosslinks/normcoverage/test.yml @@ -4,7 +4,7 @@ - crosslinks - crosslinks/normcoverage files: - - path: results/crosslinks/sample1.norm.bedgraph.gz + - path: results/crosslinks_normcoverage/sample1.norm.bedgraph.gz md5sum: 1fa6c24abd03b07ad8c0a5d2f39b371d - - path: results/crosslinks/sample4.norm.bedgraph.gz + - path: results/crosslinks_normcoverage/sample4.norm.bedgraph.gz md5sum: f281eecf840f53b8dc2fd46e82266a74 diff --git a/tests/modules/htseq/count/main.nf b/tests/modules/htseq/count/main.nf index 04acf00..cf337b8 100644 --- a/tests/modules/htseq/count/main.nf +++ b/tests/modules/htseq/count/main.nf @@ -10,7 +10,7 @@ log.info ("Starting tests for htseq...") /* Module inclusions --------------------------------------------------------------------------------------*/ -include { HTSEQ_COUNT } from '../../../../modules/htseq/count/main.nf' addParams( options: [args: '-f bam -s no -m union'] ) +include { HTSEQ_COUNT } from '../../../../modules/htseq/count/main.nf' include { ASSERT_CHANNEL_COUNT } from '../../../../test_workflows/assertions/main.nf' include { MD5 } from '../../../../test_workflows/assertions/main.nf' @@ -43,8 +43,8 @@ workflow { //Check count ASSERT_CHANNEL_COUNT( HTSEQ_COUNT.out.counts, "counts", 2) - ASSERT_CHANNEL_COUNT( HTSEQ_COUNT.out.version, "version", 2) + ASSERT_CHANNEL_COUNT( HTSEQ_COUNT.out.versions, "versions", 2) //Check MD5 MD5( HTSEQ_COUNT.out.counts ) -} \ No newline at end of file +} diff --git a/tests/modules/htseq/count/test.config b/tests/modules/htseq/count/test.config new file mode 100644 index 0000000..46eb97c --- /dev/null +++ b/tests/modules/htseq/count/test.config @@ -0,0 +1,5 @@ +process { + withName: 'HTSEQ_COUNT' { + ext.args = '-f bam -s no -m union' + } +} diff --git a/tests/modules/htseq/count/test.yml b/tests/modules/htseq/count/test.yml index 1328a31..4209db9 100644 --- a/tests/modules/htseq/count/test.yml +++ b/tests/modules/htseq/count/test.yml @@ -1,10 +1,10 @@ - name: htseq count - command: nextflow run ./tests/modules/htseq/count -c tests/config/nextflow.config + command: nextflow run ./tests/modules/htseq/count -c tests/config/nextflow.config -c tests/modules/htseq/count/test.config tags: - htseq - htseq/count files: - - path: results/htseq/sample1.tsv + - path: results/htseq_count/sample1.tsv md5sum: d670ba20d717229b6c42ea74b1b39b14 - - path: results/htseq/sample2.tsv + - path: results/htseq_count/sample2.tsv md5sum: d670ba20d717229b6c42ea74b1b39b14 diff --git a/tests/modules/icount/peaks/test.yml b/tests/modules/icount/peaks/test.yml deleted file mode 100644 index bce73b9..0000000 --- a/tests/modules/icount/peaks/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: icount peaks - command: nextflow run ./tests/modules/icount/peaks -c tests/config/nextflow.config - tags: - - icount - - icount/peaks - files: - - path: results/icount/sample1.scores.tsv - md5sum: 477c7bec8b1a1faf209afc514235a111 - - path: results/icount/sample4.scores.tsv - md5sum: b0384def31f9f125ad03558d181c7b05 diff --git a/tests/modules/icount/segment/main.nf b/tests/modules/icount/segment/main.nf index 12749e1..1767c45 100644 --- a/tests/modules/icount/segment/main.nf +++ b/tests/modules/icount/segment/main.nf @@ -4,7 +4,7 @@ nextflow.enable.dsl=2 // Log -log.info ("Starting tests for iCount...") +log.info ("Starting tests for iCount segment...") /*------------------------------------------------------------------------------------*/ /* Define params @@ -14,7 +14,7 @@ log.info ("Starting tests for iCount...") /* Module inclusions --------------------------------------------------------------------------------------*/ -include {ICOUNT_SEGMENT} from '../../../../modules/icount/segment/main.nf' addParams( options: [:] ) +include {ICOUNT_SEGMENT} from '../../../../modules/icount/segment/main.nf' include { ASSERT_CHANNEL_COUNT; ASSERT_LINE_NUMBER; @@ -49,7 +49,7 @@ workflow { ICOUNT_SEGMENT( ch_gtf, ch_fai) ASSERT_CHANNEL_COUNT( ICOUNT_SEGMENT.out.gtf, "gtf", 1) - ASSERT_CHANNEL_COUNT( ICOUNT_SEGMENT.out.version, "version", 1) + ASSERT_CHANNEL_COUNT( ICOUNT_SEGMENT.out.versions, "versions", 1) ICOUNT_SEGMENT.out.gtf .map{ [[id: "icount_segmentation"], it] } diff --git a/tests/modules/icount/segment/test.yml b/tests/modules/icount/segment/test.yml index 8bf4796..c142455 100644 --- a/tests/modules/icount/segment/test.yml +++ b/tests/modules/icount/segment/test.yml @@ -4,5 +4,5 @@ - icount - icount/segment files: - - path: results/icount/icount_segmentation.gtf + - path: results/icount_segment/icount_segmentation.gtf md5sum: 9b45451d777e17d1f0e1ec002d0f3af0 diff --git a/tests/modules/icount/peaks/main.nf b/tests/modules/icount/sigxls/main.nf similarity index 68% rename from tests/modules/icount/peaks/main.nf rename to tests/modules/icount/sigxls/main.nf index 87cc191..ac5ec1d 100644 --- a/tests/modules/icount/peaks/main.nf +++ b/tests/modules/icount/sigxls/main.nf @@ -4,7 +4,7 @@ nextflow.enable.dsl=2 // Log -log.info ("Starting tests for iCount...") +log.info ("Starting tests for iCount sigxls...") /*------------------------------------------------------------------------------------*/ /* Define params @@ -14,12 +14,12 @@ log.info ("Starting tests for iCount...") /* Module inclusions --------------------------------------------------------------------------------------*/ -include {ICOUNT_PEAKS} from '../../../../modules/icount/peaks/main.nf' addParams( options: [args: '--half_window 3 --fdr 0.05'] ) +include {ICOUNT_SIGXLS} from '../../../../modules/icount/sigxls/main.nf' include { ASSERT_CHANNEL_COUNT; - ASSERT_LINE_NUMBER as ASSERT_PEAKS_LINE_NUMBER; + ASSERT_LINE_NUMBER as ASSERT_SIGXLS_LINE_NUMBER; ASSERT_LINE_NUMBER as ASSERT_SCORES_LINE_NUMBER; - ASSERT_MD5 as ASSERT_PEAKS_MD5; + ASSERT_MD5 as ASSERT_SIGXLS_MD5; ASSERT_MD5 as ASSERT_SCORES_MD5 } from "../../../../test_workflows/assertions/main.nf" @@ -52,7 +52,7 @@ Channel .map { row -> [ row[0], file(row[1], checkIfExists: true) ] } .set {ch_bed} -expected_peak_line_counts = [ +expected_sigxls_line_counts = [ sample1: 5, sample4: 4 ] @@ -62,7 +62,7 @@ expected_scores_line_counts = [ sample4: 195 ] -expected_peak_hashes = [ +expected_sigxls_hashes = [ sample1: "4984fdc8e94ef357bd99dad420a098be", sample4: "22d80735d26199e75cf87e632c1b76e4" ] @@ -77,15 +77,15 @@ expected_scores_hashes = [ --------------------------------------------------------------------------------------*/ workflow { - ICOUNT_PEAKS( ch_bed, ch_seg) + ICOUNT_SIGXLS( ch_bed, ch_seg) - ASSERT_CHANNEL_COUNT( ICOUNT_PEAKS.out.peaks, "peaks", 2) - ASSERT_CHANNEL_COUNT( ICOUNT_PEAKS.out.scores, "scores", 2) - ASSERT_CHANNEL_COUNT( ICOUNT_PEAKS.out.version, "version", 2) + ASSERT_CHANNEL_COUNT( ICOUNT_SIGXLS.out.sigxls, "sigxls", 2) + ASSERT_CHANNEL_COUNT( ICOUNT_SIGXLS.out.scores, "scores", 2) + ASSERT_CHANNEL_COUNT( ICOUNT_SIGXLS.out.versions, "versions", 2) - ASSERT_PEAKS_LINE_NUMBER( ICOUNT_PEAKS.out.peaks, "peaks", expected_peak_line_counts) - ASSERT_SCORES_LINE_NUMBER( ICOUNT_PEAKS.out.scores, "scores", expected_scores_line_counts) + ASSERT_SIGXLS_LINE_NUMBER( ICOUNT_SIGXLS.out.sigxls, "sigxls", expected_sigxls_line_counts) + ASSERT_SCORES_LINE_NUMBER( ICOUNT_SIGXLS.out.scores, "scores", expected_scores_line_counts) - ASSERT_PEAKS_MD5( ICOUNT_PEAKS.out.peaks, "peaks", expected_peak_hashes) - ASSERT_SCORES_MD5( ICOUNT_PEAKS.out.scores, "scores", expected_scores_hashes) + ASSERT_SIGXLS_MD5( ICOUNT_SIGXLS.out.sigxls, "sigxls", expected_sigxls_hashes) + ASSERT_SCORES_MD5( ICOUNT_SIGXLS.out.scores, "scores", expected_scores_hashes) } diff --git a/tests/modules/icount/sigxls/test.config b/tests/modules/icount/sigxls/test.config new file mode 100644 index 0000000..66ab9ad --- /dev/null +++ b/tests/modules/icount/sigxls/test.config @@ -0,0 +1,5 @@ +process { + withName: 'ICOUNT_SIGXLS' { + ext.args = '--half_window 3 --fdr 0.05' + } +} diff --git a/tests/modules/icount/sigxls/test.yml b/tests/modules/icount/sigxls/test.yml new file mode 100644 index 0000000..da21dcd --- /dev/null +++ b/tests/modules/icount/sigxls/test.yml @@ -0,0 +1,10 @@ +- name: icount peaks + command: nextflow run ./tests/modules/icount/sigxls -c tests/config/nextflow.config -c tests/modules/icount/sigxls/test.config + tags: + - icount + - icount/sigxls + files: + - path: results/icount_sigxls/sample1.scores.tsv + md5sum: 477c7bec8b1a1faf209afc514235a111 + - path: results/icount_sigxls/sample4.scores.tsv + md5sum: b0384def31f9f125ad03558d181c7b05 diff --git a/tests/modules/paraclu/convert/main.nf b/tests/modules/paraclu/convert/main.nf index ac8f598..dd843cf 100644 --- a/tests/modules/paraclu/convert/main.nf +++ b/tests/modules/paraclu/convert/main.nf @@ -8,7 +8,9 @@ log.info ("Starting tests for test_flows...") /* Module inclusions /*------------------------------------------------------------------------------------*/ -include { ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_CONVERT; ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' +include { + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_CONVERT; + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_LINE_NUMBER } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_MD5 } from '../../../../test_workflows/assertions/main.nf' include { PARACLU_CONVERT } from '../../../../modules/paraclu/convert/main.nf' @@ -47,8 +49,8 @@ workflow { PARACLU_CONVERT { ch_peaks } ASSERT_CHANNEL_COUNT_CONVERT( PARACLU_CONVERT.out.peaks, "PARACLU_CONVERT", 2 ) - ASSERT_CHANNEL_COUNT_VERSION( PARACLU_CONVERT.out.version, "PARACLU_VERSION", 2 ) + ASSERT_CHANNEL_COUNT_VERSION( PARACLU_CONVERT.out.versions, "PARACLU_VERSIONS", 2 ) ASSERT_LINE_NUMBER( PARACLU_CONVERT.out.peaks, "PARACLU_CONVERT", expected_line_counts ) ASSERT_MD5( PARACLU_CONVERT.out.peaks, "PARACLU_CONVERT", expected_md5_hashes ) -} \ No newline at end of file +} diff --git a/tests/modules/paraclu/convert/test.yml b/tests/modules/paraclu/convert/test.yml index ec9db96..453070b 100644 --- a/tests/modules/paraclu/convert/test.yml +++ b/tests/modules/paraclu/convert/test.yml @@ -4,7 +4,7 @@ - paraclu - paraclu/convert files: - - path: results/paraclu/sample1.peaks.bed.gz + - path: results/paraclu_convert/sample1.peaks.bed.gz md5sum: 5637c135647d36d569f54583290a0519 - - path: results/paraclu/sample4.peaks.bed.gz + - path: results/paraclu_convert/sample4.peaks.bed.gz md5sum: a078adb926cc56810bd2ffe45d74fc50 diff --git a/tests/modules/paraclu/cut/main.nf b/tests/modules/paraclu/cut/main.nf index e09a8ca..4d09b25 100644 --- a/tests/modules/paraclu/cut/main.nf +++ b/tests/modules/paraclu/cut/main.nf @@ -8,13 +8,12 @@ log.info ("Starting tests for paraclu cut...") /* Module inclusions /*------------------------------------------------------------------------------------*/ -def Map options = [:] -options.args = "-d 2 -l 200" - -include { ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_CUT; ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' +include { + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_CUT; + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_LINE_NUMBER } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_MD5 } from '../../../../test_workflows/assertions/main.nf' -include { PARACLU_CUT } from '../../../../modules/paraclu/cut/main.nf' addParams( options: options ) +include { PARACLU_CUT } from '../../../../modules/paraclu/cut/main.nf' /*------------------------------------------------------------------------------------*/ /* Define input channels @@ -50,8 +49,8 @@ workflow { PARACLU_CUT { ch_sigxls } ASSERT_CHANNEL_COUNT_CUT( PARACLU_CUT.out.peaks, "PARACLU_CUT", 2 ) - ASSERT_CHANNEL_COUNT_VERSION( PARACLU_CUT.out.version, "PARACLU_VERSION", 2 ) + ASSERT_CHANNEL_COUNT_VERSION( PARACLU_CUT.out.versions, "PARACLU_VERSIONS", 2 ) ASSERT_LINE_NUMBER( PARACLU_CUT.out.peaks, "PARACLU_CUT", expected_line_counts ) ASSERT_MD5( PARACLU_CUT.out.peaks, "PARACLU_CUT", expected_md5_hashes ) -} \ No newline at end of file +} diff --git a/tests/modules/paraclu/cut/test.config b/tests/modules/paraclu/cut/test.config new file mode 100644 index 0000000..08606a0 --- /dev/null +++ b/tests/modules/paraclu/cut/test.config @@ -0,0 +1,5 @@ +process { + withName: 'PARACLU_CUT' { + ext.args = '-d 2 -l 200' + } +} diff --git a/tests/modules/paraclu/cut/test.yml b/tests/modules/paraclu/cut/test.yml index 8bb6d7f..fb1b9f6 100644 --- a/tests/modules/paraclu/cut/test.yml +++ b/tests/modules/paraclu/cut/test.yml @@ -1,10 +1,10 @@ - name: paraclu cut - command: nextflow run ./tests/modules/paraclu/cut -c tests/config/nextflow.config + command: nextflow run ./tests/modules/paraclu/cut -c tests/config/nextflow.config -c tests/modules/paraclu/cut/test.config tags: - paraclu - paraclu/cut files: - - path: results/paraclu/sample1.peaks.tsv.gz + - path: results/paraclu_cut/sample1.peaks.tsv.gz md5sum: b048a33808b59897ef5031e8fa228a0c - - path: results/paraclu/sample4.peaks.tsv.gz + - path: results/paraclu_cut/sample4.peaks.tsv.gz md5sum: 191750fcbc59dd645a2028b694314dff diff --git a/tests/modules/paraclu/paraclu/main.nf b/tests/modules/paraclu/paraclu/main.nf index 11c2ec5..05547d7 100644 --- a/tests/modules/paraclu/paraclu/main.nf +++ b/tests/modules/paraclu/paraclu/main.nf @@ -8,13 +8,12 @@ log.info ("Starting tests for paraclu...") /* Module inclusions /*------------------------------------------------------------------------------------*/ -def Map options = [:] -options.args = "10" - -include { ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_SIGXLS; ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' +include { + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_SIGXLS; + ASSERT_CHANNEL_COUNT as ASSERT_CHANNEL_COUNT_VERSION } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_LINE_NUMBER } from '../../../../test_workflows/assertions/main.nf' include { ASSERT_MD5 } from '../../../../test_workflows/assertions/main.nf' -include { PARACLU_PARACLU } from '../../../../modules/paraclu/paraclu/main.nf' addParams( options: options ) +include { PARACLU_PARACLU } from '../../../../modules/paraclu/paraclu/main.nf' /*------------------------------------------------------------------------------------*/ /* Define input channels @@ -50,8 +49,8 @@ workflow { PARACLU_PARACLU { ch_crosslinks } ASSERT_CHANNEL_COUNT_SIGXLS( PARACLU_PARACLU.out.sigxls, "PARACLU_SIGXL", 2 ) - ASSERT_CHANNEL_COUNT_VERSION( PARACLU_PARACLU.out.version, "PARACLU_VERSION", 2 ) + ASSERT_CHANNEL_COUNT_VERSION( PARACLU_PARACLU.out.versions, "PARACLU_VERSIONS", 2 ) ASSERT_LINE_NUMBER( PARACLU_PARACLU.out.sigxls, "PARACLU", expected_line_counts ) ASSERT_MD5( PARACLU_PARACLU.out.sigxls, "PARACLU", expected_md5_hashes ) -} \ No newline at end of file +} diff --git a/tests/modules/paraclu/paraclu/test.config b/tests/modules/paraclu/paraclu/test.config new file mode 100644 index 0000000..c828567 --- /dev/null +++ b/tests/modules/paraclu/paraclu/test.config @@ -0,0 +1,5 @@ +process { + withName: 'PARACLU_PARACLU' { + ext.args = '10' + } +} diff --git a/tests/modules/paraclu/paraclu/test.yml b/tests/modules/paraclu/paraclu/test.yml index 285f86a..55f2b9d 100644 --- a/tests/modules/paraclu/paraclu/test.yml +++ b/tests/modules/paraclu/paraclu/test.yml @@ -1,10 +1,10 @@ - name: paraclu paraclu - command: nextflow run ./tests/modules/paraclu/paraclu -c tests/config/nextflow.config + command: nextflow run ./tests/modules/paraclu/paraclu -c tests/config/nextflow.config -c tests/modules/paraclu/paraclu/test.config tags: - paraclu - paraclu/paraclu files: - - path: results/paraclu/sample1.sigxls.tsv.gz + - path: results/paraclu_paraclu/sample1.sigxls.tsv.gz md5sum: 6fae57f714af12aefdb5c387ab72cd56 - - path: results/paraclu/sample4.sigxls.tsv.gz + - path: results/paraclu_paraclu/sample4.sigxls.tsv.gz md5sum: 13df830d862eda8a54b494687104576f diff --git a/tests/modules/peka/main.nf b/tests/modules/peka/main.nf index 431bcb9..4aadf18 100644 --- a/tests/modules/peka/main.nf +++ b/tests/modules/peka/main.nf @@ -14,7 +14,7 @@ log.info ("Starting tests for PEKA...") /* Module inclusions --------------------------------------------------------------------------------------*/ -include {PEKA} from '../../../modules/peka/main.nf' addParams( options: [args: "-sr intron UTR3"] ) +include {PEKA} from '../../../modules/peka/main.nf' include { ASSERT_CHANNEL_COUNT; ASSERT_LINE_NUMBER as ASSERT_DISTRIBUTION_LINE_NUMBER; @@ -102,7 +102,7 @@ workflow { ASSERT_CHANNEL_COUNT( PEKA.out.distribution, "distribution", 1) ASSERT_CHANNEL_COUNT( PEKA.out.cluster, "cluster", 1) ASSERT_CHANNEL_COUNT( PEKA.out.pdf, "pdf", 1) - ASSERT_CHANNEL_COUNT( PEKA.out.version, "version", 1) + ASSERT_CHANNEL_COUNT( PEKA.out.versions, "versions", 1) ASSERT_DISTRIBUTION_LINE_NUMBER( PEKA.out.distribution.map( unfold_meta ).flatten().collate(2), diff --git a/tests/modules/peka/peka.config b/tests/modules/peka/peka.config new file mode 100644 index 0000000..68900ed --- /dev/null +++ b/tests/modules/peka/peka.config @@ -0,0 +1,5 @@ +process { + withName: 'PEKA' { + ext.args = '-sr intron UTR3' + } +} diff --git a/tests/modules/peka/test.yml b/tests/modules/peka/test.yml index 7c971a4..037efcd 100644 --- a/tests/modules/peka/test.yml +++ b/tests/modules/peka/test.yml @@ -1,4 +1,4 @@ - name: peka - command: nextflow run ./tests/modules/peka -c tests/config/nextflow.config + command: nextflow run tests/modules/peka -c tests/config/nextflow.config -c tests/modules/peka/peka.config tags: - peka diff --git a/tests/modules/ultraplex/main.nf b/tests/modules/ultraplex/main.nf index 68a96a2..5289c1b 100644 --- a/tests/modules/ultraplex/main.nf +++ b/tests/modules/ultraplex/main.nf @@ -16,11 +16,21 @@ params.verbose = true /* Module inclusions --------------------------------------------------------------------------------------*/ -include {ULTRAPLEX as ULTRAPLEX_SINGLE} from '../../../modules/ultraplex/main.nf' addParams(options: [ publish_dir: 'ultraplex_single' ] ) -include {ULTRAPLEX as ULTRAPLEX_PAIRED} from '../../../modules/ultraplex/main.nf' addParams(options: [ publish_dir: 'ultraplex_paired' ] ) -include {ULTRAPLEX as ULTRAPLEX_ARGS} from '../../../modules/ultraplex/main.nf' addParams(options: [ publish_dir: 'ultraplex_single_args', args: '--phredquality 0' ] ) -include {ASSERT_CHANNEL_COUNT} from '../../../test_workflows/assertions/test/main.nf' -//include {ASSERT_LINE_NUMBER as line_count_1; ASSERT_LINE_NUMBER as line_count_2; ASSERT_LINE_NUMBER as line_count_3; ASSERT_LINE_NUMBER as line_count_4; ASSERT_LINE_NUMBER as line_count_5} from "../../../test_workflows/assertions/main.nf" +include {ULTRAPLEX as ULTRAPLEX_SINGLE} from '../../../modules/ultraplex/main.nf' +include {ULTRAPLEX as ULTRAPLEX_PAIRED} from '../../../modules/ultraplex/main.nf' +include {ULTRAPLEX as ULTRAPLEX_ARGS} from '../../../modules/ultraplex/main.nf' +include { + ASSERT_CHANNEL_COUNT; + ASSERT_LINE_NUMBER as ASSERT_LINE_NUMBER_SINGLE; + ASSERT_LINE_NUMBER as ASSERT_LINE_NUMBER_SINGLE_NOMATCH; + ASSERT_LINE_NUMBER as ASSERT_LINE_NUMBER_ARGS; + ASSERT_LINE_NUMBER as ASSERT_LINE_NUMBER_ARGS_NOMATCH; + ASSERT_LINE_NUMBER as ASSERT_LINE_NUMBER_PAIRED + ASSERT_MD5 as ASSERT_MD5_SINGLE; + ASSERT_MD5 as ASSERT_MD5_SINGLE_NOMATCH; + ASSERT_MD5 as ASSERT_MD5_ARGS; + ASSERT_MD5 as ASSERT_MD5_ARGS_NOMATCH; + ASSERT_MD5 as ASSERT_MD5_PAIRED } from "../../../test_workflows/assertions/main.nf" /*------------------------------------------------------------------------------------*/ @@ -67,12 +77,30 @@ single_end_valid_reads_line_count = [ ultraplex_demux_5bc_NNGCGNN_3bc_NNTG: 244 ] +single_end_valid_reads_hashes = [ + ultraplex_demux_5bc_NNGCGNN_3bc_NNTG: "dd5ca5a3b0d7f9a029b0cb3c7eab12ce", + ultraplex_demux_5bc_NNCCANN_3bc_NNCC: "46859593cf07ea79f80a2aaa4586b5de", + ultraplex_demux_5bc_NNCCANN_3bc_NNAT: "be96d6811322b0fe39824d6943c5c7c6", + ultraplex_demux_5bc_NNGCGNN_3bc_NNCC: "7075f8565c0d3a36624ead7eb5f5f464", + ultraplex_demux_5bc_NNGCGNN_3bc_NNAT: "ef8c0e2201f2f90a44b5b748d502d76f", + ultraplex_demux_5bc_NNCCANN_3bc_NNTG: "6d8b4ad6873a342b9c459c5b8c97137f", + ultraplex_demux_5bc_NNATGNN_3bc_NNTG: "b4950cd651b9a48bd2c3ddaab5407ad1", + ultraplex_demux_5bc_NNATGNN_3bc_NNCC: "7801a8f532919579e30ee9968c98ecf0", + ultraplex_demux_5bc_NNATGNN_3bc_NNAT: "3d4051f529d26e0a6f34faeddc8208f8" +] + single_end_no_match_line_count = [ ultraplex_demux_5bc_NNATGNN_3bc_no_match: 2596, ultraplex_demux_5bc_NNCCANN_3bc_no_match: 2624, ultraplex_demux_5bc_NNGCGNN_3bc_no_match: 2596 ] +single_end_no_match_hashes = [ + ultraplex_demux_5bc_NNGCGNN_3bc_no_match: "80e7cb67b7a2e06f39b40032c263f4ef", + ultraplex_demux_5bc_NNCCANN_3bc_no_match: "dc922af64362244c01863cc6a4f2e0dc", + ultraplex_demux_5bc_NNATGNN_3bc_no_match: "1c21cc3476f027b66504812808d19af9" +] + single_end_zero_phred_valid_reads_line_count = [ ultraplex_demux_5bc_NNATGNN_3bc_NNAT: 268, ultraplex_demux_5bc_NNATGNN_3bc_NNCC: 268, @@ -85,12 +113,30 @@ single_end_zero_phred_valid_reads_line_count = [ ultraplex_demux_5bc_NNGCGNN_3bc_NNTG: 268 ] +single_end_zero_phred_valid_reads_hashes = [ + ultraplex_demux_5bc_NNGCGNN_3bc_NNTG: "575da2a57ea0bd159b3bccec74aa2ff5", + ultraplex_demux_5bc_NNCCANN_3bc_NNCC: "2686690141610e2fa21ce4b5f64961a0", + ultraplex_demux_5bc_NNCCANN_3bc_NNAT: "1083022230796784d7f69ca11df6b2fa", + ultraplex_demux_5bc_NNGCGNN_3bc_NNCC: "e121be78cfb234724d3510fcace6b952", + ultraplex_demux_5bc_NNGCGNN_3bc_NNAT: "52c32a63ecc87f0dc2f63c80deac6316", + ultraplex_demux_5bc_NNCCANN_3bc_NNTG: "a012bc5a021866baf2ff8091a3a8efca", + ultraplex_demux_5bc_NNATGNN_3bc_NNTG: "6786ca9395b1cbd4cb9aa66ce5555bb8", + ultraplex_demux_5bc_NNATGNN_3bc_NNCC: "c0fc2552ee00d6b3a9e455d74359a1b6", + ultraplex_demux_5bc_NNATGNN_3bc_NNAT: "aa47223a9a958c9cd11cc8d4b2e68c0c" +] + single_end_zero_phred_no_match_line_count = [ ultraplex_demux_5bc_NNATGNN_3bc_no_match: 2556, ultraplex_demux_5bc_NNCCANN_3bc_no_match: 2556, ultraplex_demux_5bc_NNGCGNN_3bc_no_match: 2556 ] +single_end_zero_phred_no_match_hashes = [ + ultraplex_demux_5bc_NNGCGNN_3bc_no_match: "3b9051e6c7c2c1f88c0b5517d5c69788", + ultraplex_demux_5bc_NNCCANN_3bc_no_match: "f4ead754bccd3a8b323c1f3ccd158422", + ultraplex_demux_5bc_NNATGNN_3bc_no_match: "9cb80f89605d8b283f75749929191fc7" +] + paired_end_valid_reads_line_count = [ ultraplex_demux_5bc_NNATGNN_3bc_NNAT_Fwd: 1120, ultraplex_demux_5bc_NNATGNN_3bc_NNAT_Rev: 1120, @@ -112,6 +158,27 @@ paired_end_valid_reads_line_count = [ ultraplex_demux_5bc_NNGCGNN_3bc_NNTG_Rev: 1120 ] +paired_end_valid_reads_hashes = [ + ultraplex_demux_5bc_NNGCGNN_3bc_NNCC_Fwd: "4e06a3acf4c255984c99422603f3e885", + ultraplex_demux_5bc_NNATGNN_3bc_NNAT_Fwd: "0e0fb2326b7d8c5934557983b02511ef", + ultraplex_demux_5bc_NNGCGNN_3bc_NNTG_Fwd: "f74d82229e369467911c788465f598b0", + ultraplex_demux_5bc_NNATGNN_3bc_NNCC_Rev: "2f6eaddd40c5b421fe6228302f356350", + ultraplex_demux_5bc_NNATGNN_3bc_NNTG_Rev: "15d50fa39bfddabfd62e5f8d5a25184b", + ultraplex_demux_5bc_NNGCGNN_3bc_NNAT_Rev: "521985cd50372c18c8cbcb4b2f724d85", + ultraplex_demux_5bc_NNCCANN_3bc_NNTG_Rev: "b6cceac1916e7ac043b949490ccac122", + ultraplex_demux_5bc_NNCCANN_3bc_NNCC_Rev: "373a60ee2cf239e58c330d55c9769924", + ultraplex_demux_5bc_NNCCANN_3bc_NNAT_Fwd: "cce5fea5454578316ec0ee5de757196f", + ultraplex_demux_5bc_NNGCGNN_3bc_NNTG_Rev: "f96c8aafe6be26708a80fc229d62f523", + ultraplex_demux_5bc_NNATGNN_3bc_NNAT_Rev: "5dc9622f97c08ef043a6593a350fdb9c", + ultraplex_demux_5bc_NNGCGNN_3bc_NNCC_Rev: "befa4fcfe6a42b658fac0c830769f040", + ultraplex_demux_5bc_NNGCGNN_3bc_NNAT_Fwd: "1e9506a8c321653d5c0289d226f01551", + ultraplex_demux_5bc_NNATGNN_3bc_NNTG_Fwd: "93e2e57ade3cf5afef3d18b2bc17283f", + ultraplex_demux_5bc_NNATGNN_3bc_NNCC_Fwd: "e0fc008aa324381576b29731ceefe94a", + ultraplex_demux_5bc_NNCCANN_3bc_NNCC_Fwd: "4e82201590de288649689c0c8c160057", + ultraplex_demux_5bc_NNCCANN_3bc_NNTG_Fwd: "9a90f19672e5167bc39f95729f137f0d", + ultraplex_demux_5bc_NNCCANN_3bc_NNAT_Rev: "c75a3e9c5d4d00d6d2e1e965dec9b2fa" +] + /*------------------------------------------------------------------------------------*/ /* Run tests --------------------------------------------------------------------------------------*/ @@ -122,13 +189,13 @@ workflow { ULTRAPLEX_SINGLE.out.fastq .map{ it[1] } .flatten() - .map{ [ it.getSimpleName(), it ] } + .map{ [ ["id": it.getSimpleName()], it ] } .set{ ch_valid_reads_single } ULTRAPLEX_SINGLE.out.no_match_fastq .map{ it[1] } .flatten() - .map{ [ it.getSimpleName(), it ] } + .map{ [ ["id": it.getSimpleName()], it ] } .set{ ch_no_match_reads_single } // Testing channel outputs @@ -141,10 +208,26 @@ workflow { ASSERT_CHANNEL_COUNT( ULTRAPLEX_SINGLE.out.report, "report", 1) // Testing fastq output lengths - //line_count_1( ch_valid_reads_single, "single_valid_reads", - // single_end_valid_reads_line_count ) - //line_count_2( ch_no_match_reads_single, "single_no_match", - // single_end_no_match_line_count ) + ASSERT_LINE_NUMBER_SINGLE ( + ch_valid_reads_single, + "single_valid_reads", + single_end_valid_reads_line_count + ) + ASSERT_LINE_NUMBER_SINGLE_NOMATCH ( + ch_no_match_reads_single, + "single_no_match", + single_end_no_match_line_count + ) + ASSERT_MD5_SINGLE ( + ch_valid_reads_single, + "single_valid_reads", + single_end_valid_reads_hashes + ) + ASSERT_MD5_SINGLE_NOMATCH ( + ch_no_match_reads_single, + "single_no_match", + single_end_no_match_hashes + ) // DIFFERENT ARGS @@ -153,13 +236,13 @@ workflow { ULTRAPLEX_ARGS.out.fastq .map{ it[1] } .flatten() - .map{ [ it.getSimpleName(), it ] } + .map{ [ ["id": it.getSimpleName()], it ] } .set{ ch_valid_reads_single_args } ULTRAPLEX_ARGS.out.no_match_fastq .map{ it[1] } .flatten() - .map{ [ it.getSimpleName(), it ] } + .map{ [ ["id": it.getSimpleName()], it ] } .set{ ch_no_match_reads_single_args } // Testing channel outputs @@ -172,10 +255,27 @@ workflow { ASSERT_CHANNEL_COUNT( ULTRAPLEX_ARGS.out.report, "report", 1) // Testing fastq output lengths - //line_count_3( ch_valid_reads_single_args, "single_valid_reads_args", - // single_end_zero_phred_valid_reads_line_count ) - //line_count_4( ch_no_match_reads_single_args, "single_no_match_args", - // single_end_zero_phred_no_match_line_count ) + ASSERT_LINE_NUMBER_ARGS ( + ch_valid_reads_single_args, + "single_valid_reads_args", + single_end_zero_phred_valid_reads_line_count + ) + ASSERT_LINE_NUMBER_ARGS_NOMATCH ( + ch_no_match_reads_single_args, + "single_no_match_args", + single_end_zero_phred_no_match_line_count + ) + ASSERT_MD5_ARGS ( + ch_valid_reads_single_args, + "single_valid_reads_args", + single_end_zero_phred_valid_reads_hashes + ) + ASSERT_MD5_ARGS_NOMATCH ( + ch_no_match_reads_single_args, + "single_no_match_args", + single_end_zero_phred_no_match_hashes + ) + // PAIRED END @@ -184,7 +284,7 @@ workflow { ULTRAPLEX_PAIRED.out.fastq .map{ it[1] } .flatten() - .map{ [ it.getSimpleName(), it ] } + .map{ [ ["id": it.getSimpleName()], it ] } .set{ ch_valid_reads_paired } // Testing channel outputs @@ -194,7 +294,15 @@ workflow { ASSERT_CHANNEL_COUNT( ULTRAPLEX_PAIRED.out.no_match_fastq, "no_match_fastq", 0) ASSERT_CHANNEL_COUNT( ULTRAPLEX_PAIRED.out.report, "report", 1) - // // Testing fastq output lengths - //line_count_5( ch_valid_reads_paired, "paired_valid_reads_args", - // paired_end_valid_reads_line_count ) -} \ No newline at end of file + // Testing fastq output lengths + ASSERT_LINE_NUMBER_PAIRED ( + ch_valid_reads_paired, + "paired_valid_reads_args", + paired_end_valid_reads_line_count + ) + ASSERT_MD5_PAIRED ( + ch_valid_reads_paired, + "paired_valid_reads_args", + paired_end_valid_reads_hashes + ) +} diff --git a/tests/modules/ultraplex/test.config b/tests/modules/ultraplex/test.config new file mode 100644 index 0000000..bd00a41 --- /dev/null +++ b/tests/modules/ultraplex/test.config @@ -0,0 +1,9 @@ +process { + withName: 'ULTRAPLEX_ARGS' { + ext.args = '--phredquality 0' + } +} + + + + diff --git a/tests/modules/ultraplex/test.yml b/tests/modules/ultraplex/test.yml index 23d5bc0..7accfcd 100644 --- a/tests/modules/ultraplex/test.yml +++ b/tests/modules/ultraplex/test.yml @@ -1,4 +1,4 @@ - name: ultraplex - command: nextflow run ./tests/modules/ultraplex -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ultraplex -c tests/config/nextflow.config -c tests/modules/ultraplex/test.config tags: - ultraplex