From 9194fb845e1ec6a92ac340a15a22e47f3ad22781 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 6 May 2022 07:54:10 +0000 Subject: [PATCH 01/65] Add module kat hist --- modules/kat/hist/main.nf | 42 +++++++++++++++++ modules/kat/hist/meta.yml | 64 ++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/kat/hist/main.nf | 28 +++++++++++ tests/modules/kat/hist/nextflow.config | 9 ++++ tests/modules/kat/hist/test.yml | 30 ++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 modules/kat/hist/main.nf create mode 100644 modules/kat/hist/meta.yml create mode 100644 tests/modules/kat/hist/main.nf create mode 100644 tests/modules/kat/hist/nextflow.config create mode 100644 tests/modules/kat/hist/test.yml diff --git a/modules/kat/hist/main.nf b/modules/kat/hist/main.nf new file mode 100644 index 00000000..e9a486f9 --- /dev/null +++ b/modules/kat/hist/main.nf @@ -0,0 +1,42 @@ +process KAT_HIST { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::kat=2.4.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kat:2.4.2--py38hfc5f9d8_2': + 'quay.io/biocontainers/kat:2.4.2--py38hfc5f9d8_2' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.hist") , emit: hist + tuple val(meta), path("*.hist.dist_analysis.json"), emit: json + tuple val(meta), path("*.png") , emit: png , optional: true + tuple val(meta), path("*.ps") , emit: ps , optional: true + tuple val(meta), path("*.pdf") , emit: pdf , optional: true + tuple val(meta), path("*-hash.jf*") , emit: jellyfish_hash, optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + kat hist \\ + --threads $task.cpus \\ + --output_prefix ${prefix}.hist \\ + $args \\ + $reads + + ls -l + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kat: \$( kat hist --version | sed 's/kat //' ) + END_VERSIONS + """ +} diff --git a/modules/kat/hist/meta.yml b/modules/kat/hist/meta.yml new file mode 100644 index 00000000..a7b45347 --- /dev/null +++ b/modules/kat/hist/meta.yml @@ -0,0 +1,64 @@ +name: "kat_hist" +description: Creates a histogram of the number of distinct k-mers having a given frequency. +keywords: + - k-mer + - histogram + - count +tools: + - "kat": + description: "KAT is a suite of tools that analyse jellyfish hashes or sequence files (fasta or fastq) using kmer counts" + homepage: https://www.earlham.ac.uk/kat-tools + documentation: https://kat.readthedocs.io/en/latest/index.html + tool_dev_url: https://github.com/TGAC/KAT + doi: http://bioinformatics.oxfordjournals.org/content/early/2016/10/20/bioinformatics.btw663.abstract + licence: "['GPL v3']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - hist: + type: file + description: KAT histogram of k-mer counts + pattern: "*.hist" + - json: + type: file + description: KAT histogram summary of distance analysis + pattern: "*.hist.dist_analysis.json" + - png: + type: file + description: KAT plot of k-mer histogram in PNG format + pattern: "*.png" + - ps: + type: file + description: KAT plot of k-mer histogram in PS format + pattern: "*.ps" + - pdf: + type: file + description: KAT plot of k-mer histogram in PDF format + pattern: "*.pdf" + - jellyfish_hash: + type: file + description: Jellyfish hash file + pattern: "*-hist.jf*" + +authors: + - "@mahesh-panchal" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 32a28477..21b112d0 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1041,6 +1041,10 @@ kallistobustools/ref: - modules/kallistobustools/ref/** - tests/modules/kallistobustools/ref/** +kat/hist: + - modules/kat/hist/** + - tests/modules/kat/hist/** + khmer/normalizebymedian: - modules/khmer/normalizebymedian/** - tests/modules/khmer/normalizebymedian/** diff --git a/tests/modules/kat/hist/main.nf b/tests/modules/kat/hist/main.nf new file mode 100644 index 00000000..06be6150 --- /dev/null +++ b/tests/modules/kat/hist/main.nf @@ -0,0 +1,28 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { KAT_HIST } from '../../../../modules/kat/hist/main.nf' + +workflow test_kat_hist_single_end { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + + KAT_HIST ( input ) +} + +workflow test_kat_hist_paired_end { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + ] + ] + + KAT_HIST ( input ) +} diff --git a/tests/modules/kat/hist/nextflow.config b/tests/modules/kat/hist/nextflow.config new file mode 100644 index 00000000..a2af9dff --- /dev/null +++ b/tests/modules/kat/hist/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: 'test_kat_hist_single_end:KAT_HIST' { + ext.args = '-d' + } + +} diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml new file mode 100644 index 00000000..994cffa4 --- /dev/null +++ b/tests/modules/kat/hist/test.yml @@ -0,0 +1,30 @@ +- name: kat hist test_kat_hist_single_end + command: nextflow run tests/modules/kat/hist -entry test_kat_hist_single_end -c tests/config/nextflow.config + tags: + - kat/hist + - kat + files: + - path: output/kat/test.hist + md5sum: 1aceb823b6774f14f5cca15954138efd + - path: output/kat/test.hist-hash.jf27 + - path: output/kat/test.hist.dist_analysis.json + md5sum: ec4317d510f752855411d13c0f24dea9 + - path: output/kat/test.hist.png + md5sum: 30daaf4d2dd4b1574e387df973c39d03 + - path: output/kat/versions.yml + md5sum: 296f28c007bc55f8f5490702cf3f81d4 + +- name: kat hist test_kat_hist_paired_end + command: nextflow run tests/modules/kat/hist -entry test_kat_hist_paired_end -c tests/config/nextflow.config + tags: + - kat/hist + - kat + files: + - path: output/kat/test.hist + md5sum: c4e8e01996bd8f676e02690220e1def7 + - path: output/kat/test.hist.dist_analysis.json + md5sum: 954a3d1c3fc56f80f0929315ed299824 + - path: output/kat/test.hist.png + md5sum: 8a21ce0965342234f5982f947f4f10b0 + - path: output/kat/versions.yml + md5sum: 3a07329af7ce78e76b021996cd08eacb From c19e7da59decb430b3e57c5d2b5175005850b0af Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 6 May 2022 10:55:48 +0200 Subject: [PATCH 02/65] Apply suggestions from code review Remove versions md5sum Co-authored-by: FriederikeHanssen --- tests/modules/kat/hist/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml index 994cffa4..131e8a3a 100644 --- a/tests/modules/kat/hist/test.yml +++ b/tests/modules/kat/hist/test.yml @@ -12,7 +12,6 @@ - path: output/kat/test.hist.png md5sum: 30daaf4d2dd4b1574e387df973c39d03 - path: output/kat/versions.yml - md5sum: 296f28c007bc55f8f5490702cf3f81d4 - name: kat hist test_kat_hist_paired_end command: nextflow run tests/modules/kat/hist -entry test_kat_hist_paired_end -c tests/config/nextflow.config @@ -27,4 +26,3 @@ - path: output/kat/test.hist.png md5sum: 8a21ce0965342234f5982f947f4f10b0 - path: output/kat/versions.yml - md5sum: 3a07329af7ce78e76b021996cd08eacb From 9b4923dcd5334ad44590180abfc73b0dee387874 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 10 May 2022 15:02:37 +0000 Subject: [PATCH 03/65] Change test files --- tests/modules/kat/hist/main.nf | 6 +++--- tests/modules/kat/hist/test.yml | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/modules/kat/hist/main.nf b/tests/modules/kat/hist/main.nf index 06be6150..88136749 100644 --- a/tests/modules/kat/hist/main.nf +++ b/tests/modules/kat/hist/main.nf @@ -8,7 +8,7 @@ workflow test_kat_hist_single_end { input = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] KAT_HIST ( input ) @@ -19,8 +19,8 @@ workflow test_kat_hist_paired_end { input = [ [ id:'test', single_end:false ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_2_fastq_gz'], checkIfExists: true), ] ] diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml index 131e8a3a..94f545e6 100644 --- a/tests/modules/kat/hist/test.yml +++ b/tests/modules/kat/hist/test.yml @@ -5,13 +5,14 @@ - kat files: - path: output/kat/test.hist - md5sum: 1aceb823b6774f14f5cca15954138efd + md5sum: c6eba52b3a2653a684577a8ae20b74c1 - path: output/kat/test.hist-hash.jf27 - path: output/kat/test.hist.dist_analysis.json - md5sum: ec4317d510f752855411d13c0f24dea9 + md5sum: 52a5a2d91c71b940f36f1f0a7fd5ef10 - path: output/kat/test.hist.png - md5sum: 30daaf4d2dd4b1574e387df973c39d03 + md5sum: 49861ef1a265e0edde3550b39c64a274 - path: output/kat/versions.yml + md5sum: 296f28c007bc55f8f5490702cf3f81d4 - name: kat hist test_kat_hist_paired_end command: nextflow run tests/modules/kat/hist -entry test_kat_hist_paired_end -c tests/config/nextflow.config @@ -20,9 +21,10 @@ - kat files: - path: output/kat/test.hist - md5sum: c4e8e01996bd8f676e02690220e1def7 + md5sum: 91429091e74b1718051591d83a1ccb5d - path: output/kat/test.hist.dist_analysis.json - md5sum: 954a3d1c3fc56f80f0929315ed299824 + md5sum: 8b0dabeaff4ba706b33aa8964d687e13 - path: output/kat/test.hist.png - md5sum: 8a21ce0965342234f5982f947f4f10b0 + md5sum: e20774d0d2b979cb6ead7b7fb5ad36d9 - path: output/kat/versions.yml + md5sum: 3a07329af7ce78e76b021996cd08eacb From 7a16ece747c402c23cf1a8b36b2edf0ee468dad3 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 10 May 2022 15:13:25 +0000 Subject: [PATCH 04/65] Change md5sum to contains --- tests/modules/kat/hist/test.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml index 94f545e6..19d92ee2 100644 --- a/tests/modules/kat/hist/test.yml +++ b/tests/modules/kat/hist/test.yml @@ -8,7 +8,14 @@ md5sum: c6eba52b3a2653a684577a8ae20b74c1 - path: output/kat/test.hist-hash.jf27 - path: output/kat/test.hist.dist_analysis.json - md5sum: 52a5a2d91c71b940f36f1f0a7fd5ef10 + # md5sum: 52a5a2d91c71b940f36f1f0a7fd5ef10 # This is variable for an unknown reason + contains: + - "nb_peaks" + - "global_minima" + - "global_maxima" + - "mean_freq" + - "est_genome_size" + - "est_het_rate" - path: output/kat/test.hist.png md5sum: 49861ef1a265e0edde3550b39c64a274 - path: output/kat/versions.yml @@ -23,7 +30,14 @@ - path: output/kat/test.hist md5sum: 91429091e74b1718051591d83a1ccb5d - path: output/kat/test.hist.dist_analysis.json - md5sum: 8b0dabeaff4ba706b33aa8964d687e13 + # md5sum: 8b0dabeaff4ba706b33aa8964d687e13 # This is variable for an unknown reason + contains: + - "nb_peaks" + - "global_minima" + - "global_maxima" + - "mean_freq" + - "est_genome_size" + - "est_het_rate" - path: output/kat/test.hist.png md5sum: e20774d0d2b979cb6ead7b7fb5ad36d9 - path: output/kat/versions.yml From c70b169f61620f35bd6633426f4b236ced9e067d Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 20 May 2022 13:34:54 +0200 Subject: [PATCH 05/65] create modules --- modules/bcftools/rhocall/main.nf | 75 +++++++++++++++++++ modules/bcftools/rhocall/meta.yml | 51 +++++++++++++ tests/config/pytest_modules.yml | 4 + tests/modules/bcftools/rhocall/main.nf | 15 ++++ .../modules/bcftools/rhocall/nextflow.config | 5 ++ tests/modules/bcftools/rhocall/test.yml | 14 ++++ 6 files changed, 164 insertions(+) create mode 100644 modules/bcftools/rhocall/main.nf create mode 100644 modules/bcftools/rhocall/meta.yml create mode 100644 tests/modules/bcftools/rhocall/main.nf create mode 100644 tests/modules/bcftools/rhocall/nextflow.config create mode 100644 tests/modules/bcftools/rhocall/test.yml diff --git a/modules/bcftools/rhocall/main.nf b/modules/bcftools/rhocall/main.nf new file mode 100644 index 00000000..7036963e --- /dev/null +++ b/modules/bcftools/rhocall/main.nf @@ -0,0 +1,75 @@ +// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) +// https://github.com/nf-core/modules/tree/master/modules +// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: +// https://nf-co.re/join +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta +// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty +// list (`[]`) instead of a file can be used to work around this issue. + +process BCFTOOLS_RHOCALL { + tag "$meta.id" + label 'process_medium' + + // TODO nf-core: List required Conda package(s). + // Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10"). + // For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems. + // TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below. + conda (params.enable_conda ? "bioconda::bcftools=1.15.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.15.1--h0ea216a_0': + 'quay.io/biocontainers/bcftools:1.15.1--h0ea216a_0' }" + + input: + // TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group" + // MUST be provided as an input via a Groovy Map called "meta". + // This information may not be required in some instances e.g. indexing reference genome files: + // https://github.com/nf-core/modules/blob/master/modules/bwa/index/main.nf + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + tuple val(meta), path(bam) + + output: + // TODO nf-core: Named file extensions MUST be emitted for ALL output channels + tuple val(meta), path("*.bam"), emit: bam + // TODO nf-core: List additional required output channels/values here + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 + // If the software is unable to output a version number on the command-line then it can be manually specified + // e.g. https://github.com/nf-core/modules/blob/master/modules/homer/annotatepeaks/main.nf + // Each software used MUST provide the software name and version number in the YAML version file (versions.yml) + // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "task.ext.args" directive + // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter + // using the Nextflow "task" variable e.g. "--threads $task.cpus" + // TODO nf-core: Please replace the example samtools command below with your module's command + // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) + """ + samtools \\ + sort \\ + $args \\ + -@ $task.cpus \\ + -o ${prefix}.bam \\ + -T $prefix \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) + END_VERSIONS + """ +} diff --git a/modules/bcftools/rhocall/meta.yml b/modules/bcftools/rhocall/meta.yml new file mode 100644 index 00000000..fa7baf2a --- /dev/null +++ b/modules/bcftools/rhocall/meta.yml @@ -0,0 +1,51 @@ +name: "bcftools_rhocall" +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +keywords: + - sort +tools: + - "bcftools": + ## TODO nf-core: Add a description and other details for the software below + description: "BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations." + homepage: "None" + documentation: "None" + tool_dev_url: "None" + doi: "" + licence: "['GPL']" + +## TODO nf-core: Add a description of all of the variables used as input +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + # + ## TODO nf-core: Delete / customise this example input + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +## TODO nf-core: Add a description of all of the variables used as output +output: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + # + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + ## TODO nf-core: Delete / customise this example output + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + +authors: + - "@ramprasadn" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 16411798..858cbd47 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -166,6 +166,10 @@ bcftools/reheader: - modules/bcftools/reheader/** - tests/modules/bcftools/reheader/** +bcftools/rhocall: + - modules/bcftools/rhocall/** + - tests/modules/bcftools/rhocall/** + bcftools/sort: - modules/bcftools/sort/** - tests/modules/bcftools/sort/** diff --git a/tests/modules/bcftools/rhocall/main.nf b/tests/modules/bcftools/rhocall/main.nf new file mode 100644 index 00000000..2630e4f7 --- /dev/null +++ b/tests/modules/bcftools/rhocall/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_RHOCALL } from '../../../../modules/bcftools/rhocall/main.nf' + +workflow test_bcftools_rhocall { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + BCFTOOLS_RHOCALL ( input ) +} diff --git a/tests/modules/bcftools/rhocall/nextflow.config b/tests/modules/bcftools/rhocall/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/bcftools/rhocall/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/bcftools/rhocall/test.yml b/tests/modules/bcftools/rhocall/test.yml new file mode 100644 index 00000000..5d5f44f6 --- /dev/null +++ b/tests/modules/bcftools/rhocall/test.yml @@ -0,0 +1,14 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml bcftools/rhocall +- name: "bcftools rhocall" + command: nextflow run ./tests/modules/bcftools/rhocall -entry test_bcftools_rhocall -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/rhocall/nextflow.config + tags: + - "bcftools" + # + - "bcftools/rhocall" + # + files: + - path: "output/bcftools/test.bam" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/bcftools/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 2542c9d1767dbb374c6fb07583eda166f5287e18 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 20 May 2022 16:46:19 +0200 Subject: [PATCH 06/65] add tests --- modules/bcftools/rhocall/main.nf | 75 ------------------- modules/bcftools/rhocall/meta.yml | 51 ------------- modules/bcftools/roh/main.nf | 61 +++++++++++++++ modules/bcftools/roh/meta.yml | 56 ++++++++++++++ tests/config/pytest_modules.yml | 6 +- tests/modules/bcftools/rhocall/main.nf | 15 ---- tests/modules/bcftools/rhocall/test.yml | 14 ---- tests/modules/bcftools/roh/main.nf | 20 +++++ .../bcftools/{rhocall => roh}/nextflow.config | 0 tests/modules/bcftools/roh/test.yml | 8 ++ 10 files changed, 148 insertions(+), 158 deletions(-) delete mode 100644 modules/bcftools/rhocall/main.nf delete mode 100644 modules/bcftools/rhocall/meta.yml create mode 100644 modules/bcftools/roh/main.nf create mode 100644 modules/bcftools/roh/meta.yml delete mode 100644 tests/modules/bcftools/rhocall/main.nf delete mode 100644 tests/modules/bcftools/rhocall/test.yml create mode 100644 tests/modules/bcftools/roh/main.nf rename tests/modules/bcftools/{rhocall => roh}/nextflow.config (100%) create mode 100644 tests/modules/bcftools/roh/test.yml diff --git a/modules/bcftools/rhocall/main.nf b/modules/bcftools/rhocall/main.nf deleted file mode 100644 index 7036963e..00000000 --- a/modules/bcftools/rhocall/main.nf +++ /dev/null @@ -1,75 +0,0 @@ -// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) -// https://github.com/nf-core/modules/tree/master/modules -// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: -// https://nf-co.re/join -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta -// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty -// list (`[]`) instead of a file can be used to work around this issue. - -process BCFTOOLS_RHOCALL { - tag "$meta.id" - label 'process_medium' - - // TODO nf-core: List required Conda package(s). - // Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10"). - // For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems. - // TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below. - conda (params.enable_conda ? "bioconda::bcftools=1.15.1" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.15.1--h0ea216a_0': - 'quay.io/biocontainers/bcftools:1.15.1--h0ea216a_0' }" - - input: - // TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group" - // MUST be provided as an input via a Groovy Map called "meta". - // This information may not be required in some instances e.g. indexing reference genome files: - // https://github.com/nf-core/modules/blob/master/modules/bwa/index/main.nf - // TODO nf-core: Where applicable please provide/convert compressed files as input/output - // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. - tuple val(meta), path(bam) - - output: - // TODO nf-core: Named file extensions MUST be emitted for ALL output channels - tuple val(meta), path("*.bam"), emit: bam - // TODO nf-core: List additional required output channels/values here - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 - // If the software is unable to output a version number on the command-line then it can be manually specified - // e.g. https://github.com/nf-core/modules/blob/master/modules/homer/annotatepeaks/main.nf - // Each software used MUST provide the software name and version number in the YAML version file (versions.yml) - // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "task.ext.args" directive - // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter - // using the Nextflow "task" variable e.g. "--threads $task.cpus" - // TODO nf-core: Please replace the example samtools command below with your module's command - // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) - """ - samtools \\ - sort \\ - $args \\ - -@ $task.cpus \\ - -o ${prefix}.bam \\ - -T $prefix \\ - $bam - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bcftools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) - END_VERSIONS - """ -} diff --git a/modules/bcftools/rhocall/meta.yml b/modules/bcftools/rhocall/meta.yml deleted file mode 100644 index fa7baf2a..00000000 --- a/modules/bcftools/rhocall/meta.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "bcftools_rhocall" -## TODO nf-core: Add a description of the module and list keywords -description: write your description here -keywords: - - sort -tools: - - "bcftools": - ## TODO nf-core: Add a description and other details for the software below - description: "BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations." - homepage: "None" - documentation: "None" - tool_dev_url: "None" - doi: "" - licence: "['GPL']" - -## TODO nf-core: Add a description of all of the variables used as input -input: - # Only when we have meta - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - # - ## TODO nf-core: Delete / customise this example input - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - -## TODO nf-core: Add a description of all of the variables used as output -output: - #Only when we have meta - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - # - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - ## TODO nf-core: Delete / customise this example output - - bam: - type: file - description: Sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - -authors: - - "@ramprasadn" diff --git a/modules/bcftools/roh/main.nf b/modules/bcftools/roh/main.nf new file mode 100644 index 00000000..55d8c4a3 --- /dev/null +++ b/modules/bcftools/roh/main.nf @@ -0,0 +1,61 @@ +process BCFTOOLS_ROH { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bcftools=1.15.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.15.1--h0ea216a_0': + 'quay.io/biocontainers/bcftools:1.15.1--h0ea216a_0' }" + + input: + tuple val(meta), path(vcf), path(tbi) + path af_file + path genetic_map + path regions_file + path samples_file + path targets_file + + output: + tuple val(meta), path("*.roh"), emit: roh + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def af_read = af_file ? "--AF-file ${af_file}" : '' + def gen_map = genetic_map ? "--genetic-map ${genetic_map}" : '' + def reg_file = regions_file ? "--regions-file ${regions_file}" : '' + def samp_file = samples_file ? "--samples-file ${samples_file}" : '' + def targ_file = targets_file ? "--targets-file ${targets_file}" : '' + """ + bcftools \\ + roh \\ + $args \\ + $af_read \\ + $gen_map \\ + $reg_file \\ + $samp_file \\ + $targ_file \\ + -o ${prefix}.roh.gz \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.roh + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/bcftools/roh/meta.yml b/modules/bcftools/roh/meta.yml new file mode 100644 index 00000000..09535fe8 --- /dev/null +++ b/modules/bcftools/roh/meta.yml @@ -0,0 +1,56 @@ +name: "bcftools_roh" +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +keywords: + - sort +tools: + - "roh": + description: "A program for detecting runs of homo/autozygosity. Only bi-allelic sites are considered." + homepage: https://www.htslib.org/ + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file + pattern: "*.{vcf,.vcf.gz}" + - af_file: + type: file + description: "Read allele frequencies from a tab-delimited file containing the columns: CHROM\tPOS\tREF,ALT\tAF." + - genetic_map: + type: file + description: "Genetic map in the format required also by IMPUTE2." + - regions_file: + type: file + description: "Regions can be specified either on command line or in a VCF, BED, or tab-delimited file (the default)." + - samples_file: + type: file + description: "File of sample names to include or exclude if prefixed with '^'." + - targets_file: + type: file + description: "Targets can be specified either on command line or in a VCF, BED, or tab-delimited file (the default)." + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - roh: + type: file + description: Contains site-specific and/or per-region runs of homo/autozygosity calls. + pattern: "*.{roh}" + +authors: + - "@ramprasadn" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 858cbd47..e15315e9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -166,9 +166,9 @@ bcftools/reheader: - modules/bcftools/reheader/** - tests/modules/bcftools/reheader/** -bcftools/rhocall: - - modules/bcftools/rhocall/** - - tests/modules/bcftools/rhocall/** +bcftools/roh: + - modules/bcftools/roh/** + - tests/modules/bcftools/roh/** bcftools/sort: - modules/bcftools/sort/** diff --git a/tests/modules/bcftools/rhocall/main.nf b/tests/modules/bcftools/rhocall/main.nf deleted file mode 100644 index 2630e4f7..00000000 --- a/tests/modules/bcftools/rhocall/main.nf +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BCFTOOLS_RHOCALL } from '../../../../modules/bcftools/rhocall/main.nf' - -workflow test_bcftools_rhocall { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) - ] - - BCFTOOLS_RHOCALL ( input ) -} diff --git a/tests/modules/bcftools/rhocall/test.yml b/tests/modules/bcftools/rhocall/test.yml deleted file mode 100644 index 5d5f44f6..00000000 --- a/tests/modules/bcftools/rhocall/test.yml +++ /dev/null @@ -1,14 +0,0 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml bcftools/rhocall -- name: "bcftools rhocall" - command: nextflow run ./tests/modules/bcftools/rhocall -entry test_bcftools_rhocall -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/rhocall/nextflow.config - tags: - - "bcftools" - # - - "bcftools/rhocall" - # - files: - - path: "output/bcftools/test.bam" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/bcftools/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b diff --git a/tests/modules/bcftools/roh/main.nf b/tests/modules/bcftools/roh/main.nf new file mode 100644 index 00000000..5dd6f897 --- /dev/null +++ b/tests/modules/bcftools/roh/main.nf @@ -0,0 +1,20 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_ROH } from '../../../../modules/bcftools/roh/main.nf' + +workflow test_bcftools_roh { + + input = [ [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + + af_file = [] + gen_map = [] + regions = [] + targets = [] + samples = [] + + BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets ) +} diff --git a/tests/modules/bcftools/rhocall/nextflow.config b/tests/modules/bcftools/roh/nextflow.config similarity index 100% rename from tests/modules/bcftools/rhocall/nextflow.config rename to tests/modules/bcftools/roh/nextflow.config diff --git a/tests/modules/bcftools/roh/test.yml b/tests/modules/bcftools/roh/test.yml new file mode 100644 index 00000000..7a8c754b --- /dev/null +++ b/tests/modules/bcftools/roh/test.yml @@ -0,0 +1,8 @@ +- name: "bcftools roh" + command: nextflow run ./tests/modules/bcftools/roh -entry test_bcftools_roh -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/roh/nextflow.config + tags: + - "bcftools" + - "bcftools/rhoh" + files: + - path: "output/bcftools/test.roh" + - path: output/bcftools/versions.yml From 635edc0022a39acd295a65f14dec482c6a36b9d1 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 20 May 2022 17:07:42 +0200 Subject: [PATCH 07/65] fix typo --- modules/bcftools/roh/main.nf | 2 +- tests/modules/bcftools/roh/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bcftools/roh/main.nf b/modules/bcftools/roh/main.nf index 55d8c4a3..890b6fad 100644 --- a/modules/bcftools/roh/main.nf +++ b/modules/bcftools/roh/main.nf @@ -39,7 +39,7 @@ process BCFTOOLS_ROH { $reg_file \\ $samp_file \\ $targ_file \\ - -o ${prefix}.roh.gz \\ + -o ${prefix}.roh \\ $vcf cat <<-END_VERSIONS > versions.yml diff --git a/tests/modules/bcftools/roh/test.yml b/tests/modules/bcftools/roh/test.yml index 7a8c754b..2387ee39 100644 --- a/tests/modules/bcftools/roh/test.yml +++ b/tests/modules/bcftools/roh/test.yml @@ -2,7 +2,7 @@ command: nextflow run ./tests/modules/bcftools/roh -entry test_bcftools_roh -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/roh/nextflow.config tags: - "bcftools" - - "bcftools/rhoh" + - "bcftools/roh" files: - path: "output/bcftools/test.roh" - path: output/bcftools/versions.yml From 995bf88327b5f4dad1af9abbe3a2d8d24968fb72 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 20 May 2022 17:10:09 +0200 Subject: [PATCH 08/65] add stub --- tests/modules/bcftools/roh/main.nf | 17 ++++++++++++++++- tests/modules/bcftools/roh/test.yml | 11 ++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/modules/bcftools/roh/main.nf b/tests/modules/bcftools/roh/main.nf index 5dd6f897..3eb534b6 100644 --- a/tests/modules/bcftools/roh/main.nf +++ b/tests/modules/bcftools/roh/main.nf @@ -6,7 +6,22 @@ include { BCFTOOLS_ROH } from '../../../../modules/bcftools/roh/main.nf' workflow test_bcftools_roh { - input = [ [ id:'out' ], // meta map + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + + af_file = [] + gen_map = [] + regions = [] + targets = [] + samples = [] + + BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets ) +} + +workflow test_bcftools_roh_stub { + + input = [ [ id:'test' ], // meta map file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] diff --git a/tests/modules/bcftools/roh/test.yml b/tests/modules/bcftools/roh/test.yml index 2387ee39..9cc50a66 100644 --- a/tests/modules/bcftools/roh/test.yml +++ b/tests/modules/bcftools/roh/test.yml @@ -5,4 +5,13 @@ - "bcftools/roh" files: - path: "output/bcftools/test.roh" - - path: output/bcftools/versions.yml + - path: "output/bcftools/versions.yml" + +- name: "bcftools roh stub" + command: nextflow run ./tests/modules/bcftools/roh -entry test_bcftools_roh_stub -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/roh/nextflow.config + tags: + - "bcftools" + - "bcftools/roh" + files: + - path: "output/bcftools/test.roh" + - path: "output/bcftools/versions.yml" From b40b147004d02af5c4c0fb7ae17986d8727514db Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Mon, 23 May 2022 08:51:29 +0200 Subject: [PATCH 09/65] Update tests/modules/kat/hist/test.yml Co-authored-by: Sateesh Peri <105730406+sateeshblue@users.noreply.github.com> --- tests/modules/kat/hist/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml index 19d92ee2..90502485 100644 --- a/tests/modules/kat/hist/test.yml +++ b/tests/modules/kat/hist/test.yml @@ -19,7 +19,6 @@ - path: output/kat/test.hist.png md5sum: 49861ef1a265e0edde3550b39c64a274 - path: output/kat/versions.yml - md5sum: 296f28c007bc55f8f5490702cf3f81d4 - name: kat hist test_kat_hist_paired_end command: nextflow run tests/modules/kat/hist -entry test_kat_hist_paired_end -c tests/config/nextflow.config From d7c1fe14778375e0751372b553e77fc84efb0541 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Mon, 23 May 2022 08:51:49 +0200 Subject: [PATCH 10/65] Update tests/modules/kat/hist/test.yml Co-authored-by: Sateesh Peri <105730406+sateeshblue@users.noreply.github.com> --- tests/modules/kat/hist/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/modules/kat/hist/test.yml b/tests/modules/kat/hist/test.yml index 90502485..391a3a21 100644 --- a/tests/modules/kat/hist/test.yml +++ b/tests/modules/kat/hist/test.yml @@ -40,4 +40,3 @@ - path: output/kat/test.hist.png md5sum: e20774d0d2b979cb6ead7b7fb5ad36d9 - path: output/kat/versions.yml - md5sum: 3a07329af7ce78e76b021996cd08eacb From 8d5680a6b782d97b359a4d2702259b71f96f5441 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 10:01:55 +0200 Subject: [PATCH 11/65] Add vserach usearch_global --- modules/vsearch/usearchglobal/main.nf | 51 +++++++++++++++++++ modules/vsearch/usearchglobal/meta.yml | 38 ++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/vsearch/usearchglobal/main.nf | 12 +++++ .../vsearch/usearchglobal/nextflow.config | 5 ++ tests/modules/vsearch/usearchglobal/test.yml | 7 +++ .../vsearch/usearchglobal/test.yml.ori | 14 +++++ 7 files changed, 131 insertions(+) create mode 100644 modules/vsearch/usearchglobal/main.nf create mode 100644 modules/vsearch/usearchglobal/meta.yml create mode 100644 tests/modules/vsearch/usearchglobal/main.nf create mode 100644 tests/modules/vsearch/usearchglobal/nextflow.config create mode 100644 tests/modules/vsearch/usearchglobal/test.yml create mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..65ee62cc --- /dev/null +++ b/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,51 @@ +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta + +process VSEARCH_USEARCHGLOBAL { + tag '$queryfasta' + label 'process_low' + + conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" + + input: + path queryfasta + path db + val outprefix + + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + + output: + path ("*.tsv") , emit: tsv + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + vsearch \\ + --usearch_global $queryfasta \\ + --db $db \\ + --threads $task.cpus \\ + $args \\ + --blast6out ${outprefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vsearch: \$(vsearch --version 2>&1 | head -n 1 | sed 's/vsearch //g' | sed 's/,.*//g' | sed 's/^v//' | sed 's/_.*//') + END_VERSIONS + """ +} diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml new file mode 100644 index 00000000..8cb97446 --- /dev/null +++ b/modules/vsearch/usearchglobal/meta.yml @@ -0,0 +1,38 @@ +name: "vsearch_usearchglobal" +description: Compare target sequences to fasta-formatted query sequences using global pairwise alignment. +keywords: + - vsearch + - usearch + - alignment + - fasta +tools: + - "vsearch": + description: "VSEARCH is a versatile open-source tool for microbiome analysis, including chimera detection, clustering, dereplication and rereplication, extraction, FASTA/FASTQ/SFF file processing, masking, orienting, pair-wise alignment, restriction site cutting, searching, shuffling, sorting, subsampling, and taxonomic classification of amplicon sequences for metagenomics, genomics, and population genetics. (USEARCH alternative)" + homepage: "https://github.com/torognes/vsearch" + documentation: "None" + tool_dev_url: "https://github.com/torognes/vsearch" + doi: "doi: 10.7717/peerj.2584" + licence: "['GPL v3-or-later OR BSD-2-clause']" + +input: + - queryfasta: + type: file + description: Query sequences in FASTA format + pattern: "*.{fasta,fa,fna,faa}" + - db: + type: file + description: Reference database file. It may be in FASTA or UDB format. + pattern: "*" + +output: + - blast6out: + type: file + description: Tab delimited results in blast-like format + pattern: "*.{tsv}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jtangrot" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2d0d3226..05188329 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2024,6 +2024,10 @@ vcftools: - modules/vcftools/** - tests/modules/vcftools/** +vsearch/usearchglobal: + - modules/vsearch/usearchglobal/** + - tests/modules/vsearch/usearchglobal/** + yara/index: - modules/yara/index/** - tests/modules/yara/index/** diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..02becd21 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VSEARCH_USEARCHGLOBAL } from '../../../../modules/vsearch/usearchglobal/main.nf' + +workflow test_vsearch_usearchglobal { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) +} diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config new file mode 100644 index 00000000..aab29979 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -0,0 +1,5 @@ +process { + ext.args = '--id 0.985' + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml new file mode 100644 index 00000000..b013519d --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -0,0 +1,7 @@ +- name: vsearch usearchglobal test_vsearch_usearchglobal + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch/usearchglobal + files: + - path: output/vsearch/blast6out_results.tsv + md5sum: 09733131643f1d951321a6e17a35eb8c diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori new file mode 100644 index 00000000..df644165 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml.ori @@ -0,0 +1,14 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml vsearch/usearchglobal +- name: "vsearch usearchglobal" + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - "vsearch" + # + - "vsearch/usearchglobal" + # + files: + - path: "output/vsearch/blast6out_results.tsv" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/vsearch/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 06a3bff20135aa898d373ef410fa96809fd78aef Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 23 May 2022 12:59:48 +0200 Subject: [PATCH 12/65] fix lint error --- tests/modules/bcftools/roh/nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/modules/bcftools/roh/nextflow.config b/tests/modules/bcftools/roh/nextflow.config index 50f50a7a..8730f1c4 100644 --- a/tests/modules/bcftools/roh/nextflow.config +++ b/tests/modules/bcftools/roh/nextflow.config @@ -1,5 +1,5 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file + +} From 853b76d16a263b314e5807f675d532b5cc1a68d6 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 14:02:10 +0200 Subject: [PATCH 13/65] Add options for output file type --- modules/vsearch/usearchglobal/main.nf | 38 +++++++++++++++---- tests/modules/vsearch/usearchglobal/main.nf | 14 ++++++- .../vsearch/usearchglobal/nextflow.config | 4 +- tests/modules/vsearch/usearchglobal/test.yml | 14 ++++++- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 65ee62cc..0b31842f 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -10,7 +10,7 @@ // bwa mem | samtools view -B -T ref.fasta process VSEARCH_USEARCHGLOBAL { - tag '$queryfasta' + tag "$meta.id" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) @@ -19,29 +19,53 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - path queryfasta + tuple val(meta), path(queryfasta) path db - val outprefix + val outoption + val user_columns // TODO nf-core: Where applicable please provide/convert compressed files as input/output // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. output: - path ("*.tsv") , emit: tsv - path "versions.yml" , emit: versions - + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions + when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def columns = user_columns ? "--userfields ${user_columns}" : '' + switch ( outoption ) { + case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break + case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + default: + outfmt = "--alnout"; + out_ext = 'aln'; + log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + break + } """ vsearch \\ --usearch_global $queryfasta \\ --db $db \\ --threads $task.cpus \\ $args \\ - --blast6out ${outprefix}.tsv + ${columns} \\ + ${outfmt} ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index 02becd21..cdf0fb2f 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,5 +8,17 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) + + outoption = "xcfert" // Nonsense text to check default case. + columns = "" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) +} + +workflow test_vsearch_usearchglobal_userout { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + outoption = "userout" + columns = "query+target+id" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index aab29979..3148a59e 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,5 @@ process { ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file +} + diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b013519d..b7ebec4a 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,7 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: + - vsearch - vsearch/usearchglobal files: - - path: output/vsearch/blast6out_results.tsv - md5sum: 09733131643f1d951321a6e17a35eb8c + - path: output/vsearch/test.aln + md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + +- name: vsearch usearchglobal test_vsearch_usearchglobal_userout + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch + - vsearch/usearchglobal + files: + - path: output/vsearch/test.user.tsv + md5sum: b6cc50f7c8d18cb82e74dab70ed4baab From bbee9e3c3bea54e8cedc0d8ec68619b1d05dae2e Mon Sep 17 00:00:00 2001 From: SusiJo Date: Mon, 23 May 2022 18:35:50 +0200 Subject: [PATCH 14/65] add new module cnvkit/reference --- modules/cnvkit/reference/main.nf | 39 +++++++++++++++ modules/cnvkit/reference/meta.yml | 47 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/cnvkit/reference/main.nf | 14 ++++++ .../modules/cnvkit/reference/nextflow.config | 5 ++ tests/modules/cnvkit/reference/test.yml | 8 ++++ 6 files changed, 117 insertions(+) create mode 100644 modules/cnvkit/reference/main.nf create mode 100644 modules/cnvkit/reference/meta.yml create mode 100644 tests/modules/cnvkit/reference/main.nf create mode 100644 tests/modules/cnvkit/reference/nextflow.config create mode 100644 tests/modules/cnvkit/reference/test.yml diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf new file mode 100644 index 00000000..1f0b20d8 --- /dev/null +++ b/modules/cnvkit/reference/main.nf @@ -0,0 +1,39 @@ +process CNVKIT_REFERENCE { + tag "$reference" + label 'process_low' + + conda (params.enable_conda ? "bioconda::cnvkit=0.9.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.9--pyhdfd78af_0': + 'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }" + + input: + path fasta + path targets + path antitargets + + output: + path("*.cnn") , emit: cnn + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + cnvkit.py \\ + reference \\ + --fasta $fasta \\ + --targets $targets \\ + --antitargets $antitargets \\ + --output reference.cnn \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvkit: \$(cnvkit.py version | sed -e "s/cnvkit v//g") + END_VERSIONS + """ +} diff --git a/modules/cnvkit/reference/meta.yml b/modules/cnvkit/reference/meta.yml new file mode 100644 index 00000000..2e0fef1a --- /dev/null +++ b/modules/cnvkit/reference/meta.yml @@ -0,0 +1,47 @@ +name: cnvkit_reference +description: +keywords: + - cnvkit + - reference +tools: + - cnvkit: + description: | + CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. + It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent. + homepage: https://cnvkit.readthedocs.io/en/stable/index.html + documentation: https://cnvkit.readthedocs.io/en/stable/index.html + tool_dev_url: https://github.com/etal/cnvkit + doi: 10.1371/journal.pcbi.1004873 + licence: ["Apache-2.0"] + +input: + - fasta: + type: file + description: File containing reference genome + pattern: "*.{fasta}" + - targets: + type: file + description: File containing genomic regions + pattern: "*.{bed}" + - antitargets: + type: file + description: File containing off-target genomic regions + pattern: "*.{bed}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reference: + type: file + description: File containing a copy-number reference (required for CNV calling in tumor_only mode) + pattern: "*.{cnn}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@SusiJo" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 78e85487..0e5a1815 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -451,6 +451,10 @@ cnvkit/batch: - modules/cnvkit/batch/** - tests/modules/cnvkit/batch/** +cnvkit/reference: + - modules/cnvkit/reference/** + - tests/modules/cnvkit/reference/** + controlfreec/assesssignificance: - modules/controlfreec/assesssignificance/** - tests/modules/controlfreec/assesssignificance/** diff --git a/tests/modules/cnvkit/reference/main.nf b/tests/modules/cnvkit/reference/main.nf new file mode 100644 index 00000000..bd7009c0 --- /dev/null +++ b/tests/modules/cnvkit/reference/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CNVKIT_REFERENCE } from '../../../../modules/cnvkit/reference/main.nf' + +workflow test_cnvkit_reference { + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + targets = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + antitargets = file("/Users/susanne/Documents/repos/forks/modules/test_antitarget/output/cnvkit/test.antitarget.bed", checkIfExists: true) + + CNVKIT_REFERENCE ( fasta, targets, antitargets ) +} diff --git a/tests/modules/cnvkit/reference/nextflow.config b/tests/modules/cnvkit/reference/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/cnvkit/reference/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/cnvkit/reference/test.yml b/tests/modules/cnvkit/reference/test.yml new file mode 100644 index 00000000..b1b8c896 --- /dev/null +++ b/tests/modules/cnvkit/reference/test.yml @@ -0,0 +1,8 @@ +- name: cnvkit reference test_cnvkit_reference + command: nextflow run ./tests/modules/cnvkit/reference -entry test_cnvkit_reference -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/reference/nextflow.config + tags: + - cnvkit/reference + - cnvkit + files: + - path: output/cnvkit/reference.cnn + md5sum: 7c4a7902f5ab101b1f9d6038d331b3d9 From 8fec7ae3218020fc305ba14fe19720783b8baf1c Mon Sep 17 00:00:00 2001 From: SusiJo Date: Mon, 23 May 2022 19:01:46 +0200 Subject: [PATCH 15/65] added new testdata path --- tests/config/test_data.config | 1 + tests/modules/cnvkit/reference/main.nf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/config/test_data.config b/tests/config/test_data.config index cf7d45f6..39331664 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -142,6 +142,7 @@ params { genome_21_sizes = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.sizes" genome_21_interval_list = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list" genome_21_multi_interval_bed = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed" + genome_21_multi_interval_antitarget_bed = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.antitarget.bed" genome_21_multi_interval_bed_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz" genome_21_multi_interval_bed_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi" genome_21_chromosomes_dir = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz" diff --git a/tests/modules/cnvkit/reference/main.nf b/tests/modules/cnvkit/reference/main.nf index bd7009c0..a72ad566 100644 --- a/tests/modules/cnvkit/reference/main.nf +++ b/tests/modules/cnvkit/reference/main.nf @@ -8,7 +8,7 @@ workflow test_cnvkit_reference { fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) targets = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - antitargets = file("/Users/susanne/Documents/repos/forks/modules/test_antitarget/output/cnvkit/test.antitarget.bed", checkIfExists: true) + antitargets = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_antitarget_bed'], checkIfExists: true) CNVKIT_REFERENCE ( fasta, targets, antitargets ) } From 84f02a08a5d6d881cb18c31fb15faca4e735a1f2 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 23 May 2022 22:31:09 +0100 Subject: [PATCH 16/65] Update umitools/dedup module to make --output-stats optional --- modules/umitools/dedup/main.nf | 10 +- modules/umitools/dedup/meta.yml | 4 + tests/modules/umitools/dedup/main.nf | 77 ++++++++----- tests/modules/umitools/dedup/nextflow.config | 6 +- tests/modules/umitools/dedup/test.yml | 107 +++++++++++++------ 5 files changed, 135 insertions(+), 69 deletions(-) diff --git a/modules/umitools/dedup/main.nf b/modules/umitools/dedup/main.nf index dfcbcf2f..07e6061d 100644 --- a/modules/umitools/dedup/main.nf +++ b/modules/umitools/dedup/main.nf @@ -9,12 +9,13 @@ process UMITOOLS_DEDUP { input: tuple val(meta), path(bam), path(bai) + val get_output_stats output: tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*edit_distance.tsv"), emit: tsv_edit_distance - tuple val(meta), path("*per_umi.tsv") , emit: tsv_per_umi - tuple val(meta), path("*per_position.tsv") , emit: tsv_umi_per_position + tuple val(meta), path("*edit_distance.tsv"), optional:true, emit: tsv_edit_distance + tuple val(meta), path("*per_umi.tsv") , optional:true, emit: tsv_per_umi + tuple val(meta), path("*per_position.tsv") , optional:true, emit: tsv_umi_per_position path "versions.yml" , emit: versions when: @@ -24,12 +25,13 @@ process UMITOOLS_DEDUP { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def paired = meta.single_end ? "" : "--paired" + def stats = get_output_stats ? "--output-stats $prefix" : "" """ umi_tools \\ dedup \\ -I $bam \\ -S ${prefix}.bam \\ - --output-stats $prefix \\ + $stats \\ $paired \\ $args diff --git a/modules/umitools/dedup/meta.yml b/modules/umitools/dedup/meta.yml index eee8952f..56888e5a 100644 --- a/modules/umitools/dedup/meta.yml +++ b/modules/umitools/dedup/meta.yml @@ -26,6 +26,10 @@ input: description: | BAM index files corresponding to the input BAM file. pattern: "*.{bai}" + - get_output_stats: + type: boolean + description: | + Whether or not to generate output stats. output: - meta: type: map diff --git a/tests/modules/umitools/dedup/main.nf b/tests/modules/umitools/dedup/main.nf index f89ba935..1edcb287 100644 --- a/tests/modules/umitools/dedup/main.nf +++ b/tests/modules/umitools/dedup/main.nf @@ -3,54 +3,81 @@ nextflow.enable.dsl = 2 include { UMITOOLS_EXTRACT } from '../../../../modules/umitools/extract/main.nf' -include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' -include { BWA_MEM } from '../../../../modules/bwa/mem/main.nf' +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_MEM } from '../../../../modules/bwa/mem/main.nf' include { SAMTOOLS_INDEX } from '../../../../modules/samtools/index/main.nf' -include { UMITOOLS_DEDUP } from '../../../../modules/umitools/dedup/main.nf' +include { UMITOOLS_DEDUP } from '../../../../modules/umitools/dedup/main.nf' // // Test with no UMI // workflow test_umitools_dedup_no_umi { - input = [ [ id:'test'], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test'], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + get_output_stats = false - UMITOOLS_DEDUP ( input ) + UMITOOLS_DEDUP ( input, get_output_stats ) } // -// Test with single-end data +// Test with single-end data without --output-stats // -workflow test_umitools_dedup_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - ] - +workflow test_umitools_dedup_single_end_no_stats { + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + get_output_stats = false UMITOOLS_EXTRACT ( input ) BWA_INDEX ( fasta ) BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) - SAMTOOLS_INDEX (BWA_MEM.out.bam) - UMITOOLS_DEDUP(BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0])) + SAMTOOLS_INDEX ( BWA_MEM.out.bam ) + UMITOOLS_DEDUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), get_output_stats ) } // -// Test with paired-end data +// Test with paired-end data without --output-stats // -workflow test_umitools_dedup_paired_end { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] - ] - +workflow test_umitools_dedup_paired_end_no_stats { + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + get_output_stats = false UMITOOLS_EXTRACT ( input ) BWA_INDEX ( fasta ) BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) - SAMTOOLS_INDEX (BWA_MEM.out.bam) - UMITOOLS_DEDUP(BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0])) + SAMTOOLS_INDEX ( BWA_MEM.out.bam ) + UMITOOLS_DEDUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), get_output_stats ) +} + +// +// Test with paired-end data with --output-stats +// +workflow test_umitools_dedup_paired_end_stats { + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + get_output_stats = true + + UMITOOLS_EXTRACT ( input ) + BWA_INDEX ( fasta ) + BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) + SAMTOOLS_INDEX ( BWA_MEM.out.bam ) + UMITOOLS_DEDUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), get_output_stats ) } diff --git a/tests/modules/umitools/dedup/nextflow.config b/tests/modules/umitools/dedup/nextflow.config index 4a7533ef..a7bde28e 100644 --- a/tests/modules/umitools/dedup/nextflow.config +++ b/tests/modules/umitools/dedup/nextflow.config @@ -7,11 +7,7 @@ process { } withName: UMITOOLS_DEDUP { - ext.args = '' - ext.prefix = 'dedup' + ext.prefix = { "${meta.id}.dedup" } } - withName: BWA_MEM { - ext.args2 = '' - } } diff --git a/tests/modules/umitools/dedup/test.yml b/tests/modules/umitools/dedup/test.yml index 2ba9073b..ef4c2aaf 100644 --- a/tests/modules/umitools/dedup/test.yml +++ b/tests/modules/umitools/dedup/test.yml @@ -1,54 +1,91 @@ - name: umitools dedup test_umitools_dedup_no_umi - command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_no_umi -c tests/config/nextflow.config + command: nextflow run ./tests/modules/umitools/dedup -entry test_umitools_dedup_no_umi -c ./tests/config/nextflow.config -c ./tests/modules/umitools/dedup/nextflow.config tags: - umitools/dedup - umitools files: - - path: output/umitools/dedup.bam + - path: output/umitools/test.dedup.bam md5sum: 53b4edc399db81b87d2343e78af73cf0 - - path: output/umitools/dedup_edit_distance.tsv - md5sum: 65186b0964e2f8d970cc04d736d8b119 - - path: output/umitools/dedup_per_umi.tsv - md5sum: 8e6783a4a79437b095f095f2aefe7c01 - - path: output/umitools/dedup_per_umi_per_position.tsv - md5sum: 9386db4a104b8e4e32f3ca4a84efa4ac - - path: output/umitools/versions.yml - md5sum: 4aaaa33565bcd9a984255139933d6446 -- name: umitools dedup test_umitools_dedup_single_end - command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_single_end -c tests/config/nextflow.config +- name: umitools dedup test_umitools_dedup_single_end_no_stats + command: nextflow run ./tests/modules/umitools/dedup -entry test_umitools_dedup_single_end_no_stats -c ./tests/config/nextflow.config -c ./tests/modules/umitools/dedup/nextflow.config tags: - - umitools - umitools/dedup + - umitools files: + - path: output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - path: output/bwa/test.bam - md5sum: ea41a3cdca1856b22845e1067fd31f37 - - path: output/bwa/versions.yml - md5sum: ce4d987f2c53f4c01b31d210c357b24a + md5sum: 3ecbe569cadb9b6c881917ce60779f75 - path: output/samtools/test.bam.bai md5sum: 095af0ad3921212597ffd7c342ecd5a0 - - path: output/samtools/versions.yml - md5sum: 69b7cde627c9b4e8403dfc125db71cc7 - - path: output/umitools/dedup.bam - md5sum: d95df177063432748ff33f473910cb1e - - path: output/umitools/versions.yml - md5sum: 730e768dd199d2f5bfb6fd0850446344 + - path: output/umitools/test.dedup.bam + md5sum: 8f7c519e110d6515d858eda6b16727ac + - path: output/umitools/test.umi_extract.fastq.gz + - path: output/umitools/test.umi_extract.log -- name: umitools dedup test_umitools_dedup_paired_end - command: nextflow run tests/modules/umitools/dedup -entry test_umitools_dedup_paired_end -c tests/config/nextflow.config +- name: umitools dedup test_umitools_dedup_paired_end_no_stats + command: nextflow run ./tests/modules/umitools/dedup -entry test_umitools_dedup_paired_end_no_stats -c ./tests/config/nextflow.config -c ./tests/modules/umitools/dedup/nextflow.config tags: - - umitools - umitools/dedup + - umitools files: + - path: output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - path: output/bwa/test.bam - md5sum: 1ad786cae0ff2254c655e3a206929617 - - path: output/bwa/versions.yml - md5sum: b524c5ddf61c20f4a0a93ae8fc78b851 + md5sum: e7dcbac1825bf210409b762dbb4fec8f - path: output/samtools/test.bam.bai - md5sum: 7496f4056a8e86327ca93e350f282fc2 - - path: output/samtools/versions.yml - md5sum: 72fc2ab934fd4bca0f7f14a705530d34 - - path: output/umitools/dedup.bam - md5sum: e8d1eae2aacef76254948c5568e94555 - - path: output/umitools/versions.yml - md5sum: fd39e05042d354b3d8de49b617d3183d + md5sum: f75780d1de7860329b7fb4afeadc4bed + - path: output/umitools/test.dedup.bam + md5sum: d75284de88b05569a66667e5b9936be9 + - path: output/umitools/test.umi_extract.log + - path: output/umitools/test.umi_extract_1.fastq.gz + - path: output/umitools/test.umi_extract_2.fastq.gz + +- name: umitools dedup test_umitools_dedup_paired_end_stats + command: nextflow run ./tests/modules/umitools/dedup -entry test_umitools_dedup_paired_end_stats -c ./tests/config/nextflow.config -c ./tests/modules/umitools/dedup/nextflow.config + tags: + - umitools/dedup + - umitools + files: + - path: output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 + - path: output/bwa/test.bam + md5sum: e7dcbac1825bf210409b762dbb4fec8f + - path: output/samtools/test.bam.bai + md5sum: f75780d1de7860329b7fb4afeadc4bed + - path: output/umitools/test.dedup.bam + md5sum: d75284de88b05569a66667e5b9936be9 + - path: output/umitools/test.dedup_edit_distance.tsv + md5sum: c247a49b58768e6e2e86a6c08483e612 + - path: output/umitools/test.dedup_per_umi.tsv + md5sum: 10e35ca37f2bfb521ac6dd7314951a68 + - path: output/umitools/test.dedup_per_umi_per_position.tsv + md5sum: 2e1a12e6f720510880068deddeefe063 + - path: output/umitools/test.umi_extract.log + - path: output/umitools/test.umi_extract_1.fastq.gz + - path: output/umitools/test.umi_extract_2.fastq.gz From a3e70777ad7df0aaf9bbeff11e302c01bb54346d Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 23 May 2022 22:39:12 +0100 Subject: [PATCH 17/65] Fix Conda tests --- tests/modules/umitools/dedup/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/modules/umitools/dedup/test.yml b/tests/modules/umitools/dedup/test.yml index ef4c2aaf..5a92a35a 100644 --- a/tests/modules/umitools/dedup/test.yml +++ b/tests/modules/umitools/dedup/test.yml @@ -5,7 +5,6 @@ - umitools files: - path: output/umitools/test.dedup.bam - md5sum: 53b4edc399db81b87d2343e78af73cf0 - name: umitools dedup test_umitools_dedup_single_end_no_stats command: nextflow run ./tests/modules/umitools/dedup -entry test_umitools_dedup_single_end_no_stats -c ./tests/config/nextflow.config -c ./tests/modules/umitools/dedup/nextflow.config @@ -28,7 +27,6 @@ - path: output/samtools/test.bam.bai md5sum: 095af0ad3921212597ffd7c342ecd5a0 - path: output/umitools/test.dedup.bam - md5sum: 8f7c519e110d6515d858eda6b16727ac - path: output/umitools/test.umi_extract.fastq.gz - path: output/umitools/test.umi_extract.log @@ -53,7 +51,6 @@ - path: output/samtools/test.bam.bai md5sum: f75780d1de7860329b7fb4afeadc4bed - path: output/umitools/test.dedup.bam - md5sum: d75284de88b05569a66667e5b9936be9 - path: output/umitools/test.umi_extract.log - path: output/umitools/test.umi_extract_1.fastq.gz - path: output/umitools/test.umi_extract_2.fastq.gz @@ -79,7 +76,6 @@ - path: output/samtools/test.bam.bai md5sum: f75780d1de7860329b7fb4afeadc4bed - path: output/umitools/test.dedup.bam - md5sum: d75284de88b05569a66667e5b9936be9 - path: output/umitools/test.dedup_edit_distance.tsv md5sum: c247a49b58768e6e2e86a6c08483e612 - path: output/umitools/test.dedup_per_umi.tsv From 5db94ea0ee8f80319e307ecf89b121e82e8c2ba8 Mon Sep 17 00:00:00 2001 From: SusiJo Date: Tue, 24 May 2022 10:17:41 +0200 Subject: [PATCH 18/65] changed tag of module --- modules/cnvkit/reference/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf index 1f0b20d8..992d768f 100644 --- a/modules/cnvkit/reference/main.nf +++ b/modules/cnvkit/reference/main.nf @@ -1,5 +1,5 @@ process CNVKIT_REFERENCE { - tag "$reference" + tag "$fasta" label 'process_low' conda (params.enable_conda ? "bioconda::cnvkit=0.9.9" : null) From 01fb8851c3e778052d342059736ecc09abab2e0d Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 11:47:58 +0200 Subject: [PATCH 19/65] mosdept: cram compatiblility --- modules/mosdepth/main.nf | 33 +++-------- modules/mosdepth/meta.yml | 13 +++-- tests/modules/mosdepth/main.nf | 55 +++++++++++------- tests/modules/mosdepth/test.yml | 98 +++++++++++++++++++-------------- 4 files changed, 106 insertions(+), 93 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index ff91e06f..894df1ae 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -10,13 +10,13 @@ process MOSDEPTH { input: tuple val(meta), path(bam), path(bai) path bed - val window_size + path fasta output: tuple val(meta), path('*.global.dist.txt') , emit: global_txt tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true tuple val(meta), path('*.summary.txt') , emit: summary_txt - tuple val(meta), path('*.per-base.d4') , emit: d4 , optional:true + tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi, optional:true tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true @@ -29,36 +29,17 @@ process MOSDEPTH { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - if (window_size) { - interval = "--by ${window_size}" - } else if ( bed ) { - interval = "--by ${bed}" - } else { - interval = "" - } + def reference = fasta ? "--fasta ${fasta}" : "" + def interval = bed ? "--by ${bed}" : "" + """ mosdepth \\ + --threads ${task.cpus} \\ $interval \\ + $reference \\ $args \\ $prefix \\ $bam - cat <<-END_VERSIONS > versions.yml - "${task.process}": - mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//') - END_VERSIONS - """ - - stub: - def prefix = task.ext.prefix ?: "${meta.id}" - """ - touch ${prefix}.global.dist.txt - touch ${prefix}.region.dist.txt - touch ${prefix}.summary.txt - touch ${prefix}.per-base.d4 - touch ${prefix}.per-base.bed.gz - touch ${prefix}.per-base.bed.gz.csi - touch ${prefix}.regions.bed.gz - touch ${prefix}.regions.bed.gz.csi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index 636e966b..6e9e34c9 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -30,10 +30,10 @@ input: type: file description: BED file with intersected intervals pattern: "*.{bed}" - - window_size: - type: integer - description: Window size - pattern: "[0-9]+" + - fasta: + type: file + description: Reference genome FASTA file + pattern: "*.{fa,fasta}" output: - meta: type: map @@ -60,6 +60,10 @@ output: type: file description: Index file for BED file with per-base coverage pattern: "*.{per-base.bed.gz.csi}" + - per_base_d4: + type: file + description: D4 file with per-base coverage + pattern: "*.{per-base.d4}" - regions_bed: type: file description: BED file with per-region coverage @@ -76,3 +80,4 @@ authors: - "@joseespinosa" - "@drpatelh" - "@ramprasadn" + - "@matthdsm" diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index ddd68129..86ca0e86 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -5,32 +5,45 @@ nextflow.enable.dsl = 2 include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' workflow test_mosdepth { - input = [ [ id:'test', single_end:true ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] MOSDEPTH ( input, [], [] ) } - -workflow test_mosdepth_window { - input = [ [ id:'test', single_end:true ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - window = 100 - - MOSDEPTH ( input, [], window ) -} - - workflow test_mosdepth_bed { - input = [ [ id:'test', single_end:true ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] MOSDEPTH ( input, bed, [] ) } + +workflow test_mosdepth_cram { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] + ] + fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + + MOSDEPTH ( input, [], fasta ) +} + +workflow test_mosdepth_cram_bed { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + + MOSDEPTH ( input, bed, fasta ) +} diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index c66e0b89..2cacb185 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -1,53 +1,67 @@ -- name: mosdepth - command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config +- name: mosdepth test_mosdepth + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: - mosdepth files: - - path: ./output/mosdepth/test.per-base.bed.gz.csi - md5sum: b2aad62c41a7146680d31df505fcc8c5 - - path: ./output/mosdepth/test.per-base.bed.gz - md5sum: 11b3f649072c2c7453febb085b1a9c33 - - path: ./output/mosdepth/test.mosdepth.global.dist.txt - md5sum: 2a1de1b0ecc361a21cd296ec4e1efd6a - - path: ./output/mosdepth/test.mosdepth.summary.txt - md5sum: 7b249dd3b3e58cc122fbd25ea84aa25d + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 -- name: mosdepth window - command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_window -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config +- name: mosdepth test_mosdepth_bed + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_bed -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: - mosdepth files: - - path: ./output/mosdepth/test.per-base.bed.gz.csi - md5sum: b2aad62c41a7146680d31df505fcc8c5 - - path: ./output/mosdepth/test.per-base.bed.gz - md5sum: 11b3f649072c2c7453febb085b1a9c33 - - path: ./output/mosdepth/test.mosdepth.global.dist.txt - md5sum: 2a1de1b0ecc361a21cd296ec4e1efd6a - - path: ./output/mosdepth/test.regions.bed.gz - md5sum: 64e1ced01c4443d7c1796ef553992f0c - - path: ./output/mosdepth/test.regions.bed.gz.csi - md5sum: 9e312b4b0784bd46dfbd23b3a8afed6a - - path: ./output/mosdepth/test.mosdepth.region.dist.txt - md5sum: 65fbc824c4212c6884354d8ac72ad37e - - path: ./output/mosdepth/test.mosdepth.summary.txt - md5sum: 11804907dab069ddb99ca97bf2698572 + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 96c037f769974b904beb53edc4f56d82 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.regions.bed.gz + md5sum: 5d398caf7171ec4406278e2add3009ae + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: 47669cfe41f3e222e74d81e1b1be191f -- name: mosdepth bed - command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_bed -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config +- name: mosdepth test_mosdepth_cram + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_cram -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: - mosdepth files: - - path: ./output/mosdepth/test.per-base.bed.gz.csi - md5sum: b2aad62c41a7146680d31df505fcc8c5 - - path: ./output/mosdepth/test.per-base.bed.gz - md5sum: 11b3f649072c2c7453febb085b1a9c33 - - path: ./output/mosdepth/test.mosdepth.global.dist.txt - md5sum: 2a1de1b0ecc361a21cd296ec4e1efd6a - - path: ./output/mosdepth/test.regions.bed.gz - md5sum: 347f877700d1dc42c95157199eff25d5 - - path: ./output/mosdepth/test.regions.bed.gz.csi - md5sum: ed5fbf46e3bdcbf60094df295bc40356 - - path: ./output/mosdepth/test.mosdepth.region.dist.txt - md5sum: 295564628113d2ec0ca34d7f661cfea8 - - path: ./output/mosdepth/test.mosdepth.summary.txt - md5sum: b07817412fd17819c14541e63bc4926c + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + +- name: mosdepth test_mosdepth_cram_bed + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_cram_bed -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 96c037f769974b904beb53edc4f56d82 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.regions.bed.gz + md5sum: 5d398caf7171ec4406278e2add3009ae + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: 47669cfe41f3e222e74d81e1b1be191f From 29a4f112be0a28006af99564a149711a9e08af91 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 24 May 2022 11:14:32 +0100 Subject: [PATCH 20/65] Update main.nf --- modules/cnvkit/reference/main.nf | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf index 992d768f..71d9ed28 100644 --- a/modules/cnvkit/reference/main.nf +++ b/modules/cnvkit/reference/main.nf @@ -8,20 +8,19 @@ process CNVKIT_REFERENCE { 'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }" input: - path fasta - path targets - path antitargets + path fasta + path targets + path antitargets output: - path("*.cnn") , emit: cnn - path "versions.yml" , emit: versions + path "*.cnn" , emit: cnn + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - """ cnvkit.py \\ reference \\ From b5850fd47157627b43fe6c80fd9defb097df893e Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 12:16:03 +0200 Subject: [PATCH 21/65] add stub --- modules/mosdepth/main.nf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 894df1ae..1f503c6b 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -46,4 +46,22 @@ process MOSDEPTH { mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.global.dist.txt + touch ${prefix}.region.dist.txt + touch ${prefix}.summary.txt + touch ${prefix}.per-base.d4 + touch ${prefix}.per-base.bed.gz + touch ${prefix}.per-base.bed.gz.csi + touch ${prefix}.regions.bed.gz + touch ${prefix}.regions.bed.gz.csi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//') + END_VERSIONS + """ } From 7e777c6626064d7463ecbf91c2c599db85eec647 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 12:25:31 +0200 Subject: [PATCH 22/65] add error is is provided twice --- modules/mosdepth/main.nf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 1f503c6b..a5218286 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -31,6 +31,9 @@ process MOSDEPTH { def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--fasta ${fasta}" : "" def interval = bed ? "--by ${bed}" : "" + if (bed && ext.args.contains("--by")) { + exit 1, "--by can only be specified once." + } """ mosdepth \\ From 858cbe80c67093a39486bbb545b91c95077615bd Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 12:43:49 +0200 Subject: [PATCH 23/65] add must fail test --- modules/mosdepth/main.nf | 2 +- tests/modules/mosdepth/main.nf | 14 +++++++++++++- tests/modules/mosdepth/nextflow.config | 4 +++- tests/modules/mosdepth/test.yml | 6 ++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index a5218286..39586797 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -31,7 +31,7 @@ process MOSDEPTH { def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--fasta ${fasta}" : "" def interval = bed ? "--by ${bed}" : "" - if (bed && ext.args.contains("--by")) { + if (bed && args.contains("--by")) { exit 1, "--by can only be specified once." } diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index 86ca0e86..eab47e89 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' workflow test_mosdepth { input = [ @@ -47,3 +48,14 @@ workflow test_mosdepth_cram_bed { MOSDEPTH ( input, bed, fasta ) } + +workflow test_mosdepth_fail { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + + MOSDEPTH_FAIL ( input, bed, [] ) +} diff --git a/tests/modules/mosdepth/nextflow.config b/tests/modules/mosdepth/nextflow.config index 8730f1c4..85674a3c 100644 --- a/tests/modules/mosdepth/nextflow.config +++ b/tests/modules/mosdepth/nextflow.config @@ -1,5 +1,7 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - + withName: MOSDEPTH_FAIL { + ext.args = "--by 100" + } } diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index 2cacb185..4eaf9bf1 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -65,3 +65,9 @@ md5sum: 5d398caf7171ec4406278e2add3009ae - path: output/mosdepth/test.regions.bed.gz.csi md5sum: 47669cfe41f3e222e74d81e1b1be191f + +- name: mosdepth test_mosdepth_fail + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + exitcode: 1 From 5bc2d419a94ec8b916739205961c115f62eec9c6 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 13:23:00 +0200 Subject: [PATCH 24/65] fix fail test --- tests/modules/mosdepth/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index 4eaf9bf1..a927396c 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -70,4 +70,4 @@ command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: - mosdepth - exitcode: 1 + exit_code: 1 From a2a8e09762a5aec8985f0d93125eafe3a6d2d365 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 13:45:52 +0200 Subject: [PATCH 25/65] Update modules/mosdepth/main.nf Co-authored-by: Harshil Patel --- modules/mosdepth/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 39586797..5f6538e7 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -32,7 +32,7 @@ process MOSDEPTH { def reference = fasta ? "--fasta ${fasta}" : "" def interval = bed ? "--by ${bed}" : "" if (bed && args.contains("--by")) { - exit 1, "--by can only be specified once." + exit 1, "'--by' can only be specified once when running mosdepth! Either remove input BED file definition or remove '--by' from 'ext.args' definition" } """ From 749edce06945870a708397e37be4042048aaeb50 Mon Sep 17 00:00:00 2001 From: SusiJo Date: Tue, 24 May 2022 14:20:19 +0200 Subject: [PATCH 26/65] add prefix --- modules/cnvkit/reference/main.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf index 992d768f..bf4b3c21 100644 --- a/modules/cnvkit/reference/main.nf +++ b/modules/cnvkit/reference/main.nf @@ -21,6 +21,7 @@ process CNVKIT_REFERENCE { script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ cnvkit.py \\ @@ -28,7 +29,7 @@ process CNVKIT_REFERENCE { --fasta $fasta \\ --targets $targets \\ --antitargets $antitargets \\ - --output reference.cnn \\ + --output ${prefix}.reference.cnn \\ $args cat <<-END_VERSIONS > versions.yml From 8381a5e5dd73228b3fe744e51f1964d62c28c1e5 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 24 May 2022 14:43:40 +0200 Subject: [PATCH 27/65] add window test --- tests/modules/mosdepth/main.nf | 16 ++++++++++++++-- tests/modules/mosdepth/nextflow.config | 3 +++ tests/modules/mosdepth/test.yml | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index eab47e89..96a9ef20 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -2,8 +2,9 @@ nextflow.enable.dsl = 2 -include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' -include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main.nf' workflow test_mosdepth { input = [ @@ -49,6 +50,17 @@ workflow test_mosdepth_cram_bed { MOSDEPTH ( input, bed, fasta ) } +workflow test_mosdepth_window { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + + MOSDEPTH_WINDOW ( input, [], [] ) +} + workflow test_mosdepth_fail { input = [ [ id:'test', single_end:true ], diff --git a/tests/modules/mosdepth/nextflow.config b/tests/modules/mosdepth/nextflow.config index 85674a3c..4a6153e6 100644 --- a/tests/modules/mosdepth/nextflow.config +++ b/tests/modules/mosdepth/nextflow.config @@ -4,4 +4,7 @@ process { withName: MOSDEPTH_FAIL { ext.args = "--by 100" } + withName: MOSDEPTH_WINDOW { + ext.args = "--by 100" + } } diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index a927396c..a3115d6e 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -66,6 +66,26 @@ - path: output/mosdepth/test.regions.bed.gz.csi md5sum: 47669cfe41f3e222e74d81e1b1be191f +- name: mosdepth test_mosdepth_window + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_window -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: 39e0e707ec32feb5176fd20a95f1f468 + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 96c037f769974b904beb53edc4f56d82 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.regions.bed.gz + md5sum: f02e2cb49cc050e13d76942d6960827a + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: 257d67678136963d9dd904330079609d + - name: mosdepth test_mosdepth_fail command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: From 8208140d21f3a754fff2e177db7a0e570fa2af6e Mon Sep 17 00:00:00 2001 From: SusiJo Date: Tue, 24 May 2022 14:59:52 +0200 Subject: [PATCH 28/65] missing meta.id changed --- modules/cnvkit/reference/main.nf | 2 +- tests/modules/cnvkit/reference/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf index d5b8baa0..10458f27 100644 --- a/modules/cnvkit/reference/main.nf +++ b/modules/cnvkit/reference/main.nf @@ -21,7 +21,7 @@ process CNVKIT_REFERENCE { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def prefix = task.ext.prefix ?: targets.BaseName """ cnvkit.py \\ diff --git a/tests/modules/cnvkit/reference/test.yml b/tests/modules/cnvkit/reference/test.yml index b1b8c896..a5baf0a2 100644 --- a/tests/modules/cnvkit/reference/test.yml +++ b/tests/modules/cnvkit/reference/test.yml @@ -4,5 +4,5 @@ - cnvkit/reference - cnvkit files: - - path: output/cnvkit/reference.cnn + - path: output/cnvkit/multi_intervals.reference.cnn md5sum: 7c4a7902f5ab101b1f9d6038d331b3d9 From b0dba3ee7543dc89a00575fb619408de97cd889d Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Tue, 24 May 2022 16:17:15 +0200 Subject: [PATCH 29/65] update description --- modules/bcftools/roh/meta.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/bcftools/roh/meta.yml b/modules/bcftools/roh/meta.yml index 09535fe8..fd03d4ce 100644 --- a/modules/bcftools/roh/meta.yml +++ b/modules/bcftools/roh/meta.yml @@ -1,8 +1,7 @@ name: "bcftools_roh" -## TODO nf-core: Add a description of the module and list keywords -description: write your description here +description: A program for detecting runs of homo/autozygosity. Only bi-allelic sites are considered. keywords: - - sort + - roh tools: - "roh": description: "A program for detecting runs of homo/autozygosity. Only bi-allelic sites are considered." From f1fc7fc38eb65782cdf2d05bc4d56a11ec8922a8 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 15:15:07 -0400 Subject: [PATCH 30/65] adding upzip --- modules/gamma/{ => gamma}/main.nf | 15 ++++++++-- modules/gamma/{ => gamma}/meta.yml | 0 tests/modules/gamma/gamma/main.nf | 29 +++++++++++++++++++ .../modules/gamma/{ => gamma}/nextflow.config | 0 tests/modules/gamma/gamma/test.yml | 29 +++++++++++++++++++ tests/modules/gamma/main.nf | 17 ----------- tests/modules/gamma/test.yml | 13 --------- 7 files changed, 71 insertions(+), 32 deletions(-) rename modules/gamma/{ => gamma}/main.nf (83%) rename modules/gamma/{ => gamma}/meta.yml (100%) create mode 100644 tests/modules/gamma/gamma/main.nf rename tests/modules/gamma/{ => gamma}/nextflow.config (100%) create mode 100644 tests/modules/gamma/gamma/test.yml delete mode 100644 tests/modules/gamma/main.nf delete mode 100644 tests/modules/gamma/test.yml diff --git a/modules/gamma/main.nf b/modules/gamma/gamma/main.nf similarity index 83% rename from modules/gamma/main.nf rename to modules/gamma/gamma/main.nf index e176ee68..51a5f6c8 100644 --- a/modules/gamma/main.nf +++ b/modules/gamma/gamma/main.nf @@ -26,13 +26,24 @@ process GAMMA { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + """ - GAMMA.py \\ + if [[ ${fasta} == *.gz ]] + then + FNAME=\$(basename ${fasta} .gz) + gunzip -f ${fasta} + GAMMA.py \\ + $args \\ + "\${FNAME}" \\ + $db \\ + $prefix + else + GAMMA.py \\ $args \\ $fasta \\ $db \\ $prefix - + fi cat <<-END_VERSIONS > versions.yml "${task.process}": gamma: $VERSION diff --git a/modules/gamma/meta.yml b/modules/gamma/gamma/meta.yml similarity index 100% rename from modules/gamma/meta.yml rename to modules/gamma/gamma/meta.yml diff --git a/tests/modules/gamma/gamma/main.nf b/tests/modules/gamma/gamma/main.nf new file mode 100644 index 00000000..070a3bf1 --- /dev/null +++ b/tests/modules/gamma/gamma/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GAMMA } from '../../../../modules/gamma/gamma/main.nf' + +workflow test_unzip { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true), + ] + + db = [ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/ResGANNCBI_20210507_srst2.fasta", checkIfExists: true), ] + + GAMMA ( input, db ) +} + +workflow test_gamma { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + GAMMA ( input, db ) +} diff --git a/tests/modules/gamma/nextflow.config b/tests/modules/gamma/gamma/nextflow.config similarity index 100% rename from tests/modules/gamma/nextflow.config rename to tests/modules/gamma/gamma/nextflow.config diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml new file mode 100644 index 00000000..308d890f --- /dev/null +++ b/tests/modules/gamma/gamma/test.yml @@ -0,0 +1,29 @@ +- name: gamma gamma test_unzip + command: nextflow run tests/modules/gamma/gamma -entry test_unzip -c tests/config/nextflow.config + tags: + - gamma/gamma + - gamma + files: + - path: /tmp/tmppm1ybfln/gamma/test.fasta + md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce + - path: /tmp/tmppm1ybfln/gamma/test.gamma + md5sum: 46165a89e10b7315d3a9b0aa6c561626 + - path: /tmp/tmppm1ybfln/gamma/test.psl + md5sum: f489ce4602ddbcb692d5781ee3fbf449 + - path: /tmp/tmppm1ybfln/gamma/versions.yml + md5sum: ad23c3ec60663598543cbe8bc74bc4ab + +- name: gamma gamma test_gamma + command: nextflow run tests/modules/gamma/gamma -entry test_gamma -c tests/config/nextflow.config + tags: + - gamma/gamma + - gamma + files: + - path: /tmp/tmpw3chm6da/gamma/test.fasta + md5sum: df37b48466181311e0a679f3c5878484 + - path: /tmp/tmpw3chm6da/gamma/test.gamma + md5sum: 3256708fa517a65ed01d99e0e3c762ae + - path: /tmp/tmpw3chm6da/gamma/test.psl + md5sum: 162a2757ed3b167ae1e0cdb24213f940 + - path: /tmp/tmpw3chm6da/gamma/versions.yml + md5sum: 3fefb5b46c94993362243c5f9a472057 diff --git a/tests/modules/gamma/main.nf b/tests/modules/gamma/main.nf deleted file mode 100644 index f9477706..00000000 --- a/tests/modules/gamma/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GAMMA } from '../../../modules/gamma/main.nf' - -workflow test_gamma { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] - - GAMMA ( input, db ) -} diff --git a/tests/modules/gamma/test.yml b/tests/modules/gamma/test.yml deleted file mode 100644 index 1b493b49..00000000 --- a/tests/modules/gamma/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: gamma test_gamma - command: nextflow run tests/modules/gamma -entry test_gamma -c tests/config/nextflow.config - tags: - - gamma - files: - - path: output/gamma/test.fasta - md5sum: df37b48466181311e0a679f3c5878484 - - path: output/gamma/test.gamma - md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: output/gamma/test.psl - md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: output/gamma/versions.yml - md5sum: 3fefb5b46c94993362243c5f9a472057 From b8aaea7429e74cb23acff21b03ba3814d7905ed1 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 16:27:00 -0400 Subject: [PATCH 31/65] updating paths in test.yml --- modules/gamma/gamma/main.nf | 2 +- modules/gamma/gamma/meta.yml | 3 ++- tests/modules/gamma/gamma/main.nf | 6 +++--- tests/modules/gamma/gamma/test.yml | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/gamma/gamma/main.nf b/modules/gamma/gamma/main.nf index 51a5f6c8..fddced62 100644 --- a/modules/gamma/gamma/main.nf +++ b/modules/gamma/gamma/main.nf @@ -1,6 +1,6 @@ def VERSION = '2.1' // Version information not provided by tool on CLI -process GAMMA { +process GAMMA_GAMMA { tag "$meta.id" label 'process_low' diff --git a/modules/gamma/gamma/meta.yml b/modules/gamma/gamma/meta.yml index 316b685b..d9e272e2 100644 --- a/modules/gamma/gamma/meta.yml +++ b/modules/gamma/gamma/meta.yml @@ -1,4 +1,4 @@ -name: "gamma" +name: "gamma_gamma" description: Gene Allele Mutation Microbial Assessment keywords: - gamma @@ -61,3 +61,4 @@ output: authors: - "@sateeshperi" - "@rastanton" + - "@jvhagey" diff --git a/tests/modules/gamma/gamma/main.nf b/tests/modules/gamma/gamma/main.nf index 070a3bf1..97e58be7 100644 --- a/tests/modules/gamma/gamma/main.nf +++ b/tests/modules/gamma/gamma/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GAMMA } from '../../../../modules/gamma/gamma/main.nf' +include { GAMMA_GAMMA } from '../../../../modules/gamma/gamma/main.nf' workflow test_unzip { @@ -13,7 +13,7 @@ workflow test_unzip { db = [ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/ResGANNCBI_20210507_srst2.fasta", checkIfExists: true), ] - GAMMA ( input, db ) + GAMMA_GAMMA ( input, db ) } workflow test_gamma { @@ -25,5 +25,5 @@ workflow test_gamma { db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] - GAMMA ( input, db ) + GAMMA_GAMMA ( input, db ) } diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml index 308d890f..2c649105 100644 --- a/tests/modules/gamma/gamma/test.yml +++ b/tests/modules/gamma/gamma/test.yml @@ -4,14 +4,14 @@ - gamma/gamma - gamma files: - - path: /tmp/tmppm1ybfln/gamma/test.fasta + - path: output/gamma/gamma/test.fasta md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce - - path: /tmp/tmppm1ybfln/gamma/test.gamma + - path: output/gamma/gamma/test.gamma md5sum: 46165a89e10b7315d3a9b0aa6c561626 - - path: /tmp/tmppm1ybfln/gamma/test.psl + - path: output/gamma/gamma/test.psl md5sum: f489ce4602ddbcb692d5781ee3fbf449 - - path: /tmp/tmppm1ybfln/gamma/versions.yml - md5sum: ad23c3ec60663598543cbe8bc74bc4ab + - path: output/gamma/gamma/versions.yml + md5sum: 8baafec7b3b87f788f69e30d317c9722 - name: gamma gamma test_gamma command: nextflow run tests/modules/gamma/gamma -entry test_gamma -c tests/config/nextflow.config @@ -19,11 +19,11 @@ - gamma/gamma - gamma files: - - path: /tmp/tmpw3chm6da/gamma/test.fasta + - path: output/gamma/gamma/test.fasta md5sum: df37b48466181311e0a679f3c5878484 - - path: /tmp/tmpw3chm6da/gamma/test.gamma + - path: output/gamma/gamma/test.gamma md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: /tmp/tmpw3chm6da/gamma/test.psl + - path: output/gamma/gamma/test.psl md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: /tmp/tmpw3chm6da/gamma/versions.yml - md5sum: 3fefb5b46c94993362243c5f9a472057 + - path: output/gamma/gamma/versions.yml + md5sum: b75c2871d8cac2f8ac67c0fbd22babd6 From bb999395aa4d03d02336794c655cfcdf34855b05 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 19:19:38 -0400 Subject: [PATCH 32/65] fixed pytest_modules.yml --- tests/config/pytest_modules.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2063d691..80711bae 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -707,9 +707,9 @@ freebayes: - modules/freebayes/** - tests/modules/freebayes/** -gamma: - - modules/gamma/** - - tests/modules/gamma/** +gamma/gamma: + - modules/gamma/gamma/** + - tests/modules/gamma/gamma/** gatk4/applybqsr: - modules/gatk4/applybqsr/** From 127665d27ba5512bfe1596f86c2b11a197556233 Mon Sep 17 00:00:00 2001 From: jvhagey Date: Tue, 24 May 2022 19:27:09 -0400 Subject: [PATCH 33/65] fixed test.yml --- tests/modules/gamma/gamma/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/modules/gamma/gamma/test.yml b/tests/modules/gamma/gamma/test.yml index 2c649105..163eda5f 100644 --- a/tests/modules/gamma/gamma/test.yml +++ b/tests/modules/gamma/gamma/test.yml @@ -4,13 +4,13 @@ - gamma/gamma - gamma files: - - path: output/gamma/gamma/test.fasta + - path: output/gamma/test.fasta md5sum: 5b3b831d863fffaa3410a9ee7bfa12ce - - path: output/gamma/gamma/test.gamma + - path: output/gamma/test.gamma md5sum: 46165a89e10b7315d3a9b0aa6c561626 - - path: output/gamma/gamma/test.psl + - path: output/gamma/test.psl md5sum: f489ce4602ddbcb692d5781ee3fbf449 - - path: output/gamma/gamma/versions.yml + - path: output/gamma/versions.yml md5sum: 8baafec7b3b87f788f69e30d317c9722 - name: gamma gamma test_gamma @@ -19,11 +19,11 @@ - gamma/gamma - gamma files: - - path: output/gamma/gamma/test.fasta + - path: output/gamma/test.fasta md5sum: df37b48466181311e0a679f3c5878484 - - path: output/gamma/gamma/test.gamma + - path: output/gamma/test.gamma md5sum: 3256708fa517a65ed01d99e0e3c762ae - - path: output/gamma/gamma/test.psl + - path: output/gamma/test.psl md5sum: 162a2757ed3b167ae1e0cdb24213f940 - - path: output/gamma/gamma/versions.yml + - path: output/gamma/versions.yml md5sum: b75c2871d8cac2f8ac67c0fbd22babd6 From c452f562890534ca3d0a331de7c35b744037fdae Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Wed, 25 May 2022 12:29:14 +0000 Subject: [PATCH 34/65] Patch mash screen --- modules/mash/screen/main.nf | 8 ++++---- modules/mash/screen/meta.yml | 9 +++++---- tests/modules/mash/screen/main.nf | 9 ++++++--- tests/modules/mash/screen/test.yml | 10 +++++----- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/mash/screen/main.nf b/modules/mash/screen/main.nf index 3e7859ed..be272cbb 100644 --- a/modules/mash/screen/main.nf +++ b/modules/mash/screen/main.nf @@ -8,8 +8,8 @@ process MASH_SCREEN { 'quay.io/biocontainers/mash:2.3--he348c14_1' }" input: - tuple val(meta), path(query_sketch) - path fastx_db + tuple val(meta), path(query) + path sequences_sketch output: tuple val(meta), path("*.screen"), emit: screen @@ -26,8 +26,8 @@ process MASH_SCREEN { screen \\ $args \\ -p $task.cpus \\ - $query_sketch \\ - $fastx_db \\ + $sequences_sketch \\ + $query \\ > ${prefix}.screen cat <<-END_VERSIONS > versions.yml diff --git a/modules/mash/screen/meta.yml b/modules/mash/screen/meta.yml index 81e455bc..063aca6c 100644 --- a/modules/mash/screen/meta.yml +++ b/modules/mash/screen/meta.yml @@ -20,13 +20,14 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - query_sketch: + - query: type: file - description: MinHash sketch of query sequences - pattern: "*.msh" - - fastx_db: + description: Query sequences + pattern: "*.fastq.gz" + - sequence_sketch: type: file description: Sequence files to match against + pattern: "*.msh" output: - meta: diff --git a/tests/modules/mash/screen/main.nf b/tests/modules/mash/screen/main.nf index 7f0b8bd9..5338d932 100644 --- a/tests/modules/mash/screen/main.nf +++ b/tests/modules/mash/screen/main.nf @@ -14,8 +14,11 @@ workflow test_mash_screen { file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] - fastx_db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + sars_db = [ + [ id: 'sars_db' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] - MASH_SKETCH ( input ) - MASH_SCREEN ( MASH_SKETCH.out.mash, fastx_db ) + MASH_SKETCH ( sars_db ) + MASH_SCREEN ( input, MASH_SKETCH.out.mash.map { meta, sketch -> sketch } ) } diff --git a/tests/modules/mash/screen/test.yml b/tests/modules/mash/screen/test.yml index f622817a..e4907ce9 100644 --- a/tests/modules/mash/screen/test.yml +++ b/tests/modules/mash/screen/test.yml @@ -4,9 +4,9 @@ - mash - mash/screen files: - - path: output/mash/test.mash_stats - md5sum: 2a6f297d8e69a5e4160243bc6c89129c - - path: output/mash/test.msh - md5sum: d747145a43dad5f82342036f8f5d9133 + - path: output/mash/sars_db.mash_stats + md5sum: 1dafbd23e36e18bf4c87a007d0fc98f7 + - path: output/mash/sars_db.msh + md5sum: 24289e4a13526e88eeb2abfca4a0f0a8 - path: output/mash/test.screen - md5sum: d3c871dccd5cd57ab54781fa5c5d7278 + md5sum: ac8701e1aab651b2f36c6380b1351b11 From 72ff2732e3177b041234aa49c1775376a00d59f4 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 25 May 2022 19:19:39 +0200 Subject: [PATCH 35/65] add all remaining outputs to mosdepth --- modules/mosdepth/main.nf | 29 ++++++++++++------ modules/mosdepth/meta.yml | 16 ++++++++++ tests/modules/mosdepth/main.nf | 30 ++++++++++++++++-- tests/modules/mosdepth/nextflow.config | 6 ++++ tests/modules/mosdepth/test.yml | 42 ++++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 12 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 5f6538e7..96471cfc 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -13,15 +13,19 @@ process MOSDEPTH { path fasta output: - tuple val(meta), path('*.global.dist.txt') , emit: global_txt - tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true - tuple val(meta), path('*.summary.txt') , emit: summary_txt - tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true - tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true - tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi, optional:true - tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true - tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true - path "versions.yml" , emit: versions + tuple val(meta), path('*.global.dist.txt') , emit: global_txt + tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true + tuple val(meta), path('*.summary.txt') , emit: summary_txt + tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true + tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true + tuple val(meta), path('*.per-base.bed.gz.csi') , emit: per_base_csi, optional:true + tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true + tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true + tuple val(meta), path('*.quantized.bed.gz') , emit: quantized_bed , optional:true + tuple val(meta), path('*.quantized.bed.gz.csi') , emit: quantized_csi , optional:true + tuple val(meta), path('*.thresholds.bed.gz') , emit: thresholds_bed , optional:true + tuple val(meta), path('*.thresholds.bed.gz.csi'), emit: thresholds_csi , optional:true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -34,6 +38,9 @@ process MOSDEPTH { if (bed && args.contains("--by")) { exit 1, "'--by' can only be specified once when running mosdepth! Either remove input BED file definition or remove '--by' from 'ext.args' definition" } + if (!bed && args.contains("--thresholds")) { + exit 1, "'--thresholds' can only be specified in conjunction with '--by'" + } """ mosdepth \\ @@ -61,6 +68,10 @@ process MOSDEPTH { touch ${prefix}.per-base.bed.gz.csi touch ${prefix}.regions.bed.gz touch ${prefix}.regions.bed.gz.csi + touch ${prefix}.quantized.bed.gz + touch ${prefix}.quantized.bed.gz.csi + touch ${prefix}.thresholds.bed.gz + touch ${prefix}.thresholds.bed.gz.csi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index 6e9e34c9..d1e33447 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -72,6 +72,22 @@ output: type: file description: Index file for BED file with per-region coverage pattern: "*.{regions.bed.gz.csi}" + - quantized_bed: + type: file + description: BED file with binned coverage + pattern: "*.{quantized.bed.gz}" + - quantized_csi: + type: file + description: Index file for BED file with binned coverage + pattern: "*.{quantized.bed.gz.csi}" + - thresholds_bed: + type: file + description: BED file with the number of bases in each region that are covered at or above each threshold + pattern: "*.{thresholds.bed.gz}" + - thresholds_csi: + type: file + description: Index file for BED file with threshold coverage + pattern: "*.{thresholds.bed.gz.csi}" - versions: type: file description: File containing software versions diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index 96a9ef20..dd4a01c4 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -2,9 +2,12 @@ nextflow.enable.dsl = 2 -include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' -include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' -include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_FAIL } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_THRESHOLD } from '../../../modules/mosdepth/main.nf' +include { MOSDEPTH as MOSDEPTH_QUANTIZED } from '../../../modules/mosdepth/main.nf' + workflow test_mosdepth { input = [ @@ -61,6 +64,27 @@ workflow test_mosdepth_window { MOSDEPTH_WINDOW ( input, [], [] ) } +workflow test_mosdepth_quantized { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + + MOSDEPTH_QUANTIZED ( input, [], [] ) +} + +workflow test_mosdepth_thresholds { + input = [ + [ id:'test', single_end:true ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + ] + bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + + MOSDEPTH_THRESHOLD ( input, bed, [] ) +} + workflow test_mosdepth_fail { input = [ [ id:'test', single_end:true ], diff --git a/tests/modules/mosdepth/nextflow.config b/tests/modules/mosdepth/nextflow.config index 4a6153e6..66e9291f 100644 --- a/tests/modules/mosdepth/nextflow.config +++ b/tests/modules/mosdepth/nextflow.config @@ -7,4 +7,10 @@ process { withName: MOSDEPTH_WINDOW { ext.args = "--by 100" } + withName: MOSDEPTH_QUANTIZED { + ext.args = "--quantize 0:1:4:100:200" + } + withName: MOSDEPTH_THRESHOLD { + ext.args = "--thresholds 1,10,20,30" + } } diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index a3115d6e..8efadb9d 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -86,6 +86,48 @@ - path: output/mosdepth/test.regions.bed.gz.csi md5sum: 257d67678136963d9dd904330079609d +- name: mosdepth test_mosdepth_quantized + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_quantized -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.quantized.bed.gz + md5sum: 3e434a8bafcf59a67841ae3d4d752838 + - path: output/mosdepth/test.quantized.bed.gz.csi + md5sum: be9617f551f19a33923f1e886eaefb93 + +- name: mosdepth test_mosdepth_thresholds + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_thresholds -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config + tags: + - mosdepth + files: + - path: output/mosdepth/test.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.region.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: output/mosdepth/test.mosdepth.summary.txt + md5sum: 96c037f769974b904beb53edc4f56d82 + - path: output/mosdepth/test.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: output/mosdepth/test.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: output/mosdepth/test.regions.bed.gz + md5sum: 5d398caf7171ec4406278e2add3009ae + - path: output/mosdepth/test.regions.bed.gz.csi + md5sum: 47669cfe41f3e222e74d81e1b1be191f + - path: output/mosdepth/test.thresholds.bed.gz + md5sum: 13101e326eea3cbfa1d569b69f494f4c + - path: output/mosdepth/test.thresholds.bed.gz.csi + md5sum: 912055ee9452229439df6fae95644196 + - name: mosdepth test_mosdepth_fail command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth_fail -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: From 241a1de035d47529fd09835f3f619490308afc21 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 25 May 2022 19:38:12 +0100 Subject: [PATCH 36/65] Update main.nf --- tests/modules/mosdepth/main.nf | 93 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index dd4a01c4..1bb8e8ff 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -8,90 +8,89 @@ include { MOSDEPTH as MOSDEPTH_WINDOW } from '../../../modules/mosdepth/main. include { MOSDEPTH as MOSDEPTH_THRESHOLD } from '../../../modules/mosdepth/main.nf' include { MOSDEPTH as MOSDEPTH_QUANTIZED } from '../../../modules/mosdepth/main.nf' - workflow test_mosdepth { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] MOSDEPTH ( input, [], [] ) } workflow test_mosdepth_bed { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH ( input, bed, [] ) } workflow test_mosdepth_cram { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) MOSDEPTH ( input, [], fasta ) } workflow test_mosdepth_cram_bed { input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] - fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) MOSDEPTH ( input, bed, fasta ) } workflow test_mosdepth_window { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_WINDOW ( input, [], [] ) } workflow test_mosdepth_quantized { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] MOSDEPTH_QUANTIZED ( input, [], [] ) } workflow test_mosdepth_thresholds { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_THRESHOLD ( input, bed, [] ) } workflow test_mosdepth_fail { - input = [ - [ id:'test', single_end:true ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - bed = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + input = [ + [ id:'test', single_end:true ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) MOSDEPTH_FAIL ( input, bed, [] ) } From 72a31b76eb1b58879e0d91fb1d992e0118693098 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 25 May 2022 19:42:15 +0100 Subject: [PATCH 37/65] Update main.nf --- modules/mosdepth/main.nf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 96471cfc..d7e3c929 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -14,17 +14,17 @@ process MOSDEPTH { output: tuple val(meta), path('*.global.dist.txt') , emit: global_txt - tuple val(meta), path('*.region.dist.txt') , emit: regions_txt , optional:true tuple val(meta), path('*.summary.txt') , emit: summary_txt - tuple val(meta), path('*.per-base.d4') , emit: per_base_d4 , optional:true - tuple val(meta), path('*.per-base.bed.gz') , emit: per_base_bed, optional:true - tuple val(meta), path('*.per-base.bed.gz.csi') , emit: per_base_csi, optional:true - tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed , optional:true - tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi , optional:true - tuple val(meta), path('*.quantized.bed.gz') , emit: quantized_bed , optional:true - tuple val(meta), path('*.quantized.bed.gz.csi') , emit: quantized_csi , optional:true - tuple val(meta), path('*.thresholds.bed.gz') , emit: thresholds_bed , optional:true - tuple val(meta), path('*.thresholds.bed.gz.csi'), emit: thresholds_csi , optional:true + tuple val(meta), path('*.region.dist.txt') , optional:true, emit: regions_txt + tuple val(meta), path('*.per-base.d4') , optional:true, emit: per_base_d4 + tuple val(meta), path('*.per-base.bed.gz') , optional:true, emit: per_base_bed + tuple val(meta), path('*.per-base.bed.gz.csi') , optional:true, emit: per_base_csi + tuple val(meta), path('*.regions.bed.gz') , optional:true, emit: regions_bed + tuple val(meta), path('*.regions.bed.gz.csi') , optional:true, emit: regions_csi + tuple val(meta), path('*.quantized.bed.gz') , optional:true, emit: quantized_bed + tuple val(meta), path('*.quantized.bed.gz.csi') , optional:true, emit: quantized_csi + tuple val(meta), path('*.thresholds.bed.gz') , optional:true, emit: thresholds_bed + tuple val(meta), path('*.thresholds.bed.gz.csi'), optional:true, emit: thresholds_csi path "versions.yml" , emit: versions when: @@ -44,7 +44,7 @@ process MOSDEPTH { """ mosdepth \\ - --threads ${task.cpus} \\ + --threads $task.cpus \\ $interval \\ $reference \\ $args \\ From 05e4e2cddec05c58e7a807e03a8e751456eef572 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Thu, 26 May 2022 20:16:45 +0200 Subject: [PATCH 38/65] Add idcutoff as input --- modules/vsearch/usearchglobal/main.nf | 53 ++++++++----------- modules/vsearch/usearchglobal/meta.yml | 51 ++++++++++++++++-- tests/modules/vsearch/usearchglobal/main.nf | 7 +-- .../vsearch/usearchglobal/nextflow.config | 1 - tests/modules/vsearch/usearchglobal/test.yml | 8 +-- .../vsearch/usearchglobal/test.yml.ori | 14 ----- 6 files changed, 79 insertions(+), 55 deletions(-) delete mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 0b31842f..ed95b7c3 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -1,39 +1,31 @@ -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta - process VSEARCH_USEARCHGLOBAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--h95f258a_0': 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - tuple val(meta), path(queryfasta) + val(meta) + path(queryfasta) path db + val idcutoff val outoption val user_columns - // TODO nf-core: Where applicable please provide/convert compressed files as input/output - // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. - output: - tuple val(meta), path('*.aln') , optional: true, emit: aln - tuple val(meta), path('*.biom') , optional: true, emit: biom - tuple val(meta), path('*.sam') , optional: true, emit: sam - tuple val(meta), path('*.tsv') , optional: true, emit: tsv - tuple val(meta), path('*.uc') , optional: true, emit: uc - path "versions.yml" , emit: versions + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.lca') , optional: true, emit: lca + tuple val(meta), path('*.mothur') , optional: true, emit: mothur + tuple val(meta), path('*.otu') , optional: true, emit: otu + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -45,13 +37,13 @@ process VSEARCH_USEARCHGLOBAL { switch ( outoption ) { case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break - case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break - case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break - case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break - case "samout": outfmt = "--samout"; out_ext = 'sam'; break - case "uc": outfmt = "--uc"; out_ext = 'uc'; break - case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break - case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'txt'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca'; break default: outfmt = "--alnout"; out_ext = 'aln'; @@ -62,6 +54,7 @@ process VSEARCH_USEARCHGLOBAL { vsearch \\ --usearch_global $queryfasta \\ --db $db \\ + --id $idcutoff \\ --threads $task.cpus \\ $args \\ ${columns} \\ diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 8cb97446..848fb65a 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -15,20 +15,65 @@ tools: licence: "['GPL v3-or-later OR BSD-2-clause']" input: + - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test' ] - queryfasta: type: file description: Query sequences in FASTA format pattern: "*.{fasta,fa,fna,faa}" - db: type: file - description: Reference database file. It may be in FASTA or UDB format. + description: Reference database file in FASTA or UDB format pattern: "*" + - idcutoff: + type: real + description: Reject the sequence match if the pairwise identity is lower than the given id cutoff value (value ranging from 0.0 to 1.0 included) + - outoption: + type: string + description: Specify the type of output file to be generated by selecting one of the vsearch output file options + pattern: "alnout|biomout|blast6out|mothur_shared_out|otutabout|samout|uc|userout|lcaout" + - user_columns: + type: string + description: If using the `userout` option, specify which columns to include in output, with fields separated with `+` (e.g. query+target+id). See USEARCH manual for valid options. For other output options, use an empty string. output: - - blast6out: + - aln: type: file - description: Tab delimited results in blast-like format + description: Results in pairwise alignment format + pattern: "*.{aln}" + - biom: + type: file + description: Results in an OTU table in the biom version 1.0 file format + pattern: "*.{biom}" + - lca: + type: file + description: Last common ancestor (LCA) information about the hits of each query in tab-separated format + pattern: "*.{lca}" + - mothur: + type: file + description: Results in an OTU table in the mothur ’shared’ tab-separated plain text file format + pattern: "*.{mothur}" + - otu: + type: file + description: Results in an OTU table in the classic tab-separated plain text format + pattern: "*.{otu}" + - sam: + type: file + description: Results written in sam format + pattern: "*.{sam}" + - tsv: + type: file + description: Results in tab-separated output, columns defined by user pattern: "*.{tsv}" + - txt: + type: file + description: Tab delimited results in blast-like tabular format + pattern: "*.{txt}" + - uc: + type: file + description: Tab delimited results in a uclust-like format with 10 columns + pattern: "*.{uc}" - versions: type: file description: File containing software versions diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index cdf0fb2f..f4afec32 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,17 +8,18 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - + idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index 3148a59e..14f46dea 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,4 @@ process { - ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b7ebec4a..79bcd50e 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,17 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - path: output/vsearch/test.aln - md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + md5sum: 2543c4147530dcb1ba4550d3fdb1502a - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - - path: output/vsearch/test.user.tsv + - path: output/vsearch/test.tsv md5sum: b6cc50f7c8d18cb82e74dab70ed4baab diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori deleted file mode 100644 index df644165..00000000 --- a/tests/modules/vsearch/usearchglobal/test.yml.ori +++ /dev/null @@ -1,14 +0,0 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml vsearch/usearchglobal -- name: "vsearch usearchglobal" - command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config - tags: - - "vsearch" - # - - "vsearch/usearchglobal" - # - files: - - path: "output/vsearch/blast6out_results.tsv" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/vsearch/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From fb6c7bca3d55c19a793372513395e3a567bdd7ba Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 27 May 2022 11:35:04 +0100 Subject: [PATCH 39/65] Bump container version for STAR to 2.7.10a --- modules/star/align/main.nf | 13 +++++++------ modules/star/genomegenerate/main.nf | 13 ++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/star/align/main.nf b/modules/star/align/main.nf index 762b84f6..e5aa36f5 100644 --- a/modules/star/align/main.nf +++ b/modules/star/align/main.nf @@ -2,16 +2,15 @@ process STAR_ALIGN { tag "$meta.id" label 'process_high' - // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? 'bioconda::star=2.7.9a' : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/star:2.7.9a--h9ee0642_0' : - 'quay.io/biocontainers/star:2.7.9a--h9ee0642_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: tuple val(meta), path(reads) - path index - path gtf + path index + path gtf val star_ignore_sjdbgtf val seq_platform val seq_center @@ -67,6 +66,8 @@ process STAR_ALIGN { cat <<-END_VERSIONS > versions.yml "${task.process}": star: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') END_VERSIONS """ } diff --git a/modules/star/genomegenerate/main.nf b/modules/star/genomegenerate/main.nf index e5568f1d..3c298016 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -2,19 +2,18 @@ process STAR_GENOMEGENERATE { tag "$fasta" label 'process_high' - // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? "bioconda::star=2.7.9a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) + conda (params.enable_conda ? "bioconda::star=2.7.10a bioconda::samtools=1.15.1 conda-forge::gawk=5.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' : - 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1c4c32d87798d425c970ececfbadd155e7560277-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:afaaa4c6f5b308b4b6aa2dd8e99e1466b2a6b0cd-0' }" input: path fasta path gtf output: - path "star" , emit: index - path "versions.yml" , emit: versions + path "star" , emit: index + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -22,7 +21,7 @@ process STAR_GENOMEGENERATE { script: def args = task.ext.args ?: '' def args_list = args.tokenize() - def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' + def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' if (args_list.contains('--genomeSAindexNbases')) { """ mkdir star From ad578cafcc559b8a6a99257b91e85ba044d9f619 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 27 May 2022 12:14:10 +0100 Subject: [PATCH 40/65] Fix tests --- tests/modules/star/align/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/modules/star/align/test.yml b/tests/modules/star/align/test.yml index af5bebe5..f7cb0f62 100644 --- a/tests/modules/star/align/test.yml +++ b/tests/modules/star/align/test.yml @@ -36,7 +36,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: b9f5e2f6a624b64c300fe25dc3ac801f + md5sum: 63de6af2210e138b49d7b4d570c6e67f - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -80,7 +80,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: 38d08f0b944a2a1b981a250d675aa0d9 + md5sum: 7cdef439bc8092bfefb4d091bf8ee6ab - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -124,7 +124,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: c740d5177067c1fcc48ab7a16cd639d7 + md5sum: 5dbc36fce7b72628c809bbc7d3d67973 - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -168,9 +168,9 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: a1bd1b40950a58ea2776908076160052 + md5sum: d85858bf55a523121dde762046a34c5c - path: output/star/test.Chimeric.out.junction - md5sum: 327629eb54032212f29e1c32cbac6975 + md5sum: ae87d1a24180f5a35cf6b47fdfdd0539 - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out From 1c99ffd876a3a91c13764b7b9c26959d74eb1bea Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 10:01:55 +0200 Subject: [PATCH 41/65] Add vserach usearch_global --- modules/vsearch/usearchglobal/main.nf | 51 +++++++++++++++++++ modules/vsearch/usearchglobal/meta.yml | 38 ++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/vsearch/usearchglobal/main.nf | 12 +++++ .../vsearch/usearchglobal/nextflow.config | 5 ++ tests/modules/vsearch/usearchglobal/test.yml | 7 +++ .../vsearch/usearchglobal/test.yml.ori | 14 +++++ 7 files changed, 131 insertions(+) create mode 100644 modules/vsearch/usearchglobal/main.nf create mode 100644 modules/vsearch/usearchglobal/meta.yml create mode 100644 tests/modules/vsearch/usearchglobal/main.nf create mode 100644 tests/modules/vsearch/usearchglobal/nextflow.config create mode 100644 tests/modules/vsearch/usearchglobal/test.yml create mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..65ee62cc --- /dev/null +++ b/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,51 @@ +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta + +process VSEARCH_USEARCHGLOBAL { + tag '$queryfasta' + label 'process_low' + + conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" + + input: + path queryfasta + path db + val outprefix + + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + + output: + path ("*.tsv") , emit: tsv + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + vsearch \\ + --usearch_global $queryfasta \\ + --db $db \\ + --threads $task.cpus \\ + $args \\ + --blast6out ${outprefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vsearch: \$(vsearch --version 2>&1 | head -n 1 | sed 's/vsearch //g' | sed 's/,.*//g' | sed 's/^v//' | sed 's/_.*//') + END_VERSIONS + """ +} diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml new file mode 100644 index 00000000..8cb97446 --- /dev/null +++ b/modules/vsearch/usearchglobal/meta.yml @@ -0,0 +1,38 @@ +name: "vsearch_usearchglobal" +description: Compare target sequences to fasta-formatted query sequences using global pairwise alignment. +keywords: + - vsearch + - usearch + - alignment + - fasta +tools: + - "vsearch": + description: "VSEARCH is a versatile open-source tool for microbiome analysis, including chimera detection, clustering, dereplication and rereplication, extraction, FASTA/FASTQ/SFF file processing, masking, orienting, pair-wise alignment, restriction site cutting, searching, shuffling, sorting, subsampling, and taxonomic classification of amplicon sequences for metagenomics, genomics, and population genetics. (USEARCH alternative)" + homepage: "https://github.com/torognes/vsearch" + documentation: "None" + tool_dev_url: "https://github.com/torognes/vsearch" + doi: "doi: 10.7717/peerj.2584" + licence: "['GPL v3-or-later OR BSD-2-clause']" + +input: + - queryfasta: + type: file + description: Query sequences in FASTA format + pattern: "*.{fasta,fa,fna,faa}" + - db: + type: file + description: Reference database file. It may be in FASTA or UDB format. + pattern: "*" + +output: + - blast6out: + type: file + description: Tab delimited results in blast-like format + pattern: "*.{tsv}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jtangrot" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 529f3e02..3ff58b5c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2052,6 +2052,10 @@ vcftools: - modules/vcftools/** - tests/modules/vcftools/** +vsearch/usearchglobal: + - modules/vsearch/usearchglobal/** + - tests/modules/vsearch/usearchglobal/** + yara/index: - modules/yara/index/** - tests/modules/yara/index/** diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf new file mode 100644 index 00000000..02becd21 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VSEARCH_USEARCHGLOBAL } from '../../../../modules/vsearch/usearchglobal/main.nf' + +workflow test_vsearch_usearchglobal { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) +} diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config new file mode 100644 index 00000000..aab29979 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -0,0 +1,5 @@ +process { + ext.args = '--id 0.985' + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml new file mode 100644 index 00000000..b013519d --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -0,0 +1,7 @@ +- name: vsearch usearchglobal test_vsearch_usearchglobal + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch/usearchglobal + files: + - path: output/vsearch/blast6out_results.tsv + md5sum: 09733131643f1d951321a6e17a35eb8c diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori new file mode 100644 index 00000000..df644165 --- /dev/null +++ b/tests/modules/vsearch/usearchglobal/test.yml.ori @@ -0,0 +1,14 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml vsearch/usearchglobal +- name: "vsearch usearchglobal" + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - "vsearch" + # + - "vsearch/usearchglobal" + # + files: + - path: "output/vsearch/blast6out_results.tsv" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/vsearch/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 589ce2d73a0b9a3109f5291587eff425ca7fbfa5 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 23 May 2022 14:02:10 +0200 Subject: [PATCH 42/65] Add options for output file type --- modules/vsearch/usearchglobal/main.nf | 38 +++++++++++++++---- tests/modules/vsearch/usearchglobal/main.nf | 14 ++++++- .../vsearch/usearchglobal/nextflow.config | 4 +- tests/modules/vsearch/usearchglobal/test.yml | 14 ++++++- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 65ee62cc..0b31842f 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -10,7 +10,7 @@ // bwa mem | samtools view -B -T ref.fasta process VSEARCH_USEARCHGLOBAL { - tag '$queryfasta' + tag "$meta.id" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) @@ -19,29 +19,53 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - path queryfasta + tuple val(meta), path(queryfasta) path db - val outprefix + val outoption + val user_columns // TODO nf-core: Where applicable please provide/convert compressed files as input/output // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. output: - path ("*.tsv") , emit: tsv - path "versions.yml" , emit: versions - + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions + when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def columns = user_columns ? "--userfields ${user_columns}" : '' + switch ( outoption ) { + case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break + case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + default: + outfmt = "--alnout"; + out_ext = 'aln'; + log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + break + } """ vsearch \\ --usearch_global $queryfasta \\ --db $db \\ --threads $task.cpus \\ $args \\ - --blast6out ${outprefix}.tsv + ${columns} \\ + ${outfmt} ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index 02becd21..cdf0fb2f 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,5 +8,17 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - VSEARCH_USEARCHGLOBAL ( query, db, "blast6out_results" ) + + outoption = "xcfert" // Nonsense text to check default case. + columns = "" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) +} + +workflow test_vsearch_usearchglobal_userout { + + query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) + db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + outoption = "userout" + columns = "query+target+id" + VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index aab29979..3148a59e 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,5 @@ process { ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file +} + diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b013519d..b7ebec4a 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,7 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: + - vsearch - vsearch/usearchglobal files: - - path: output/vsearch/blast6out_results.tsv - md5sum: 09733131643f1d951321a6e17a35eb8c + - path: output/vsearch/test.aln + md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + +- name: vsearch usearchglobal test_vsearch_usearchglobal_userout + command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config + tags: + - vsearch + - vsearch/usearchglobal + files: + - path: output/vsearch/test.user.tsv + md5sum: b6cc50f7c8d18cb82e74dab70ed4baab From 01d86439f5a25cd6b46006420ad7eb35049f4b27 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Thu, 26 May 2022 20:16:45 +0200 Subject: [PATCH 43/65] Add idcutoff as input --- modules/vsearch/usearchglobal/main.nf | 53 ++++++++----------- modules/vsearch/usearchglobal/meta.yml | 51 ++++++++++++++++-- tests/modules/vsearch/usearchglobal/main.nf | 7 +-- .../vsearch/usearchglobal/nextflow.config | 1 - tests/modules/vsearch/usearchglobal/test.yml | 8 +-- .../vsearch/usearchglobal/test.yml.ori | 14 ----- 6 files changed, 79 insertions(+), 55 deletions(-) delete mode 100644 tests/modules/vsearch/usearchglobal/test.yml.ori diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 0b31842f..ed95b7c3 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -1,39 +1,31 @@ -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta - process VSEARCH_USEARCHGLOBAL { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1': + 'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--h95f258a_0': 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - tuple val(meta), path(queryfasta) + val(meta) + path(queryfasta) path db + val idcutoff val outoption val user_columns - // TODO nf-core: Where applicable please provide/convert compressed files as input/output - // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. - output: - tuple val(meta), path('*.aln') , optional: true, emit: aln - tuple val(meta), path('*.biom') , optional: true, emit: biom - tuple val(meta), path('*.sam') , optional: true, emit: sam - tuple val(meta), path('*.tsv') , optional: true, emit: tsv - tuple val(meta), path('*.uc') , optional: true, emit: uc - path "versions.yml" , emit: versions + tuple val(meta), path('*.aln') , optional: true, emit: aln + tuple val(meta), path('*.biom') , optional: true, emit: biom + tuple val(meta), path('*.lca') , optional: true, emit: lca + tuple val(meta), path('*.mothur') , optional: true, emit: mothur + tuple val(meta), path('*.otu') , optional: true, emit: otu + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.uc') , optional: true, emit: uc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -45,13 +37,13 @@ process VSEARCH_USEARCHGLOBAL { switch ( outoption ) { case "alnout": outfmt = "--alnout"; out_ext = 'aln'; break case "biomout": outfmt = "--biomout"; out_ext = 'biom'; break - case "blast6out": outfmt = "--blast6out"; out_ext = 'blast6out.tsv'; break - case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur.tsv'; break - case "otutabout": outfmt = "--otutabout"; out_ext = 'otu.tsv'; break - case "samout": outfmt = "--samout"; out_ext = 'sam'; break - case "uc": outfmt = "--uc"; out_ext = 'uc'; break - case "userout": outfmt = "--userout"; out_ext = 'user.tsv'; break - case "lcaout": outfmt = "--lcaout"; out_ext = 'lca.tsv'; break + case "blast6out": outfmt = "--blast6out"; out_ext = 'txt'; break + case "mothur_shared_out": outfmt = "--mothur_shared_out"; out_ext = 'mothur'; break + case "otutabout": outfmt = "--otutabout"; out_ext = 'otu'; break + case "samout": outfmt = "--samout"; out_ext = 'sam'; break + case "uc": outfmt = "--uc"; out_ext = 'uc'; break + case "userout": outfmt = "--userout"; out_ext = 'tsv'; break + case "lcaout": outfmt = "--lcaout"; out_ext = 'lca'; break default: outfmt = "--alnout"; out_ext = 'aln'; @@ -62,6 +54,7 @@ process VSEARCH_USEARCHGLOBAL { vsearch \\ --usearch_global $queryfasta \\ --db $db \\ + --id $idcutoff \\ --threads $task.cpus \\ $args \\ ${columns} \\ diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 8cb97446..848fb65a 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -15,20 +15,65 @@ tools: licence: "['GPL v3-or-later OR BSD-2-clause']" input: + - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test' ] - queryfasta: type: file description: Query sequences in FASTA format pattern: "*.{fasta,fa,fna,faa}" - db: type: file - description: Reference database file. It may be in FASTA or UDB format. + description: Reference database file in FASTA or UDB format pattern: "*" + - idcutoff: + type: real + description: Reject the sequence match if the pairwise identity is lower than the given id cutoff value (value ranging from 0.0 to 1.0 included) + - outoption: + type: string + description: Specify the type of output file to be generated by selecting one of the vsearch output file options + pattern: "alnout|biomout|blast6out|mothur_shared_out|otutabout|samout|uc|userout|lcaout" + - user_columns: + type: string + description: If using the `userout` option, specify which columns to include in output, with fields separated with `+` (e.g. query+target+id). See USEARCH manual for valid options. For other output options, use an empty string. output: - - blast6out: + - aln: type: file - description: Tab delimited results in blast-like format + description: Results in pairwise alignment format + pattern: "*.{aln}" + - biom: + type: file + description: Results in an OTU table in the biom version 1.0 file format + pattern: "*.{biom}" + - lca: + type: file + description: Last common ancestor (LCA) information about the hits of each query in tab-separated format + pattern: "*.{lca}" + - mothur: + type: file + description: Results in an OTU table in the mothur ’shared’ tab-separated plain text file format + pattern: "*.{mothur}" + - otu: + type: file + description: Results in an OTU table in the classic tab-separated plain text format + pattern: "*.{otu}" + - sam: + type: file + description: Results written in sam format + pattern: "*.{sam}" + - tsv: + type: file + description: Results in tab-separated output, columns defined by user pattern: "*.{tsv}" + - txt: + type: file + description: Tab delimited results in blast-like tabular format + pattern: "*.{txt}" + - uc: + type: file + description: Tab delimited results in a uclust-like format with 10 columns + pattern: "*.{uc}" - versions: type: file description: File containing software versions diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index cdf0fb2f..f4afec32 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -8,17 +8,18 @@ workflow test_vsearch_usearchglobal { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - + idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { query = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) db = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [ [id:'test'], query ], db, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) } diff --git a/tests/modules/vsearch/usearchglobal/nextflow.config b/tests/modules/vsearch/usearchglobal/nextflow.config index 3148a59e..14f46dea 100644 --- a/tests/modules/vsearch/usearchglobal/nextflow.config +++ b/tests/modules/vsearch/usearchglobal/nextflow.config @@ -1,5 +1,4 @@ process { - ext.args = '--id 0.985' publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index b7ebec4a..79bcd50e 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -1,17 +1,17 @@ - name: vsearch usearchglobal test_vsearch_usearchglobal command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - path: output/vsearch/test.aln - md5sum: 7b7479c16e0ecb503913da8bde48d6c5 + md5sum: 2543c4147530dcb1ba4550d3fdb1502a - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config tags: - - vsearch - vsearch/usearchglobal + - vsearch files: - - path: output/vsearch/test.user.tsv + - path: output/vsearch/test.tsv md5sum: b6cc50f7c8d18cb82e74dab70ed4baab diff --git a/tests/modules/vsearch/usearchglobal/test.yml.ori b/tests/modules/vsearch/usearchglobal/test.yml.ori deleted file mode 100644 index df644165..00000000 --- a/tests/modules/vsearch/usearchglobal/test.yml.ori +++ /dev/null @@ -1,14 +0,0 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml vsearch/usearchglobal -- name: "vsearch usearchglobal" - command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config - tags: - - "vsearch" - # - - "vsearch/usearchglobal" - # - files: - - path: "output/vsearch/blast6out_results.tsv" - md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/vsearch/versions.yml - md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b From 2e16c90fce782bda854d2d638d0e216fc613ca39 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 09:57:05 +0200 Subject: [PATCH 44/65] Fix whitespace --- modules/vsearch/usearchglobal/main.nf | 2 +- modules/vsearch/usearchglobal/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index ed95b7c3..804ef223 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -26,7 +26,7 @@ process VSEARCH_USEARCHGLOBAL { tuple val(meta), path('*.txt') , optional: true, emit: txt tuple val(meta), path('*.uc') , optional: true, emit: uc path "versions.yml" , emit: versions - + when: task.ext.when == null || task.ext.when diff --git a/modules/vsearch/usearchglobal/meta.yml b/modules/vsearch/usearchglobal/meta.yml index 848fb65a..3b22e9cd 100644 --- a/modules/vsearch/usearchglobal/meta.yml +++ b/modules/vsearch/usearchglobal/meta.yml @@ -65,7 +65,7 @@ output: - tsv: type: file description: Results in tab-separated output, columns defined by user - pattern: "*.{tsv}" + pattern: "*.{tsv}" - txt: type: file description: Tab delimited results in blast-like tabular format From c67c15f243b6e590fb28275dbcc29f0d4ae6053c Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:01:06 +0200 Subject: [PATCH 45/65] Make input tuple --- modules/vsearch/usearchglobal/main.nf | 3 +-- tests/modules/vsearch/usearchglobal/main.nf | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 804ef223..88d945ea 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -8,8 +8,7 @@ process VSEARCH_USEARCHGLOBAL { 'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }" input: - val(meta) - path(queryfasta) + tuple val(meta), path(queryfasta) path db val idcutoff val outoption diff --git a/tests/modules/vsearch/usearchglobal/main.nf b/tests/modules/vsearch/usearchglobal/main.nf index f4afec32..90dc3191 100644 --- a/tests/modules/vsearch/usearchglobal/main.nf +++ b/tests/modules/vsearch/usearchglobal/main.nf @@ -11,7 +11,7 @@ workflow test_vsearch_usearchglobal { idcutoff = 0.985 outoption = "xcfert" // Nonsense text to check default case. columns = "" - VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [[id:'test'], query], db, idcutoff, outoption, columns ) } workflow test_vsearch_usearchglobal_userout { @@ -21,5 +21,5 @@ workflow test_vsearch_usearchglobal_userout { idcutoff = 0.985 outoption = "userout" columns = "query+target+id" - VSEARCH_USEARCHGLOBAL ( [id:'test'], query, db, idcutoff, outoption, columns ) + VSEARCH_USEARCHGLOBAL ( [[id:'test'], query], db, idcutoff, outoption, columns ) } From 69e00b55d39c2d4c1f4ef94fd5be972d8478c07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeanette=20T=C3=A5ngrot?= Date: Mon, 30 May 2022 13:03:45 +0200 Subject: [PATCH 46/65] Update modules/vsearch/usearchglobal/main.nf Co-authored-by: Daniel Straub <42973691+d4straub@users.noreply.github.com> --- modules/vsearch/usearchglobal/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vsearch/usearchglobal/main.nf b/modules/vsearch/usearchglobal/main.nf index 804ef223..01e379d2 100644 --- a/modules/vsearch/usearchglobal/main.nf +++ b/modules/vsearch/usearchglobal/main.nf @@ -47,7 +47,7 @@ process VSEARCH_USEARCHGLOBAL { default: outfmt = "--alnout"; out_ext = 'aln'; - log.warn("Unknown output file format provided (${outoption}): selectingpairwise alignments (alnout)"); + log.warn("Unknown output file format provided (${outoption}): selecting pairwise alignments (alnout)"); break } """ From 6aac5c2c4099f950f43f9db7fa3b4b639c4c7ffc Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:30:27 +0200 Subject: [PATCH 47/65] Update test --- tests/modules/vsearch/usearchglobal/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index 79bcd50e..a593f78f 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -5,7 +5,16 @@ - vsearch files: - path: output/vsearch/test.aln - md5sum: 2543c4147530dcb1ba4550d3fdb1502a + contains: + - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" + - "Query >lcl|MT192765.1_cds_QIK50427.1_2" + - "%Id TLen Target" + - "100% 29829 MT192765.1" + - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" + - "Target 29829nt >MT192765.1" + - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" + - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" + - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config From 6ae405c5dab57ca9ce3761bfd6f39d6bb8df9e20 Mon Sep 17 00:00:00 2001 From: jtangrot Date: Mon, 30 May 2022 13:35:12 +0200 Subject: [PATCH 48/65] prettier --- tests/modules/vsearch/usearchglobal/test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/modules/vsearch/usearchglobal/test.yml b/tests/modules/vsearch/usearchglobal/test.yml index a593f78f..227d728f 100644 --- a/tests/modules/vsearch/usearchglobal/test.yml +++ b/tests/modules/vsearch/usearchglobal/test.yml @@ -6,15 +6,15 @@ files: - path: output/vsearch/test.aln contains: - - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" - - "Query >lcl|MT192765.1_cds_QIK50427.1_2" - - "%Id TLen Target" - - "100% 29829 MT192765.1" - - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" - - "Target 29829nt >MT192765.1" - - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" - - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" - - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" + - "vsearch --usearch_global transcriptome.fasta --db genome.fasta --id 0.985 --threads 2 --alnout test.aln" + - "Query >lcl|MT192765.1_cds_QIK50427.1_2" + - "%Id TLen Target" + - "100% 29829 MT192765.1" + - "Query 3822nt >lcl|MT192765.1_cds_QIK50427.1_2" + - "Target 29829nt >MT192765.1" + - "Qry 21249 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21291" + - "Tgt 21506 + CAACAGAGTTGTTATTTCTAGTGATGTTCTTGTTAACAACTAA 21548" + - "21291 cols, 21290 ids (100.0%), 1 gaps (0.0%)" - name: vsearch usearchglobal test_vsearch_usearchglobal_userout command: nextflow run ./tests/modules/vsearch/usearchglobal -entry test_vsearch_usearchglobal_userout -c ./tests/config/nextflow.config -c ./tests/modules/vsearch/usearchglobal/nextflow.config From d463cd5dd676738e95363e46302918d366a6b6d2 Mon Sep 17 00:00:00 2001 From: Sebastien Guizard Date: Mon, 30 May 2022 17:26:51 +0100 Subject: [PATCH 49/65] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Remove=20last?= =?UTF-8?q?=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/bamtools/convert/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/bamtools/convert/meta.yml b/modules/bamtools/convert/meta.yml index 5796a4ab..dcd1cc65 100644 --- a/modules/bamtools/convert/meta.yml +++ b/modules/bamtools/convert/meta.yml @@ -42,7 +42,6 @@ output: type: file description: File containing software versions pattern: "versions.yml" - ## TODO nf-core: Delete / customise this example output - out: type: file description: The data in the asked format (bed, fasta, fastq, json, pileup, sam, yaml) From 723852bf3d3b12059b2f53da8bc055206f3019d7 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 13:38:18 +0200 Subject: [PATCH 50/65] Fixes running without shortreads, and also ensures all tests produce non-empty fastq.gz files --- modules/filtlong/main.nf | 2 +- tests/modules/filtlong/nextflow.config | 2 ++ tests/modules/filtlong/test.yml | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf index 0e6fdd53..67500053 100644 --- a/modules/filtlong/main.nf +++ b/modules/filtlong/main.nf @@ -20,7 +20,7 @@ process FILTLONG { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def short_reads = meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" """ filtlong \\ $short_reads \\ diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index 8730f1c4..ec9854c2 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -2,4 +2,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + ext.args = "--min_length 10" + } diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index dc5fa5a9..9c465303 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -1,23 +1,23 @@ - name: filtlong test_filtlong - command: nextflow run ./tests/modules/filtlong -entry test_filtlong -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed - name: filtlong test_filtlong_illumina_se - command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed - name: filtlong test_filtlong_illumina_pe - command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config tags: - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: 7029066c27ac6f5ef18d660d5741979a + md5sum: ff2b6e10fea0c45f10e8739a5bca25ed From 430def06faabbbbfe03da68661c329b85a1296ed Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 14:45:41 +0200 Subject: [PATCH 51/65] Switch from md5sum to string due to conda flakiness --- tests/modules/filtlong/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index 9c465303..93f847ec 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -4,7 +4,8 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" - name: filtlong test_filtlong_illumina_se command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config @@ -12,7 +13,8 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" - name: filtlong test_filtlong_illumina_pe command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config @@ -20,4 +22,5 @@ - filtlong files: - path: output/filtlong/test_lr_filtlong.fastq.gz - md5sum: ff2b6e10fea0c45f10e8739a5bca25ed + contains: + - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" From 51b0a6e4f3b048a1eebeb86896fa0374771ca554 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 31 May 2022 15:15:58 +0200 Subject: [PATCH 52/65] Added optional input of index files to bcftools/concat --- modules/bcftools/concat/main.nf | 2 +- modules/bcftools/concat/meta.yml | 5 +++++ tests/modules/bcftools/concat/main.nf | 18 +++++++++++++++--- tests/modules/bcftools/concat/test.yml | 15 ++++++++++++--- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/modules/bcftools/concat/main.nf b/modules/bcftools/concat/main.nf index c0633ef7..257ee36f 100644 --- a/modules/bcftools/concat/main.nf +++ b/modules/bcftools/concat/main.nf @@ -8,7 +8,7 @@ process BCFTOOLS_CONCAT { 'quay.io/biocontainers/bcftools:1.14--h88f3f91_0' }" input: - tuple val(meta), path(vcfs) + tuple val(meta), path(vcfs), path(tbi) output: tuple val(meta), path("*.gz"), emit: vcf diff --git a/modules/bcftools/concat/meta.yml b/modules/bcftools/concat/meta.yml index 3984276f..167dbe5a 100644 --- a/modules/bcftools/concat/meta.yml +++ b/modules/bcftools/concat/meta.yml @@ -25,6 +25,11 @@ input: description: | List containing 2 or more vcf files e.g. [ 'file1.vcf', 'file2.vcf' ] + - tbi: + type: files + description: | + List containing 2 or more index files (optional) + e.g. [ 'file1.tbi', 'file2.tbi' ] output: - meta: type: map diff --git a/tests/modules/bcftools/concat/main.nf b/tests/modules/bcftools/concat/main.nf index 8441d488..777dc5b8 100644 --- a/tests/modules/bcftools/concat/main.nf +++ b/tests/modules/bcftools/concat/main.nf @@ -4,13 +4,25 @@ nextflow.enable.dsl = 2 include { BCFTOOLS_CONCAT } from '../../../../modules/bcftools/concat/main.nf' -workflow test_bcftools_concat { +workflow test_bcftools_concat_tbi { input = [ [ id:'test3' ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ] + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) ] + ] + + BCFTOOLS_CONCAT ( input ) +} + +workflow test_bcftools_concat_no_tbi { + + input = [ [ id:'test3' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ], + [] ] - BCFTOOLS_CONCAT ( input ) } diff --git a/tests/modules/bcftools/concat/test.yml b/tests/modules/bcftools/concat/test.yml index 7d04ebc6..0d12badc 100644 --- a/tests/modules/bcftools/concat/test.yml +++ b/tests/modules/bcftools/concat/test.yml @@ -1,8 +1,17 @@ -- name: bcftools concat test_bcftools_concat - command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config +- name: bcftools concat test_bcftools_concat_tbi + command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config tags: - - bcftools/concat - bcftools + - bcftools/concat + files: + - path: output/bcftools/test3.vcf.gz + md5sum: 35c88bfaad20101062e98beb217d7137 + +- name: bcftools concat test_bcftools_concat_no_tbi + command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat_no_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config + tags: + - bcftools + - bcftools/concat files: - path: output/bcftools/test3.vcf.gz md5sum: 35c88bfaad20101062e98beb217d7137 From 5513d095f5240a0240cd327e3b86fa619819d3d4 Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen Date: Tue, 31 May 2022 15:37:26 +0200 Subject: [PATCH 53/65] Adding tbi-files to the output from GATK4_MERGEVCFS. #1709 --- modules/gatk4/mergevcfs/main.nf | 1 + modules/gatk4/mergevcfs/meta.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index 964c1a3b..35930a6e 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -13,6 +13,7 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi path "versions.yml" , emit: versions when: diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 8d4123d9..6110e944 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -35,6 +35,12 @@ output: type: file description: merged vcf file pattern: "*.vcf.gz" + - tbi: + type: file + description: index files for the merged vcf files + pattern: "*.tbi" + + - versions: type: file description: File containing software versions From 3e20ca7e9a0400b3d878e6c846a3b3733bfb867c Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:46:28 +0200 Subject: [PATCH 54/65] Don't hardcode forced output names --- tests/modules/filtlong/nextflow.config | 1 + tests/modules/filtlong/test.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index ec9854c2..f0b90e67 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,5 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" + ext.prefix = "${meta.id}_lr" } diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index 93f847ec..87bd491b 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -3,7 +3,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -12,7 +12,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -21,6 +21,6 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" From 089f761f0bf79c4a486f1df9b6205f650196a2c1 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:49:57 +0200 Subject: [PATCH 55/65] Actually add the changes --- modules/filtlong/main.nf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf index 67500053..9dbf05b2 100644 --- a/modules/filtlong/main.nf +++ b/modules/filtlong/main.nf @@ -11,7 +11,7 @@ process FILTLONG { tuple val(meta), path(shortreads), path(longreads) output: - tuple val(meta), path("${meta.id}_lr_filtlong.fastq.gz"), emit: reads + tuple val(meta), path("*.fastq.gz"), emit: reads path "versions.yml" , emit: versions when: @@ -21,12 +21,13 @@ process FILTLONG { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + if ("$longreads" == "${prefix}.fastq.gz") error "Longread FASTQ input and output names are the same, set prefix in module configuration to disambiguate!" """ filtlong \\ $short_reads \\ $args \\ $longreads \\ - | gzip -n > ${prefix}_lr_filtlong.fastq.gz + | gzip -n > ${prefix}.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": From 98bb45cf4e93801116d9435f2c1e644f91f0628d Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 13:59:56 +0000 Subject: [PATCH 56/65] Updating test for gatk4/mergevcfs --- tests/modules/gatk4/mergevcfs/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/modules/gatk4/mergevcfs/test.yml b/tests/modules/gatk4/mergevcfs/test.yml index da2f7578..eb43a184 100644 --- a/tests/modules/gatk4/mergevcfs/test.yml +++ b/tests/modules/gatk4/mergevcfs/test.yml @@ -6,6 +6,8 @@ files: - path: output/gatk4/test.vcf.gz md5sum: 5b289bda88d3a3504f2e19ee8cff177c + - path: output/gatk4/test.vcf.gz.tbi + md5sum: a81673763b13086cfce9a23e72a35a16 - path: output/gatk4/versions.yml - name: gatk4 mergevcfs test_gatk4_mergevcfs_no_dict From 80366924fdd0b0183cebe2258f25807db5b93c10 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 31 May 2022 16:08:13 +0200 Subject: [PATCH 57/65] added gatk4/composestrtablefile --- modules/gatk4/composestrtablefile/main.nf | 51 +++++++++++++++++++ modules/gatk4/composestrtablefile/meta.yml | 43 ++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ .../modules/gatk4/composestrtablefile/main.nf | 16 ++++++ .../gatk4/composestrtablefile/nextflow.config | 5 ++ .../gatk4/composestrtablefile/test.yml | 8 +++ 6 files changed, 127 insertions(+) create mode 100644 modules/gatk4/composestrtablefile/main.nf create mode 100644 modules/gatk4/composestrtablefile/meta.yml create mode 100644 tests/modules/gatk4/composestrtablefile/main.nf create mode 100644 tests/modules/gatk4/composestrtablefile/nextflow.config create mode 100644 tests/modules/gatk4/composestrtablefile/test.yml diff --git a/modules/gatk4/composestrtablefile/main.nf b/modules/gatk4/composestrtablefile/main.nf new file mode 100644 index 00000000..a1114f2a --- /dev/null +++ b/modules/gatk4/composestrtablefile/main.nf @@ -0,0 +1,51 @@ +process GATK4_COMPOSESTRTABLEFILE { + tag "$fasta" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.6.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" + + input: + tuple path(fasta), path(fasta_fai), path(dict) + + output: + path "*.zip" , emit: str_table + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + def avail_mem = 6 + if (!task.memory) { + log.info '[GATK ComposeSTRTableFile] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" ComposeSTRTableFile \\ + --reference $fasta \\ + --output ${fasta.baseName}.zip \\ + --tmp-dir . \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ + + stub: + """ + touch test.zip + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/composestrtablefile/meta.yml b/modules/gatk4/composestrtablefile/meta.yml new file mode 100644 index 00000000..eb825ef4 --- /dev/null +++ b/modules/gatk4/composestrtablefile/meta.yml @@ -0,0 +1,43 @@ +name: "gatk4_composestrtablefile" +description: This tool looks for low-complexity STR sequences along the reference that are later used to estimate the Dragstr model during single sample auto calibration CalibrateDragstrModel. +keywords: + - gatk4 + - composestrtablefile +tools: + - gatk4: + description: + Genome Analysis Toolkit (GATK4). Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools + with a primary focus on variant discovery and genotyping. Its powerful processing engine + and high-performance computing features make it capable of taking on projects of any size. + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/articles/4405451249819-ComposeSTRTableFile + tool_dev_url: https://github.com/broadinstitute/gatk + doi: 10.1158/1538-7445.AM2017-3590 + licence: ["Apache-2.0"] + +input: + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" + - fasta_fai: + type: file + description: index of the FASTA reference file + pattern: "*.fai" + - dict: + type: file + description: Sequence dictionary of the FASTA reference file + pattern: "*.dict" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - str_table: + type: file + description: A zipped folder containing the STR table files + pattern: "*.zip" + +authors: + - "@nvnieuwk" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3ff58b5c..bf4a6137 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -751,6 +751,10 @@ gatk4/combinegvcfs: - modules/gatk4/combinegvcfs/** - tests/modules/gatk4/combinegvcfs/** +gatk4/composestrtablefile: + - modules/gatk4/composestrtablefile/** + - tests/modules/gatk4/composestrtablefile/** + gatk4/createsequencedictionary: - modules/gatk4/createsequencedictionary/** - tests/modules/gatk4/createsequencedictionary/** diff --git a/tests/modules/gatk4/composestrtablefile/main.nf b/tests/modules/gatk4/composestrtablefile/main.nf new file mode 100644 index 00000000..9fc2e5f5 --- /dev/null +++ b/tests/modules/gatk4/composestrtablefile/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_COMPOSESTRTABLEFILE } from '../../../../modules/gatk4/composestrtablefile/main.nf' + +workflow test_gatk4_composestrtablefile { + + input = [ + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + ] + + GATK4_COMPOSESTRTABLEFILE ( input ) +} diff --git a/tests/modules/gatk4/composestrtablefile/nextflow.config b/tests/modules/gatk4/composestrtablefile/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/gatk4/composestrtablefile/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/gatk4/composestrtablefile/test.yml b/tests/modules/gatk4/composestrtablefile/test.yml new file mode 100644 index 00000000..3bafb348 --- /dev/null +++ b/tests/modules/gatk4/composestrtablefile/test.yml @@ -0,0 +1,8 @@ +- name: gatk4 composestrtablefile test_gatk4_composestrtablefile + command: nextflow run ./tests/modules/gatk4/composestrtablefile -entry test_gatk4_composestrtablefile -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/composestrtablefile/nextflow.config + tags: + - gatk4/composestrtablefile + - gatk4 + files: + - path: output/gatk4/genome.zip + contains: "[ # TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead ]" From ec41ea6082fcfaadcb8a6a4f02979144de86cd91 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 31 May 2022 16:12:05 +0200 Subject: [PATCH 58/65] fix test.yml --- tests/modules/gatk4/composestrtablefile/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/modules/gatk4/composestrtablefile/test.yml b/tests/modules/gatk4/composestrtablefile/test.yml index 3bafb348..514ae79c 100644 --- a/tests/modules/gatk4/composestrtablefile/test.yml +++ b/tests/modules/gatk4/composestrtablefile/test.yml @@ -1,8 +1,7 @@ - name: gatk4 composestrtablefile test_gatk4_composestrtablefile command: nextflow run ./tests/modules/gatk4/composestrtablefile -entry test_gatk4_composestrtablefile -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/composestrtablefile/nextflow.config tags: - - gatk4/composestrtablefile - gatk4 + - gatk4/composestrtablefile files: - - path: output/gatk4/genome.zip - contains: "[ # TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead ]" + - path: output/gatk4/genome.zip \ No newline at end of file From 1166fb51505b39983af8ee16ecb382222eec22bb Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 31 May 2022 16:13:38 +0200 Subject: [PATCH 59/65] prettier --- tests/modules/gatk4/composestrtablefile/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/gatk4/composestrtablefile/test.yml b/tests/modules/gatk4/composestrtablefile/test.yml index 514ae79c..597ae144 100644 --- a/tests/modules/gatk4/composestrtablefile/test.yml +++ b/tests/modules/gatk4/composestrtablefile/test.yml @@ -4,4 +4,4 @@ - gatk4 - gatk4/composestrtablefile files: - - path: output/gatk4/genome.zip \ No newline at end of file + - path: output/gatk4/genome.zip From 4199a05aeb0ec277d40cb112949bb85893310873 Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 15:34:34 +0000 Subject: [PATCH 60/65] Removing redundant empty line --- modules/gatk4/mergevcfs/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 6110e944..3ebce0b9 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -40,7 +40,6 @@ output: description: index files for the merged vcf files pattern: "*.tbi" - - versions: type: file description: File containing software versions From df22cd80df8bee4d3f1d5750026c26c560be7392 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 20:07:52 +0200 Subject: [PATCH 61/65] Fix config for tests --- tests/modules/filtlong/nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index f0b90e67..5e4c9fbb 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,6 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" - ext.prefix = "${meta.id}_lr" + ext.prefix = "test_lr" } From 5b74a179c3323d683065e820b2fb5a80fdaedcb7 Mon Sep 17 00:00:00 2001 From: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:14:08 +0200 Subject: [PATCH 62/65] Update modules/gatk4/composestrtablefile/main.nf Co-authored-by: FriederikeHanssen --- modules/gatk4/composestrtablefile/main.nf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gatk4/composestrtablefile/main.nf b/modules/gatk4/composestrtablefile/main.nf index a1114f2a..dae61166 100644 --- a/modules/gatk4/composestrtablefile/main.nf +++ b/modules/gatk4/composestrtablefile/main.nf @@ -8,7 +8,9 @@ process GATK4_COMPOSESTRTABLEFILE { 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: - tuple path(fasta), path(fasta_fai), path(dict) + path(fasta) + path(fasta_fai) + path(dict) output: path "*.zip" , emit: str_table From d4f3df4677fb0aff66db16c896e59fc4ef93a01b Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 1 Jun 2022 09:17:05 +0200 Subject: [PATCH 63/65] Updated the test --- tests/modules/gatk4/composestrtablefile/main.nf | 14 ++++++++++---- tests/modules/gatk4/composestrtablefile/test.yml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/modules/gatk4/composestrtablefile/main.nf b/tests/modules/gatk4/composestrtablefile/main.nf index 9fc2e5f5..da8967cc 100644 --- a/tests/modules/gatk4/composestrtablefile/main.nf +++ b/tests/modules/gatk4/composestrtablefile/main.nf @@ -6,11 +6,17 @@ include { GATK4_COMPOSESTRTABLEFILE } from '../../../../modules/gatk4/composestr workflow test_gatk4_composestrtablefile { - input = [ - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true), + fasta = [ + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + + fasta_fai = [ + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + + dict = [ file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] - GATK4_COMPOSESTRTABLEFILE ( input ) + GATK4_COMPOSESTRTABLEFILE ( fasta, fasta_fai, dict ) } diff --git a/tests/modules/gatk4/composestrtablefile/test.yml b/tests/modules/gatk4/composestrtablefile/test.yml index 597ae144..0a87372a 100644 --- a/tests/modules/gatk4/composestrtablefile/test.yml +++ b/tests/modules/gatk4/composestrtablefile/test.yml @@ -1,7 +1,7 @@ - name: gatk4 composestrtablefile test_gatk4_composestrtablefile command: nextflow run ./tests/modules/gatk4/composestrtablefile -entry test_gatk4_composestrtablefile -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/composestrtablefile/nextflow.config tags: - - gatk4 - gatk4/composestrtablefile + - gatk4 files: - path: output/gatk4/genome.zip From 8470f3cb7e790701401523c58a72e183ac47ecac Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 1 Jun 2022 09:20:20 +0200 Subject: [PATCH 64/65] linting --- tests/modules/gatk4/composestrtablefile/main.nf | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/modules/gatk4/composestrtablefile/main.nf b/tests/modules/gatk4/composestrtablefile/main.nf index da8967cc..8fccadb9 100644 --- a/tests/modules/gatk4/composestrtablefile/main.nf +++ b/tests/modules/gatk4/composestrtablefile/main.nf @@ -6,17 +6,11 @@ include { GATK4_COMPOSESTRTABLEFILE } from '../../../../modules/gatk4/composestr workflow test_gatk4_composestrtablefile { - fasta = [ - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - fasta_fai = [ - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] + fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - dict = [ - file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - ] + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) GATK4_COMPOSESTRTABLEFILE ( fasta, fasta_fai, dict ) } From 114a54c8d5a8e898a126c2804e3e221286eb2682 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 1 Jun 2022 09:22:09 +0200 Subject: [PATCH 65/65] spaces fix --- modules/gatk4/composestrtablefile/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gatk4/composestrtablefile/main.nf b/modules/gatk4/composestrtablefile/main.nf index dae61166..8f2f00f2 100644 --- a/modules/gatk4/composestrtablefile/main.nf +++ b/modules/gatk4/composestrtablefile/main.nf @@ -8,9 +8,9 @@ process GATK4_COMPOSESTRTABLEFILE { 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: - path(fasta) - path(fasta_fai) - path(dict) + path(fasta) + path(fasta_fai) + path(dict) output: path "*.zip" , emit: str_table