diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index f1122ea3..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -name: Bug report -about: Report something that is broken or incorrect -title: "[BUG]" ---- - - - -## Check Documentation - -I have checked the following places for your error: - -- [ ] [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) -- [ ] [nf-core/module documentation](https://github.com/nf-core/modules/blob/master/README.md) - -## Description of the bug - - - -## Steps to reproduce - -Steps to reproduce the behaviour: - -1. Command line: -2. See error: - -## Expected behaviour - - - -## Log files - -Have you provided the following extra information/files: - -- [ ] The command used to run the module -- [ ] The `.nextflow.log` file - -## System - -- Hardware: -- Executor: -- OS: -- Version - -## Nextflow Installation - -- Version: - -## Container engine - -- Engine: -- version: -- Image tag: - -## Additional context - - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..74907cfe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,52 @@ +name: Bug report +description: Report something that is broken or incorrect +labels: bug +body: + - type: checkboxes + attributes: + label: Have you checked the docs? + description: I have checked the following places for my error + options: + - label: "[nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting)" + required: true + - label: "[nf-core modules documentation](https://nf-co.re/docs/contributing/modules)" + required: true + + - type: textarea + id: description + attributes: + label: Description of the bug + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + id: command_used + attributes: + label: Command used and terminal output + description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal. + render: console + placeholder: | + $ nextflow run ... + + Some output where something broke + + - type: textarea + id: files + attributes: + label: Relevant files + description: | + Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed. + Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files. + + - type: textarea + id: system + attributes: + label: System information + description: | + * Nextflow version _(eg. 21.10.3)_ + * Hardware _(eg. HPC, Desktop, Cloud)_ + * Executor _(eg. slurm, local, awsbatch)_ + * Container engine and version: _(e.g. Docker 1.0.0, Singularity, Conda, Podman, Shifter or Charliecloud)_ + * OS and version: _(eg. CentOS Linux, macOS, Ubuntu 22.04)_ + * Image tag: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 72d6c058..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for nf-core/modules -title: "[FEATURE]" ---- - - - -## Is your feature request related to a problem? Please describe - - - - - -## Describe the solution you'd like - - - -## Describe alternatives you've considered - - - -## Additional context - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..316fba90 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,32 @@ +name: Feature request +description: Suggest an idea for nf-core/modules +labels: feature +title: "[FEATURE]" +body: + - type: textarea + id: description + attributes: + label: Is your feature request related to a problem? Please describe + description: A clear and concise description of what the bug is. + placeholder: | + + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of the solution you want to happen. + + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + + - type: textarea + id: additional_context + attributes: + label: Additional context + description: Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/new_module.md b/.github/ISSUE_TEMPLATE/new_module.md deleted file mode 100644 index 5c7e61cc..00000000 --- a/.github/ISSUE_TEMPLATE/new_module.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: New module -about: Suggest a new module for nf-core/modules -title: "new module: TOOL/SUBTOOL" -label: new module ---- - - - -I think it would be good to have a module for [TOOL](https://bioconda.github.io/recipes/TOOL/README.html) - -- [ ] This module does not exist yet with the [`nf-core modules list`](https://github.com/nf-core/tools#list-modules) command -- [ ] There is no [open pull request](https://github.com/nf-core/modules/pulls) for this module -- [ ] There is no [open issue](https://github.com/nf-core/modules/issues) for this module -- [ ] If I'm planning to work on this module, I added myself to the `Assignees` to facilitate tracking who is working on the module diff --git a/.github/ISSUE_TEMPLATE/new_module.yml b/.github/ISSUE_TEMPLATE/new_module.yml new file mode 100644 index 00000000..2d3e9d47 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_module.yml @@ -0,0 +1,36 @@ +name: New module +description: Suggest a new module for nf-core/modules +title: "new module: TOOL/SUBTOOL" +labels: new module +body: + - type: checkboxes + attributes: + label: Is there an existing module for this? + description: This module does not exist yet with the [`nf-core modules list`](https://github.com/nf-core/tools#list-modules) command + options: + - label: I have searched for the existing module + required: true + + - type: checkboxes + attributes: + label: Is there an open PR for this? + description: There is no [open pull request](https://github.com/nf-core/modules/pulls) for this module + options: + - label: I have searched for existing PRs + required: true + + - type: checkboxes + attributes: + label: Is there an open issue for this? + description: There is no [open issue](https://github.com/nf-core/modules/issues) for this module + options: + - label: I have searched for existing issues + required: true + + - type: checkboxes + attributes: + label: Are you going to work on this? + description: If I'm planning to work on this module, I added myself to the `Assignees` to facilitate tracking who is working on the module + options: + - label: If I'm planning to work on this module, I added myself to the `Assignees` to facilitate tracking who is working on the module + required: false diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf new file mode 100644 index 00000000..fb003a30 --- /dev/null +++ b/modules/antismash/antismashlite/main.nf @@ -0,0 +1,68 @@ +process ANTISMASH_ANTISMASHLITE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::antismash-lite=6.0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/antismash-lite:6.0.1--pyhdfd78af_1' : + 'quay.io/biocontainers/antismash-lite:6.0.1--pyhdfd78af_1' }" + + containerOptions { + workflow.containerEngine == 'singularity' ? + "-B $antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : + workflow.containerEngine == 'docker' ? + "-v \$PWD/$antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : + '' + } + + input: + tuple val(meta), path(sequence_input) + path(databases) + path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). + path(gff) + + output: + tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file + tuple val(meta), path("${prefix}/{css,images,js}") , emit: html_accessory_files + tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html") , optional: true, emit: knownclusterblast_html + tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt") , optional: true, emit: knownclusterblast_txt + tuple val(meta), path("${prefix}/svg/clusterblast*.svg") , optional: true, emit: svg_files_clusterblast + tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg") , optional: true, emit: svg_files_knownclusterblast + tuple val(meta), path("${prefix}/*.gbk") , emit: gbk_input + tuple val(meta), path("${prefix}/*.json") , emit: json_results + tuple val(meta), path("${prefix}/*.log") , emit: log + tuple val(meta), path("${prefix}/*.zip") , emit: zip + tuple val(meta), path("${prefix}/*region*.gbk") , emit: gbk_results + tuple val(meta), path("${prefix}/clusterblastoutput.txt") , optional: true, emit: clusterblastoutput + tuple val(meta), path("${prefix}/index.html") , emit: html + tuple val(meta), path("${prefix}/knownclusterblastoutput.txt") , optional: true, emit: knownclusterblastoutput + tuple val(meta), path("${prefix}/regions.js") , emit: json_sideloading + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" + gff_flag = "--genefinding-gff3 ${gff}" + + """ + ## We specifically do not include annotations (--genefinding-tool none) as + ## this should be run as a separate module for versioning purposes + antismash \\ + $args \\ + $gff_flag \\ + -c $task.cpus \\ + --output-dir $prefix \\ + --genefinding-tool none \\ + --logfile $prefix/${prefix}.log \\ + --databases $databases \\ + $sequence_input + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + antismash-lite: \$(antismash --version | sed 's/antiSMASH //') + END_VERSIONS + """ +} diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml new file mode 100644 index 00000000..b3e8564e --- /dev/null +++ b/modules/antismash/antismashlite/meta.yml @@ -0,0 +1,128 @@ +name: antismash_antismashlite +description: | + antiSMASH allows the rapid genome-wide identification, annotation + and analysis of secondary metabolite biosynthesis gene clusters. +keywords: + - secondary metabolites + - BGC + - biosynthetic gene cluster + - genome mining + - NRPS + - RiPP + - antibiotics + - prokaryotes + - bacteria + - eukaryotes + - fungi + - antismash + +tools: + - antismashlite: + description: "antiSMASH - the antibiotics and Secondary Metabolite Analysis SHell" + homepage: "https://docs.antismash.secondarymetabolites.org" + documentation: "https://docs.antismash.secondarymetabolites.org" + tool_dev_url: "https://github.com/antismash/antismash" + doi: "10.1093/nar/gkab335" + licence: "['AGPL v3']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - sequence_input: + type: file + description: nucleotide sequence file (annotated) + pattern: "*.{gbk, gb, gbff, genbank, embl, fasta, fna}" + - databases: + type: directory + description: downloaded AntiSMASH databases e.g. data/databases + pattern: "*/" + - antismash_dir: + type: directory + description: | + A local copy of an AntiSMASH installation folder. This is required when running with + docker and singularity (not required for conda), due to attempted 'modifications' of + files during database checks in the installation directory, something that cannot + be done in immutable docker/singularity containers. Therefore, a local installation + directory needs to be mounted (including all modified files from the downloading step) + to the container as a workaround. + pattern: "*/" + - gff: + type: file + pattern: "*.gff" + +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" + - clusterblast_file: + type: file + description: Output of ClusterBlast algorithm + pattern: "clusterblast/*_c*.txt" + - html_accessory_files: + type: directory + description: Accessory files for the HTML output + pattern: "{css/,images/,js/}" + - knownclusterblast_html: + type: file + description: Tables with MIBiG hits in HTML format + pattern: "knownclusterblast/region*/ctg*.html" + - knownclusterblast_txt: + type: file + description: Tables with MIBiG hits + pattern: "knownclusterblast/*_c*.txt" + - svg_files_clusterblast: + type: file + description: SVG images showing the % identity of the aligned hits against their queries + pattern: "svg/clusterblast*.svg" + - svg_files_knownclusterblast: + type: file + description: SVG images showing the % identity of the aligned hits against their queries + pattern: "svg/knownclusterblast*.svg" + - gbk_input: + type: file + description: Nucleotide sequence and annotations in GenBank format; converted from input file + pattern: "*.gbk" + - json_results: + type: file + description: Nucleotide sequence and annotations in JSON format; converted from GenBank file (gbk_input) + pattern: "*.json" + - log: + type: file + description: Contains all the logging output that antiSMASH produced during its run + pattern: "*.log" + - zip: + type: file + description: Contains a compressed version of the output folder in zip format + pattern: "*.zip" + - gbk_results: + type: file + description: Nucleotide sequence and annotations in GenBank format; one file per antiSMASH hit + pattern: "*region*.gbk" + - clusterblastoutput: + type: file + description: Raw BLAST output of known clusters previously predicted by antiSMASH using the built-in ClusterBlast algorithm + pattern: "clusterblastoutput.txt" + - html: + type: file + description: Graphical web view of results in HTML format + patterN: "index.html" + - knownclusterblastoutput: + type: file + description: Raw BLAST output of known clusters of the MIBiG database + pattern: "knownclusterblastoutput.txt" + - json_sideloading: + type: file + description: Sideloaded annotations of protoclusters and/or subregions (see antiSMASH documentation "Annotation sideloading") + pattern: "regions.js" + +authors: + - "@jasmezz" diff --git a/modules/antismash/antismashlitedownloaddatabases/main.nf b/modules/antismash/antismashlitedownloaddatabases/main.nf index 1853d80a..a0928333 100644 --- a/modules/antismash/antismashlitedownloaddatabases/main.nf +++ b/modules/antismash/antismashlitedownloaddatabases/main.nf @@ -7,8 +7,9 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { 'quay.io/biocontainers/antismash-lite:6.0.1--pyhdfd78af_1' }" /* - These files are normally downloaded by download-antismash-databases itself, and must be retrieved for input by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. This is solely for use for CI tests of the nf-core/module version of antiSMASH. + These files are normally downloaded/created by download-antismash-databases itself, and must be retrieved for input by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. This is solely for use for CI tests of the nf-core/module version of antiSMASH. Reason: Upon execution, the tool checks if certain database files are present within the container and if not, it tries to create them in /usr/local/bin, for which only root user has write permissions. Mounting those database files with this module prevents the tool from trying to create them. + These files are also emitted as output channels in this module to enable the antismash-lite module to use them as mount volumes to the docker/singularity containers. */ containerOptions { @@ -26,6 +27,7 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { output: path("antismash_db") , emit: database + path("antismash_dir"), emit: antismash_dir path "versions.yml", emit: versions when: @@ -33,14 +35,22 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { script: def args = task.ext.args ?: '' + conda = params.enable_conda """ download-antismash-databases \\ --database-dir antismash_db \\ $args + if [[ $conda = false ]]; \ + then \ + cp -r /usr/local/lib/python3.8/site-packages/antismash antismash_dir; \ + else \ + cp -r \$(python -c 'import antismash;print(antismash.__file__.split("/__")[0])') antismash_dir; \ + fi + cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash: \$(antismash --version | sed 's/antiSMASH //') + antismash-lite: \$(antismash --version | sed 's/antiSMASH //') END_VERSIONS """ } diff --git a/modules/antismash/antismashlitedownloaddatabases/meta.yml b/modules/antismash/antismashlitedownloaddatabases/meta.yml index ad393bae..f7ddf3b0 100644 --- a/modules/antismash/antismashlitedownloaddatabases/meta.yml +++ b/modules/antismash/antismashlitedownloaddatabases/meta.yml @@ -27,17 +27,17 @@ input: - database_css: type: directory description: | - antismash/outputs/html/css folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + antismash/outputs/html/css folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. pattern: "css" - database_detection: type: directory description: | - antismash/detection folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + antismash/detection folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. pattern: "detection" - database_modules: type: directory description: | - antismash/modules folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + antismash/modules folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. pattern: "modules" output: @@ -50,6 +50,11 @@ output: type: directory description: Download directory for antiSMASH databases pattern: "antismash_db" + - antismash_dir: + type: directory + description: | + antismash installation folder which is being modified during the antiSMASH database downloading step. The modified files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database and installation folder in pipelines. + pattern: "antismash_dir" authors: - "@jasmezz" diff --git a/modules/arriba/main.nf b/modules/arriba/main.nf index e0d30b45..b7883acd 100644 --- a/modules/arriba/main.nf +++ b/modules/arriba/main.nf @@ -2,15 +2,20 @@ process ARRIBA { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::arriba=2.1.0" : null) + conda (params.enable_conda ? "bioconda::arriba=2.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/arriba:2.1.0--h3198e80_1' : - 'quay.io/biocontainers/arriba:2.1.0--h3198e80_1' }" + 'https://depot.galaxyproject.org/singularity/arriba:2.2.1--hecb563c_2' : + 'quay.io/biocontainers/arriba:2.2.1--hecb563c_2' }" input: tuple val(meta), path(bam) path fasta path gtf + path blacklist + path known_fusions + path structural_variants + path tags + path protein_domains output: tuple val(meta), path("*.fusions.tsv") , emit: fusions @@ -23,7 +28,12 @@ process ARRIBA { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def blacklist = (args.contains('-b')) ? '' : '-f blacklist' + def blacklist = blacklist ? "-b $blacklist" : "-f blacklist" + def known_fusions = known_fusions ? "-k $known_fusions" : "" + def structural_variants = structural_variants ? "-d $structual_variants" : "" + def tags = tags ? "-t $tags" : "" + def protein_domains = protein_domains ? "-p $protein_domains" : "" + """ arriba \\ -x $bam \\ @@ -32,6 +42,10 @@ process ARRIBA { -o ${prefix}.fusions.tsv \\ -O ${prefix}.fusions.discarded.tsv \\ $blacklist \\ + $known_fusions \\ + $structural_variants \\ + $tags \\ + $protein_domains \\ $args cat <<-END_VERSIONS > versions.yml @@ -39,4 +53,14 @@ process ARRIBA { arriba: \$(arriba -h | grep 'Version:' 2>&1 | sed 's/Version:\s//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo stub > ${prefix}.fusions.tsv + echo stub > ${prefix}.fusions.discarded.tsv + + echo "${task.process}:" > versions.yml + echo ' arriba: 2.2.1' >> versions.yml + """ } diff --git a/modules/arriba/meta.yml b/modules/arriba/meta.yml index 4bde2f08..119dd912 100644 --- a/modules/arriba/meta.yml +++ b/modules/arriba/meta.yml @@ -30,6 +30,26 @@ input: type: file description: Annotation GTF file pattern: "*.{gtf}" + - blacklist: + type: file + description: Blacklist file + pattern: "*.{tsv}" + - known_fusions: + type: file + description: Known fusions file + pattern: "*.{tsv}" + - structural_variants: + type: file + description: Structural variants file + pattern: "*.{tsv}" + - tags: + type: file + description: Tags file + pattern: "*.{tsv}" + - protein_domains: + type: file + description: Protein domains file + pattern: "*.{gff3}" output: - meta: @@ -51,4 +71,4 @@ output: pattern: "*.{fusions.discarded.tsv}" authors: - - "@praveenraj2018" + - "@praveenraj2018,@rannick" diff --git a/modules/bamtools/split/main.nf b/modules/bamtools/split/main.nf index 014e5cdb..aaa5b663 100644 --- a/modules/bamtools/split/main.nf +++ b/modules/bamtools/split/main.nf @@ -2,10 +2,10 @@ process BAMTOOLS_SPLIT { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::bamtools=2.5.1" : null) + conda (params.enable_conda ? "bioconda::bamtools=2.5.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bamtools:2.5.1--h9a82719_9' : - 'quay.io/biocontainers/bamtools:2.5.1--h9a82719_9' }" + 'https://depot.galaxyproject.org/singularity/bamtools:2.5.2--hd03093a_0' : + 'quay.io/biocontainers/bamtools:2.5.2--hd03093a_0' }" input: tuple val(meta), path(bam) @@ -20,11 +20,15 @@ process BAMTOOLS_SPLIT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def input_list = bam.collect{"-in $it"}.join(' ') """ bamtools \\ - split \\ - -in $bam \\ - $args + merge \\ + $input_list \\ + | bamtools \\ + split \\ + -stub $prefix \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/bamtools/split/meta.yml b/modules/bamtools/split/meta.yml index 0e848212..8af701f0 100644 --- a/modules/bamtools/split/meta.yml +++ b/modules/bamtools/split/meta.yml @@ -23,7 +23,7 @@ input: e.g. [ id:'test', single_end:false ] - bam: type: file - description: A BAM file to split + description: A list of one or more BAM files to merge and then split pattern: "*.bam" output: @@ -43,3 +43,4 @@ output: authors: - "@sguizard" + - "@matthdsm" diff --git a/modules/bedtools/split/main.nf b/modules/bedtools/split/main.nf new file mode 100644 index 00000000..86054292 --- /dev/null +++ b/modules/bedtools/split/main.nf @@ -0,0 +1,38 @@ +process BEDTOOLS_SPLIT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--h468198e_3': + 'quay.io/biocontainers/bedtools:2.30.0--h7d7f7ad_2' }" + + input: + tuple val(meta), path(bed) + val(number_of_files) + + output: + tuple val(meta), path("*.bed"), emit: beds + 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}" + + """ + bedtools \\ + split \\ + $args \\ + -i $bed \\ + -p $prefix \\ + -n $number_of_files + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS + """ +} diff --git a/modules/bedtools/split/meta.yml b/modules/bedtools/split/meta.yml new file mode 100644 index 00000000..1f41cc70 --- /dev/null +++ b/modules/bedtools/split/meta.yml @@ -0,0 +1,41 @@ +name: "bedtools_split" +description: Split BED files into several smaller BED files +keywords: + - sort +tools: + - "bedtools": + description: "A powerful toolset for genome arithmetic" + documentation: "https://bedtools.readthedocs.io/en/latest/content/tools/sort.html" + licence: "['MIT', 'GPL v2']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - bed: + type: value + description: The number of files to split the BED into + +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" + - beds: + type: file + description: list of split BED files + pattern: "*.bed" + +authors: + - "@nvnieuwk" diff --git a/modules/biobambam/bammerge/main.nf b/modules/biobambam/bammerge/main.nf new file mode 100644 index 00000000..75040903 --- /dev/null +++ b/modules/biobambam/bammerge/main.nf @@ -0,0 +1,38 @@ +process BIOBAMBAM_BAMMERGE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::biobambam=2.0.183" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/biobambam:2.0.183--h9f5acd7_1': + 'quay.io/biocontainers/biobambam:2.0.183--h9f5acd7_1' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("${prefix}.bam") ,emit: bam + tuple val(meta), path("*.bai") ,optional:true, emit: bam_index + tuple val(meta), path("*.md5") ,optional:true, emit: checksum + path "versions.yml" ,emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input_string = bam.join(" I=") + + """ + bammerge \\ + I=${input_string} \\ + $args \\ + > ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bammerge: \$( bammerge --version |& sed '1!d; s/.*version //; s/.\$//' ) + END_VERSIONS + """ +} diff --git a/modules/biobambam/bammerge/meta.yml b/modules/biobambam/bammerge/meta.yml new file mode 100644 index 00000000..9dbe24bc --- /dev/null +++ b/modules/biobambam/bammerge/meta.yml @@ -0,0 +1,46 @@ +name: biobambam_bammerge +description: Merge a list of sorted bam files +keywords: + - merge + - bam +tools: + - biobambam: + description: | + biobambam is a set of tools for early stage alignment file processing. + homepage: https://gitlab.com/german.tischler/biobambam2 + documentation: https://gitlab.com/german.tischler/biobambam2/-/blob/master/README.md + doi: 10.1186/1751-0473-9-13 + licence: ["GPL v3"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: List containing 1 or more bam files +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Merged BAM file + pattern: "*.bam" + - bam_index: + type: file + description: BAM index file + pattern: "*" + - checksum: + type: file + description: Checksum file + pattern: "*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@matthdsm" diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index 44ce76ca..c74e376f 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -1,77 +1,71 @@ process BOWTIE2_ALIGN { tag "$meta.id" - label 'process_high' + label "process_high" - conda (params.enable_conda ? 'bioconda::bowtie2=2.4.4 bioconda::samtools=1.15.1 conda-forge::pigz=2.6' : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0' : - 'quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0' }" + conda (params.enable_conda ? "bioconda::bowtie2=2.4.4 bioconda::samtools=1.15.1 conda-forge::pigz=2.6" : null) + container "${ workflow.containerEngine == "singularity" && !task.ext.singularity_pull_docker_container ? + "https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0" : + "quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0" }" input: tuple val(meta), path(reads) path index val save_unaligned + val sort_bam output: - tuple val(meta), path('*.bam') , emit: bam - tuple val(meta), path('*.log') , emit: log - tuple val(meta), path('*fastq.gz'), emit: fastq, optional:true + tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.log") , emit: log + tuple val(meta), path("*fastq.gz"), emit: fastq, optional:true path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def args2 = task.ext.args2 ?: '' + def args = task.ext.args ?: "" + def args2 = task.ext.args2 ?: "" def prefix = task.ext.prefix ?: "${meta.id}" + + def unaligned = "" + def reads_args = "" if (meta.single_end) { - def unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' - """ - INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'` - bowtie2 \\ - -x \$INDEX \\ - -U $reads \\ - --threads $task.cpus \\ - $unaligned \\ - $args \\ - 2> ${prefix}.bowtie2.log \\ - | samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam - - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) - END_VERSIONS - """ + unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : "" + reads_args = "-U ${reads}" } else { - def unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' - """ - INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'` - bowtie2 \\ - -x \$INDEX \\ - -1 ${reads[0]} \\ - -2 ${reads[1]} \\ - --threads $task.cpus \\ - $unaligned \\ - $args \\ - 2> ${prefix}.bowtie2.log \\ - | samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam - - - if [ -f ${prefix}.unmapped.fastq.1.gz ]; then - mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz - fi - if [ -f ${prefix}.unmapped.fastq.2.gz ]; then - mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz - fi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) - END_VERSIONS - """ + unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : "" + reads_args = "-1 ${reads[0]} -2 ${reads[1]}" } + + def samtools_command = sort_bam ? 'sort' : 'view' + + """ + INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/.rev.1.bt2//"` + [ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed "s/.rev.1.bt2l//"` + [ -z "\$INDEX" ] && echo "Bowtie2 index files not found" 1>&2 && exit 1 + + bowtie2 \\ + -x \$INDEX \\ + $reads_args \\ + --threads $task.cpus \\ + $unaligned \\ + $args \\ + 2> ${prefix}.bowtie2.log \\ + | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - + + if [ -f ${prefix}.unmapped.fastq.1.gz ]; then + mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz + fi + + if [ -f ${prefix}.unmapped.fastq.2.gz ]; then + mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz + fi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ } diff --git a/modules/bowtie2/align/meta.yml b/modules/bowtie2/align/meta.yml index f80421ec..c99fa4e3 100644 --- a/modules/bowtie2/align/meta.yml +++ b/modules/bowtie2/align/meta.yml @@ -29,6 +29,15 @@ input: type: file description: Bowtie2 genome index files pattern: "*.ebwt" + - save_unaligned: + type: boolean + description: | + Save reads that do not map to the reference (true) or discard them (false) + (default: false) + - sort_bam: + type: boolean + description: use samtools sort (true) or samtools view (false) + pattern: "true or false" output: - bam: type: file diff --git a/modules/busco/main.nf b/modules/busco/main.nf new file mode 100644 index 00000000..f0713862 --- /dev/null +++ b/modules/busco/main.nf @@ -0,0 +1,84 @@ +process BUSCO { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::busco=5.3.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/busco:5.3.2--pyhdfd78af_0': + 'quay.io/biocontainers/busco:5.3.2--pyhdfd78af_0' }" + + input: + tuple val(meta), path('tmp_input/*') + each lineage // Required: lineage to check against, "auto" enables --auto-lineage instead + path busco_lineages_path // Recommended: path to busco lineages - downloads if not set + path config_file // Optional: busco configuration file + + output: + tuple val(meta), path("*-busco.batch_summary.txt"), emit: batch_summary + tuple val(meta), path("short_summary.*.txt") , emit: short_summaries_txt, optional: true + tuple val(meta), path("short_summary.*.json") , emit: short_summaries_json, optional: true + tuple val(meta), path("*-busco") , emit: busco_dir + 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}-${lineage}" + def busco_config = config_file ? "--config $config_file" : '' + def busco_lineage = lineage.equals('auto') ? '--auto-lineage' : "--lineage_dataset ${lineage}" + def busco_lineage_dir = busco_lineages_path ? "--offline --download_path ${busco_lineages_path}" : '' + """ + # Nextflow changes the container --entrypoint to /bin/bash (container default entrypoint: /usr/local/env-execute) + # Check for container variable initialisation script and source it. + if [ -f "/usr/local/env-activate.sh" ]; then + set +u # Otherwise, errors out because of various unbound variables + . "/usr/local/env-activate.sh" + set -u + fi + + # If the augustus config directory is not writable, then copy to writeable area + if [ ! -w "\${AUGUSTUS_CONFIG_PATH}" ]; then + # Create writable tmp directory for augustus + AUG_CONF_DIR=\$( mktemp -d -p \$PWD ) + cp -r \$AUGUSTUS_CONFIG_PATH/* \$AUG_CONF_DIR + export AUGUSTUS_CONFIG_PATH=\$AUG_CONF_DIR + echo "New AUGUSTUS_CONFIG_PATH=\${AUGUSTUS_CONFIG_PATH}" + fi + + # Ensure the input is uncompressed + INPUT_SEQS=input_seqs + mkdir "\$INPUT_SEQS" + cd "\$INPUT_SEQS" + for FASTA in ../tmp_input/*; do + if [ "\${FASTA##*.}" == 'gz' ]; then + gzip -cdf "\$FASTA" > \$( basename "\$FASTA" .gz ) + else + ln -s "\$FASTA" . + fi + done + cd .. + + busco \\ + --cpu $task.cpus \\ + --in "\$INPUT_SEQS" \\ + --out ${prefix}-busco \\ + $busco_lineage \\ + $busco_lineage_dir \\ + $busco_config \\ + $args + + # clean up + rm -rf "\$INPUT_SEQS" + + # Move files to avoid staging/publishing issues + mv ${prefix}-busco/batch_summary.txt ${prefix}-busco.batch_summary.txt + mv ${prefix}-busco/*/short_summary.*.{json,txt} . || echo "Short summaries were not available: No genes were found." + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + busco: \$( busco --version 2>&1 | sed 's/^BUSCO //' ) + END_VERSIONS + """ +} diff --git a/modules/busco/meta.yml b/modules/busco/meta.yml new file mode 100644 index 00000000..ef8c5245 --- /dev/null +++ b/modules/busco/meta.yml @@ -0,0 +1,69 @@ +name: busco +description: Benchmarking Universal Single Copy Orthologs +keywords: + - quality control + - genome + - transcriptome + - proteome +tools: + - busco: + description: BUSCO provides measures for quantitative assessment of genome assembly, gene set, and transcriptome completeness based on evolutionarily informed expectations of gene content from near-universal single-copy orthologs selected from OrthoDB. + homepage: https://busco.ezlab.org/ + documentation: https://busco.ezlab.org/busco_userguide.html + tool_dev_url: https://gitlab.com/ezlab/busco + doi: "10.1007/978-1-4939-9173-0_14" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Nucleic or amino acid sequence file in FASTA format. + pattern: "*.{fasta,fna,fa,fasta.gz,fna.gz,fa.gz}" + - lineage: + type: value + description: The BUSCO lineage to use, or "auto" to automatically select lineage + - busco_lineages_path: + type: directory + description: Path to local BUSCO lineages directory. + - config_file: + type: file + description: Path to BUSCO config file. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - batch_summary: + type: file + description: Summary of all sequence files analyzed + pattern: "*-busco.batch_summary.txt" + - short_summaries_txt: + type: file + description: Short Busco summary in plain text format + pattern: "short_summary.*.txt" + - short_summaries_json: + type: file + description: Short Busco summary in JSON format + pattern: "short_summary.*.json" + - busco_dir: + type: directory + description: BUSCO lineage specific output + pattern: "*-busco" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@priyanka-surana" + - "@charles-plessy" + - "@mahesh-panchal" + - "@muffato" + - "@jvhagey" diff --git a/modules/cat/fastq/main.nf b/modules/cat/fastq/main.nf index bf0877c3..b6854895 100644 --- a/modules/cat/fastq/main.nf +++ b/modules/cat/fastq/main.nf @@ -4,8 +4,8 @@ process CAT_FASTQ { conda (params.enable_conda ? "conda-forge::sed=4.7" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : - 'biocontainers/biocontainers:v1.2.0_cv1' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" input: tuple val(meta), path(reads, stageAs: "input*/*") diff --git a/modules/cnvpytor/callcnvs/main.nf b/modules/cnvpytor/callcnvs/main.nf index 17675cde..69c9d40e 100644 --- a/modules/cnvpytor/callcnvs/main.nf +++ b/modules/cnvpytor/callcnvs/main.nf @@ -2,43 +2,42 @@ process CNVPYTOR_CALLCNVS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null) + conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvpytor:1.0--py39h6a678da_2': - 'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }" + 'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0': + 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" input: tuple val(meta), path(pytor) + val bin_sizes output: - tuple val(meta), path("*.tsv"), emit: cnvs - path "versions.yml" , emit: versions + tuple val(meta), path("${pytor.baseName}.pytor") , emit: pytor + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '1000' - def prefix = task.ext.prefix ?: "${meta.id}" + def bins = bin_sizes ?: '1000' """ cnvpytor \\ -root $pytor \\ - -call $args > ${prefix}.tsv + -call $bin_sizes cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.tsv + touch ${pytor.baseName}.pytor cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ } diff --git a/modules/cnvpytor/callcnvs/meta.yml b/modules/cnvpytor/callcnvs/meta.yml index edfc462a..6ba46b6f 100644 --- a/modules/cnvpytor/callcnvs/meta.yml +++ b/modules/cnvpytor/callcnvs/meta.yml @@ -17,8 +17,11 @@ input: e.g. [ id:'test'] - pytor: type: file - description: cnvpytor root file + description: pytor file containing partitions of read depth histograms using mean-shift method pattern: "*.{pytor}" + - bin_sizes: + type: string + description: list of binsizes separated by space e.g. "1000 10000" and "1000" output: - meta: @@ -26,10 +29,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test' ] - - cnvs: + - pytor: type: file - description: file containing identified copy numer variations - pattern: "*.{tsv}" + description: pytor files containing cnv calls + pattern: "*.{pytor}" - versions: type: file description: File containing software versions diff --git a/modules/cnvpytor/histogram/main.nf b/modules/cnvpytor/histogram/main.nf index 9e59c6b8..fd2ebe14 100644 --- a/modules/cnvpytor/histogram/main.nf +++ b/modules/cnvpytor/histogram/main.nf @@ -2,13 +2,15 @@ process CNVPYTOR_HISTOGRAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null) + conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvpytor:1.0--py39h6a678da_2': - 'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }" + 'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0': + 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" input: tuple val(meta), path(pytor) + val bin_sizes + output: tuple val(meta), path("${pytor.baseName}.pytor") , emit: pytor @@ -18,15 +20,15 @@ process CNVPYTOR_HISTOGRAM { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '1000' + def bins = bin_sizes ?: '1000' """ cnvpytor \\ -root $pytor \\ - -his $args + -his $bins cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ @@ -36,7 +38,7 @@ process CNVPYTOR_HISTOGRAM { cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ } diff --git a/modules/cnvpytor/histogram/meta.yml b/modules/cnvpytor/histogram/meta.yml index fcad2221..ecd48b9a 100644 --- a/modules/cnvpytor/histogram/meta.yml +++ b/modules/cnvpytor/histogram/meta.yml @@ -22,6 +22,9 @@ input: type: file description: pytor file containing read depth data pattern: "*.{pytor}" + - bin_sizes: + type: string + description: list of binsizes separated by space e.g. "1000 10000" and "1000" output: - meta: @@ -40,3 +43,4 @@ output: authors: - "@sima-r" + - "@ramprasadn" diff --git a/modules/cnvpytor/importreaddepth/main.nf b/modules/cnvpytor/importreaddepth/main.nf index 162da719..6f9abae9 100644 --- a/modules/cnvpytor/importreaddepth/main.nf +++ b/modules/cnvpytor/importreaddepth/main.nf @@ -2,10 +2,10 @@ process CNVPYTOR_IMPORTREADDEPTH { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null) + conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvpytor:1.0--py39h6a678da_2': - 'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }" + 'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0': + 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" input: tuple val(meta), path(input_file), path(index) @@ -32,7 +32,7 @@ process CNVPYTOR_IMPORTREADDEPTH { cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ @@ -43,7 +43,7 @@ process CNVPYTOR_IMPORTREADDEPTH { cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ } diff --git a/modules/cnvpytor/importreaddepth/meta.yml b/modules/cnvpytor/importreaddepth/meta.yml index 1cf3c0d0..8b58887e 100644 --- a/modules/cnvpytor/importreaddepth/meta.yml +++ b/modules/cnvpytor/importreaddepth/meta.yml @@ -52,3 +52,4 @@ output: authors: - "@sima-r" + - "@ramprasadn" diff --git a/modules/cnvpytor/partition/main.nf b/modules/cnvpytor/partition/main.nf index 0311bdfc..6d7a9c6b 100644 --- a/modules/cnvpytor/partition/main.nf +++ b/modules/cnvpytor/partition/main.nf @@ -2,13 +2,14 @@ process CNVPYTOR_PARTITION { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null) + conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvpytor:1.0--py39h6a678da_2': - 'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }" + 'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0': + 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" input: tuple val(meta), path(pytor) + val bin_sizes output: tuple val(meta), path("${pytor.baseName}.pytor"), emit: pytor @@ -18,15 +19,15 @@ process CNVPYTOR_PARTITION { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def bins = bin_sizes ?: '1000' """ cnvpytor \\ -root $pytor \\ - -partition $args + -partition $bins cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ @@ -36,7 +37,7 @@ process CNVPYTOR_PARTITION { cat <<-END_VERSIONS > versions.yml "${task.process}": - cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' )) + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) END_VERSIONS """ } diff --git a/modules/cnvpytor/partition/meta.yml b/modules/cnvpytor/partition/meta.yml index a72cea4c..17b5e199 100644 --- a/modules/cnvpytor/partition/meta.yml +++ b/modules/cnvpytor/partition/meta.yml @@ -22,6 +22,9 @@ input: type: file description: pytor file containing read depth data pattern: "*.{pytor}" + - bin_sizes: + type: string + description: list of binsizes separated by space e.g. "1000 10000" and "1000" output: - meta: @@ -40,3 +43,4 @@ output: authors: - "@sima-r" + - "@ramprasadn" diff --git a/modules/cnvpytor/view/main.nf b/modules/cnvpytor/view/main.nf new file mode 100644 index 00000000..1bb61a38 --- /dev/null +++ b/modules/cnvpytor/view/main.nf @@ -0,0 +1,60 @@ +process CNVPYTOR_VIEW { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0': + 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(pytor_files) + val bin_sizes + val output_format + + output: + tuple val(meta), path("*.vcf"), emit: vcf , optional: true + tuple val(meta), path("*.tsv"), emit: tsv , optional: true + tuple val(meta), path("*.xls"), emit: xls , optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def output_suffix = output_format ?: 'vcf' + def bins = bin_sizes ?: '1000' + def input = pytor_files.join(" ") + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + python3 < versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) + END_VERSIONS + """ + + stub: + def output_suffix = output_format ?: 'vcf' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.${output_suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )) + END_VERSIONS + """ +} diff --git a/modules/cnvpytor/view/meta.yml b/modules/cnvpytor/view/meta.yml new file mode 100644 index 00000000..e4e68fad --- /dev/null +++ b/modules/cnvpytor/view/meta.yml @@ -0,0 +1,56 @@ +name: cnvpytor_view +description: view function to generate vcfs +keywords: + - cnv calling +tools: + - cnvpytor: + description: calling CNVs using read depth + homepage: https://github.com/abyzovlab/CNVpytor + documentation: https://github.com/abyzovlab/CNVpytor + tool_dev_url: https://github.com/abyzovlab/CNVpytor + doi: "10.1101/2021.01.27.428472v1" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - pytor_files: + type: file + description: pytor file containing cnv calls. To merge calls from multiple samples use a list of files. + pattern: "*.{pytor}" + - bin_sizes: + type: string + description: list of binsizes separated by space e.g. "1000 10000" and "1000" + - output_format: + type: string + description: output format of the cnv calls. Valid entries are "tsv", "vcf", and "xls" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - tsv: + type: file + description: tsv file containing cnv calls + pattern: "*.{tsv}" + - vcf: + type: file + description: vcf file containing cnv calls + pattern: "*.{vcf}" + - xls: + type: file + description: xls file containing cnv calls + pattern: "*.{xls}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@sima-r" + - "@ramprasadn" diff --git a/modules/custom/getchromsizes/main.nf b/modules/custom/getchromsizes/main.nf index bbcfa9be..0eabf3a4 100644 --- a/modules/custom/getchromsizes/main.nf +++ b/modules/custom/getchromsizes/main.nf @@ -2,10 +2,10 @@ process CUSTOM_GETCHROMSIZES { tag "$fasta" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: path fasta diff --git a/modules/custom/sratoolsncbisettings/main.nf b/modules/custom/sratoolsncbisettings/main.nf new file mode 100644 index 00000000..21bf3005 --- /dev/null +++ b/modules/custom/sratoolsncbisettings/main.nf @@ -0,0 +1,20 @@ +process CUSTOM_SRATOOLSNCBISETTINGS { + tag 'ncbi-settings' + label 'process_low' + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5321ha49a11a_3' : + 'quay.io/biocontainers/sra-tools:2.11.0--pl5321ha49a11a_3' }" + + output: + path('*.mkfg') , emit: ncbi_settings + path 'versions.yml', emit: versions + + when: + task.ext.when == null || task.ext.when + + shell: + config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" + template 'detect_ncbi_settings.sh' +} diff --git a/modules/custom/sratoolsncbisettings/meta.yml b/modules/custom/sratoolsncbisettings/meta.yml new file mode 100644 index 00000000..01e98856 --- /dev/null +++ b/modules/custom/sratoolsncbisettings/meta.yml @@ -0,0 +1,28 @@ +name: "sratoolsncbisettings" +description: Test for the presence of suitable NCBI settings or create them on the fly. +keywords: + - NCBI + - settings + - sra-tools + - prefetch + - fasterq-dump +tools: + - "sratools": + description: "SRA Toolkit and SDK from NCBI" + homepage: https://github.com/ncbi/sra-tools + documentation: https://github.com/ncbi/sra-tools/wiki + tool_dev_url: https://github.com/ncbi/sra-tools + licence: "['Public Domain']" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - ncbi_settings: + type: file + description: An NCBI user settings file. + pattern: "*.mkfg" + +authors: + - "@Midnighter" diff --git a/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh b/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh new file mode 100644 index 00000000..cfe3a324 --- /dev/null +++ b/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -u + + +# Get the expected NCBI settings path and define the environment variable +# `NCBI_SETTINGS`. +eval "$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" + +# If the user settings do not exist yet, create a file suitable for `prefetch` +# and `fasterq-dump`. If an existing settings file does not contain the required +# values, error out with a helpful message. +if [[ ! -f "${NCBI_SETTINGS}" ]]; then + printf '!{config}' > 'user-settings.mkfg' +else + prefetch --help &> /dev/null + if [[ $? = 78 ]]; then + echo "You have an existing vdb-config at '${NCBI_SETTINGS}' but it is"\ + "missing the required entries for /LIBS/GUID and"\ + "/libs/cloud/report_instance_identity."\ + "Feel free to add the following to your settings file:" >&2 + echo "$(printf '!{config}')" >&2 + exit 1 + fi + fasterq-dump --help &> /dev/null + if [[ $? = 78 ]]; then + echo "You have an existing vdb-config at '${NCBI_SETTINGS}' but it is"\ + "missing the required entries for /LIBS/GUID and"\ + "/libs/cloud/report_instance_identity."\ + "Feel free to add the following to your settings file:" >&2 + echo "$(printf '!{config}')" >&2 + exit 1 + fi + if [[ "${NCBI_SETTINGS}" != *.mkfg ]]; then + echo "The detected settings '${NCBI_SETTINGS}' do not have the required"\ + "file extension '.mkfg'." >&2 + exit 1 + fi + cp "${NCBI_SETTINGS}" ./ +fi + +cat <<-END_VERSIONS > versions.yml +"!{task.process}": + sratools: $(vdb-config --version 2>&1 | grep -Eo '[0-9.]+') +END_VERSIONS diff --git a/modules/diamond/blastp/main.nf b/modules/diamond/blastp/main.nf index 955952dc..033186ea 100644 --- a/modules/diamond/blastp/main.nf +++ b/modules/diamond/blastp/main.nf @@ -2,20 +2,26 @@ process DIAMOND_BLASTP { tag "$meta.id" label 'process_medium' - // Dimaond is limited to v2.0.9 because there is not a - // singularity version higher than this at the current time. - conda (params.enable_conda ? "bioconda::diamond=2.0.9" : null) + conda (params.enable_conda ? "bioconda::diamond=2.0.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : - 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + 'https://depot.galaxyproject.org/singularity/diamond:2.0.15--hb97b32f_0' : + 'quay.io/biocontainers/diamond:2.0.15--hb97b32f_0' }" input: tuple val(meta), path(fasta) - path db + path db + val out_ext + val blast_columns output: - tuple val(meta), path('*.txt'), emit: txt - path "versions.yml" , emit: versions + tuple val(meta), path('*.blast'), optional: true, emit: blast + tuple val(meta), path('*.xml') , optional: true, emit: xml + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.daa') , optional: true, emit: daa + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.paf') , optional: true, emit: paf + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,6 +29,21 @@ process DIAMOND_BLASTP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def columns = blast_columns ? "${blast_columns}" : '' + switch ( out_ext ) { + case "blast": outfmt = 0; break + case "xml": outfmt = 5; break + case "txt": outfmt = 6; break + case "daa": outfmt = 100; break + case "sam": outfmt = 101; break + case "tsv": outfmt = 102; break + case "paf": outfmt = 103; break + default: + outfmt = '6'; + out_ext = 'txt'; + log.warn("Unknown output file format provided (${out_ext}): selecting DIAMOND default of tabular BLAST output (txt)"); + break + } """ DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` @@ -31,8 +52,9 @@ process DIAMOND_BLASTP { --threads $task.cpus \\ --db \$DB \\ --query $fasta \\ + --outfmt ${outfmt} ${columns} \\ $args \\ - --out ${prefix}.txt + --out ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/diamond/blastp/meta.yml b/modules/diamond/blastp/meta.yml index 8ac1d371..3aa81e53 100644 --- a/modules/diamond/blastp/meta.yml +++ b/modules/diamond/blastp/meta.yml @@ -28,12 +28,50 @@ input: type: directory description: Directory containing the protein blast database pattern: "*" + - out_ext: + type: string + description: | + Specify the type of output file to be generated. `blast` corresponds to + BLAST pairwise format. `xml` corresponds to BLAST xml format. + `txt` corresponds to to BLAST tabular format. `tsv` corresponds to + taxonomic classification format. + pattern: "blast|xml|txt|daa|sam|tsv|paf" + - blast_columns: + type: string + description: | + Optional space separated list of DIAMOND tabular BLAST output keywords + used for in conjunction with the 'txt' out_ext option (--outfmt 6). See + DIAMOND documnetation for more information. output: - - txt: + - blast: type: file description: File containing blastp hits - pattern: "*.{blastp.txt}" + pattern: "*.{blast}" + - xml: + type: file + description: File containing blastp hits + pattern: "*.{xml}" + - txt: + type: file + description: File containing hits in tabular BLAST format. + pattern: "*.{txt}" + - daa: + type: file + description: File containing hits DAA format + pattern: "*.{daa}" + - sam: + type: file + description: File containing aligned reads in SAM format + pattern: "*.{sam}" + - tsv: + type: file + description: Tab separated file containing taxonomic classification of hits + pattern: "*.{tsv}" + - paf: + type: file + description: File containing aligned reads in pairwise mapping format format + pattern: "*.{paf}" - versions: type: file description: File containing software versions @@ -41,3 +79,4 @@ output: authors: - "@spficklin" + - "@jfy133" diff --git a/modules/diamond/blastx/main.nf b/modules/diamond/blastx/main.nf index 3700bd36..d3272279 100644 --- a/modules/diamond/blastx/main.nf +++ b/modules/diamond/blastx/main.nf @@ -2,20 +2,26 @@ process DIAMOND_BLASTX { tag "$meta.id" label 'process_medium' - // Dimaond is limited to v2.0.9 because there is not a - // singularity version higher than this at the current time. - conda (params.enable_conda ? "bioconda::diamond=2.0.9" : null) + conda (params.enable_conda ? "bioconda::diamond=2.0.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : - 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + 'https://depot.galaxyproject.org/singularity/diamond:2.0.15--hb97b32f_0' : + 'quay.io/biocontainers/diamond:2.0.15--hb97b32f_0' }" input: tuple val(meta), path(fasta) - path db + path db + val out_ext + val blast_columns output: - tuple val(meta), path('*.txt'), emit: txt - path "versions.yml" , emit: versions + tuple val(meta), path('*.blast'), optional: true, emit: blast + tuple val(meta), path('*.xml') , optional: true, emit: xml + tuple val(meta), path('*.txt') , optional: true, emit: txt + tuple val(meta), path('*.daa') , optional: true, emit: daa + tuple val(meta), path('*.sam') , optional: true, emit: sam + tuple val(meta), path('*.tsv') , optional: true, emit: tsv + tuple val(meta), path('*.paf') , optional: true, emit: paf + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,6 +29,21 @@ process DIAMOND_BLASTX { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def columns = blast_columns ? "${blast_columns}" : '' + switch ( out_ext ) { + case "blast": outfmt = 0; break + case "xml": outfmt = 5; break + case "txt": outfmt = 6; break + case "daa": outfmt = 100; break + case "sam": outfmt = 101; break + case "tsv": outfmt = 102; break + case "paf": outfmt = 103; break + default: + outfmt = '6'; + out_ext = 'txt'; + log.warn("Unknown output file format provided (${out_ext}): selecting DIAMOND default of tabular BLAST output (txt)"); + break + } """ DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` @@ -31,8 +52,9 @@ process DIAMOND_BLASTX { --threads $task.cpus \\ --db \$DB \\ --query $fasta \\ + --outfmt ${outfmt} ${columns} \\ $args \\ - --out ${prefix}.txt + --out ${prefix}.${out_ext} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/diamond/blastx/meta.yml b/modules/diamond/blastx/meta.yml index 7eb3d7b4..2dcd7bc6 100644 --- a/modules/diamond/blastx/meta.yml +++ b/modules/diamond/blastx/meta.yml @@ -28,12 +28,44 @@ input: type: directory description: Directory containing the nucelotide blast database pattern: "*" + - out_ext: + type: string + description: | + Specify the type of output file to be generated. `blast` corresponds to + BLAST pairwise format. `xml` corresponds to BLAST xml format. + `txt` corresponds to to BLAST tabular format. `tsv` corresponds to + taxonomic classification format. + pattern: "blast|xml|txt|daa|sam|tsv|paf" output: + - blast: + type: file + description: File containing blastp hits + pattern: "*.{blast}" + - xml: + type: file + description: File containing blastp hits + pattern: "*.{xml}" - txt: type: file - description: File containing blastx hits - pattern: "*.{blastx.txt}" + description: File containing hits in tabular BLAST format. + pattern: "*.{txt}" + - daa: + type: file + description: File containing hits DAA format + pattern: "*.{daa}" + - sam: + type: file + description: File containing aligned reads in SAM format + pattern: "*.{sam}" + - tsv: + type: file + description: Tab separated file containing taxonomic classification of hits + pattern: "*.{tsv}" + - paf: + type: file + description: File containing aligned reads in pairwise mapping format format + pattern: "*.{paf}" - versions: type: file description: File containing software versions @@ -41,3 +73,4 @@ output: authors: - "@spficklin" + - "@jfy133" diff --git a/modules/diamond/makedb/main.nf b/modules/diamond/makedb/main.nf index e3d62f00..a76a94e5 100644 --- a/modules/diamond/makedb/main.nf +++ b/modules/diamond/makedb/main.nf @@ -2,12 +2,10 @@ process DIAMOND_MAKEDB { tag "$fasta" label 'process_medium' - // Dimaond is limited to v2.0.9 because there is not a - // singularity version higher than this at the current time. - conda (params.enable_conda ? 'bioconda::diamond=2.0.9' : null) + conda (params.enable_conda ? "bioconda::diamond=2.0.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : - 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + 'https://depot.galaxyproject.org/singularity/diamond:2.0.15--hb97b32f_0' : + 'quay.io/biocontainers/diamond:2.0.15--hb97b32f_0' }" input: path fasta diff --git a/modules/elprep/merge/main.nf b/modules/elprep/merge/main.nf new file mode 100644 index 00000000..d5ffc497 --- /dev/null +++ b/modules/elprep/merge/main.nf @@ -0,0 +1,43 @@ +process ELPREP_MERGE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::elprep=5.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/elprep:5.1.2--he881be0_0': + 'quay.io/biocontainers/elprep:5.1.2--he881be0_0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("output/**.{bam,sam}") , emit: bam + 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 suffix = args.contains("--output-type sam") ? "sam" : "bam" + def single_end = meta.single_end ? " --single-end" : "" + + """ + # create directory and move all input so elprep can find and merge them before splitting + mkdir input + mv ${bam} input/ + + elprep merge \\ + input/ \\ + output/${prefix}.${suffix} \\ + $args \\ + ${single_end} \\ + --nr-of-threads $task.cpus + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + elprep: \$(elprep 2>&1 | head -n2 | tail -n1 |sed 's/^.*version //;s/ compiled.*\$//') + END_VERSIONS + """ +} diff --git a/modules/elprep/merge/meta.yml b/modules/elprep/merge/meta.yml new file mode 100644 index 00000000..1f49b1a0 --- /dev/null +++ b/modules/elprep/merge/meta.yml @@ -0,0 +1,44 @@ +name: "elprep_merge" +description: Merge split bam/sam chunks in one file +keywords: + - bam + - sam + - merge +tools: + - "elprep": + description: "elPrep is a high-performance tool for preparing .sam/.bam files for variant calling in sequencing pipelines. It can be used as a drop-in replacement for SAMtools/Picard/GATK4." + homepage: "https://github.com/ExaScience/elprep" + documentation: "https://github.com/ExaScience/elprep" + tool_dev_url: "https://github.com/ExaScience/elprep" + doi: "10.1371/journal.pone.0244471" + licence: "['AGPL v3']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: List of BAM/SAM chunks to merge + pattern: "*.{bam,sam}" + +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" + - bam: + type: file + description: Merged BAM/SAM file + pattern: "*.{bam,sam}" + +authors: + - "@matthdsm" diff --git a/modules/ensemblvep/Dockerfile b/modules/ensemblvep/Dockerfile index ac1b4691..b4a1c664 100644 --- a/modules/ensemblvep/Dockerfile +++ b/modules/ensemblvep/Dockerfile @@ -8,13 +8,14 @@ LABEL \ COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a -# Add conda installation dir to PATH (instead of doing 'conda activate') -ENV PATH /opt/conda/envs/nf-core-vep-104.3/bin:$PATH - # Setup default ARG variables ARG GENOME=GRCh38 ARG SPECIES=homo_sapiens -ARG VEP_VERSION=99 +ARG VEP_VERSION=104 +ARG VEP_TAG=104.3 + +# Add conda installation dir to PATH (instead of doing 'conda activate') +ENV PATH /opt/conda/envs/nf-core-vep-${VEP_TAG}/bin:$PATH # Download Genome RUN vep_install \ @@ -27,4 +28,4 @@ RUN vep_install \ --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE # Dump the details of the installed packages to a file for posterity -RUN conda env export --name nf-core-vep-104.3 > nf-core-vep-104.3.yml +RUN conda env export --name nf-core-vep-${VEP_TAG} > nf-core-vep-${VEP_TAG}.yml diff --git a/modules/ensemblvep/build.sh b/modules/ensemblvep/build.sh index 5fcb91df..650c8704 100755 --- a/modules/ensemblvep/build.sh +++ b/modules/ensemblvep/build.sh @@ -10,11 +10,12 @@ build_push() { VEP_TAG=$4 docker build \ + . \ -t nfcore/vep:${VEP_TAG}.${GENOME} \ - software/vep/. \ --build-arg GENOME=${GENOME} \ --build-arg SPECIES=${SPECIES} \ - --build-arg VEP_VERSION=${VEP_VERSION} + --build-arg VEP_VERSION=${VEP_VERSION} \ + --build-arg VEP_TAG=${VEP_TAG} docker push nfcore/vep:${VEP_TAG}.${GENOME} } diff --git a/modules/ensemblvep/main.nf b/modules/ensemblvep/main.nf index c2bd055f..a5a9b1ab 100644 --- a/modules/ensemblvep/main.nf +++ b/modules/ensemblvep/main.nf @@ -13,6 +13,7 @@ process ENSEMBLVEP { val species val cache_version path cache + path extra_files output: tuple val(meta), path("*.ann.vcf"), emit: vcf diff --git a/modules/ensemblvep/meta.yml b/modules/ensemblvep/meta.yml index cd9c8905..418bb970 100644 --- a/modules/ensemblvep/meta.yml +++ b/modules/ensemblvep/meta.yml @@ -10,17 +10,6 @@ tools: homepage: https://www.ensembl.org/info/docs/tools/vep/index.html documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html licence: ["Apache-2.0"] -params: - - use_cache: - type: boolean - description: | - Enable the usage of containers with cache - Does not work with conda - - vep_tag: - type: value - description: | - Specify the tag for the container - https://hub.docker.com/r/nfcore/vep/tags input: - meta: type: map @@ -47,6 +36,10 @@ input: type: file description: | path to VEP cache (optional) + - extra_files: + type: tuple + description: | + path to file(s) needed for plugins (optional) output: - vcf: type: file diff --git a/modules/gamma/main.nf b/modules/gamma/main.nf new file mode 100644 index 00000000..e176ee68 --- /dev/null +++ b/modules/gamma/main.nf @@ -0,0 +1,41 @@ +def VERSION = '2.1' // Version information not provided by tool on CLI + +process GAMMA { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gamma=2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gamma%3A2.1--hdfd78af_0': + 'quay.io/biocontainers/gamma:2.1--hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + path(db) + + output: + tuple val(meta), path("*.gamma") , emit: gamma + tuple val(meta), path("*.psl") , emit: psl + tuple val(meta), path("*.gff") , optional:true , emit: gff + tuple val(meta), path("*.fasta"), optional:true , emit: fasta + 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}" + """ + GAMMA.py \\ + $args \\ + $fasta \\ + $db \\ + $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gamma: $VERSION + END_VERSIONS + """ +} diff --git a/modules/gamma/meta.yml b/modules/gamma/meta.yml new file mode 100644 index 00000000..316b685b --- /dev/null +++ b/modules/gamma/meta.yml @@ -0,0 +1,63 @@ +name: "gamma" +description: Gene Allele Mutation Microbial Assessment +keywords: + - gamma + - gene-calling +tools: + - "gamma": + description: "Tool for Gene Allele Mutation Microbial Assessment" + homepage: "https://github.com/rastanton/GAMMA" + documentation: "https://github.com/rastanton/GAMMA" + tool_dev_url: "https://github.com/rastanton/GAMMA" + doi: "10.1093/bioinformatics/btab607" + licence: "['Apache License 2.0']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + - db: + type: file + description: Database in FASTA format + pattern: "*.{fa,fasta}" + +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" + + - gamma: + type: file + description: GAMMA file with annotated gene matches + pattern: "*.{gamma}" + + - psl: + type: file + description: PSL file with all gene matches found + pattern: "*.{psl}" + + - gff: + type: file + description: GFF file + pattern: "*.{gff}" + + - fasta: + type: file + description: multifasta file of the gene matches + pattern: "*.{fasta}" + +authors: + - "@sateeshperi" + - "@rastanton" diff --git a/modules/gatk4/applybqsr/main.nf b/modules/gatk4/applybqsr/main.nf index 7a64dab2..a0e2c45c 100644 --- a/modules/gatk4/applybqsr/main.nf +++ b/modules/gatk4/applybqsr/main.nf @@ -2,10 +2,10 @@ process GATK4_APPLYBQSR { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(bqsr_table), path(intervals) diff --git a/modules/gatk4/applybqsrspark/main.nf b/modules/gatk4/applybqsrspark/main.nf index 04303c09..9d7891ba 100644 --- a/modules/gatk4/applybqsrspark/main.nf +++ b/modules/gatk4/applybqsrspark/main.nf @@ -2,10 +2,10 @@ process GATK4_APPLYBQSR_SPARK { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + 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.3.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(bqsr_table), path(intervals) diff --git a/modules/gatk4/applyvqsr/main.nf b/modules/gatk4/applyvqsr/main.nf index 8b235809..d3da8332 100644 --- a/modules/gatk4/applyvqsr/main.nf +++ b/modules/gatk4/applyvqsr/main.nf @@ -2,10 +2,10 @@ process GATK4_APPLYVQSR { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches) diff --git a/modules/gatk4/baserecalibrator/main.nf b/modules/gatk4/baserecalibrator/main.nf index 766a8338..fb26d3da 100644 --- a/modules/gatk4/baserecalibrator/main.nf +++ b/modules/gatk4/baserecalibrator/main.nf @@ -2,10 +2,10 @@ process GATK4_BASERECALIBRATOR { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/gatk4/baserecalibratorspark/main.nf b/modules/gatk4/baserecalibratorspark/main.nf index 70c70181..79988b72 100644 --- a/modules/gatk4/baserecalibratorspark/main.nf +++ b/modules/gatk4/baserecalibratorspark/main.nf @@ -2,10 +2,10 @@ process GATK4_BASERECALIBRATOR_SPARK { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + 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.3.0--hdfd78af_0' : - 'broadinstitute/gatk:4.2.3.0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/gatk4/bedtointervallist/main.nf b/modules/gatk4/bedtointervallist/main.nf index 118f535b..6224d9b3 100644 --- a/modules/gatk4/bedtointervallist/main.nf +++ b/modules/gatk4/bedtointervallist/main.nf @@ -2,10 +2,10 @@ process GATK4_BEDTOINTERVALLIST { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(bed) diff --git a/modules/gatk4/calculatecontamination/main.nf b/modules/gatk4/calculatecontamination/main.nf index 197fe6c2..c289684e 100644 --- a/modules/gatk4/calculatecontamination/main.nf +++ b/modules/gatk4/calculatecontamination/main.nf @@ -2,10 +2,10 @@ process GATK4_CALCULATECONTAMINATION { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(pileup), path(matched) diff --git a/modules/gatk4/cnnscorevariants/main.nf b/modules/gatk4/cnnscorevariants/main.nf new file mode 100644 index 00000000..a1bb3811 --- /dev/null +++ b/modules/gatk4/cnnscorevariants/main.nf @@ -0,0 +1,58 @@ +process GATK4_CNNSCOREVARIANTS { + tag "$meta.id" + label 'process_low' + + //Conda is not supported at the moment: https://github.com/broadinstitute/gatk/issues/7811 + if (params.enable_conda) { + exit 1, "Conda environments cannot be used for GATK4/CNNScoreVariants at the moment. Please use docker or singularity containers." + } + container 'broadinstitute/gatk:4.2.6.1' //Biocontainers is missing a package + + input: + tuple val(meta), path(vcf), path(tbi), path(aligned_input), path(intervals) + path fasta + path fai + path dict + path architecture + path weights + + output: + tuple val(meta), path("*cnn.vcf.gz") , emit: vcf + tuple val(meta), path("*cnn.vcf.gz.tbi"), emit: tbi + 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 aligned_input = aligned_input ? "--input $aligned_input" : "" + def interval_command = intervals ? "--intervals $intervals" : "" + def architecture = architecture ? "--architecture $architecture" : "" + def weights = weights ? "--weights $weights" : "" + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK CnnScoreVariants] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" CNNScoreVariants \\ + --variant $vcf \\ + --output ${prefix}.cnn.vcf.gz \\ + --reference $fasta \\ + $interval_command \\ + $aligned_input \\ + $architecture \\ + $weights \\ + --tmp-dir . \\ + $args + + 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/cnnscorevariants/meta.yml b/modules/gatk4/cnnscorevariants/meta.yml new file mode 100644 index 00000000..4e59cb8e --- /dev/null +++ b/modules/gatk4/cnnscorevariants/meta.yml @@ -0,0 +1,80 @@ +name: "gatk4_cnnscorevariants" +description: Apply a Convolutional Neural Net to filter annotated variants +keywords: + - gatk4_cnnscorevariants + - gatk4 + - variants +tools: + - gatk4: + description: | + 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/categories/360002369672s + doi: 10.1158/1538-7445.AM2017-3590 + licence: ["Apache-2.0"] + +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.gz" + - tbi: + type: file + description: VCF index file + pattern: "*.vcf.gz.tbi" + - aligned_input: + type: file + description: BAM/CRAM file from alignment (optional) + pattern: "*.{bam,cram}" + - intervals: + type: file + description: Bed file with the genomic regions included in the library (optional) + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - architecture: + type: file + description: Neural Net architecture configuration json file (optional) + pattern: "*.json" + - weights: + type: file + description: Keras model HD5 file with neural net weights. (optional) + pattern: "*.hd5" + +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" + - vcf: + type: file + description: Annotated VCF file + pattern: "*.vcf" + - tbi: + type: file + description: VCF index file + pattern: "*.vcf.gz.tbi" + +authors: + - "@FriederikeHanssen" diff --git a/modules/gatk4/combinegvcfs/main.nf b/modules/gatk4/combinegvcfs/main.nf index 45bf4372..db4d9cdb 100644 --- a/modules/gatk4/combinegvcfs/main.nf +++ b/modules/gatk4/combinegvcfs/main.nf @@ -2,10 +2,10 @@ process GATK4_COMBINEGVCFS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_idx) diff --git a/modules/gatk4/createsequencedictionary/main.nf b/modules/gatk4/createsequencedictionary/main.nf index dbf37048..13fa9e81 100644 --- a/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/gatk4/createsequencedictionary/main.nf @@ -2,10 +2,10 @@ process GATK4_CREATESEQUENCEDICTIONARY { tag "$fasta" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: path fasta diff --git a/modules/gatk4/createsomaticpanelofnormals/main.nf b/modules/gatk4/createsomaticpanelofnormals/main.nf index 3df29947..653a9497 100644 --- a/modules/gatk4/createsomaticpanelofnormals/main.nf +++ b/modules/gatk4/createsomaticpanelofnormals/main.nf @@ -2,10 +2,10 @@ process GATK4_CREATESOMATICPANELOFNORMALS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(genomicsdb) diff --git a/modules/gatk4/estimatelibrarycomplexity/main.nf b/modules/gatk4/estimatelibrarycomplexity/main.nf index caa34630..46e09a95 100644 --- a/modules/gatk4/estimatelibrarycomplexity/main.nf +++ b/modules/gatk4/estimatelibrarycomplexity/main.nf @@ -2,10 +2,10 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input) diff --git a/modules/gatk4/fastqtosam/main.nf b/modules/gatk4/fastqtosam/main.nf index 199058d0..326d4d58 100644 --- a/modules/gatk4/fastqtosam/main.nf +++ b/modules/gatk4/fastqtosam/main.nf @@ -2,10 +2,10 @@ process GATK4_FASTQTOSAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(reads) diff --git a/modules/gatk4/filtermutectcalls/main.nf b/modules/gatk4/filtermutectcalls/main.nf index c1c82e0b..91f6defa 100644 --- a/modules/gatk4/filtermutectcalls/main.nf +++ b/modules/gatk4/filtermutectcalls/main.nf @@ -2,10 +2,10 @@ process GATK4_FILTERMUTECTCALLS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(stats), path(orientationbias), path(segmentation), path(table), val(estimate) diff --git a/modules/gatk4/filtervarianttranches/main.nf b/modules/gatk4/filtervarianttranches/main.nf new file mode 100644 index 00000000..98e620e7 --- /dev/null +++ b/modules/gatk4/filtervarianttranches/main.nf @@ -0,0 +1,51 @@ +process GATK4_FILTERVARIANTTRANCHES { + tag "$meta.id" + 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 val(meta), path(vcf), path(tbi), path(intervals) + path resources + path resources_index + path fasta + path fai + path dict + + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + tuple val(meta), path("*.vcf.gz.tbi"), emit: tbi + 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 resources = resources.collect{"--resource $it"}.join(' ') + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK FilterVariantTranches] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" FilterVariantTranches \\ + --variant $vcf \\ + $resources \\ + --output ${prefix}.filtered.vcf.gz \\ + --tmp-dir . \\ + $args + + 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/filtervarianttranches/meta.yml b/modules/gatk4/filtervarianttranches/meta.yml new file mode 100644 index 00000000..f89063a5 --- /dev/null +++ b/modules/gatk4/filtervarianttranches/meta.yml @@ -0,0 +1,68 @@ +name: "gatk4_filtervarianttranches" +description: Apply tranche filtering +keywords: + - gatk4 + - filtervarianttranches + +tools: + - "gatk4": + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: a VCF file containing variants, must have info key:CNN_2D + pattern: "*.vcf.gz" + - tbi: + type: file + description: tbi file matching with -vcf + pattern: "*.vcf.gz.tbi" + - resources: + type: list + description: resource A VCF containing known SNP and or INDEL sites. Can be supplied as many times as necessary + pattern: "*.vcf.gz" + - resources_index: + type: list + description: Index of resource VCF containing known SNP and or INDEL sites. Can be supplied as many times as necessary + pattern: "*.vcf.gz" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "fasta.fai" + - dict: + +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" + - vcf: + type: file + description: VCF file + pattern: "*.vcf.gz" + - tbi: + type: file + description: VCF index file + pattern: "*.vcf.gz.tbi" + +authors: + - "@FriederikeHanssen" diff --git a/modules/gatk4/gatherbqsrreports/main.nf b/modules/gatk4/gatherbqsrreports/main.nf index 1f5f2e1b..231bd39e 100644 --- a/modules/gatk4/gatherbqsrreports/main.nf +++ b/modules/gatk4/gatherbqsrreports/main.nf @@ -2,10 +2,10 @@ process GATK4_GATHERBQSRREPORTS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(table) diff --git a/modules/gatk4/gatherpileupsummaries/main.nf b/modules/gatk4/gatherpileupsummaries/main.nf index f5e9cf22..0b763f41 100644 --- a/modules/gatk4/gatherpileupsummaries/main.nf +++ b/modules/gatk4/gatherpileupsummaries/main.nf @@ -2,10 +2,10 @@ process GATK4_GATHERPILEUPSUMMARIES { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: diff --git a/modules/gatk4/genomicsdbimport/main.nf b/modules/gatk4/genomicsdbimport/main.nf index d2b78899..810f2b63 100644 --- a/modules/gatk4/genomicsdbimport/main.nf +++ b/modules/gatk4/genomicsdbimport/main.nf @@ -2,10 +2,10 @@ process GATK4_GENOMICSDBIMPORT { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi), path(interval_file), val(interval_value), path(wspace) diff --git a/modules/gatk4/genotypegvcfs/main.nf b/modules/gatk4/genotypegvcfs/main.nf index 0df88d66..11024b1b 100644 --- a/modules/gatk4/genotypegvcfs/main.nf +++ b/modules/gatk4/genotypegvcfs/main.nf @@ -2,10 +2,10 @@ process GATK4_GENOTYPEGVCFS { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(gvcf), path(gvcf_index), path(intervals), path(intervals_index) diff --git a/modules/gatk4/getpileupsummaries/main.nf b/modules/gatk4/getpileupsummaries/main.nf index c0946f71..1c056170 100644 --- a/modules/gatk4/getpileupsummaries/main.nf +++ b/modules/gatk4/getpileupsummaries/main.nf @@ -2,10 +2,10 @@ process GATK4_GETPILEUPSUMMARIES { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(index), path(intervals) @@ -40,7 +40,7 @@ process GATK4_GETPILEUPSUMMARIES { --variant $variants \\ --output ${prefix}.pileups.table \\ $reference_command \\ - $sites_command \\ + $interval_command \\ --tmp-dir . \\ $args diff --git a/modules/gatk4/haplotypecaller/main.nf b/modules/gatk4/haplotypecaller/main.nf index 57f69ecd..6dd3f69e 100644 --- a/modules/gatk4/haplotypecaller/main.nf +++ b/modules/gatk4/haplotypecaller/main.nf @@ -2,10 +2,10 @@ process GATK4_HAPLOTYPECALLER { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) @@ -17,7 +17,7 @@ process GATK4_HAPLOTYPECALLER { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - tuple val(meta), path("*.tbi") , emit: tbi + tuple val(meta), path("*.tbi") , optional:true, emit: tbi path "versions.yml" , emit: versions when: diff --git a/modules/gatk4/indexfeaturefile/main.nf b/modules/gatk4/indexfeaturefile/main.nf index 90ff94e6..264f71ef 100644 --- a/modules/gatk4/indexfeaturefile/main.nf +++ b/modules/gatk4/indexfeaturefile/main.nf @@ -2,10 +2,10 @@ process GATK4_INDEXFEATUREFILE { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(feature_file) diff --git a/modules/gatk4/intervallisttobed/main.nf b/modules/gatk4/intervallisttobed/main.nf index c0f9df63..84f3c472 100644 --- a/modules/gatk4/intervallisttobed/main.nf +++ b/modules/gatk4/intervallisttobed/main.nf @@ -2,10 +2,10 @@ process GATK4_INTERVALLISTTOBED { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(intervals) diff --git a/modules/gatk4/intervallisttools/main.nf b/modules/gatk4/intervallisttools/main.nf index 1b9b37f4..7ab26c15 100644 --- a/modules/gatk4/intervallisttools/main.nf +++ b/modules/gatk4/intervallisttools/main.nf @@ -2,10 +2,10 @@ process GATK4_INTERVALLISTTOOLS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(intervals) diff --git a/modules/gatk4/learnreadorientationmodel/main.nf b/modules/gatk4/learnreadorientationmodel/main.nf index 717cf211..8c4ac94e 100644 --- a/modules/gatk4/learnreadorientationmodel/main.nf +++ b/modules/gatk4/learnreadorientationmodel/main.nf @@ -2,10 +2,10 @@ process GATK4_LEARNREADORIENTATIONMODEL { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(f1r2) diff --git a/modules/gatk4/markduplicates/main.nf b/modules/gatk4/markduplicates/main.nf index e8a98156..68e4a21a 100644 --- a/modules/gatk4/markduplicates/main.nf +++ b/modules/gatk4/markduplicates/main.nf @@ -1,18 +1,18 @@ process GATK4_MARKDUPLICATES { tag "$meta.id" - label 'process_low' + label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*.bai") , emit: bai + tuple val(meta), path("*.bai") , optional:true, emit: bai tuple val(meta), path("*.metrics"), emit: metrics path "versions.yml" , emit: versions diff --git a/modules/gatk4/mergebamalignment/main.nf b/modules/gatk4/mergebamalignment/main.nf index 7ba9ccda..ff51de06 100644 --- a/modules/gatk4/mergebamalignment/main.nf +++ b/modules/gatk4/mergebamalignment/main.nf @@ -2,10 +2,10 @@ process GATK4_MERGEBAMALIGNMENT { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(aligned), path(unmapped) @@ -43,4 +43,15 @@ process GATK4_MERGEBAMALIGNMENT { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + + 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/mergemutectstats/main.nf b/modules/gatk4/mergemutectstats/main.nf index 409e06f6..54311df7 100644 --- a/modules/gatk4/mergemutectstats/main.nf +++ b/modules/gatk4/mergemutectstats/main.nf @@ -2,10 +2,10 @@ process GATK4_MERGEMUTECTSTATS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(stats) diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index 06ff3acb..964c1a3b 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -2,10 +2,10 @@ process GATK4_MERGEVCFS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf) diff --git a/modules/gatk4/mutect2/main.nf b/modules/gatk4/mutect2/main.nf index 4a1f5768..abec0d73 100644 --- a/modules/gatk4/mutect2/main.nf +++ b/modules/gatk4/mutect2/main.nf @@ -2,10 +2,10 @@ process GATK4_MUTECT2 { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) @@ -57,4 +57,18 @@ process GATK4_MUTECT2 { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.vcf.gz + touch ${prefix}.vcf.gz.tbi + touch ${prefix}.vcf.gz.stats + touch ${prefix}.f1r2.tar.gz + + 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/revertsam/main.nf b/modules/gatk4/revertsam/main.nf index 4e8e9ddc..959c3e79 100644 --- a/modules/gatk4/revertsam/main.nf +++ b/modules/gatk4/revertsam/main.nf @@ -2,10 +2,10 @@ process GATK4_REVERTSAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -39,4 +39,15 @@ process GATK4_REVERTSAM { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.reverted.bam + + 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/samtofastq/main.nf b/modules/gatk4/samtofastq/main.nf index 8553e419..de83293a 100644 --- a/modules/gatk4/samtofastq/main.nf +++ b/modules/gatk4/samtofastq/main.nf @@ -2,10 +2,10 @@ process GATK4_SAMTOFASTQ { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -40,4 +40,17 @@ process GATK4_SAMTOFASTQ { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.fastq.gz + touch ${prefix}_1.fastq.gz + touch ${prefix}_2.fastq.gz + + 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/selectvariants/main.nf b/modules/gatk4/selectvariants/main.nf index 22779211..633c21f2 100644 --- a/modules/gatk4/selectvariants/main.nf +++ b/modules/gatk4/selectvariants/main.nf @@ -2,10 +2,10 @@ process GATK4_SELECTVARIANTS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_idx) diff --git a/modules/gatk4/splitintervals/main.nf b/modules/gatk4/splitintervals/main.nf new file mode 100644 index 00000000..9df66c21 --- /dev/null +++ b/modules/gatk4/splitintervals/main.nf @@ -0,0 +1,48 @@ +process GATK4_SPLITINTERVALS { + tag "$meta.id" + 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 val(meta), path(intervals) + path(fasta) + path(fasta_fai) + path(dict) + + output: + tuple val(meta), path("**.interval_list"), emit: split_intervals + 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 reference = fasta ? "--reference $fasta" : "" + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK SplitIntervals] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + + """ + gatk --java-options "-Xmx${avail_mem}g" SplitIntervals \\ + --output ${prefix} \\ + --intervals $intervals \\ + $reference \\ + --tmp-dir . \\ + $args + + 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/splitintervals/meta.yml b/modules/gatk4/splitintervals/meta.yml new file mode 100644 index 00000000..ba557544 --- /dev/null +++ b/modules/gatk4/splitintervals/meta.yml @@ -0,0 +1,53 @@ +name: gatk4_splitintervals +keywords: + - interval + - bed +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - interval: + type: file + description: Interval list or BED + pattern: "*.{interval,interval_list,bed}" + - fasta: + type: file + description: Reference FASTA + pattern: "*.{fa,fasta}" + - fasta_fai: + type: file + description: Reference FASTA index + pattern: "*.fai" + - dict: + type: file + description: Reference sequence dictionary + pattern: "*.dict" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bed: + type: file + description: A list of scattered interval lists + pattern: "*.interval_list" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@nvnieuwk" diff --git a/modules/gatk4/splitncigarreads/main.nf b/modules/gatk4/splitncigarreads/main.nf index f7c559d9..456ec055 100644 --- a/modules/gatk4/splitncigarreads/main.nf +++ b/modules/gatk4/splitncigarreads/main.nf @@ -2,13 +2,13 @@ process GATK4_SPLITNCIGARREADS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(bam), path(bai), path(intervals) path fasta path fai path dict @@ -23,6 +23,7 @@ process GATK4_SPLITNCIGARREADS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def interval_command = intervals ? "--intervals $intervals" : "" def avail_mem = 3 if (!task.memory) { @@ -35,6 +36,7 @@ process GATK4_SPLITNCIGARREADS { --input $bam \\ --output ${prefix}.bam \\ --reference $fasta \\ + $interval_command \\ --tmp-dir . \\ $args diff --git a/modules/gatk4/splitncigarreads/meta.yml b/modules/gatk4/splitncigarreads/meta.yml index 407e80bd..76bfdcd3 100644 --- a/modules/gatk4/splitncigarreads/meta.yml +++ b/modules/gatk4/splitncigarreads/meta.yml @@ -23,6 +23,13 @@ input: type: list description: BAM/SAM/CRAM file containing reads pattern: "*.{bam,sam,cram}" + - bai: + type: list + description: BAI/SAI/CRAI index file (optional) + pattern: "*.{bai,sai,crai}" + - intervals: + type: file + description: Bed file with the genomic regions included in the library (optional) - fasta: type: file description: The reference fasta file diff --git a/modules/gatk4/variantfiltration/main.nf b/modules/gatk4/variantfiltration/main.nf index 6beb87ef..cda06e11 100644 --- a/modules/gatk4/variantfiltration/main.nf +++ b/modules/gatk4/variantfiltration/main.nf @@ -2,10 +2,10 @@ process GATK4_VARIANTFILTRATION { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi) diff --git a/modules/gatk4/variantrecalibrator/main.nf b/modules/gatk4/variantrecalibrator/main.nf index cdcc1221..120aeade 100644 --- a/modules/gatk4/variantrecalibrator/main.nf +++ b/modules/gatk4/variantrecalibrator/main.nf @@ -2,10 +2,10 @@ process GATK4_VARIANTRECALIBRATOR { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + 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.5.0--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0': + 'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi) diff --git a/modules/genomescope2/main.nf b/modules/genomescope2/main.nf new file mode 100644 index 00000000..2ddf9e43 --- /dev/null +++ b/modules/genomescope2/main.nf @@ -0,0 +1,40 @@ +process GENOMESCOPE2 { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::genomescope2=2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/genomescope2:2.0--py310r41hdfd78af_5': + 'quay.io/biocontainers/genomescope2:2.0--py310r41hdfd78af_5' }" + + input: + tuple val(meta), path(histogram) + + output: + tuple val(meta), path("*_linear_plot.png") , emit: linear_plot_png + tuple val(meta), path("*_transformed_linear_plot.png"), emit: transformed_linear_plot_png + tuple val(meta), path("*_log_plot.png") , emit: log_plot_png + tuple val(meta), path("*_transformed_log_plot.png") , emit: transformed_log_plot_png + tuple val(meta), path("*_model.txt") , emit: model + tuple val(meta), path("*_summary.txt") , emit: summary + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + genomescope2 \\ + --input $histogram \\ + $args \\ + --output . \\ + --name_prefix $prefix + + cat <<-END_VERSIONS > versions.yml + '${task.process}': + genomescope2: \$( genomescope2 -v | sed 's/GenomeScope //' ) + END_VERSIONS + """ +} diff --git a/modules/genomescope2/meta.yml b/modules/genomescope2/meta.yml new file mode 100644 index 00000000..505daafe --- /dev/null +++ b/modules/genomescope2/meta.yml @@ -0,0 +1,67 @@ +name: "genomescope2" +description: Estimate genome heterozygosity, repeat content, and size from sequencing reads using a kmer-based statistical approach +keywords: + - "genome size" + - "genome heterozygosity" + - "repeat content" +tools: + - "genomescope2": + description: "Reference-free profiling of polyploid genomes" + homepage: "http://qb.cshl.edu/genomescope/genomescope2.0/" + documentation: "https://github.com/tbenavi1/genomescope2.0/blob/master/README.md" + tool_dev_url: "https://github.com/tbenavi1/genomescope2.0" + doi: "https://doi.org/10.1038/s41467-020-14998-3" + licence: "['Apache License, Version 2.0 (Apache-2.0)']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - histogram: + type: file + description: A K-mer histogram file + pattern: "*.hist" + +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" + - linear_plot_png: + type: file + description: A genomescope2 linear plot in PNG format + pattern: "*_linear_plot.png" + - linear_plot_png: + type: file + description: A genomescope2 linear plot in PNG format + pattern: "*_linear_plot.png" + - transformed_linear_plot_png: + type: file + description: A genomescope2 transformed linear plot in PNG format + pattern: "*_transformed_linear_plot.png" + - log_plot_png: + type: file + description: A genomescope2 log plot in PNG format + pattern: "*_log_plot.png" + - transformed_log_plot_png: + type: file + description: A genomescope2 transformed log plot in PNG format + pattern: "*_transformed_log_plot.png" + - model: + type: file + description: Genomescope2 model fit summary + pattern: "*_model.txt" + - summary: + type: file + description: Genomescope2 histogram summary + pattern: "*_summary.txt" + +authors: + - "@mahesh-panchal" diff --git a/modules/gunzip/main.nf b/modules/gunzip/main.nf index 9d4b0666..61bf1afa 100644 --- a/modules/gunzip/main.nf +++ b/modules/gunzip/main.nf @@ -4,8 +4,8 @@ process GUNZIP { conda (params.enable_conda ? "conda-forge::sed=4.7" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : - 'biocontainers/biocontainers:v1.2.0_cv1' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" input: tuple val(meta), path(archive) diff --git a/modules/happy/happy/main.nf b/modules/happy/happy/main.nf new file mode 100644 index 00000000..1bb99117 --- /dev/null +++ b/modules/happy/happy/main.nf @@ -0,0 +1,42 @@ +def VERSION = '0.3.14' + +process HAPPY_HAPPY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::hap.py=0.3.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hap.py:0.3.14--py27h5c5a3ab_0': + 'quay.io/biocontainers/hap.py:0.3.14--py27h5c5a3ab_0' }" + + input: + tuple val(meta), path(truth_vcf), path(query_vcf), path(bed) + tuple path(fasta), path(fasta_fai) + + output: + tuple val(meta), path('*.csv'), path('*.json') , emit: metrics + 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}" + + """ + hap.py \\ + $truth_vcf \\ + $query_vcf \\ + $args \\ + --reference $fasta \\ + --threads $task.cpus \\ + -R $bed \\ + -o $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hap.py: $VERSION + END_VERSIONS + """ +} diff --git a/modules/happy/happy/meta.yml b/modules/happy/happy/meta.yml new file mode 100644 index 00000000..8ec762d5 --- /dev/null +++ b/modules/happy/happy/meta.yml @@ -0,0 +1,67 @@ +name: "happy_happy" +description: Hap.py is a tool to compare diploid genotypes at haplotype level. Rather than comparing VCF records row by row, hap.py will generate and match alternate sequences in a superlocus. A superlocus is a small region of the genome (sized between 1 and around 1000 bp) that contains one or more variants. +keywords: + - happy + - benchmark + - haplotype +tools: + - "happy": + description: "Haplotype VCF comparison tools" + homepage: "https://www.illumina.com/products/by-type/informatics-products/basespace-sequence-hub/apps/hap-py-benchmarking.html" + documentation: "https://github.com/Illumina/hap.py" + tool_dev_url: "https://github.com/Illumina/hap.py" + doi: "" + licence: "['BSD-2-clause']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - truth_vcf: + type: file + description: gold standard VCF file + pattern: "*.{vcf,vcf.gz}" + - query_vcf: + type: file + description: VCF/GVCF file to query + pattern: "*.{vcf,vcf.gz}" + - bed: + type: file + description: BED file + pattern: "*.bed" + - fasta: + type: file + description: FASTA file of the reference genome + pattern: "*.{fa,fasta}" + - fasta_fai: + type: file + description: The index of the reference FASTA + pattern: "*.fai" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - summary: + type: file + description: A CSV file containing the summary of the benchmarking + pattern: "*.summary.csv" + - extended: + type: file + description: A CSV file containing extended info of the benchmarking + pattern: "*.extended.csv" + - runinfo: + type: file + description: A JSON file containing the run info + pattern: "*.runinfo.json" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@nvnieuwk" diff --git a/modules/happy/prepy/main.nf b/modules/happy/prepy/main.nf new file mode 100644 index 00000000..936f56ea --- /dev/null +++ b/modules/happy/prepy/main.nf @@ -0,0 +1,41 @@ +def VERSION = '0.3.14' + +process HAPPY_PREPY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::hap.py=0.3.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hap.py:0.3.14--py27h5c5a3ab_0': + 'quay.io/biocontainers/hap.py:0.3.14--py27h5c5a3ab_0' }" + + input: + tuple val(meta), path(vcf), path(bed) + tuple path(fasta), path(fasta_fai) + + output: + tuple val(meta), path('*.vcf.gz') , emit: preprocessed_vcf + 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}" + + """ + pre.py \\ + $args \\ + -R $bed \\ + --reference $fasta \\ + --threads $task.cpus \\ + $vcf \\ + ${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pre.py: $VERSION + END_VERSIONS + """ +} diff --git a/modules/happy/prepy/meta.yml b/modules/happy/prepy/meta.yml new file mode 100644 index 00000000..7e27a652 --- /dev/null +++ b/modules/happy/prepy/meta.yml @@ -0,0 +1,55 @@ +name: "happy_prepy" +description: Pre.py is a preprocessing tool made to preprocess VCF files for Hap.py +keywords: + - happy + - benchmark + - haplotype +tools: + - "happy": + description: "Haplotype VCF comparison tools" + homepage: "https://www.illumina.com/products/by-type/informatics-products/basespace-sequence-hub/apps/hap-py-benchmarking.html" + documentation: "https://github.com/Illumina/hap.py" + tool_dev_url: "https://github.com/Illumina/hap.py" + doi: "" + licence: "['BSD-2-clause']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file to preprocess + pattern: "*.{vcf,vcf.gz}" + - bed: + type: file + description: BED file + pattern: "*.bed" + - fasta: + type: file + description: FASTA file of the reference genome + pattern: "*.{fa,fasta}" + - fasta_fai: + type: file + description: The index of the reference FASTA + pattern: "*.fai" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: A preprocessed VCF file + pattern: "*.vcf.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@nvnieuwk" diff --git a/modules/hmtnote/main.nf b/modules/hmtnote/main.nf new file mode 100644 index 00000000..a1796924 --- /dev/null +++ b/modules/hmtnote/main.nf @@ -0,0 +1,45 @@ +process HMTNOTE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::hmtnote=0.7.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmtnote:0.7.2--pyhdfd78af_0': + 'quay.io/biocontainers/hmtnote:0.7.2--pyhdfd78af_0' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*_annotated.vcf"), emit: vcf + 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}" + + """ + hmtnote \\ + annotate \\ + $vcf \\ + ${prefix}_annotated.vcf \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' )) + END_VERSIONS + """ + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_annotated.vcf + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' )) + END_VERSIONS + """ +} diff --git a/modules/hmtnote/meta.yml b/modules/hmtnote/meta.yml new file mode 100644 index 00000000..92b4be1b --- /dev/null +++ b/modules/hmtnote/meta.yml @@ -0,0 +1,39 @@ +name: hmtnote +description: Human mitochondrial variants annotation using HmtVar. +keywords: + - hmtnote mitochondria annotation +tools: + - hmtnote: + description: Human mitochondrial variants annotation using HmtVar. + homepage: https://github.com/robertopreste/HmtNote + documentation: https://hmtnote.readthedocs.io/en/latest/usage.html + tool_dev_url: None + doi: "https://doi.org/10.1101/600619" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + - vcf: + type: file + description: vcf file + pattern: "*.vcf" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: annotated vcf + pattern: "*_annotated.vcf" + +authors: + - "@sysbiocoder" diff --git a/modules/krona/kronadb/main.nf b/modules/krona/kronadb/main.nf index afcb0694..eaab43f0 100644 --- a/modules/krona/kronadb/main.nf +++ b/modules/krona/kronadb/main.nf @@ -18,7 +18,9 @@ process KRONA_KRONADB { script: def args = task.ext.args ?: '' """ - ktUpdateTaxonomy.sh taxonomy + ktUpdateTaxonomy.sh \\ + $args \\ + taxonomy/ cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/krona/ktimporttaxonomy/main.nf b/modules/krona/ktimporttaxonomy/main.nf index 7837bb87..bc78c6ba 100644 --- a/modules/krona/ktimporttaxonomy/main.nf +++ b/modules/krona/ktimporttaxonomy/main.nf @@ -23,7 +23,10 @@ process KRONA_KTIMPORTTAXONOMY { script: def args = task.ext.args ?: '' """ - ktImportTaxonomy "$report" -tax taxonomy + ktImportTaxonomy \\ + $args \\ + -tax taxonomy/ \\ + "$report" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/krona/ktimporttaxonomy/meta.yml b/modules/krona/ktimporttaxonomy/meta.yml index b65919f8..df0ad1c9 100644 --- a/modules/krona/ktimporttaxonomy/meta.yml +++ b/modules/krona/ktimporttaxonomy/meta.yml @@ -23,8 +23,11 @@ input: Groovy Map containing sample information e.g. [ id:'test'] - database: - type: path - description: "Path to the taxonomy database downloaded by krona/kronadb" + type: file + description: | + Path to the taxonomy database .tab file downloaded by krona/ktUpdateTaxonomy + The file will be saved under a folder named "taxonomy" as "taxonomy/taxonomy.tab". + The parent folder will be passed as argument to ktImportTaxonomy. - report: type: file description: "A tab-delimited file with taxonomy IDs and (optionally) query IDs, magnitudes, and scores. Query IDs are taken from column 1, taxonomy IDs from column 2, and scores from column 3. Lines beginning with # will be ignored." diff --git a/modules/krona/ktimporttext/main.nf b/modules/krona/ktimporttext/main.nf new file mode 100644 index 00000000..de0cfc22 --- /dev/null +++ b/modules/krona/ktimporttext/main.nf @@ -0,0 +1,34 @@ +process KRONA_KTIMPORTTEXT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::krona=2.8.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/krona:2.8.1--pl5321hdfd78af_1': + 'quay.io/biocontainers/krona:2.8.1--pl5321hdfd78af_1' }" + + input: + tuple val(meta), path(report) + + output: + tuple val(meta), path ('*.html'), emit: html + 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}" + """ + ktImportText \\ + $args \\ + -o ${prefix}.html \\ + $report + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + krona: \$( echo \$(ktImportText 2>&1) | sed 's/^.*KronaTools //g; s/- ktImportText.*\$//g') + END_VERSIONS + """ +} diff --git a/modules/krona/ktimporttext/meta.yml b/modules/krona/ktimporttext/meta.yml new file mode 100644 index 00000000..a7108e0d --- /dev/null +++ b/modules/krona/ktimporttext/meta.yml @@ -0,0 +1,47 @@ +name: "krona_ktimporttext" +description: Creates a Krona chart from text files listing quantities and lineages. +keywords: + - plot + - taxonomy + - interactive + - html + - visualisation + - krona chart + - metagenomics +tools: + - krona: + description: Krona Tools is a set of scripts to create Krona charts from several Bioinformatics tools as well as from text and XML files. + homepage: https://github.com/marbl/Krona/wiki/KronaTools + documentation: http://manpages.ubuntu.com/manpages/impish/man1/ktImportTaxonomy.1.html + tool_dev_url: https://github.com/marbl/Krona + doi: 10.1186/1471-2105-12-385 + licence: https://raw.githubusercontent.com/marbl/Krona/master/KronaTools/LICENSE.txt + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test'] + - report: + type: file + description: "Tab-delimited text file. Each line should be a number followed by a list of wedges to contribute to (starting from the highest level). If no wedges are listed (and just a quantity is given), it will contribute to the top level. If the same lineage is listed more than once, the values will be added. Quantities can be omitted if -q is specified. Lines beginning with '#' will be ignored." + pattern: "*.{txt}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - html: + type: file + description: A html file containing an interactive krona plot. + pattern: "*.{html}" + +authors: + - "@jianhong" diff --git a/modules/krona/ktupdatetaxonomy/main.nf b/modules/krona/ktupdatetaxonomy/main.nf new file mode 100644 index 00000000..8326f219 --- /dev/null +++ b/modules/krona/ktupdatetaxonomy/main.nf @@ -0,0 +1,30 @@ +def VERSION='2.7.1' // Version information not provided by tool on CLI + +process KRONA_KTUPDATETAXONOMY { + label 'process_low' + + conda (params.enable_conda ? "bioconda::krona=2.7.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/krona:2.7.1--pl526_5' : + 'quay.io/biocontainers/krona:2.7.1--pl526_5' }" + + output: + path 'taxonomy/taxonomy.tab', emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + ktUpdateTaxonomy.sh \\ + $args \\ + taxonomy/ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + krona: $VERSION + END_VERSIONS + """ +} diff --git a/modules/krona/ktupdatetaxonomy/meta.yml b/modules/krona/ktupdatetaxonomy/meta.yml new file mode 100644 index 00000000..945b5062 --- /dev/null +++ b/modules/krona/ktupdatetaxonomy/meta.yml @@ -0,0 +1,31 @@ +name: krona_ktupdatetaxonomy +description: KronaTools Update Taxonomy downloads a taxonomy database +keywords: + - database + - taxonomy + - krona + - visualisation +tools: + - krona: + description: Krona Tools is a set of scripts to create Krona charts from several Bioinformatics tools as well as from text and XML files. + homepage: https://github.com/marbl/Krona/wiki/KronaTools + documentation: https://github.com/marbl/Krona/wiki/Installing + tool_dev_url: + doi: https://doi.org/10.1186/1471-2105-12-385 + licence: + +input: + - none: There is no input. This module downloads a pre-built taxonomy database for use with Krona Tools. + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - db: + type: file + description: A TAB separated file that contains a taxonomy database. + pattern: "*.{tab}" + +authors: + - "@mjakobs" diff --git a/modules/mash/screen/main.nf b/modules/mash/screen/main.nf new file mode 100644 index 00000000..3e7859ed --- /dev/null +++ b/modules/mash/screen/main.nf @@ -0,0 +1,38 @@ +process MASH_SCREEN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::mash=2.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mash:2.3--he348c14_1': + 'quay.io/biocontainers/mash:2.3--he348c14_1' }" + + input: + tuple val(meta), path(query_sketch) + path fastx_db + + output: + tuple val(meta), path("*.screen"), emit: screen + 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}" + """ + mash \\ + screen \\ + $args \\ + -p $task.cpus \\ + $query_sketch \\ + $fastx_db \\ + > ${prefix}.screen + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mash: \$( mash --version ) + END_VERSIONS + """ +} diff --git a/modules/mash/screen/meta.yml b/modules/mash/screen/meta.yml new file mode 100644 index 00000000..81e455bc --- /dev/null +++ b/modules/mash/screen/meta.yml @@ -0,0 +1,47 @@ +name: "mash_screen" +description: Screens query sequences against large sequence databases +keywords: + - screen + - containment + - contamination + - taxonomic assignment +tools: + - "mash": + description: Fast sequence distance estimator that uses MinHash + homepage: https://github.com/marbl/Mash + documentation: https://mash.readthedocs.io/en/latest/sketches.html + tool_dev_url: https://github.com/marbl/Mash + doi: "10.1186/s13059-016-0997-x" + licence: ["https://github.com/marbl/Mash/blob/master/LICENSE.txt"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - query_sketch: + type: file + description: MinHash sketch of query sequences + pattern: "*.msh" + - fastx_db: + type: file + description: Sequence files to match against + +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" + - screen: + type: file + description: List of sequences from fastx_db similar to query sequences + pattern: "*.screen" + +authors: + - "@mahesh-panchal" diff --git a/modules/maxquant/lfq/main.nf b/modules/maxquant/lfq/main.nf new file mode 100644 index 00000000..3fc45725 --- /dev/null +++ b/modules/maxquant/lfq/main.nf @@ -0,0 +1,37 @@ +process MAXQUANT_LFQ { + tag "$meta.id" + label 'process_long' + conda (params.enable_conda ? "bioconda::maxquant=2.0.3.0=py310hdfd78af_1" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/maxquant:2.0.3.0--py310hdfd78af_1" + } else { + container "quay.io/biocontainers/maxquant:2.0.3.0--py310hdfd78af_1" + } + + input: + tuple val(meta), path(fasta), path(paramfile) + path raw + + output: + tuple val(meta), path("*.txt"), emit: maxquant_txt + 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}" + + """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + maxquant: \$(maxquant --version 2>&1 > /dev/null | cut -f2 -d\" \") + END_VERSIONS + sed \"s_.*_$task.cpus_\" ${paramfile} > mqpar_changed.xml + sed -i \"s|PLACEHOLDER|\$PWD/|g\" mqpar_changed.xml + mkdir temp + maxquant mqpar_changed.xml + mv combined/txt/*.txt . + """ +} diff --git a/modules/maxquant/lfq/meta.yml b/modules/maxquant/lfq/meta.yml new file mode 100644 index 00000000..1078fc7a --- /dev/null +++ b/modules/maxquant/lfq/meta.yml @@ -0,0 +1,52 @@ +name: maxquant_lfq +description: Run standard proteomics data analysis with MaxQuant, mostly dedicated to label-free. Paths to fasta and raw files needs to be marked by "PLACEHOLDER" +keywords: + - sort +tools: + - maxquant: + description: MaxQuant is a quantitative proteomics software package designed for analyzing large mass-spectrometric data sets. License restricted. + homepage: None + documentation: None + tool_dev_url: None + doi: "" + licence: ["http://www.coxdocs.org/lib/exe/fetch.php?media=license_agreement.pdf"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + + - raw: + type: file + description: raw files with mass spectra + pattern: "*.{raw,RAW,Raw}" + + - fasta: + type: file + description: fasta file with protein sequences + pattern: "*.{fasta}" + + - parfile: + type: file + description: MaxQuant parameter file (XML) + pattern: "*.{xml}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software version + pattern: "versions.yml" + - maxquant_txt: + type: file + description: tables with peptides and protein information + pattern: "*.{txt}" + +authors: + - "@veitveit" diff --git a/modules/md5sum/main.nf b/modules/md5sum/main.nf new file mode 100644 index 00000000..2b516f1b --- /dev/null +++ b/modules/md5sum/main.nf @@ -0,0 +1,35 @@ +process MD5SUM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "conda-forge::coreutils=9.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" + + input: + tuple val(meta), path(file) + + output: + tuple val(meta), path("*.md5"), emit: checksum + 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}" + + """ + md5sum \\ + $args \\ + ${file} \\ + > ${file}.md5 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + md5sum: \$(echo \$(md5sum --version 2>&1 | head -n 1| sed 's/^.*) //;' )) + END_VERSIONS + """ +} diff --git a/modules/md5sum/meta.yml b/modules/md5sum/meta.yml new file mode 100644 index 00000000..d4f1939d --- /dev/null +++ b/modules/md5sum/meta.yml @@ -0,0 +1,39 @@ +name: "md5sum" +description: Create an MD5 (128-bit) checksum +keywords: + - checksum +tools: + - "md5sum": + description: Create an MD5 (128-bit) checksum + homepage: "https://www.gnu.org" + documentation: "https://man7.org/linux/man-pages/man1/md5sum.1.html" + licence: GPLv3+ + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - file: + type: file + description: Any file + pattern: "*.*" + +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" + - checksum: + type: file + description: File containing checksum + pattern: "*.md5" + +authors: + - "@matthdsm" diff --git a/modules/meryl/count/main.nf b/modules/meryl/count/main.nf new file mode 100644 index 00000000..f7a2811d --- /dev/null +++ b/modules/meryl/count/main.nf @@ -0,0 +1,37 @@ +process MERYL_COUNT { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::meryl=1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': + 'quay.io/biocontainers/meryl:1.3--h87f3376_1' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.meryldb"), emit: meryl_db + 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}" + """ + for READ in $reads; do + meryl count \\ + threads=$task.cpus \\ + $args \\ + $reads \\ + output read.\${READ%.f*}.meryldb + done + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ +} diff --git a/modules/meryl/count/meta.yml b/modules/meryl/count/meta.yml new file mode 100644 index 00000000..854f8759 --- /dev/null +++ b/modules/meryl/count/meta.yml @@ -0,0 +1,43 @@ +name: "meryl_count" +description: A genomic k-mer counter (and sequence utility) with nice features. +keywords: + - k-mer + - count +tools: + - "meryl": + description: "A genomic k-mer counter (and sequence utility) with nice features. " + homepage: "https://github.com/marbl/meryl" + documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" + tool_dev_url: "https://github.com/marbl/meryl" + doi: "" + licence: "['GPL']" + +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" + - meryl_db: + type: directory + description: A Meryl k-mer database + pattern: "*.meryldb" + +authors: + - "@mahesh-panchal" diff --git a/modules/meryl/histogram/main.nf b/modules/meryl/histogram/main.nf new file mode 100644 index 00000000..a1f18f05 --- /dev/null +++ b/modules/meryl/histogram/main.nf @@ -0,0 +1,34 @@ +process MERYL_HISTOGRAM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::meryl=1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': + 'quay.io/biocontainers/meryl:1.3--h87f3376_1' }" + + input: + tuple val(meta), path(meryl_db) + + output: + tuple val(meta), path("*.hist"), emit: hist + 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}" + """ + meryl histogram \\ + threads=$task.cpus \\ + $args \\ + $meryl_db > ${prefix}.hist + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ +} diff --git a/modules/meryl/histogram/meta.yml b/modules/meryl/histogram/meta.yml new file mode 100644 index 00000000..b786e076 --- /dev/null +++ b/modules/meryl/histogram/meta.yml @@ -0,0 +1,41 @@ +name: "meryl_histogram" +description: A genomic k-mer counter (and sequence utility) with nice features. +keywords: + - k-mer + - histogram +tools: + - "meryl": + description: "A genomic k-mer counter (and sequence utility) with nice features. " + homepage: "https://github.com/marbl/meryl" + documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" + tool_dev_url: "https://github.com/marbl/meryl" + doi: "" + licence: "['GPL']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meryl_dbs: + type: directory + description: Meryl k-mer database + +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: Histogram of k-mers + pattern: "*.hist" + +authors: + - "@mahesh-panchal" diff --git a/modules/meryl/unionsum/main.nf b/modules/meryl/unionsum/main.nf new file mode 100644 index 00000000..98baa870 --- /dev/null +++ b/modules/meryl/unionsum/main.nf @@ -0,0 +1,35 @@ +process MERYL_UNIONSUM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::meryl=1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': + 'quay.io/biocontainers/meryl:1.3--h87f3376_1' }" + + input: + tuple val(meta), path(meryl_dbs) + + output: + tuple val(meta), path("*.unionsum.meryldb"), emit: meryl_db + 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}" + """ + meryl union-sum \\ + threads=$task.cpus \\ + $args \\ + output ${prefix}.unionsum.meryldb \\ + $meryl_dbs + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ +} diff --git a/modules/meryl/unionsum/meta.yml b/modules/meryl/unionsum/meta.yml new file mode 100644 index 00000000..cea7f0f6 --- /dev/null +++ b/modules/meryl/unionsum/meta.yml @@ -0,0 +1,41 @@ +name: "meryl_unionsum" +description: A genomic k-mer counter (and sequence utility) with nice features. +keywords: + - k-mer + - unionsum +tools: + - "meryl": + description: "A genomic k-mer counter (and sequence utility) with nice features. " + homepage: "https://github.com/marbl/meryl" + documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" + tool_dev_url: "https://github.com/marbl/meryl" + doi: "" + licence: "['GPL']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meryl_dbs: + type: directory + description: Meryl k-mer databases + +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" + - meryl_db: + type: directory + description: A Meryl k-mer database that is the union sum of the input databases + pattern: "*.unionsum.meryldb" + +authors: + - "@mahesh-panchal" diff --git a/modules/metaphlan3/main.nf b/modules/metaphlan3/main.nf index 3fc6b277..bff0eb9a 100644 --- a/modules/metaphlan3/main.nf +++ b/modules/metaphlan3/main.nf @@ -23,7 +23,7 @@ process METAPHLAN3 { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input_type = ("$input".endsWith(".fastq.gz")) ? "--input_type fastq" : ("$input".contains(".fasta")) ? "--input_type fasta" : ("$input".endsWith(".bowtie2out.txt")) ? "--input_type bowtie2out" : "--input_type sam" + def input_type = ("$input".endsWith(".fastq.gz") || "$input".endsWith(".fq.gz")) ? "--input_type fastq" : ("$input".contains(".fasta")) ? "--input_type fasta" : ("$input".endsWith(".bowtie2out.txt")) ? "--input_type bowtie2out" : "--input_type sam" def input_data = ("$input_type".contains("fastq")) && !meta.single_end ? "${input[0]},${input[1]}" : "$input" def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt" diff --git a/modules/minimap2/align/main.nf b/modules/minimap2/align/main.nf index fe06f14d..08ac6eef 100644 --- a/modules/minimap2/align/main.nf +++ b/modules/minimap2/align/main.nf @@ -2,18 +2,22 @@ process MINIMAP2_ALIGN { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? 'bioconda::minimap2=2.21' : null) + conda (params.enable_conda ? 'bioconda::minimap2=2.21 bioconda::samtools=1.12' : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/minimap2:2.21--h5bf99c6_0' : - 'quay.io/biocontainers/minimap2:2.21--h5bf99c6_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' : + 'quay.io/biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' }" input: tuple val(meta), path(reads) path reference + val bam_format + val cigar_paf_format + val cigar_bam output: - tuple val(meta), path("*.paf"), emit: paf - path "versions.yml" , emit: versions + tuple val(meta), path("*.paf"), optional: true, emit: paf + tuple val(meta), path("*.bam"), optional: true, emit: bam + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -22,13 +26,19 @@ process MINIMAP2_ALIGN { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def input_reads = meta.single_end ? "$reads" : "${reads[0]} ${reads[1]}" + def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" + def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' + def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' """ minimap2 \\ $args \\ -t $task.cpus \\ $reference \\ $input_reads \\ - > ${prefix}.paf + $cigar_paf \\ + $set_cigar_bam \\ + $bam_output + cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/minimap2/align/meta.yml b/modules/minimap2/align/meta.yml index 89e24283..991b39a0 100644 --- a/modules/minimap2/align/meta.yml +++ b/modules/minimap2/align/meta.yml @@ -29,6 +29,17 @@ input: type: file description: | Reference database in FASTA format. + - bam_format: + type: boolean + description: Specify that output should be in BAM format + - cigar_paf_format: + type: boolean + description: Specify that output CIGAR should be in PAF format + - cigar_bam: + type: boolean + description: | + Write CIGAR with >65535 ops at the CG tag. This is recommended when + doing XYZ (https://github.com/lh3/minimap2#working-with-65535-cigar-operations) output: - meta: type: map @@ -39,9 +50,16 @@ output: type: file description: Alignment in PAF format pattern: "*.paf" + - bam: + type: file + description: Alignment in BAM format + pattern: "*.bam" - versions: type: file description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" + - "@sofstam" + - "@sateeshperi" + - "@jfy133" diff --git a/modules/motus/downloaddb/main.nf b/modules/motus/downloaddb/main.nf new file mode 100644 index 00000000..317624b5 --- /dev/null +++ b/modules/motus/downloaddb/main.nf @@ -0,0 +1,39 @@ +process MOTUS_DOWNLOADDB { + label 'process_low' + + conda (params.enable_conda ? "bioconda::motus=3.0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/motus:3.0.1--pyhdfd78af_0': + 'quay.io/biocontainers/motus:3.0.1--pyhdfd78af_0' }" + + input: + path motus_downloaddb_script + + output: + path "db_mOTU/" , emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def software = "${motus_downloaddb_script.simpleName}_copy.py" + """ + ## must copy script file to working directory, + ## otherwise the reference_db will be download to bin folder + ## other than current directory + cp $motus_downloaddb_script ${software} + python ${software} \\ + $args \\ + -t $task.cpus + + ## mOTUs version number is not available from command line. + ## mOTUs save the version number in index database folder. + ## mOTUs will check the database version is same version as exec version. + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mOTUs: \$(grep motus db_mOTU/db_mOTU_versions | sed 's/motus\\t//g') + END_VERSIONS + """ +} diff --git a/modules/motus/downloaddb/meta.yml b/modules/motus/downloaddb/meta.yml new file mode 100644 index 00000000..64df5ee0 --- /dev/null +++ b/modules/motus/downloaddb/meta.yml @@ -0,0 +1,39 @@ +name: "motus_downloaddb" +description: Download the mOTUs database +keywords: + - classify + - metagenomics + - fastq + - taxonomic profiling + - database + - download +tools: + - "motus": + description: "The mOTU profiler is a computational tool that estimates relative taxonomic abundance of known and currently unknown microbial community members using metagenomic shotgun sequencing data." + homepage: "None" + documentation: "https://github.com/motu-tool/mOTUs/wiki" + tool_dev_url: "https://github.com/motu-tool/mOTUs" + doi: "10.1038/s41467-019-08844-4" + licence: "['GPL v3']" + +input: + - motus_downloaddb: + type: directory + description: | + The mOTUs downloadDB script source file. + It is the source file installed or + remote source in github such as https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py + pattern: "downloadDB.py" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - db: + type: directory + description: The mOTUs database directory + pattern: "db_mOTU" + +authors: + - "@jianhong" diff --git a/modules/motus/profile/main.nf b/modules/motus/profile/main.nf new file mode 100644 index 00000000..6a1acd3d --- /dev/null +++ b/modules/motus/profile/main.nf @@ -0,0 +1,54 @@ +process MOTUS_PROFILE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::motus=3.0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/motus:3.0.1--pyhdfd78af_0': + 'quay.io/biocontainers/motus:3.0.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(reads) + path db + + output: + tuple val(meta), path("*.out"), emit: out + tuple val(meta), path("*.bam"), optional: true, emit: bam + tuple val(meta), path("*.mgc"), optional: true, emit: mgc + 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 inputs = reads[0].getExtension() == 'bam' ? + "-i ${reads}" : + reads[0].getExtension() == 'mgc' ? "-m $reads" : + meta.single_end ? + "-s $reads" : "-f ${reads[0]} -r ${reads[1]}" + def refdb = db ? "-db ${db}" : "" + """ + motus profile \\ + $args \\ + $inputs \\ + $refdb \\ + -t $task.cpus \\ + -n $prefix \\ + -o ${prefix}.out + + ## mOTUs version number is not available from command line. + ## mOTUs save the version number in index database folder. + ## mOTUs will check the database version is same version as exec version. + if [ "$db" == "" ]; then + VERSION=\$(echo \$(motus -h 2>&1) | sed 's/^.*Version: //; s/References.*\$//') + else + VERSION=\$(grep motus $db/db_mOTU_versions | sed 's/motus\\t//g') + fi + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mOTUs: \$VERSION + END_VERSIONS + """ +} diff --git a/modules/motus/profile/meta.yml b/modules/motus/profile/meta.yml new file mode 100644 index 00000000..19803bdc --- /dev/null +++ b/modules/motus/profile/meta.yml @@ -0,0 +1,61 @@ +name: "motus_profile" +description: Taxonomic meta-omics profiling using universal marker genes +keywords: + - classify + - metagenomics + - fastq + - taxonomic profiling +tools: + - "motus": + description: "Marker gene-based OTU (mOTU) profiling" + homepage: "https://motu-tool.org/" + documentation: "https://github.com/motu-tool/mOTUs/wiki" + tool_dev_url: "https://github.com/motu-tool/mOTUs" + doi: "10.1038/s41467-019-08844-4" + 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/fasta files of size 1 and 2 for single-end and paired-end data, + respectively. + Or the intermediate bam file mapped by bwa to the mOTUs database or + the output bam file from motus profile. + Or the intermediate mgc read counts table. + pattern: "*.{fastq,fq,fasta,fa,fastq.gz,fq.gz,fasta.gz,fa.gz,.bam,.mgc}" + - db: + type: directory + description: | + mOTUs database downloaded by `motus downloadDB` + +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" + - out: + type: file + description: Results with taxonomic classification of each read + pattern: "*.out" + - bam: + type: file + description: Optional intermediate sorted BAM file from BWA + pattern: "*.{bam}" + - mgc: + type: file + description: Optional intermediate mgc read count table file saved with `-M`. + pattern: "*.{mgc}" + +authors: + - "@jianhong" diff --git a/modules/phantompeakqualtools/main.nf b/modules/phantompeakqualtools/main.nf index f584cb65..d8f73342 100644 --- a/modules/phantompeakqualtools/main.nf +++ b/modules/phantompeakqualtools/main.nf @@ -22,11 +22,12 @@ process PHANTOMPEAKQUALTOOLS { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ RUN_SPP=`which run_spp.R` - Rscript $args -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus + Rscript $args -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" $args2 cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/addorreplacereadgroups/main.nf b/modules/picard/addorreplacereadgroups/main.nf index 8e1d10af..fd102f67 100644 --- a/modules/picard/addorreplacereadgroups/main.nf +++ b/modules/picard/addorreplacereadgroups/main.nf @@ -2,10 +2,10 @@ process PICARD_ADDORREPLACEREADGROUPS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::picard=2.26.9" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.9--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.9--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -38,12 +38,12 @@ process PICARD_ADDORREPLACEREADGROUPS { -Xmx${avail_mem}g \\ --INPUT ${bam} \\ --OUTPUT ${prefix}.bam \\ - -ID ${ID} \\ - -LB ${LIBRARY} \\ - -PL ${PLATFORM} \\ - -PU ${BARCODE} \\ - -SM ${SAMPLE} \\ - -CREATE_INDEX true + --RGID ${ID} \\ + --RGLB ${LIBRARY} \\ + --RGPL ${PLATFORM} \\ + --RGPU ${BARCODE} \\ + --RGSM ${SAMPLE} \\ + --CREATE_INDEX true cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/cleansam/main.nf b/modules/picard/cleansam/main.nf index fb435911..62989565 100644 --- a/modules/picard/cleansam/main.nf +++ b/modules/picard/cleansam/main.nf @@ -2,10 +2,10 @@ process PICARD_CLEANSAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.9" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.9--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.9--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -31,8 +31,8 @@ process PICARD_CLEANSAM { -Xmx${avail_mem}g \\ CleanSam \\ ${args} \\ - -I ${bam} \\ - -O ${prefix}.bam + --INPUT ${bam} \\ + --OUTPUT ${prefix}.bam cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/collecthsmetrics/main.nf b/modules/picard/collecthsmetrics/main.nf index ef7a9b9f..317aff4b 100644 --- a/modules/picard/collecthsmetrics/main.nf +++ b/modules/picard/collecthsmetrics/main.nf @@ -2,10 +2,10 @@ process PICARD_COLLECTHSMETRICS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -38,10 +38,10 @@ process PICARD_COLLECTHSMETRICS { CollectHsMetrics \\ $args \\ $reference \\ - -BAIT_INTERVALS $bait_intervals \\ - -TARGET_INTERVALS $target_intervals \\ - -INPUT $bam \\ - -OUTPUT ${prefix}.CollectHsMetrics.coverage_metrics + --BAIT_INTERVALS $bait_intervals \\ + --TARGET_INTERVALS $target_intervals \\ + --INPUT $bam \\ + --OUTPUT ${prefix}.CollectHsMetrics.coverage_metrics cat <<-END_VERSIONS > versions.yml diff --git a/modules/picard/collectmultiplemetrics/main.nf b/modules/picard/collectmultiplemetrics/main.nf index 340463a8..a653b549 100644 --- a/modules/picard/collectmultiplemetrics/main.nf +++ b/modules/picard/collectmultiplemetrics/main.nf @@ -2,10 +2,10 @@ process PICARD_COLLECTMULTIPLEMETRICS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -33,9 +33,9 @@ process PICARD_COLLECTMULTIPLEMETRICS { -Xmx${avail_mem}g \\ CollectMultipleMetrics \\ $args \\ - INPUT=$bam \\ - OUTPUT=${prefix}.CollectMultipleMetrics \\ - REFERENCE_SEQUENCE=$fasta + --INPUT $bam \\ + --OUTPUT ${prefix}.CollectMultipleMetrics \\ + --REFERENCE_SEQUENCE $fasta cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/collectwgsmetrics/main.nf b/modules/picard/collectwgsmetrics/main.nf index f4efaa4c..e6dd49e9 100644 --- a/modules/picard/collectwgsmetrics/main.nf +++ b/modules/picard/collectwgsmetrics/main.nf @@ -2,13 +2,13 @@ process PICARD_COLLECTWGSMETRICS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(bam) path fasta output: @@ -32,9 +32,10 @@ process PICARD_COLLECTWGSMETRICS { -Xmx${avail_mem}g \\ CollectWgsMetrics \\ $args \\ - INPUT=$bam \\ - OUTPUT=${prefix}.CollectWgsMetrics.coverage_metrics \\ - REFERENCE_SEQUENCE=$fasta + --INPUT $bam \\ + --OUTPUT ${prefix}.CollectWgsMetrics.coverage_metrics \\ + --REFERENCE_SEQUENCE $fasta + cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/createsequencedictionary/main.nf b/modules/picard/createsequencedictionary/main.nf index 96069e9f..2348c496 100644 --- a/modules/picard/createsequencedictionary/main.nf +++ b/modules/picard/createsequencedictionary/main.nf @@ -2,10 +2,10 @@ process PICARD_CREATESEQUENCEDICTIONARY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.9" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.9--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.9--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(fasta) @@ -31,8 +31,8 @@ process PICARD_CREATESEQUENCEDICTIONARY { -Xmx${avail_mem}g \\ CreateSequenceDictionary \\ $args \\ - R=$fasta \\ - O=${prefix}.dict + --REFERENCE $fasta \\ + --OUTPUT ${prefix}.dict cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/crosscheckfingerprints/main.nf b/modules/picard/crosscheckfingerprints/main.nf index b3dface5..d3b59402 100644 --- a/modules/picard/crosscheckfingerprints/main.nf +++ b/modules/picard/crosscheckfingerprints/main.nf @@ -2,10 +2,10 @@ process PICARD_CROSSCHECKFINGERPRINTS { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(input1) diff --git a/modules/picard/filtersamreads/main.nf b/modules/picard/filtersamreads/main.nf index ab75abfa..adedcdc2 100644 --- a/modules/picard/filtersamreads/main.nf +++ b/modules/picard/filtersamreads/main.nf @@ -2,10 +2,10 @@ process PICARD_FILTERSAMREADS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam), path(readlist) diff --git a/modules/picard/fixmateinformation/main.nf b/modules/picard/fixmateinformation/main.nf index 763f3bb4..539b1082 100644 --- a/modules/picard/fixmateinformation/main.nf +++ b/modules/picard/fixmateinformation/main.nf @@ -2,10 +2,10 @@ process PICARD_FIXMATEINFORMATION { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::picard=2.26.9" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.9--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.9--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -31,8 +31,8 @@ process PICARD_FIXMATEINFORMATION { picard \\ FixMateInformation \\ -Xmx${avail_mem}g \\ - -I ${bam} \\ - -O ${prefix}.bam \\ + --INPUT ${bam} \\ + --OUTPUT ${prefix}.bam \\ --VALIDATION_STRINGENCY ${STRINGENCY} cat <<-END_VERSIONS > versions.yml diff --git a/modules/picard/liftovervcf/main.nf b/modules/picard/liftovervcf/main.nf index cdbd637e..c92abfeb 100644 --- a/modules/picard/liftovervcf/main.nf +++ b/modules/picard/liftovervcf/main.nf @@ -2,10 +2,10 @@ process PICARD_LIFTOVERVCF { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(input_vcf) @@ -35,11 +35,11 @@ process PICARD_LIFTOVERVCF { -Xmx${avail_mem}g \\ LiftoverVcf \\ $args \\ - I=$input_vcf \\ - O=${prefix}.lifted.vcf.gz \\ - CHAIN=$chain \\ - REJECT=${prefix}.unlifted.vcf.gz \\ - R=$fasta + --INPUT $input_vcf \\ + --OUTPUT ${prefix}.lifted.vcf.gz \\ + --CHAIN $chain \\ + --REJECT ${prefix}.unlifted.vcf.gz \\ + --REFERENCE_SEQUENCE $fasta cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/markduplicates/main.nf b/modules/picard/markduplicates/main.nf index e754a587..1565c647 100644 --- a/modules/picard/markduplicates/main.nf +++ b/modules/picard/markduplicates/main.nf @@ -2,10 +2,10 @@ process PICARD_MARKDUPLICATES { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -33,9 +33,9 @@ process PICARD_MARKDUPLICATES { -Xmx${avail_mem}g \\ MarkDuplicates \\ $args \\ - I=$bam \\ - O=${prefix}.bam \\ - M=${prefix}.MarkDuplicates.metrics.txt + --INPUT $bam \\ + --OUTPUT ${prefix}.bam \\ + --METRICS_FILE ${prefix}.MarkDuplicates.metrics.txt cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/picard/mergesamfiles/main.nf b/modules/picard/mergesamfiles/main.nf index ef5c3980..1e32c63a 100644 --- a/modules/picard/mergesamfiles/main.nf +++ b/modules/picard/mergesamfiles/main.nf @@ -2,10 +2,10 @@ process PICARD_MERGESAMFILES { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bams) @@ -33,8 +33,8 @@ process PICARD_MERGESAMFILES { -Xmx${avail_mem}g \\ MergeSamFiles \\ $args \\ - ${'INPUT='+bam_files.join(' INPUT=')} \\ - OUTPUT=${prefix}.bam + ${'--INPUT '+bam_files.join(' --INPUT ')} \\ + --OUTPUT ${prefix}.bam cat <<-END_VERSIONS > versions.yml "${task.process}": picard: \$( echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) diff --git a/modules/picard/sortsam/main.nf b/modules/picard/sortsam/main.nf index adec17cb..cee60fd1 100644 --- a/modules/picard/sortsam/main.nf +++ b/modules/picard/sortsam/main.nf @@ -2,10 +2,10 @@ process PICARD_SORTSAM { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(bam) diff --git a/modules/picard/sortvcf/main.nf b/modules/picard/sortvcf/main.nf index 4047545e..fb8dbb79 100644 --- a/modules/picard/sortvcf/main.nf +++ b/modules/picard/sortvcf/main.nf @@ -2,10 +2,10 @@ process PICARD_SORTVCF { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::picard=2.26.10" : null) + conda (params.enable_conda ? "bioconda::picard=2.27.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:2.27.1--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.27.1--hdfd78af_0' }" input: tuple val(meta), path(vcf) @@ -22,8 +22,8 @@ process PICARD_SORTVCF { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def seq_dict = sequence_dict ? "-SEQUENCE_DICTIONARY $sequence_dict" : "" - def reference = reference ? "-REFERENCE_SEQUENCE $reference" : "" + def seq_dict = sequence_dict ? "--SEQUENCE_DICTIONARY $sequence_dict" : "" + def reference = reference ? "--REFERENCE_SEQUENCE $reference" : "" def avail_mem = 3 if (!task.memory) { log.info '[Picard SortVcf] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' diff --git a/modules/rsem/calculateexpression/main.nf b/modules/rsem/calculateexpression/main.nf index cf147a63..1ab3a635 100644 --- a/modules/rsem/calculateexpression/main.nf +++ b/modules/rsem/calculateexpression/main.nf @@ -2,10 +2,10 @@ process RSEM_CALCULATEEXPRESSION { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.10a" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' : - 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' : + 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' }" input: tuple val(meta), path(reads) diff --git a/modules/rsem/preparereference/main.nf b/modules/rsem/preparereference/main.nf index 2d2ca205..da11be45 100644 --- a/modules/rsem/preparereference/main.nf +++ b/modules/rsem/preparereference/main.nf @@ -2,10 +2,10 @@ process RSEM_PREPAREREFERENCE { tag "$fasta" label 'process_high' - conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) + conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.10a" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' : - 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' : + 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:64aad4a4e144878400649e71f42105311be7ed87-0' }" input: path fasta, stageAs: "rsem/*" diff --git a/modules/rtgtools/vcfeval/main.nf b/modules/rtgtools/vcfeval/main.nf new file mode 100644 index 00000000..27a488f7 --- /dev/null +++ b/modules/rtgtools/vcfeval/main.nf @@ -0,0 +1,60 @@ +process RTGTOOLS_VCFEVAL { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::rtg-tools=3.12.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rtg-tools:3.12.1--hdfd78af_0': + 'quay.io/biocontainers/rtg-tools:3.12.1--hdfd78af_0' }" + + input: + tuple val(meta), path(query_vcf), path(query_vcf_tbi) + tuple path(truth_vcf), path(truth_vcf_tbi) + path(truth_regions) + path(evaluation_regions) + path(sdf) + + output: + tuple val(meta), path("**results/{done,progress,*.log}") , emit: logs + tuple val(meta), path("**tp.vcf.gz"), path("**tp.vcf.gz.tbi") , emit: tp + tuple val(meta), path("**fn.vcf.gz"), path("**fn.vcf.gz.tbi") , emit: fn + tuple val(meta), path("**fp.vcf.gz"), path("**fp.vcf.gz.tbi") , emit: fp + tuple val(meta), path("**baseline.vcf.gz"), path("**baseline.vcf.gz.tbi") , emit: baseline + tuple val(meta), path("**.tsv.gz") , emit: roc + tuple val(meta), path("**results/summary.txt") , emit: summary + tuple val(meta), path("**results/phasing.txt") , emit: phasing + 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 bed_regions = truth_regions ? "--bed-regions=$truth_regions" : "" + def eval_regions = evaluation_regions ? "--evaluation-regions=$evaluation_regions" : "" + def truth_index = truth_vcf_tbi ? "" : "rtg index $truth_vcf" + def query_index = query_vcf_tbi ? "" : "rtg index $query_vcf" + def avail_mem = task.memory.toGiga() + "G" + + """ + $truth_index + $query_index + + rtg RTG_MEM=$avail_mem vcfeval \\ + $args \\ + --baseline=$truth_vcf \\ + $bed_regions \\ + $eval_regions \\ + --calls=$query_vcf \\ + --output=${prefix}_results \\ + --template=$sdf \\ + --threads=$task.cpus \\ + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rtg-tools: \$(echo \$(rtg version | head -n 1 | awk '{print \$4}')) + END_VERSIONS + """ +} diff --git a/modules/rtgtools/vcfeval/meta.yml b/modules/rtgtools/vcfeval/meta.yml new file mode 100644 index 00000000..5a5f452e --- /dev/null +++ b/modules/rtgtools/vcfeval/meta.yml @@ -0,0 +1,95 @@ +name: "rtgtools_vcfeval" +description: The VCFeval tool of RTG tools. It is used to evaluate called variants for agreement with a baseline variant set +keywords: + - benchmarking + - vcf + - rtg-tools +tools: + - "rtgtools": + description: "RealTimeGenomics Tools -- Utilities for accurate VCF comparison and manipulation" + homepage: "https://www.realtimegenomics.com/products/rtg-tools" + documentation: "https://github.com/RealTimeGenomics/rtg-tools" + tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" + doi: "" + licence: "['BSD']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - truth_vcf: + type: file + description: A standard VCF to compare against + pattern: "*.{vcf,vcf.gz}" + - truth_vcf_index: + type: file + description: The index of the standard VCF (optional) + pattern: "*.tbi" + - query_vcf: + type: file + description: A VCF with called variants to benchmark against the standard + pattern: "*.{vcf,vcf.gz}" + - query_vcf_index: + type: file + description: The index of the called VCF (optional) + pattern: "*.tbi" + - truth_regions: + type: file + description: A BED file containining the strict regions where VCFeval should only evaluate the fully overlapping variants (optional) + pattern: "*.bed" + - evaluation_regions: + type: file + description: A BED file containing the regions where VCFeval will evaluate every fully and partially overlapping variant (optional) + pattern: "*.bed" + - sdf: + type: file + description: The SDF (RTG Sequence Data File) folder of the reference genome + pattern: "*" + +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" + - logging: + type: file + description: Files containing logging from vcfeval + pattern: "*{done,progress,.log}" + - tp: + type: file + description: A tuple containing the VCF and TBI file for the true positive variants + pattern: "tp.vcf{.gz,.gz.tbi}" + - baseline: + type: file + description: A tuple containing the VCF and TBI file for the baseline true positive variants + pattern: "tp-baseline.vcf{.gz,.gz.tbi}" + - fp: + type: file + description: A tuple containing the VCF and TBI file for the false positive variants + pattern: "fp.vcf{.gz,.gz.tbi}" + - fn: + type: file + description: A tuple containing the VCF and TBI file for the false negative variants + pattern: "fn.vcf{.gz,.gz.tbi}" + - roc: + type: file + description: TSV files containing ROC data for the evaluated variants + pattern: "*.tsv.gz" + - summary: + type: file + description: A TXT file containing the summary of the evaluation + pattern: "summary.txt" + - phasing: + type: file + description: A TXT file containing the data on the phasing + pattern: "phasing.txt" + +authors: + - "@nvnieuwk" diff --git a/modules/samtools/bam2fq/main.nf b/modules/samtools/bam2fq/main.nf index 5d6aa79d..9301d1d3 100644 --- a/modules/samtools/bam2fq/main.nf +++ b/modules/samtools/bam2fq/main.nf @@ -45,7 +45,7 @@ process SAMTOOLS_BAM2FQ { bam2fq \\ $args \\ -@ $task.cpus \\ - $inputbam >${prefix}_interleaved.fq.gz + $inputbam | gzip --no-name > ${prefix}_interleaved.fq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/samtools/convert/main.nf b/modules/samtools/convert/main.nf new file mode 100644 index 00000000..e0e7d725 --- /dev/null +++ b/modules/samtools/convert/main.nf @@ -0,0 +1,42 @@ +process SAMTOOLS_CONVERT { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" + + input: + tuple val(meta), path(input), path(index) + path fasta + path fai + + output: + tuple val(meta), path("*.{cram,bam}"), path("*.{crai,bai}") , emit: alignment_index + 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 output_extension = input.getExtension() == "bam" ? "cram" : "bam" + + """ + samtools view \\ + --threads ${task.cpus} \\ + --reference ${fasta} \\ + $args \\ + $input \\ + -o ${prefix}.${output_extension} + + samtools index -@${task.cpus} ${prefix}.${output_extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/samtools/convert/meta.yml b/modules/samtools/convert/meta.yml new file mode 100644 index 00000000..937b1403 --- /dev/null +++ b/modules/samtools/convert/meta.yml @@ -0,0 +1,52 @@ +name: samtools_convert +description: convert and then index CRAM -> BAM or BAM -> CRAM file +keywords: + - view + - index + - bam + - cram +tools: + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. + These files are generated as output by short read aligners like BWA. + homepage: http://www.htslib.org/ + documentation: hhttp://www.htslib.org/doc/samtools.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 ] + - input: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - index: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + - fasta: + type: file + description: Reference file to create the CRAM file + pattern: "*.{fasta,fa}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - alignment_index: + type: file + description: filtered/converted BAM/CRAM file + index + pattern: "*{.bam/cram,.bai/crai}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@FriederikeHanssen" + - "@maxulysse" diff --git a/modules/samtools/view/main.nf b/modules/samtools/view/main.nf index 11cfb74b..55194e88 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -41,4 +41,16 @@ process SAMTOOLS_VIEW { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + touch ${prefix}.cram + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/shasum/main.nf b/modules/shasum/main.nf new file mode 100644 index 00000000..0e288435 --- /dev/null +++ b/modules/shasum/main.nf @@ -0,0 +1,35 @@ +process SHASUM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "conda-forge::coreutils=9.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" + + input: + tuple val(meta), path(file) + + output: + tuple val(meta), path("*.sha256"), emit: checksum + 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}" + + """ + sha256sum \\ + $args \\ + ${file} \\ + > ${file}.sha256 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sha256sum: \$(echo \$(sha256sum --version 2>&1 | head -n 1| sed 's/^.*) //;' )) + END_VERSIONS + """ +} diff --git a/modules/shasum/meta.yml b/modules/shasum/meta.yml new file mode 100644 index 00000000..f16e0771 --- /dev/null +++ b/modules/shasum/meta.yml @@ -0,0 +1,40 @@ +name: "shasum" +description: Print SHA256 (256-bit) checksums. +keywords: + - checksum + - sha256 +tools: + - "md5sum": + description: Create an SHA256 (256-bit) checksum. + homepage: "https://www.gnu.org" + documentation: "https://linux.die.net/man/1/shasum" + licence: GPLv3+ + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - file: + type: file + description: Any file + pattern: "*.*" + +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" + - checksum: + type: file + description: File containing checksum + pattern: "*.sha256" + +authors: + - "@matthdsm" diff --git a/modules/shigatyper/main.nf b/modules/shigatyper/main.nf new file mode 100644 index 00000000..9d5c189a --- /dev/null +++ b/modules/shigatyper/main.nf @@ -0,0 +1,64 @@ +process SHIGATYPER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::shigatyper=2.0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0': + 'quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("${prefix}.tsv") , emit: tsv + tuple val(meta), path("${prefix}-hits.tsv"), optional: true, emit: hits + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + if (meta.is_ont) { + """ + shigatyper \\ + $args \\ + --SE $reads \\ + --ont \\ + --name $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' ) + END_VERSIONS + """ + } else if (meta.single_end) { + """ + shigatyper \\ + $args \\ + --SE $reads \\ + --name $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' ) + END_VERSIONS + """ + } else { + """ + shigatyper \\ + $args \\ + --R1 ${reads[0]} \\ + --R2 ${reads[1]} \\ + --name $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' ) + END_VERSIONS + """ + } +} diff --git a/modules/shigatyper/meta.yml b/modules/shigatyper/meta.yml new file mode 100644 index 00000000..ebaded6b --- /dev/null +++ b/modules/shigatyper/meta.yml @@ -0,0 +1,47 @@ +name: "shigatyper" +description: Determine Shigella serotype from Illumina or Oxford Nanopore reads +keywords: + - fastq + - shigella + - serotype +tools: + - "shigatyper": + description: "Typing tool for Shigella spp. from WGS Illumina sequencing" + homepage: "https://github.com/CFSAN-Biostatistics/shigatyper" + documentation: "https://github.com/CFSAN-Biostatistics/shigatyper" + tool_dev_url: "https://github.com/CFSAN-Biostatistics/shigatyper" + doi: "10.1128/AEM.00165-19" + licence: "['Public Domain']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false, is_ont:false ] + - reads: + type: file + description: Illumina or Nanopore FASTQ file + pattern: "*.fastq.gz" + +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" + - tsv: + type: file + description: A TSV formatted file with ShigaTyper results + pattern: "*.tsv" + - hits: + type: file + description: A TSV formatted file with individual gene hits + pattern: "*-hits.tsv" + +authors: + - "@rpetit3" diff --git a/modules/slimfastq/main.nf b/modules/slimfastq/main.nf new file mode 100644 index 00000000..19ca876f --- /dev/null +++ b/modules/slimfastq/main.nf @@ -0,0 +1,52 @@ +def VERSION = '2.04' + +process SLIMFASTQ { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::slimfastq=2.04" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/slimfastq:2.04--h87f3376_2': + 'quay.io/biocontainers/slimfastq:2.04--h87f3376_2' }" + + input: + tuple val(meta), path(fastq) + + output: + tuple val(meta), path("*.sfq"), emit: sfq + 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}" + if (meta.single_end) { + """ + gzip -d -c '${fastq}' | slimfastq \\ + $args \\ + -f '${prefix}.sfq' + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + slimfastq: ${VERSION} + END_VERSIONS + """ + } else { + """ + gzip -d -c '${fastq[0]}' | slimfastq \\ + $args \\ + -f '${prefix}_1.sfq' + + gzip -d -c '${fastq[1]}' | slimfastq \\ + $args \\ + -f '${prefix}_2.sfq' + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + slimfastq: ${VERSION} + END_VERSIONS + """ + } +} diff --git a/modules/slimfastq/meta.yml b/modules/slimfastq/meta.yml new file mode 100644 index 00000000..3b040f25 --- /dev/null +++ b/modules/slimfastq/meta.yml @@ -0,0 +1,41 @@ +name: "slimfastq" +description: Fast, efficient, lossless compression of FASTQ files. +keywords: + - FASTQ + - compression + - lossless +tools: + - "slimfastq": + description: "slimfastq efficiently compresses/decompresses FASTQ files" + homepage: "https://github.com/Infinidat/slimfastq" + tool_dev_url: "https://github.com/Infinidat/slimfastq" + licence: "['BSD-3-clause']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq: + type: file + description: Either a single-end FASTQ file or paired-end files. + pattern: "*.{fq.gz,fastq.gz}" + +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" + - sfq: + type: file + description: Either one or two sequence files in slimfastq compressed format. + pattern: "*.{sfq}" + +authors: + - "@Midnighter" diff --git a/modules/snapaligner/single/main.nf b/modules/snapaligner/align/main.nf similarity index 87% rename from modules/snapaligner/single/main.nf rename to modules/snapaligner/align/main.nf index b13e1153..ef7af561 100644 --- a/modules/snapaligner/single/main.nf +++ b/modules/snapaligner/align/main.nf @@ -1,4 +1,4 @@ -process SNAPALIGNER_SINGLE { +process SNAPALIGNER_ALIGN { tag '$meta.id' label 'process_high' @@ -21,15 +21,16 @@ process SNAPALIGNER_SINGLE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def subcmd = meta.single_end ? "single" : "paired" """ mkdir -p index mv $index index/ - snap-aligner single \\ + snap-aligner ${subcmd} \\ index \\ ${reads.join(" ")} \\ - -o -bam ${prefix}.bam \\ + -o ${prefix}.bam \\ -t ${task.cpus} \\ $args diff --git a/modules/snapaligner/paired/meta.yml b/modules/snapaligner/align/meta.yml similarity index 86% rename from modules/snapaligner/paired/meta.yml rename to modules/snapaligner/align/meta.yml index b19e0174..611b0b71 100644 --- a/modules/snapaligner/paired/meta.yml +++ b/modules/snapaligner/align/meta.yml @@ -1,5 +1,5 @@ -name: "snapaligner_paired" -description: Performs paired end fastq alignment to a fasta reference using SNAP +name: "snapaligner_align" +description: Performs fastq alignment to a fasta reference using SNAP keywords: - alignment - map @@ -22,7 +22,7 @@ input: e.g. [ id:'test', single_end:false ] - reads: type: file - description: List of input fastq files of size 2 for fastq or 1 for bam + description: List of input fastq files of size 2 for paired fastq or 1 for bam or single fastq pattern: "*.{fastq.gz,fq.gz,fastq,fq,bam}" - index: type: file diff --git a/modules/snapaligner/paired/main.nf b/modules/snapaligner/paired/main.nf deleted file mode 100644 index 57044893..00000000 --- a/modules/snapaligner/paired/main.nf +++ /dev/null @@ -1,41 +0,0 @@ -process SNAPALIGNER_PAIRED { - tag '$meta.id' - label 'process_high' - - conda (params.enable_conda ? "bioconda::snap-aligner=2.0.1" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/snap-aligner:2.0.1--hd03093a_1': - 'quay.io/biocontainers/snap-aligner:2.0.1--hd03093a_1' }" - - input: - tuple val(meta), path(reads) - path index - - output: - tuple val(meta), path("*.bam"), emit: bam - 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}" - - """ - mkdir -p index - mv $index index/ - - snap-aligner paired \\ - index \\ - ${reads.join(" ")} \\ - -o -bam ${prefix}.bam \\ - -t ${task.cpus} \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - snapaligner: \$(snap-aligner 2>&1| head -n 1 | sed 's/^.*version //;s/.\$//') - END_VERSIONS - """ -} diff --git a/modules/snapaligner/single/meta.yml b/modules/snapaligner/single/meta.yml deleted file mode 100644 index e69cc721..00000000 --- a/modules/snapaligner/single/meta.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: "snapaligner_single" -description: Performs single end fastq alignment to a fasta reference using SNAP -keywords: - - alignment - - map - - fastq - - bam - - sam -tools: - - "snapaligner": - description: "Scalable Nucleotide Alignment Program -- a fast and accurate read aligner for high-throughput sequencing data" - homepage: "http://snap.cs.berkeley.edu" - documentation: "https://1drv.ms/b/s!AhuEg_0yZD86hcpblUt-muHKYsG8fA?e=R8ogug" - tool_dev_url: "https://github.com/amplab/snap" - doi: "10.1101/2021.11.23.469039" - licence: "['Apache v2']" -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: List of single end input files - pattern: "*.{fastq.gz,fq.gz,fastq,fq,bam}" - - index: - type: file - description: List of SNAP genome index files - pattern: "{Genome,GenomeIndex,GenomeIndexHash,OverflowTable}" - -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" - - bam: - type: file - description: Aligned BAM file - pattern: "*.{bam}" - -authors: - - "@matthdsm" diff --git a/modules/snpeff/Dockerfile b/modules/snpeff/Dockerfile index 608716a4..d0e34757 100644 --- a/modules/snpeff/Dockerfile +++ b/modules/snpeff/Dockerfile @@ -8,15 +8,16 @@ LABEL \ COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a -# Add conda installation dir to PATH (instead of doing 'conda activate') -ENV PATH /opt/conda/envs/nf-core-snpeff-5.0/bin:$PATH - # Setup default ARG variables ARG GENOME=GRCh38 ARG SNPEFF_CACHE_VERSION=99 +ARG SNPEFF_TAG=99 + +# Add conda installation dir to PATH (instead of doing 'conda activate') +ENV PATH /opt/conda/envs/nf-core-snpeff-${SNPEFF_TAG}/bin:$PATH # Download Genome RUN snpEff download -v ${GENOME}.${SNPEFF_CACHE_VERSION} # Dump the details of the installed packages to a file for posterity -RUN conda env export --name nf-core-snpeff-5.0 > nf-core-snpeff-5.0.yml +RUN conda env export --name nf-core-snpeff-${SNPEFF_TAG} > nf-core-snpeff-${SNPEFF_TAG}.yml diff --git a/modules/snpeff/build.sh b/modules/snpeff/build.sh old mode 100755 new mode 100644 index b94ffd69..2fccf9a8 --- a/modules/snpeff/build.sh +++ b/modules/snpeff/build.sh @@ -9,10 +9,11 @@ build_push() { SNPEFF_TAG=$3 docker build \ + . \ -t nfcore/snpeff:${SNPEFF_TAG}.${GENOME} \ - software/snpeff/. \ --build-arg GENOME=${GENOME} \ - --build-arg SNPEFF_CACHE_VERSION=${SNPEFF_CACHE_VERSION} + --build-arg SNPEFF_CACHE_VERSION=${SNPEFF_CACHE_VERSION} \ + --build-arg SNPEFF_TAG=${SNPEFF_TAG} docker push nfcore/snpeff:${SNPEFF_TAG}.${GENOME} } diff --git a/modules/snpeff/meta.yml b/modules/snpeff/meta.yml index c191b9ac..2f0d866e 100644 --- a/modules/snpeff/meta.yml +++ b/modules/snpeff/meta.yml @@ -10,18 +10,6 @@ tools: homepage: https://pcingola.github.io/SnpEff/ documentation: https://pcingola.github.io/SnpEff/se_introduction/ licence: ["MIT"] -params: - - use_cache: - type: boolean - description: | - boolean to enable the usage of containers with cache - Enable the usage of containers with cache - Does not work with conda - - snpeff_tag: - type: value - description: | - Specify the tag for the container - https://hub.docker.com/r/nfcore/snpeff/tags input: - meta: type: map diff --git a/modules/sratools/fasterqdump/main.nf b/modules/sratools/fasterqdump/main.nf index 1980ffeb..18f46e51 100644 --- a/modules/sratools/fasterqdump/main.nf +++ b/modules/sratools/fasterqdump/main.nf @@ -9,6 +9,7 @@ process SRATOOLS_FASTERQDUMP { input: tuple val(meta), path(sra) + path ncbi_settings output: tuple val(meta), path(output), emit: reads @@ -20,17 +21,12 @@ process SRATOOLS_FASTERQDUMP { script: def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' - def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" // Paired-end data extracted by fasterq-dump (--split-3 the default) always creates // *_1.fastq *_2.fastq files but sometimes also an additional *.fastq file // for unpaired reads which we ignore here. output = meta.single_end ? '*.fastq.gz' : '*_{1,2}.fastq.gz' """ - eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" - if [[ ! -f "\${NCBI_SETTINGS}" ]]; then - mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" - printf '${config}' > "\${NCBI_SETTINGS}" - fi + export NCBI_SETTINGS="\$PWD/${ncbi_settings}" fasterq-dump \\ $args \\ diff --git a/modules/sratools/fasterqdump/meta.yml b/modules/sratools/fasterqdump/meta.yml index ec5f69a5..d6fbd444 100644 --- a/modules/sratools/fasterqdump/meta.yml +++ b/modules/sratools/fasterqdump/meta.yml @@ -10,7 +10,7 @@ tools: homepage: https://github.com/ncbi/sra-tools documentation: https://github.com/ncbi/sra-tools/wiki tool_dev_url: https://github.com/ncbi/sra-tools - licence: ["US-Government-Work"] + licence: ["Public Domain"] input: - meta: @@ -22,6 +22,11 @@ input: type: directory description: Directory containing ETL data for the given SRA. pattern: "*/*.sra" + - ncbi_settings: + type: file + description: > + An NCBI user settings file. + pattern: "*.mkfg" output: - meta: diff --git a/modules/sratools/prefetch/main.nf b/modules/sratools/prefetch/main.nf index 2233d0aa..3426ae12 100644 --- a/modules/sratools/prefetch/main.nf +++ b/modules/sratools/prefetch/main.nf @@ -1,43 +1,25 @@ process SRATOOLS_PREFETCH { tag "$id" label 'process_low' - label 'error_retry' conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5262h314213e_0' : - 'quay.io/biocontainers/sra-tools:2.11.0--pl5262h314213e_0' }" + 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5321ha49a11a_3' : + 'quay.io/biocontainers/sra-tools:2.11.0--pl5321ha49a11a_3' }" input: tuple val(meta), val(id) + path ncbi_settings output: - tuple val(meta), path("$id"), emit: sra - path "versions.yml" , emit: versions + tuple val(meta), path(id), emit: sra + path 'versions.yml' , emit: versions when: task.ext.when == null || task.ext.when - script: - def args = task.ext.args ?: '' - def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" - """ - eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" - if [[ ! -f "\${NCBI_SETTINGS}" ]]; then - mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" - printf '${config}' > "\${NCBI_SETTINGS}" - fi - - prefetch \\ - $args \\ - --progress \\ - $id - - vdb-validate $id - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - sratools: \$(prefetch --version 2>&1 | grep -Eo '[0-9.]+') - END_VERSIONS - """ + shell: + args = task.ext.args ?: '' + args2 = task.ext.args2 ?: '5 1 100' // + template 'retry_with_backoff.sh' } diff --git a/modules/sratools/prefetch/meta.yml b/modules/sratools/prefetch/meta.yml index e08b708c..a3a26522 100644 --- a/modules/sratools/prefetch/meta.yml +++ b/modules/sratools/prefetch/meta.yml @@ -10,7 +10,7 @@ tools: homepage: https://github.com/ncbi/sra-tools documentation: https://github.com/ncbi/sra-tools/wiki tool_dev_url: https://github.com/ncbi/sra-tools - licence: ["US-Government-Work"] + licence: ["Public Domain"] input: - meta: @@ -22,6 +22,11 @@ input: type: val description: > A string denoting an SRA id. + - ncbi_settings: + type: file + description: > + An NCBI user settings file. + pattern: "*.mkfg" output: - meta: diff --git a/modules/sratools/prefetch/templates/retry_with_backoff.sh b/modules/sratools/prefetch/templates/retry_with_backoff.sh new file mode 100755 index 00000000..cec0ab43 --- /dev/null +++ b/modules/sratools/prefetch/templates/retry_with_backoff.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +set -u + +retry_with_backoff() { + local max_attempts=${1} + local delay=${2} + local max_time=${3} + local attempt=1 + local output= + local status= + + # Remove the first three arguments to this function in order to access + # the 'real' command with `${@}`. + shift 3 + + while [ ${attempt} -le ${max_attempts} ]; do + output=$("${@}") + status=${?} + + if [ ${status} -eq 0 ]; then + break + fi + + if [ ${attempt} -lt ${max_attempts} ]; then + echo "Failed attempt ${attempt} of ${max_attempts}. Retrying in ${delay} s." >&2 + sleep ${delay} + elif [ ${attempt} -eq ${max_attempts} ]; then + echo "Failed after ${attempt} attempts." >&2 + return ${status} + fi + + attempt=$(( ${attempt} + 1 )) + delay=$(( ${delay} * 2 )) + if [ ${delay} -ge ${max_time} ]; then + delay=${max_time} + fi + done + + echo "${output}" +} + +export NCBI_SETTINGS="$PWD/!{ncbi_settings}" + +retry_with_backoff !{args2} \ + prefetch \ + !{args} \ + !{id} + +vdb-validate !{id} + +cat <<-END_VERSIONS > versions.yml +"!{task.process}": + sratools: $(prefetch --version 2>&1 | grep -Eo '[0-9.]+') +END_VERSIONS diff --git a/modules/srst2/srst2/main.nf b/modules/srst2/srst2/main.nf new file mode 100644 index 00000000..e8a91716 --- /dev/null +++ b/modules/srst2/srst2/main.nf @@ -0,0 +1,47 @@ +process SRST2_SRST2 { + tag "${meta.id}" + label 'process_low' + + conda (params.enable_conda ? "bioconda::srst2=0.2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/srst2%3A0.2.0--py27_2': + 'quay.io/biocontainers/srst2:0.2.0--py27_2'}" + + input: + tuple val(meta), path(fastq_s), path(db) + + output: + tuple val(meta), path("*_genes_*_results.txt") , optional:true, emit: gene_results + tuple val(meta), path("*_fullgenes_*_results.txt") , optional:true, emit: fullgene_results + tuple val(meta), path("*_mlst_*_results.txt") , optional:true, emit: mlst_results + tuple val(meta), path("*.pileup") , emit: pileup + tuple val(meta), path("*.sorted.bam") , emit: sorted_bam + 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 read_s = meta.single_end ? "--input_se ${fastq_s}" : "--input_pe ${fastq_s[0]} ${fastq_s[1]}" + if (meta.db=="gene") { + database = "--gene_db ${db}" + } else if (meta.db=="mlst") { + database = "--mlst_db ${db}" + } else { + error "Please set meta.db to either \"gene\" or \"mlst\"" + } + """ + srst2 \\ + ${read_s} \\ + --threads $task.cpus \\ + --output ${prefix} \\ + ${database} \\ + $args + cat <<-END_VERSIONS > versions.yml + "${task.process}": + srst2: \$(echo \$(srst2 --version 2>&1) | sed 's/srst2 //' )) + END_VERSIONS + """ +} diff --git a/modules/srst2/srst2/meta.yml b/modules/srst2/srst2/meta.yml new file mode 100644 index 00000000..94c763bb --- /dev/null +++ b/modules/srst2/srst2/meta.yml @@ -0,0 +1,72 @@ +name: srst2_srst2 +description: | + Short Read Sequence Typing for Bacterial Pathogens is a program designed to take Illumina sequence data, + a MLST database and/or a database of gene sequences (e.g. resistance genes, virulence genes, etc) + and report the presence of STs and/or reference genes. +keywords: + - mlst + - typing + - illumina +tools: + - srst2: + description: "Short Read Sequence Typing for Bacterial Pathogens" + homepage: "http://katholt.github.io/srst2/" + documentation: "https://github.com/katholt/srst2/blob/master/README.md" + tool_dev_url: "https://github.com/katholt/srst2" + doi: "10.1186/s13073-014-0090-6" + licence: ["BSD"] + +input: + - meta: + type: map0.2.0-4 + description: | + Groovy Map containing sample information + id: should be the identification number or sample name + single_end: should be true for single end data and false for paired in data + db: should be either 'gene' to use the --gene_db option or "mlst" to use the --mlst_db option + e.g. [ id:'sample', single_end:false , db:'gene'] + - fasta: + type: file + description: | + gzipped fasta file. If files are NOT in + MiSeq format sample_S1_L001_R1_001.fastq.gz uses --forward and --reverse parameters; otherwise + default is _1, i.e. expect forward reads as sample_1.fastq.gz). + pattern: "*.fastq.gz" + - db: + type: file + description: Database in FASTA format + pattern: "*.fasta" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - txt: + type: file + description: A detailed report, with one row per gene per sample described here github.com/katholt/srst2#gene-typing + pattern: "*_fullgenes_*_results.txt" + - txt: + type: file + description: A tabulated summary report of samples x genes. + pattern: "*_genes_*_results.txt" + - txt: + type: file + description: A tabulated summary report of mlst subtyping. + pattern: "*_mlst_*_results.txt" + - bam: + type: file + description: Sorted BAM file + pattern: "*.sorted.bam" + - pileup: + type: file + description: SAMtools pileup file + pattern: "*.pileup" + +authors: + - "@jvhagey" diff --git a/modules/stringtie/merge/main.nf b/modules/stringtie/merge/main.nf index aa11eb36..c8460c94 100644 --- a/modules/stringtie/merge/main.nf +++ b/modules/stringtie/merge/main.nf @@ -2,10 +2,10 @@ process STRINGTIE_MERGE { label 'process_medium' // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? "bioconda::stringtie=2.1.7" : null) + conda (params.enable_conda ? "bioconda::stringtie=2.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/stringtie:2.1.7--h978d192_0' : - 'quay.io/biocontainers/stringtie:2.1.7--h978d192_0' }" + 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' : + 'quay.io/biocontainers/stringtie:2.2.1--hecb563c_2' }" input: path stringtie_gtf diff --git a/modules/stringtie/stringtie/main.nf b/modules/stringtie/stringtie/main.nf index f37e347a..c70c9819 100644 --- a/modules/stringtie/stringtie/main.nf +++ b/modules/stringtie/stringtie/main.nf @@ -1,11 +1,11 @@ -process STRINGTIE { +process STRINGTIE_STRINGTIE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::stringtie=2.1.7" : null) + conda (params.enable_conda ? "bioconda::stringtie=2.2.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/stringtie:2.1.7--h978d192_0' : - 'quay.io/biocontainers/stringtie:2.1.7--h978d192_0' }" + 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' : + 'quay.io/biocontainers/stringtie:2.2.1--hecb563c_2' }" input: tuple val(meta), path(bam) diff --git a/modules/stringtie/stringtie/meta.yml b/modules/stringtie/stringtie/meta.yml index a462c574..0dda84d0 100644 --- a/modules/stringtie/stringtie/meta.yml +++ b/modules/stringtie/stringtie/meta.yml @@ -1,4 +1,4 @@ -name: stringtie +name: stringtie_stringtie description: Transcript assembly and quantification for RNA-Se keywords: - transcript diff --git a/modules/svdb/merge/main.nf b/modules/svdb/merge/main.nf index 4a39940c..0d56fea2 100644 --- a/modules/svdb/merge/main.nf +++ b/modules/svdb/merge/main.nf @@ -2,10 +2,10 @@ process SVDB_MERGE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.6.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.6.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.6.0--py39h5371cbf_0': - 'quay.io/biocontainers/svdb:2.6.0--py39h5371cbf_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.6.1--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.6.1--py39h5371cbf_0' }" input: tuple val(meta), path(vcfs) diff --git a/modules/svdb/query/main.nf b/modules/svdb/query/main.nf index c669b5a5..dbab5259 100644 --- a/modules/svdb/query/main.nf +++ b/modules/svdb/query/main.nf @@ -2,10 +2,10 @@ process SVDB_QUERY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.6.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.6.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.6.0--py39h5371cbf_0': - 'quay.io/biocontainers/svdb:2.6.0--py39h5371cbf_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.6.1--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.6.1--py39h5371cbf_0' }" input: tuple val(meta), path(vcf) diff --git a/modules/tabix/tabix/main.nf b/modules/tabix/tabix/main.nf index c9dab068..e155e468 100644 --- a/modules/tabix/tabix/main.nf +++ b/modules/tabix/tabix/main.nf @@ -11,7 +11,8 @@ process TABIX_TABIX { tuple val(meta), path(tab) output: - tuple val(meta), path("*.tbi"), emit: tbi + tuple val(meta), path("*.tbi"), optional:true, emit: tbi + tuple val(meta), path("*.csi"), optional:true, emit: csi path "versions.yml" , emit: versions when: diff --git a/modules/tabix/tabix/meta.yml b/modules/tabix/tabix/meta.yml index 89478abe..fcc6e524 100644 --- a/modules/tabix/tabix/meta.yml +++ b/modules/tabix/tabix/meta.yml @@ -31,6 +31,10 @@ output: type: file description: tabix index file pattern: "*.{tbi}" + - csi: + type: file + description: coordinate sorted index file + pattern: "*.{csi}" - versions: type: file description: File containing software versions diff --git a/modules/tiddit/sv/main.nf b/modules/tiddit/sv/main.nf index 1bf7146a..b3e3813c 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -24,7 +24,7 @@ process TIDDIT_SV { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def reference = fasta == "dummy_file.txt" ? "--ref $fasta" : "" + def reference = fasta ? "--ref $fasta" : "" """ tiddit \\ --sv \\ diff --git a/modules/trimgalore/main.nf b/modules/trimgalore/main.nf index 9487c799..3a3fca90 100644 --- a/modules/trimgalore/main.nf +++ b/modules/trimgalore/main.nf @@ -11,12 +11,13 @@ process TRIMGALORE { tuple val(meta), path(reads) output: - tuple val(meta), path("*.fq.gz") , emit: reads - tuple val(meta), path("*report.txt"), emit: log - path "versions.yml" , emit: versions + tuple val(meta), path("*{trimmed,val}*.fq.gz"), emit: reads + tuple val(meta), path("*report.txt") , emit: log + path "versions.yml" , emit: versions - tuple val(meta), path("*.html"), emit: html optional true - tuple val(meta), path("*.zip") , emit: zip optional true + tuple val(meta), path("*unpaired*.fq.gz") , emit: unpaired, optional: true + tuple val(meta), path("*.html") , emit: html , optional: true + tuple val(meta), path("*.zip") , emit: zip , optional: true when: task.ext.when == null || task.ext.when @@ -52,6 +53,7 @@ process TRIMGALORE { $c_r1 \\ $tpc_r1 \\ ${prefix}.fastq.gz + cat <<-END_VERSIONS > versions.yml "${task.process}": trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') @@ -73,6 +75,7 @@ process TRIMGALORE { $tpc_r2 \\ ${prefix}_1.fastq.gz \\ ${prefix}_2.fastq.gz + cat <<-END_VERSIONS > versions.yml "${task.process}": trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') diff --git a/modules/trimgalore/meta.yml b/modules/trimgalore/meta.yml index e99a8833..439f566d 100644 --- a/modules/trimgalore/meta.yml +++ b/modules/trimgalore/meta.yml @@ -37,6 +37,11 @@ output: List of input adapter trimmed FastQ files of size 1 and 2 for single-end and paired-end data, respectively. pattern: "*.{fq.gz}" + - unpaired: + type: file + description: | + FastQ files containing unpaired reads from read 1 or read 2 + pattern: "*unpaired*.fq.gz" - html: type: file description: FastQC report (optional) diff --git a/modules/untar/main.nf b/modules/untar/main.nf index bbfa0bfe..058d1764 100644 --- a/modules/untar/main.nf +++ b/modules/untar/main.nf @@ -2,10 +2,10 @@ process UNTAR { tag "$archive" label 'process_low' - conda (params.enable_conda ? "conda-forge::tar=1.34" : null) + conda (params.enable_conda ? "conda-forge::sed=4.7" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' : - 'biocontainers/biocontainers:v1.2.0_cv2' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" input: tuple val(meta), path(archive) diff --git a/modules/vardictjava/main.nf b/modules/vardictjava/main.nf new file mode 100644 index 00000000..c99301bb --- /dev/null +++ b/modules/vardictjava/main.nf @@ -0,0 +1,49 @@ +def VERSION = '1.8.3' + +process VARDICTJAVA { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::vardict-java=1.8.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vardict-java:1.8.3--hdfd78af_0': + 'quay.io/biocontainers/vardict-java:1.8.3--hdfd78af_0' }" + + input: + tuple val(meta), path(bam), path(bai), path(bed) + tuple path(fasta), path(fasta_fai) + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + vardict-java \\ + $args \\ + -c 1 -S 2 -E 3 \\ + -b $bam \\ + -th $task.cpus \\ + -N $prefix \\ + -G $fasta \\ + $bed \\ + | teststrandbias.R \\ + | var2vcf_valid.pl \\ + $args2 \\ + -N $prefix \\ + | gzip -c > ${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vardict-java: $VERSION + var2vcf_valid.pl: \$(echo \$(var2vcf_valid.pl -h | sed -n 2p | awk '{ print \$2 }')) + END_VERSIONS + """ +} diff --git a/modules/vardictjava/meta.yml b/modules/vardictjava/meta.yml new file mode 100644 index 00000000..59fba966 --- /dev/null +++ b/modules/vardictjava/meta.yml @@ -0,0 +1,60 @@ +name: "vardictjava" + +description: The Java port of the VarDict variant caller +keywords: + - variant calling + - VarDict + - AstraZeneca +tools: + - "vardictjava": + description: "Java port of the VarDict variant discovery program" + homepage: "https://github.com/AstraZeneca-NGS/VarDictJava" + documentation: "https://github.com/AstraZeneca-NGS/VarDictJava" + tool_dev_url: "https://github.com/AstraZeneca-NGS/VarDictJava" + doi: "10.1093/nar/gkw227 " + licence: "['MIT']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/SAM file + pattern: "*.{bam,sam}" + - bai: + type: file + description: Index of the BAM file + pattern: "*.bai" + - fasta: + type: file + description: FASTA of the reference genome + pattern: "*.{fa,fasta}" + - fasta_fai: + type: file + description: The index of the FASTA of the reference genome + pattern: "*.fai" + - bed: + type: file + description: BED with the regions of interest + pattern: "*.bed" + +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" + - vcf: + type: file + description: VCF file output + pattern: "*.vcf.gz" + +authors: + - "@nvnieuwk" diff --git a/subworkflows/nf-core/annotation/ensemblvep/main.nf b/subworkflows/nf-core/annotation/ensemblvep/main.nf new file mode 100644 index 00000000..5073f38d --- /dev/null +++ b/subworkflows/nf-core/annotation/ensemblvep/main.nf @@ -0,0 +1,31 @@ +// +// Run VEP to annotate VCF files +// + +include { ENSEMBLVEP } from '../../../../modules/ensemblvep/main' +include { TABIX_BGZIPTABIX } from '../../../../modules/tabix/bgziptabix/main' + +workflow ANNOTATION_ENSEMBLVEP { + take: + vcf // channel: [ val(meta), vcf ] + vep_genome // value: genome to use + vep_species // value: species to use + vep_cache_version // value: cache version to use + vep_cache // path: /path/to/vep/cache (optionnal) + vep_extra_files // channel: [ file1, file2...] (optionnal) + + main: + ch_versions = Channel.empty() + + ENSEMBLVEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache, vep_extra_files) + TABIX_BGZIPTABIX(ENSEMBLVEP.out.vcf) + + // Gather versions of all tools used + ch_versions = ch_versions.mix(ENSEMBLVEP.out.versions.first()) + ch_versions = ch_versions.mix(TABIX_BGZIPTABIX.out.versions.first()) + + emit: + vcf_tbi = TABIX_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] + reports = ENSEMBLVEP.out.report // path: *.html + versions = ch_versions // path: versions.yml +} diff --git a/subworkflows/nf-core/annotation/ensemblvep/meta.yml b/subworkflows/nf-core/annotation/ensemblvep/meta.yml new file mode 100644 index 00000000..585e003b --- /dev/null +++ b/subworkflows/nf-core/annotation/ensemblvep/meta.yml @@ -0,0 +1,49 @@ +name: annotation_ensemblvep +description: | + Perform annotation with ensemblvep and bgzip + tabix index the resulting VCF file +keywords: + - ensemblvep +modules: + - ensemblvep + - tabix/bgziptabix +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + vcf to annotate + - genome: + type: value + description: | + which genome to annotate with + - species: + type: value + description: | + which species to annotate with + - cache_version: + type: value + description: | + which version of the cache to annotate with + - cache: + type: file + description: | + path to VEP cache (optional) + - extra_files: + type: tuple + description: | + path to file(s) needed for plugins (optional) +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf_tbi: + type: file + description: Compressed vcf file + tabix index + pattern: "[ *{.vcf.gz,vcf.gz.tbi} ]" +authors: + - "@maxulysse" diff --git a/subworkflows/nf-core/annotation/snpeff/main.nf b/subworkflows/nf-core/annotation/snpeff/main.nf new file mode 100644 index 00000000..dcf06eb0 --- /dev/null +++ b/subworkflows/nf-core/annotation/snpeff/main.nf @@ -0,0 +1,28 @@ +// +// Run SNPEFF to annotate VCF files +// + +include { SNPEFF } from '../../../../modules/snpeff/main' +include { TABIX_BGZIPTABIX } from '../../../../modules/tabix/bgziptabix/main' + +workflow ANNOTATION_SNPEFF { + take: + vcf // channel: [ val(meta), vcf ] + snpeff_db // value: db version to use + snpeff_cache // path: /path/to/snpeff/cache (optionnal) + + main: + ch_versions = Channel.empty() + + SNPEFF(vcf, snpeff_db, snpeff_cache) + TABIX_BGZIPTABIX(SNPEFF.out.vcf) + + // Gather versions of all tools used + ch_versions = ch_versions.mix(SNPEFF.out.versions.first()) + ch_versions = ch_versions.mix(TABIX_BGZIPTABIX.out.versions.first()) + + emit: + vcf_tbi = TABIX_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] + reports = SNPEFF.out.report // path: *.html + versions = ch_versions // path: versions.yml +} diff --git a/subworkflows/nf-core/annotation_snpeff/meta.yml b/subworkflows/nf-core/annotation/snpeff/meta.yml similarity index 66% rename from subworkflows/nf-core/annotation_snpeff/meta.yml rename to subworkflows/nf-core/annotation/snpeff/meta.yml index e0773626..241a00cc 100644 --- a/subworkflows/nf-core/annotation_snpeff/meta.yml +++ b/subworkflows/nf-core/annotation/snpeff/meta.yml @@ -11,11 +11,19 @@ input: type: map description: | Groovy Map containing sample information - e.g. [ id:'test' ] - - input: - type: vcf - description: list containing one vcf file - pattern: "[ *.{vcf,vcf.gz} ]" + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + vcf to annotate + - db: + type: value + description: | + which db to annotate with + - cache: + type: file + description: | + path to snpEff cache (optional) output: - versions: type: file diff --git a/subworkflows/nf-core/annotation_ensemblvep/main.nf b/subworkflows/nf-core/annotation_ensemblvep/main.nf deleted file mode 100644 index 3f3ecc6e..00000000 --- a/subworkflows/nf-core/annotation_ensemblvep/main.nf +++ /dev/null @@ -1,26 +0,0 @@ -// -// Run VEP to annotate VCF files -// - -include { ENSEMBLVEP } from '../../../modules/ensemblvep/main' -include { TABIX_BGZIPTABIX as ANNOTATION_BGZIPTABIX } from '../../../modules/tabix/bgziptabix/main' - -workflow ANNOTATION_ENSEMBLVEP { - take: - vcf // channel: [ val(meta), vcf ] - vep_genome // value: which genome - vep_species // value: which species - vep_cache_version // value: which cache version - vep_cache // path: path_to_vep_cache (optionnal) - - main: - ENSEMBLVEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache) - ANNOTATION_BGZIPTABIX(ENSEMBLVEP.out.vcf) - - ch_versions = ENSEMBLVEP.out.versions.first().mix(ANNOTATION_BGZIPTABIX.out.versions.first()) - - emit: - vcf_tbi = ANNOTATION_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] - reports = ENSEMBLVEP.out.report // path: *.html - versions = ch_versions // path: versions.yml -} diff --git a/subworkflows/nf-core/annotation_ensemblvep/meta.yml b/subworkflows/nf-core/annotation_ensemblvep/meta.yml deleted file mode 100644 index 991a8b2f..00000000 --- a/subworkflows/nf-core/annotation_ensemblvep/meta.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: annotation_ensemblvep -description: | - Perform annotation with ensemblvep and bgzip + tabix index the resulting VCF file -keywords: - - ensemblvep -modules: - - ensemblvep - - tabix/bgziptabix -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test' ] - - input: - type: vcf - description: list containing one vcf file - pattern: "[ *.{vcf,vcf.gz} ]" -output: - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - vcf_tbi: - type: file - description: Compressed vcf file + tabix index - pattern: "[ *{.vcf.gz,vcf.gz.tbi} ]" -authors: - - "@maxulysse" diff --git a/subworkflows/nf-core/annotation_snpeff/main.nf b/subworkflows/nf-core/annotation_snpeff/main.nf deleted file mode 100644 index add5f9c8..00000000 --- a/subworkflows/nf-core/annotation_snpeff/main.nf +++ /dev/null @@ -1,23 +0,0 @@ -// -// Run SNPEFF to annotate VCF files -// - -include { SNPEFF } from '../../../modules/snpeff/main' -include { TABIX_BGZIPTABIX as ANNOTATION_BGZIPTABIX } from '../../../modules/tabix/bgziptabix/main' - -workflow ANNOTATION_SNPEFF { - take: - vcf // channel: [ val(meta), vcf ] - snpeff_db // value: version of db to use - snpeff_cache // path: path_to_snpeff_cache (optionnal) - - main: - SNPEFF(vcf, snpeff_db, snpeff_cache) - ANNOTATION_BGZIPTABIX(SNPEFF.out.vcf) - ch_versions = SNPEFF.out.versions.first().mix(ANNOTATION_BGZIPTABIX.out.versions.first()) - - emit: - vcf_tbi = ANNOTATION_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] - reports = SNPEFF.out.report // path: *.html - versions = ch_versions // path: versions.yml -} diff --git a/subworkflows/nf-core/bam_qc_picard/main.nf b/subworkflows/nf-core/bam_qc_picard/main.nf new file mode 100644 index 00000000..e38697c3 --- /dev/null +++ b/subworkflows/nf-core/bam_qc_picard/main.nf @@ -0,0 +1,41 @@ +// +// Run QC steps on BAM/CRAM files using Picard +// + +include { PICARD_COLLECTMULTIPLEMETRICS } from '../../../modules/picard/collectmultiplemetrics/main' +include { PICARD_COLLECTWGSMETRICS } from '../../../modules/picard/collectwgsmetrics/main' +include { PICARD_COLLECTHSMETRICS } from '../../../modules/picard/collecthsmetrics/main' + +workflow BAM_QC_PICARD { + take: + ch_bam // channel: [ val(meta), [ bam ]] + ch_fasta // channel: [ fasta ] + ch_fasta_fai // channel: [ fasta_fai ] + ch_bait_interval // channel: [ bait_interval ] + ch_target_interval // channel: [ target_interval ] + + main: + ch_versions = Channel.empty() + ch_coverage_metrics = Channel.empty() + + PICARD_COLLECTMULTIPLEMETRICS( ch_bam, ch_fasta ) + ch_versions = ch_versions.mix(PICARD_COLLECTMULTIPLEMETRICS.out.versions.first()) + + if (ch_bait_interval || ch_target_interval) { + if (!ch_bait_interval) log.error("Bait interval channel is empty") + if (!ch_target_interval) log.error("Target interval channel is empty") + PICARD_COLLECTHSMETRICS( ch_bam, ch_fasta, ch_fasta_fai, ch_bait_interval, ch_target_interval ) + ch_coverage_metrics = ch_coverage_metrics.mix(PICARD_COLLECTHSMETRICS.out.metrics) + ch_versions = ch_versions.mix(PICARD_COLLECTHSMETRICS.out.versions.first()) + } else { + PICARD_COLLECTWGSMETRICS( ch_bam, ch_fasta ) + ch_versions = ch_versions.mix(PICARD_COLLECTWGSMETRICS.out.versions.first()) + ch_coverage_metrics = ch_coverage_metrics.mix(PICARD_COLLECTWGSMETRICS.out.metrics) + } + + emit: + coverage_metrics = ch_coverage_metrics // channel: [ val(meta), [ coverage_metrics ] ] + multiple_metrics = PICARD_COLLECTMULTIPLEMETRICS.out.metrics // channel: [ val(meta), [ multiple_metrics ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/bam_qc_picard/meta.yml b/subworkflows/nf-core/bam_qc_picard/meta.yml new file mode 100644 index 00000000..c45215d1 --- /dev/null +++ b/subworkflows/nf-core/bam_qc_picard/meta.yml @@ -0,0 +1,60 @@ +name: bam_qc +description: Produces comprehensive statistics from BAM file +keywords: + - statistics + - counts + - hs_metrics + - wgs_metrics + - bam + - sam + - cram +modules: + - picard/collectmultiplemetrics + - picard/collectwgsmetrics + - picard/collecthsmetrics +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - fasta: + type: optional file + description: Reference fasta file + pattern: "*.{fasta,fa}" + - fasta_fai: + type: optional file + description: Reference fasta file index + pattern: "*.{fasta,fa}.fai" + - bait_intervals: + type: optional file + description: An interval list file that contains the locations of the baits used. + pattern: "baits.interval_list" + - target_intervals: + type: optional file + description: An interval list file that contains the locations of the targets. + pattern: "targets.interval_list" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - coverage_metrics: + type: file + description: Alignment metrics files generated by picard CollectHsMetrics or CollectWgsMetrics + pattern: "*_metrics.txt" + - multiple_metrics: + type: file + description: Alignment metrics files generated by picard CollectMultipleMetrics + pattern: "*_{metrics}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@matthdsm" diff --git a/subworkflows/nf-core/sra_fastq/main.nf b/subworkflows/nf-core/sra_fastq/main.nf deleted file mode 100644 index ffa380d9..00000000 --- a/subworkflows/nf-core/sra_fastq/main.nf +++ /dev/null @@ -1,34 +0,0 @@ -// -// Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). -// - -params.prefetch_options = [:] -params.fasterqdump_options = [:] - -include { SRATOOLS_PREFETCH } from '../../../modules/sratools/prefetch/main' addParams( options: params.prefetch_options ) -include { SRATOOLS_FASTERQDUMP } from '../../../modules/sratools/fasterqdump/main' addParams( options: params.fasterqdump_options ) - -workflow SRA_FASTQ { - take: - sra_ids // channel: [ val(meta), val(id) ] - - main: - - ch_versions = Channel.empty() - - // - // Prefetch sequencing reads in SRA format. - // - SRATOOLS_PREFETCH ( sra_ids ) - ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() ) - - // - // Convert the SRA format into one or more compressed FASTQ files. - // - SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra ) - ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() ) - - emit: - reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ] - versions = ch_versions // channel: [ versions.yml ] -} diff --git a/subworkflows/nf-core/srafastq/main.nf b/subworkflows/nf-core/srafastq/main.nf new file mode 100644 index 00000000..26e8105e --- /dev/null +++ b/subworkflows/nf-core/srafastq/main.nf @@ -0,0 +1,38 @@ +include { CUSTOM_SRATOOLSNCBISETTINGS } from '../../../modules/custom/sratoolsncbisettings/main' +include { SRATOOLS_PREFETCH } from '../../../modules/sratools/prefetch/main' +include { SRATOOLS_FASTERQDUMP } from '../../../modules/sratools/fasterqdump/main' + +/** + * Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). + */ +workflow SRAFASTQ { + take: + sra_ids // channel: [ val(meta), val(id) ] + + main: + + ch_versions = Channel.empty() + + // + // Detect existing NCBI user settings or create new ones. + // + CUSTOM_SRATOOLSNCBISETTINGS() + def settings = CUSTOM_SRATOOLSNCBISETTINGS.out.ncbi_settings + ch_versions = ch_versions.mix( CUSTOM_SRATOOLSNCBISETTINGS.out.versions ) + + // + // Prefetch sequencing reads in SRA format. + // + SRATOOLS_PREFETCH ( sra_ids, settings ) + ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() ) + + // + // Convert the SRA format into one or more compressed FASTQ files. + // + SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra, settings ) + ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() ) + + emit: + reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/sra_fastq/meta.yml b/subworkflows/nf-core/srafastq/meta.yml similarity index 90% rename from subworkflows/nf-core/sra_fastq/meta.yml rename to subworkflows/nf-core/srafastq/meta.yml index 5114bce5..873ccaca 100644 --- a/subworkflows/nf-core/sra_fastq/meta.yml +++ b/subworkflows/nf-core/srafastq/meta.yml @@ -1,11 +1,14 @@ name: sra_fastq description: Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). keywords: + - SRA + - NCBI - sequencing - FASTQ - prefetch - - dump + - fasterq-dump modules: + - custom/sratoolsncbisettings - sratools/prefetch - sratools/fasterqdump input: @@ -17,7 +20,7 @@ input: - id: type: string description: > - SRA identifier. + SRA run identifier. # TODO Update when we decide on a standard for subworkflow docs output: - meta: diff --git a/subworkflows/nf-core/sra_fastq/nextflow.config b/subworkflows/nf-core/srafastq/nextflow.config similarity index 100% rename from subworkflows/nf-core/sra_fastq/nextflow.config rename to subworkflows/nf-core/srafastq/nextflow.config diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index 4ea085f9..2c672d49 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -19,6 +19,7 @@ if ("$PROFILE" == "singularity") { } else { docker.enabled = true docker.userEmulation = true + docker.runOptions = "--platform linux/x86_64" } // Increase time available to build Conda environment diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 60c2d46d..2fe9fa35 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -42,6 +42,10 @@ amrfinderplus/update: - modules/amrfinderplus/update/** - tests/modules/amrfinderplus/update/** +antismash/antismashlite: + - modules/antismash/antismashlite/** + - tests/modules/antismash/antismashlite/** + antismash/antismashlitedownloaddatabases: - modules/antismash/antismashlitedownloaddatabases/** - tests/modules/antismash/antismashlitedownloaddatabases/** @@ -218,6 +222,10 @@ bedtools/sort: - modules/bedtools/sort/** - tests/modules/bedtools/sort/** +bedtools/split: + - modules/bedtools/split/** + - tests/modules/bedtools/split/** + bedtools/subtract: - modules/bedtools/subtract/** - tests/modules/bedtools/subtract/** @@ -226,6 +234,10 @@ biobambam/bammarkduplicates2: - modules/biobambam/bammarkduplicates2/** - tests/modules/biobambam/bammarkduplicates2/** +biobambam/bammerge: + - modules/biobambam/bammerge/** + - tests/modules/biobambam/bammerge/** + biobambam/bamsormadup: - modules/biobambam/bamsormadup/** - tests/modules/biobambam/bamsormadup/** @@ -337,6 +349,10 @@ bracken/bracken: - modules/bracken/bracken/** - tests/modules/bracken/bracken/** +busco: + - modules/busco/** + - tests/modules/busco/** + bwa/aln: - modules/bwa/aln/** - tests/modules/bwa/aln/** @@ -491,6 +507,10 @@ custom/getchromsizes: - modules/custom/getchromsizes/** - tests/modules/custom/getchromsizes/** +custom/sratoolsncbisettings: + - modules/custom/sratoolsncbisettings/** + - tests/modules/custom/sratoolsncbisettings/** + cutadapt: - modules/cutadapt/** - tests/modules/cutadapt/** @@ -603,6 +623,10 @@ elprep/filter: - modules/elprep/filter/** - tests/modules/elprep/filter/** +elprep/merge: + - modules/elprep/merge/** + - tests/modules/elprep/merge/** + elprep/split: - modules/elprep/split/** - tests/modules/elprep/split/** @@ -675,6 +699,10 @@ freebayes: - modules/freebayes/** - tests/modules/freebayes/** +gamma: + - modules/gamma/** + - tests/modules/gamma/** + gatk4/applybqsr: - modules/gatk4/applybqsr/** - tests/modules/gatk4/applybqsr/** @@ -703,6 +731,10 @@ gatk4/calculatecontamination: - modules/gatk4/calculatecontamination/** - tests/modules/gatk4/calculatecontamination/** +gatk4/cnnscorevariants: + - modules/gatk4/cnnscorevariants/** + - tests/modules/gatk4/cnnscorevariants/** + gatk4/combinegvcfs: - modules/gatk4/combinegvcfs/** - tests/modules/gatk4/combinegvcfs/** @@ -727,6 +759,10 @@ gatk4/filtermutectcalls: - modules/gatk4/filtermutectcalls/** - tests/modules/gatk4/filtermutectcalls/** +gatk4/filtervarianttranches: + - modules/gatk4/filtervarianttranches/** + - tests/modules/gatk4/filtervarianttranches/** + gatk4/gatherbqsrreports: - modules/gatk4/gatherbqsrreports/** - tests/modules/gatk4/gatherbqsrreports/** @@ -803,6 +839,10 @@ gatk4/selectvariants: - modules/gatk4/selectvariants/** - tests/modules/gatk4/selectvariants/** +gatk4/splitintervals: + - modules/gatk4/splitintervals/** + - tests/modules/gatk4/splitintervals/** + gatk4/splitncigarreads: - modules/gatk4/splitncigarreads/** - tests/modules/gatk4/splitncigarreads/** @@ -823,6 +863,10 @@ genmap/mappability: - modules/genmap/mappability/** - tests/modules/genmap/mappability/** +genomescope2: + - modules/genomescope2/** + - tests/modules/genomescope2/** + genrich: - modules/genrich/** - tests/modules/genrich/** @@ -883,6 +927,14 @@ hamronization/summarize: - modules/hamronization/summarize/** - tests/modules/hamronization/summarize/** +happy/happy: + - modules/happy/happy/** + - tests/modules/happy/happy/** + +happy/prepy: + - modules/happy/prepy/** + - tests/modules/happy/prepy/** + hicap: - modules/hicap/** - tests/modules/hicap/** @@ -930,6 +982,10 @@ hmmer/hmmsearch: - modules/hmmer/hmmsearch/** - tests/modules/hmmer/hmmsearch/** +hmtnote: + - modules/hmtnote/** + - tests/modules/hmtnote/** + homer/annotatepeaks: - modules/homer/annotatepeaks/** - tests/modules/homer/annotatepeaks/** @@ -1046,6 +1102,14 @@ krona/ktimporttaxonomy: - modules/krona/ktimporttaxonomy/** - tests/modules/krona/ktimporttaxonomy/** +krona/ktimporttext: + - modules/krona/ktimporttext/** + - tests/modules/krona/ktimporttext/** + +krona/ktupdatetaxonomy: + - modules/krona/ktupdatetaxonomy/** + - tests/modules/krona/ktupdatetaxonomy/** + last/dotplot: - modules/last/dotplot/** - tests/modules/last/dotplot/** @@ -1154,6 +1218,10 @@ mash/dist: - modules/mash/dist/** - tests/modules/mash/dist/** +mash/screen: + - modules/mash/screen/** + - tests/modules/mash/screen/** + mash/sketch: - modules/mash/sketch/** - tests/modules/mash/sketch/** @@ -1166,6 +1234,14 @@ maxbin2: - modules/maxbin2/** - tests/modules/maxbin2/** +maxquant/lfq: + - modules/maxquant/lfq/** + - tests/modules/maxquant/lfq/** + +md5sum: + - modules/md5sum/** + - tests/modules/md5sum/** + medaka: - modules/medaka/** - tests/modules/medaka/** @@ -1182,6 +1258,18 @@ meningotype: - modules/meningotype/** - tests/modules/meningotype/** +meryl/count: + - modules/meryl/count/** + - tests/modules/meryl/count/** + +meryl/histogram: + - modules/meryl/histogram/** + - tests/modules/meryl/histogram/** + +meryl/unionsum: + - modules/meryl/unionsum/** + - tests/modules/meryl/unionsum/** + metabat2/jgisummarizebamcontigdepths: - modules/metabat2/jgisummarizebamcontigdepths/** - tests/modules/metabat2/jgisummarizebamcontigdepths/** @@ -1230,6 +1318,14 @@ mosdepth: - modules/mosdepth/** - tests/modules/mosdepth/** +motus/downloaddb: + - modules/motus/downloaddb/** + - tests/modules/motus/downloaddb/** + +motus/profile: + - modules/motus/profile/** + - tests/modules/motus/profile/** + msisensor/msi: - modules/msisensor/msi/** - tests/modules/msisensor/msi/** @@ -1571,6 +1667,10 @@ rseqc/tin: - modules/rseqc/tin/** - tests/modules/rseqc/tin/** +rtgtools/vcfeval: + - modules/rtgtools/vcfeval/** + - tests/modules/rtgtools/vcfeval/** + salmon/index: - modules/salmon/index/** - tests/modules/salmon/index/** @@ -1595,6 +1695,10 @@ samtools/collatefastq: - modules/samtools/collatefastq/** - tests/modules/samtools/collatefastq/** +samtools/convert: + - modules/samtools/convert/** + - tests/modules/samtools/convert/** + samtools/depth: - modules/samtools/depth/** - tests/modules/samtools/depth/** @@ -1707,6 +1811,14 @@ sexdeterrmine: - modules/sexdeterrmine/** - tests/modules/sexdeterrmine/** +shasum: + - modules/shasum/** + - tests/modules/shasum/** + +shigatyper: + - modules/shigatyper/** + - tests/modules/shigatyper/** + shovill: - modules/shovill/** - tests/modules/shovill/** @@ -1715,18 +1827,18 @@ sistr: - modules/sistr/** - tests/modules/sistr/** +slimfastq: + - modules/slimfastq/** + - tests/modules/slimfastq/** + +snapaligner/align: + - modules/snapaligner/align/** + - tests/modules/snapaligner/align/** + snapaligner/index: - modules/snapaligner/index/** - tests/modules/snapaligner/index/** -snapaligner/paired: - - modules/snapaligner/paired/** - - tests/modules/snapaligner/paired/** - -snapaligner/single: - - modules/snapaligner/single/** - - tests/modules/snapaligner/single/** - snpdists: - modules/snpdists/** - tests/modules/snpdists/** @@ -1763,6 +1875,10 @@ sratools/prefetch: - modules/sratools/prefetch/** - tests/modules/sratools/prefetch/** +srst2/srst2: + - modules/srst2/srst2/** + - tests/modules/srst2/srst2/** + ssuissero: - modules/ssuissero/** - tests/modules/ssuissero/** @@ -1904,6 +2020,10 @@ unzip: - modules/unzip/** - tests/modules/unzip/** +vardictjava: + - modules/vardictjava/** + - tests/modules/vardictjava/** + variantbam: - modules/variantbam/** - tests/modules/variantbam/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 61bd1e40..6f652b6c 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -14,6 +14,7 @@ params { genome_paf = "${test_data_dir}/genomics/sarscov2/genome/genome.paf" genome_sizes = "${test_data_dir}/genomics/sarscov2/genome/genome.sizes" transcriptome_fasta = "${test_data_dir}/genomics/sarscov2/genome/transcriptome.fasta" + proteome_fasta = "${test_data_dir}/genomics/sarscov2/genome/proteome.fasta" transcriptome_paf = "${test_data_dir}/genomics/sarscov2/genome/transcriptome.paf" test_bed = "${test_data_dir}/genomics/sarscov2/genome/bed/test.bed" @@ -109,6 +110,11 @@ params { test_sequencing_summary = "${test_data_dir}/genomics/sarscov2/nanopore/sequencing_summary/test.sequencing_summary.txt" } + 'metagenome' { + classified_reads_assignment = "${test_data_dir}/genomics/sarscov2/metagenome/test_1.kraken2.reads.txt" + kraken_report = "${test_data_dir}/genomics/sarscov2/metagenome/test_1.kraken2.report.txt" + krona_taxonomy = "${test_data_dir}/genomics/sarscov2/metagenome/krona_taxonomy.tab" + } } 'homo_sapiens' { 'genome' { @@ -119,6 +125,7 @@ params { genome_gff3 = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gff3" genome_gtf = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gtf" genome_interval_list = "${test_data_dir}/genomics/homo_sapiens/genome/genome.interval_list" + genome_multi_interval_bed = "${test_data_dir}/genomics/homo_sapiens/genome/genome.multi_intervals.bed" genome_sizes = "${test_data_dir}/genomics/homo_sapiens/genome/genome.sizes" genome_bed = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed" genome_header = "${test_data_dir}/genomics/homo_sapiens/genome/genome.header" @@ -128,6 +135,7 @@ params { transcriptome_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/transcriptome.fasta" genome2_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/genome2.fasta" genome_chain_gz = "${test_data_dir}/genomics/homo_sapiens/genome/genome.chain.gz" + genome_21_sdf = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome_sdf.tar.gz" genome_21_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.fasta" genome_21_fasta_fai = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai" genome_21_dict = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.dict" @@ -175,16 +183,16 @@ params { vcfanno_toml = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/vcfanno/vcfanno.toml" } 'pangenome' { - pangenome_fa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.fa" - pangenome_fa_gz = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.fa.gz" - pangenome_paf = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.paf" - pangenome_paf_gz = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.paf.gz" - pangenome_seqwish_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.seqwish.gfa" - pangenome_smoothxg_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.smoothxg.gfa" - pangenome_gfaffix_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.gfaffix.gfa" + pangenome_fa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.fa" + pangenome_fa_gz = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.fa.gz" + pangenome_paf = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.paf" + pangenome_paf_gz = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.paf.gz" + pangenome_seqwish_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.seqwish.gfa" + pangenome_smoothxg_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.smoothxg.gfa" + pangenome_gfaffix_gfa = "${test_data_dir}/pangenomics/homo_sapiens/pangenome.gfaffix.gfa" 'odgi' { - pangenome_og = "${test_data_dir}/pangenomics/homo_sapiens/odgi/pangenome.og" - pangenome_lay = "${test_data_dir}/pangenomics/homo_sapiens/odgi/pangenome.lay" + pangenome_og = "${test_data_dir}/pangenomics/homo_sapiens/odgi/pangenome.og" + pangenome_lay = "${test_data_dir}/pangenomics/homo_sapiens/odgi/pangenome.lay" } } 'illumina' { @@ -246,8 +254,8 @@ params { test2_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test2_2.fastq.gz" test2_umi_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test2.umi_1.fastq.gz" test2_umi_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test2.umi_2.fastq.gz" - test_rnaseq_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test.rnaseq_1.fastq.gz" - test_rnaseq_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test.rnaseq_2.fastq.gz" + test_rnaseq_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz" + test_rnaseq_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test_rnaseq_2.fastq.gz" test_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test.baserecalibrator.table" test2_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table" @@ -259,6 +267,11 @@ params { test2_haplotc_ann_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz" test2_haplotc_ann_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi" + test_haplotc_cnn_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz" + test_haplotc_cnn_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi" + + test2_haplotc_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz" + test2_haplotc_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi" test2_recal = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal" test2_recal_idx = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal.idx" @@ -312,32 +325,34 @@ params { test_pytor = "${test_data_dir}/genomics/homo_sapiens/illumina/pytor/test.pytor" } 'pacbio' { - primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta" - alz = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam" - alzpbi = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam.pbi" - ccs = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.bam" - ccs_fa = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta" - ccs_fa_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta.gz" - ccs_fq = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq" - ccs_fq_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz" - ccs_xml = "${test_data_dir}/genomics/homo_sapiens/pacbio/xml/alz.ccs.consensusreadset.xml" - hifi = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz" - lima = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.bam" - refine = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.bam" - cluster = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.bam" - singletons = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.bam" - aligned = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam" - alignedbai = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam.bai" - genemodel1 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.bed" - genemodel2 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.2.bed" - filelist = "${test_data_dir}/genomics/homo_sapiens/pacbio/txt/filelist.txt" + primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta" + alz = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam" + alzpbi = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam.pbi" + ccs = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.bam" + ccs_fa = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta" + ccs_fa_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta.gz" + ccs_fq = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq" + ccs_fq_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz" + ccs_xml = "${test_data_dir}/genomics/homo_sapiens/pacbio/xml/alz.ccs.consensusreadset.xml" + hifi = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz" + lima = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.bam" + refine = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.bam" + cluster = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.bam" + singletons = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.bam" + aligned = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam" + alignedbai = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam.bai" + genemodel1 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.bed" + genemodel2 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.2.bed" + filelist = "${test_data_dir}/genomics/homo_sapiens/pacbio/txt/filelist.txt" } } 'bacteroides_fragilis' { 'genome' { genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz" + genome_gbff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz" genome_paf = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf" genome_mapping_potential_arg = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.mapping.potential.ARG" + genome_gff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gff.gz" } 'illumina' { @@ -370,7 +385,7 @@ params { test3_gff = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test3.gff" } 'illumina' { - test_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fasta/test_1.fastq.gz" + test_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_1.fastq.gz" test_2_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_2.fastq.gz" test_se_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_se.fastq.gz" } @@ -387,33 +402,48 @@ params { } 'generic' { 'csv' { - test_csv = "${test_data_dir}/generic/csv/test.csv" + test_csv = "${test_data_dir}/generic/csv/test.csv" } 'notebooks' { - rmarkdown = "${test_data_dir}/generic/notebooks/rmarkdown/rmarkdown_notebook.Rmd" - ipython_md = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.md" - ipython_ipynb = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.ipynb" + rmarkdown = "${test_data_dir}/generic/notebooks/rmarkdown/rmarkdown_notebook.Rmd" + ipython_md = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.md" + ipython_ipynb = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.ipynb" } 'tsv' { - test_tsv = "${test_data_dir}/generic/tsv/test.tsv" + test_tsv = "${test_data_dir}/generic/tsv/test.tsv" } 'txt' { - hello = "${test_data_dir}/generic/txt/hello.txt" + hello = "${test_data_dir}/generic/txt/hello.txt" } 'cnn' { - reference = "${test_data_dir}/generic/cnn/reference.cnn" + reference = "${test_data_dir}/generic/cnn/reference.cnn" } 'cooler'{ - test_pairix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz" - test_pairix_pair_gz_px2 = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2" - test_pairs_pair = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.sample1.pairs" - test_tabix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz" - test_tabix_pair_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz.tbi" - hg19_chrom_sizes = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes" - test_merge_cool = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool" - test_merge_cool_cp2 = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cp2.cool" + test_pairix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz" + test_pairix_pair_gz_px2 = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2" + test_pairs_pair = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.sample1.pairs" + test_tabix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz" + test_tabix_pair_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz.tbi" + hg19_chrom_sizes = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes" + test_merge_cool = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool" + test_merge_cool_cp2 = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cp2.cool" } + 'config' { + ncbi_user_settings = "${test_data_dir}/generic/config/ncbi_user_settings.mkfg" + } } + 'proteomics' { + 'msspectra' { + ups_file1 = "${test_data_dir}/proteomics/msspectra/OVEMB150205_12.raw" + ups_file2 = "${test_data_dir}/proteomics/msspectra/OVEMB150205_14.raw" + } + 'database' { + yeast_ups = "${test_data_dir}/proteomics/database/yeast_UPS.fasta" + } + 'parameter' { + maxquant = "${test_data_dir}/proteomics/parameter/mqpar.xml" + } + } } } diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf new file mode 100644 index 00000000..2b23c400 --- /dev/null +++ b/tests/modules/antismash/antismashlite/main.nf @@ -0,0 +1,46 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' +include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/antismash/antismashlitedownloaddatabases/main.nf' +include { GUNZIP as GUNZIP1 } from '../../../../modules/gunzip/main.nf' +include { GUNZIP as GUNZIP2 } from '../../../../modules/gunzip/main.nf' +include { UNTAR as UNTAR1 } from '../../../../modules/untar/main.nf' +include { UNTAR as UNTAR2 } from '../../../../modules/untar/main.nf' +include { UNTAR as UNTAR3 } from '../../../../modules/untar/main.nf' + +workflow test_antismashlite { + genome_fna = [ + [ id:'test' ], + file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + ] + + genome_gff = [ + [], + file(params.test_data['bacteroides_fragilis']['genome']['genome_gff_gz'], checkIfExists: true) + ] + + antismash_css = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/css.tar.gz', checkIfExists: true) + ] + + antismash_detection = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/detection.tar.gz', checkIfExists: true) + ] + + antismash_modules = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) + ] + + GUNZIP1 ( genome_fna ) + GUNZIP2 ( genome_gff ) + UNTAR1 ( antismash_css ) + UNTAR2 ( antismash_detection ) + UNTAR3 ( antismash_modules ) + ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) + ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, GUNZIP2.out.gunzip.map{ it[1] } ) +} diff --git a/tests/modules/snapaligner/paired/nextflow.config b/tests/modules/antismash/antismashlite/nextflow.config similarity index 100% rename from tests/modules/snapaligner/paired/nextflow.config rename to tests/modules/antismash/antismashlite/nextflow.config diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml new file mode 100644 index 00000000..4642319c --- /dev/null +++ b/tests/modules/antismash/antismashlite/test.yml @@ -0,0 +1,35 @@ +- name: antismash antismashlite test_antismashlite + command: nextflow run tests/modules/antismash/antismashlite -entry test_antismashlite -c tests/config/nextflow.config + tags: + - antismash/antismashlite + - antismash + files: + - path: output/antismash/test/NZ_CP069563.1.region001.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/NZ_CP069563.1.region002.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/css/bacteria.css + md5sum: 8b3c2f8b143d5245a5f42f55803c532c + - path: output/antismash/test/genome.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/genome.json + contains: ['{"version": "6.0.1", "input_file": "genome.fna", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] + - path: output/antismash/test/genome.zip + - path: output/antismash/test/index.html + md5sum: de787e865c3a1eec143a19d2facb4de4 + - path: output/antismash/test/js/antismash.js + md5sum: 58e90c3d783ae014cc3d51849bcb50a2 + - path: output/antismash/test/js/jquery.js + md5sum: 397754ba49e9e0cf4e7c190da78dda05 + - path: output/antismash/test/js/jquery.tablesorter.min.js + md5sum: 5e9e08cef4d1be0eaa538e6eb28809a7 + - path: output/antismash/test/regions.js + contains: ['"seq_id": "NZ_CP069563.1"'] + - path: output/antismash/test/test.log + contains: ["antiSMASH version: 6.0.1"] + - path: output/antismash/versions.yml + md5sum: 759431a43da33e2ef8e2d0ebd79a439b + - path: output/gunzip1/genome.fna + md5sum: dafd38f5454b54fbea38245d773062a5 + - path: output/gunzip2/genome.gff + md5sum: 9b9c848b1946d43fa68128f4d6316052 diff --git a/tests/modules/antismash/antismashlitedownloaddatabases/test.yml b/tests/modules/antismash/antismashlitedownloaddatabases/test.yml index 3493bb4b..b4a964a0 100644 --- a/tests/modules/antismash/antismashlitedownloaddatabases/test.yml +++ b/tests/modules/antismash/antismashlitedownloaddatabases/test.yml @@ -5,10 +5,12 @@ - antismash files: - path: output/antismash/versions.yml - md5sum: e2656c8d2bcc7469eba40eb1ee5c91b3 + md5sum: 24859c67023abab99de295d3675a24b6 - path: output/antismash/antismash_db - path: output/antismash/antismash_db/clusterblast - path: output/antismash/antismash_db/clustercompare - path: output/antismash/antismash_db/pfam - path: output/antismash/antismash_db/resfam - path: output/antismash/antismash_db/tigrfam + - path: output/antismash/antismash_dir + - path: output/antismash/antismash_dir/detection/hmm_detection/data/bgc_seeds.hmm diff --git a/tests/modules/arriba/main.nf b/tests/modules/arriba/main.nf index 60741275..205adf0f 100644 --- a/tests/modules/arriba/main.nf +++ b/tests/modules/arriba/main.nf @@ -20,7 +20,7 @@ workflow test_arriba_single_end { STAR_GENOMEGENERATE ( fasta, gtf ) STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) - ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf ) + ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf , [], [], [], [], []) } workflow test_arriba_paired_end { @@ -38,5 +38,5 @@ workflow test_arriba_paired_end { STAR_GENOMEGENERATE ( fasta, gtf ) STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) - ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf ) + ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf, [], [], [], [], []) } diff --git a/tests/modules/arriba/test.yml b/tests/modules/arriba/test.yml index 52743167..b1e34db0 100644 --- a/tests/modules/arriba/test.yml +++ b/tests/modules/arriba/test.yml @@ -4,7 +4,7 @@ - arriba files: - path: output/arriba/test.fusions.discarded.tsv - md5sum: cad8c215b938d1e45b747a5b7898a4c2 + md5sum: 7602ab4ccbbb0c54fbca12a942877e6d - path: output/arriba/test.fusions.tsv md5sum: 7c3383f7eb6d79b84b0bd30a7ef02d70 - path: output/star/star/Genome @@ -39,6 +39,7 @@ - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam + md5sum: 4fa079d11f8938e51015e3e477fa7149 - path: output/star/test.Log.final.out - path: output/star/test.Log.out - path: output/star/test.Log.progress.out @@ -50,7 +51,7 @@ - arriba files: - path: output/arriba/test.fusions.discarded.tsv - md5sum: 85e36c887464e4deaa65f45174d3b8fd + md5sum: cdc6cfbc75e68ce29a766f50f390274d - path: output/arriba/test.fusions.tsv md5sum: 7c3383f7eb6d79b84b0bd30a7ef02d70 - path: output/star/star/Genome diff --git a/tests/modules/bamtools/split/main.nf b/tests/modules/bamtools/split/main.nf index eb0bed01..e5c15c32 100644 --- a/tests/modules/bamtools/split/main.nf +++ b/tests/modules/bamtools/split/main.nf @@ -2,13 +2,29 @@ nextflow.enable.dsl = 2 -include { BAMTOOLS_SPLIT } from '../../../../modules/bamtools/split/main.nf' +include { BAMTOOLS_SPLIT as BAMTOOLS_SPLIT_SINGLE } from '../../../../modules/bamtools/split/main.nf' +include { BAMTOOLS_SPLIT as BAMTOOLS_SPLIT_MULTIPLE } from '../../../../modules/bamtools/split/main.nf' -workflow test_bamtools_split { +workflow test_bamtools_split_single_input { input = [ [ id:'test', single_end:false ], // meta map - 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'], checkIfExists: true) + ] - BAMTOOLS_SPLIT ( input ) + BAMTOOLS_SPLIT_SINGLE ( input ) } + +workflow test_bamtools_split_multiple { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) + ] + ] + + BAMTOOLS_SPLIT_MULTIPLE ( input ) +} + diff --git a/tests/modules/bamtools/split/test.yml b/tests/modules/bamtools/split/test.yml index 4f52e9ce..af639b43 100644 --- a/tests/modules/bamtools/split/test.yml +++ b/tests/modules/bamtools/split/test.yml @@ -1,10 +1,23 @@ -- name: bamtools split test_bamtools_split - command: nextflow run ./tests/modules/bamtools/split -entry test_bamtools_split -c ./tests/config/nextflow.config -c ./tests/modules/bamtools/split/nextflow.config +- name: bamtools split test_bamtools_split_single_input + command: nextflow run ./tests/modules/bamtools/split -entry test_bamtools_split_single_input -c ./tests/config/nextflow.config -c ./tests/modules/bamtools/split/nextflow.config tags: - - bamtools/split - bamtools + - bamtools/split files: - - path: output/bamtools/test.paired_end.sorted.REF_chr22.bam + - path: output/bamtools/test.REF_chr22.bam md5sum: b7dc50e0edf9c6bfc2e3b0e6d074dc07 - - path: output/bamtools/test.paired_end.sorted.REF_unmapped.bam + - path: output/bamtools/test.REF_unmapped.bam md5sum: e0754bf72c51543b2d745d96537035fb + - path: output/bamtools/versions.yml + +- name: bamtools split test_bamtools_split_multiple + command: nextflow run ./tests/modules/bamtools/split -entry test_bamtools_split_multiple -c ./tests/config/nextflow.config -c ./tests/modules/bamtools/split/nextflow.config + tags: + - bamtools + - bamtools/split + files: + - path: output/bamtools/test.REF_chr22.bam + md5sum: 585675bea34c48ebe9db06a561d4b4fa + - path: output/bamtools/test.REF_unmapped.bam + md5sum: 16ad644c87b9471f3026bc87c98b4963 + - path: output/bamtools/versions.yml diff --git a/tests/modules/bedtools/split/main.nf b/tests/modules/bedtools/split/main.nf new file mode 100644 index 00000000..7a1dc685 --- /dev/null +++ b/tests/modules/bedtools/split/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BEDTOOLS_SPLIT } from '../../../../modules/bedtools/split/main.nf' + +workflow test_bedtools_split { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_multi_interval_bed'], checkIfExists: true) + ] + + number_of_files = 2 + + BEDTOOLS_SPLIT ( input, number_of_files ) +} diff --git a/tests/modules/snapaligner/single/nextflow.config b/tests/modules/bedtools/split/nextflow.config similarity index 100% rename from tests/modules/snapaligner/single/nextflow.config rename to tests/modules/bedtools/split/nextflow.config diff --git a/tests/modules/bedtools/split/test.yml b/tests/modules/bedtools/split/test.yml new file mode 100644 index 00000000..92ac17fa --- /dev/null +++ b/tests/modules/bedtools/split/test.yml @@ -0,0 +1,10 @@ +- name: bedtools split test_bedtools_split + command: nextflow run ./tests/modules/bedtools/split -entry test_bedtools_split -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/split/nextflow.config + tags: + - bedtools + - bedtools/split + files: + - path: output/bedtools/test.00001.bed + md5sum: d58e5e46c2fcc3b8be5db0f023e93cb5 + - path: output/bedtools/test.00002.bed + md5sum: 03caf952e9297a54620d2bbba8dc2823 diff --git a/tests/modules/biobambam/bammerge/main.nf b/tests/modules/biobambam/bammerge/main.nf new file mode 100644 index 00000000..7b4ee9cb --- /dev/null +++ b/tests/modules/biobambam/bammerge/main.nf @@ -0,0 +1,30 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BIOBAMBAM_BAMMERGE } from '../../../../modules/biobambam/bammerge/main.nf' + +workflow test_biobambam_bammerge_paired { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) + ] + ] + + BIOBAMBAM_BAMMERGE ( input ) +} + +workflow test_biobambam_bammerge_single { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true), + ] + ] + + BIOBAMBAM_BAMMERGE ( input ) +} diff --git a/tests/modules/biobambam/bammerge/nextflow.config b/tests/modules/biobambam/bammerge/nextflow.config new file mode 100644 index 00000000..e5d43921 --- /dev/null +++ b/tests/modules/biobambam/bammerge/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + withName: BIOBAMBAM_BAMMERGE { + ext.args = {[ + "md5=1", + "md5filename=${meta.id}.md5", + "index=1", + "indexfilename=${meta.id}.bam.bai" + ].join(" ").trim()} + } + +} diff --git a/tests/modules/biobambam/bammerge/test.yml b/tests/modules/biobambam/bammerge/test.yml new file mode 100644 index 00000000..d68b7083 --- /dev/null +++ b/tests/modules/biobambam/bammerge/test.yml @@ -0,0 +1,25 @@ +- name: biobambam bammerge test_biobambam_bammerge_paired + command: nextflow run ./tests/modules/biobambam/bammerge -entry test_biobambam_bammerge_paired -c ./tests/config/nextflow.config -c ./tests/modules/biobambam/bammerge/nextflow.config + tags: + - biobambam/bammerge + - biobambam + files: + - path: output/biobambam/test.bam + md5sum: bc3d32ab6a54d1894ca7cc79387dec57 + - path: output/biobambam/test.bam.bai + md5sum: b8ae542a37a73d79de1c15c765207c53 + - path: output/biobambam/test.md5 + md5sum: 31c59857990ceb392242136429e30243 + +- name: biobambam bammerge test_biobambam_bammerge_single + command: nextflow run ./tests/modules/biobambam/bammerge -entry test_biobambam_bammerge_single -c ./tests/config/nextflow.config -c ./tests/modules/biobambam/bammerge/nextflow.config + tags: + - biobambam/bammerge + - biobambam + files: + - path: output/biobambam/test.bam + md5sum: 86185d3d6895a7722d3b3a09c6f91bfc + - path: output/biobambam/test.bam.bai + md5sum: 973680feb6bc73cd1051ea83c7219418 + - path: output/biobambam/test.md5 + md5sum: 244a9d1cbc6d74724285c80220e5e427 diff --git a/tests/modules/bowtie2/align/main.nf b/tests/modules/bowtie2/align/main.nf index 2d3945e5..4f08b533 100644 --- a/tests/modules/bowtie2/align/main.nf +++ b/tests/modules/bowtie2/align/main.nf @@ -14,9 +14,25 @@ workflow test_bowtie2_align_single_end { ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) save_unaligned = false + sort = false BOWTIE2_BUILD ( fasta ) - BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) +} + +workflow test_bowtie2_align_single_end_sorted { + 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) + save_unaligned = false + sort = true + + BOWTIE2_BUILD ( fasta ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) } workflow test_bowtie2_align_paired_end { @@ -29,7 +45,55 @@ workflow test_bowtie2_align_paired_end { ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) save_unaligned = false + sort = false BOWTIE2_BUILD ( fasta ) - BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) +} + +workflow test_bowtie2_align_paired_end_sorted { + 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) + save_unaligned = false + sort = true + + BOWTIE2_BUILD ( fasta ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) +} + +workflow test_bowtie2_align_single_end_large_index { + 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) + save_unaligned = false + sort = false + + BOWTIE2_BUILD ( fasta ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) +} + +workflow test_bowtie2_align_paired_end_large_index { + 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) + save_unaligned = false + sort = false + + BOWTIE2_BUILD ( fasta ) + BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned, sort ) } diff --git a/tests/modules/bowtie2/align/nextflow.config b/tests/modules/bowtie2/align/nextflow.config index 8730f1c4..08f7bed0 100644 --- a/tests/modules/bowtie2/align/nextflow.config +++ b/tests/modules/bowtie2/align/nextflow.config @@ -1,5 +1,17 @@ +params { + force_large_index = false +} + process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } + +if (params.force_large_index) { + process { + withName: BOWTIE2_BUILD { + ext.args = '--large-index' + } + } +} diff --git a/tests/modules/bowtie2/align/test.yml b/tests/modules/bowtie2/align/test.yml index 95d48b88..9c9ff7a1 100644 --- a/tests/modules/bowtie2/align/test.yml +++ b/tests/modules/bowtie2/align/test.yml @@ -1,4 +1,4 @@ -- name: bowtie2 align single-end +- name: bowtie2 align test_bowtie2_align_single_end command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config tags: - bowtie2 @@ -6,36 +6,44 @@ files: - path: ./output/bowtie2/test.bam - path: ./output/bowtie2/test.bowtie2.log - - path: ./output/bowtie2/bowtie2/genome.3.bt2 - md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: ./output/bowtie2/bowtie2/genome.2.bt2 - md5sum: 47b153cd1319abc88dda532462651fcf - - path: ./output/bowtie2/bowtie2/genome.1.bt2 - md5sum: cbe3d0bbea55bc57c99b4bfa25b5fbdf - - path: ./output/bowtie2/bowtie2/genome.4.bt2 - md5sum: c25be5f8b0378abf7a58c8a880b87626 - - path: ./output/bowtie2/bowtie2/genome.rev.1.bt2 - md5sum: 52be6950579598a990570fbcf5372184 - - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2 - md5sum: e3b4ef343dea4dd571642010a7d09597 + - path: ./output/bowtie2/versions.yml -- name: bowtie2 align paired-end - command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config +- name: bowtie2 align test_bowtie2_align_single_end_sorted + command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end_sorted -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config tags: - bowtie2 - bowtie2/align files: - path: ./output/bowtie2/test.bam - path: ./output/bowtie2/test.bowtie2.log - - path: ./output/bowtie2/bowtie2/genome.3.bt2 - md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: ./output/bowtie2/bowtie2/genome.2.bt2 - md5sum: 47b153cd1319abc88dda532462651fcf - - path: ./output/bowtie2/bowtie2/genome.1.bt2 - md5sum: cbe3d0bbea55bc57c99b4bfa25b5fbdf - - path: ./output/bowtie2/bowtie2/genome.4.bt2 - md5sum: c25be5f8b0378abf7a58c8a880b87626 - - path: ./output/bowtie2/bowtie2/genome.rev.1.bt2 - md5sum: 52be6950579598a990570fbcf5372184 - - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2 - md5sum: e3b4ef343dea4dd571642010a7d09597 + - path: ./output/bowtie2/versions.yml + +- name: bowtie2 align test_bowtie2_align_paired_end + command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config + tags: + - bowtie2 + - bowtie2/align + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/bowtie2/versions.yml + +- name: bowtie2 align test_bowtie2_align_single_end_large_index + command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_single_end_large_index -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config --force_large_index + tags: + - bowtie2 + - bowtie2/align + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/bowtie2/versions.yml + +- name: bowtie2 align test_bowtie2_align_paired_end_large_index + command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end_large_index -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config --force_large_index + tags: + - bowtie2 + - bowtie2/align + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/bowtie2/versions.yml diff --git a/tests/modules/busco/main.nf b/tests/modules/busco/main.nf new file mode 100644 index 00000000..598e148a --- /dev/null +++ b/tests/modules/busco/main.nf @@ -0,0 +1,404 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BUSCO } from '../../../modules/busco/main.nf' + +workflow test_busco_genome_single_fasta { + + input = [ + [ id:'test' ], // meta map + file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + ] + + BUSCO ( + input, + ['bacteria_odb10', 'bacteroidetes_odb10'], // Launch with 'auto' to use --auto-lineage, and specified lineages // 'auto' removed from test due to memory issues + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmpyz_hi62i/busco/ + ├── short_summary.specific.bacteria_odb10.genome.fna.json -> /tmp/tmpza_0dth3/33/7d8c9b2c8931d9ad6a67aa843895e7/short_summary.specific.bacteria_odb10.genome.fna.json + ├── short_summary.specific.bacteria_odb10.genome.fna.txt -> /tmp/tmpza_0dth3/33/7d8c9b2c8931d9ad6a67aa843895e7/short_summary.specific.bacteria_odb10.genome.fna.txt + ├── short_summary.specific.bacteroidetes_odb10.genome.fna.json -> /tmp/tmpza_0dth3/6a/e95a0cd21785ce33d63b8f73a68a51/short_summary.specific.bacteroidetes_odb10.genome.fna.json + ├── short_summary.specific.bacteroidetes_odb10.genome.fna.txt -> /tmp/tmpza_0dth3/6a/e95a0cd21785ce33d63b8f73a68a51/short_summary.specific.bacteroidetes_odb10.genome.fna.txt + ├── test-bacteria_odb10-busco -> /tmp/tmpza_0dth3/33/7d8c9b2c8931d9ad6a67aa843895e7/test-bacteria_odb10-busco/ + │ ├── genome.fna/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteria_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-bacteria_odb10-busco.batch_summary.txt -> /tmp/tmpza_0dth3/33/7d8c9b2c8931d9ad6a67aa843895e7/test-bacteria_odb10-busco.batch_summary.txt + ├── test-bacteroidetes_odb10-busco -> /tmp/tmpza_0dth3/6a/e95a0cd21785ce33d63b8f73a68a51/test-bacteroidetes_odb10-busco/ + │ ├── genome.fna/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteroidetes_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-bacteroidetes_odb10-busco.batch_summary.txt -> /tmp/tmpza_0dth3/6a/e95a0cd21785ce33d63b8f73a68a51/test-bacteroidetes_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmpza_0dth3/6a/e95a0cd21785ce33d63b8f73a68a51/versions.yml + + Former Output tree -w 'auto': + /tmp/tmp846crjv2/busco/ + ├── short_summary.generic.bacteria_odb10.genome.fna.json -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/short_summary.generic.bacteria_odb10.genome.fna.json + ├── short_summary.generic.bacteria_odb10.genome.fna.txt -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/short_summary.generic.bacteria_odb10.genome.fna.txt + ├── short_summary.specific.bacteria_odb10.genome.fna.json -> /tmp/tmpi6af66j1/45/107812e983a8e695c380ebc215e7d9/short_summary.specific.bacteria_odb10.genome.fna.json + ├── short_summary.specific.bacteria_odb10.genome.fna.txt -> /tmp/tmpi6af66j1/45/107812e983a8e695c380ebc215e7d9/short_summary.specific.bacteria_odb10.genome.fna.txt + ├── short_summary.specific.bacteroidales_odb10.genome.fna.json -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/short_summary.specific.bacteroidales_odb10.genome.fna.json + ├── short_summary.specific.bacteroidales_odb10.genome.fna.txt -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/short_summary.specific.bacteroidales_odb10.genome.fna.txt + ├── short_summary.specific.bacteroidetes_odb10.genome.fna.json -> /tmp/tmpi6af66j1/a2/eb4a34894f3ac5554759ad6c9f652b/short_summary.specific.bacteroidetes_odb10.genome.fna.json + ├── short_summary.specific.bacteroidetes_odb10.genome.fna.txt -> /tmp/tmpi6af66j1/a2/eb4a34894f3ac5554759ad6c9f652b/short_summary.specific.bacteroidetes_odb10.genome.fna.txt + ├── test-auto-busco -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/test-auto-busco/ + │ ├── genome.fna/ + │ │ ├── auto_lineage/ + │ │ │ ├── run_archaea_odb10/ + │ │ │ ├── run_bacteria_odb10/ + │ │ │ └── run_eukaryota_odb10/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── metaeuk_err.log + │ │ │ ├── metaeuk_out.log + │ │ │ ├── prodigal_err.log + │ │ │ ├── prodigal_out.log + │ │ │ ├── sepp_err.log + │ │ │ └── sepp_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ ├── run_bacteria_odb10 -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/test-auto-busco/genome.fna/auto_lineage/run_bacteria_odb10/ [recursive, not followed] + │ │ └── run_bacteroidales_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-auto-busco.batch_summary.txt -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/test-auto-busco.batch_summary.txt + ├── test-bacteria_odb10-busco -> /tmp/tmpi6af66j1/45/107812e983a8e695c380ebc215e7d9/test-bacteria_odb10-busco/ + │ ├── genome.fna/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteria_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-bacteria_odb10-busco.batch_summary.txt -> /tmp/tmpi6af66j1/45/107812e983a8e695c380ebc215e7d9/test-bacteria_odb10-busco.batch_summary.txt + ├── test-bacteroidetes_odb10-busco -> /tmp/tmpi6af66j1/a2/eb4a34894f3ac5554759ad6c9f652b/test-bacteroidetes_odb10-busco/ + │ ├── genome.fna/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteroidetes_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-bacteroidetes_odb10-busco.batch_summary.txt -> /tmp/tmpi6af66j1/a2/eb4a34894f3ac5554759ad6c9f652b/test-bacteroidetes_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmpi6af66j1/18/8be22ecd7a71471ff5082bd512972b/versions.yml + */ + +} + +workflow test_busco_genome_multi_fasta { + + input = [ + [ id:'test' ], // meta map + [ + file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true), + file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true) + ] + ] + + BUSCO ( + input, + 'bacteria_odb10', + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmpk19byek7/busco/ + ├── short_summary.specific.bacteria_odb10.genome.fasta.json -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/short_summary.specific.bacteria_odb10.genome.fasta.json + ├── short_summary.specific.bacteria_odb10.genome.fasta.txt -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/short_summary.specific.bacteria_odb10.genome.fasta.txt + ├── short_summary.specific.bacteria_odb10.genome.fna.json -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/short_summary.specific.bacteria_odb10.genome.fna.json + ├── short_summary.specific.bacteria_odb10.genome.fna.txt -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/short_summary.specific.bacteria_odb10.genome.fna.txt + ├── test-bacteria_odb10-busco -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/test-bacteria_odb10-busco/ + │ ├── genome.fasta/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteria_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ ├── genome.fna/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── prodigal_err.log + │ │ │ └── prodigal_out.log + │ │ ├── prodigal_output/ + │ │ │ └── predicted_genes/ + │ │ └── run_bacteria_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-bacteria_odb10-busco.batch_summary.txt -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/test-bacteria_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmplt9fv3tl/15/ff310a16d9ce7ad24e207a05ce718e/versions.yml + */ + +} + +workflow test_busco_eukaryote_metaeuk { + + input = [ + [ id:'test' ], // meta map + file( params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + + BUSCO ( + input, + 'eukaryota_odb10', + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmpeq4dsir5/busco/ + ├── short_summary.specific.eukaryota_odb10.genome.fasta.json -> /tmp/tmp60hby2pk/6f/529873d91cda6bae3a4a6a21746aee/short_summary.specific.eukaryota_odb10.genome.fasta.json + ├── short_summary.specific.eukaryota_odb10.genome.fasta.txt -> /tmp/tmp60hby2pk/6f/529873d91cda6bae3a4a6a21746aee/short_summary.specific.eukaryota_odb10.genome.fasta.txt + ├── test-eukaryota_odb10-busco -> /tmp/tmp60hby2pk/6f/529873d91cda6bae3a4a6a21746aee/test-eukaryota_odb10-busco/ + │ ├── genome.fasta/ + │ │ ├── logs/ + │ │ │ ├── hmmsearch_err.log + │ │ │ ├── hmmsearch_out.log + │ │ │ ├── metaeuk_err.log + │ │ │ └── metaeuk_out.log + │ │ └── run_eukaryota_odb10/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── metaeuk_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ └── short_summary.txt + │ └── logs/ + │ └── busco.log + ├── test-eukaryota_odb10-busco.batch_summary.txt -> /tmp/tmp60hby2pk/6f/529873d91cda6bae3a4a6a21746aee/test-eukaryota_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmp60hby2pk/6f/529873d91cda6bae3a4a6a21746aee/versions.yml + */ + +} + +workflow test_busco_eukaryote_augustus { + + input = [ + [ id:'test' ], // meta map + file( params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + + BUSCO ( + input, + 'eukaryota_odb10', + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmp2xqaygjj/busco/ + ├── test-eukaryota_odb10-busco -> /tmp/tmpjqs61x9o/3f/67cc14e873c0ceb45e2a27594d624c/test-eukaryota_odb10-busco/ + │ ├── genome.fasta/ + │ │ ├── blast_db/ + │ │ │ ├── genome.fasta.ndb + │ │ │ ├── genome.fasta.nhr + │ │ │ ├── genome.fasta.nin + │ │ │ ├── genome.fasta.not + │ │ │ ├── genome.fasta.nsq + │ │ │ ├── genome.fasta.ntf + │ │ │ └── genome.fasta.nto + │ │ ├── logs/ + │ │ │ ├── makeblastdb_err.log + │ │ │ ├── makeblastdb_out.log + │ │ │ ├── tblastn_err.log + │ │ │ └── tblastn_out.log + │ │ └── run_eukaryota_odb10/ + │ │ ├── augustus_output/ + │ │ ├── blast_output/ + │ │ ├── busco_sequences/ + │ │ └── hmmer_output/ + │ └── logs/ + │ └── busco.log + ├── test-eukaryota_odb10-busco.batch_summary.txt -> /tmp/tmpjqs61x9o/3f/67cc14e873c0ceb45e2a27594d624c/test-eukaryota_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmpjqs61x9o/3f/67cc14e873c0ceb45e2a27594d624c/versions.yml + */ + +} + +workflow test_busco_protein { + + input = [ + [ id:'test' ], // meta map + file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['proteome_fasta'], checkIfExists: true) + ] + + BUSCO ( + input, + 'bacteria_odb10', + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmpzwd5dn56/busco/ + ├── short_summary.specific.bacteria_odb10.proteome.fasta.json -> /tmp/tmpk1nlgbf_/ae/0db07b5cd08fb23d0aba5f134ebbe2/short_summary.specific.bacteria_odb10.proteome.fasta.json + ├── short_summary.specific.bacteria_odb10.proteome.fasta.txt -> /tmp/tmpk1nlgbf_/ae/0db07b5cd08fb23d0aba5f134ebbe2/short_summary.specific.bacteria_odb10.proteome.fasta.txt + ├── test-bacteria_odb10-busco -> /tmp/tmpk1nlgbf_/ae/0db07b5cd08fb23d0aba5f134ebbe2/test-bacteria_odb10-busco/ + │ ├── logs/ + │ │ └── busco.log + │ └── proteome.fasta/ + │ ├── logs/ + │ │ ├── hmmsearch_err.log + │ │ └── hmmsearch_out.log + │ └── run_bacteria_odb10/ + │ ├── busco_sequences/ + │ ├── full_table.tsv + │ ├── hmmer_output/ + │ ├── missing_busco_list.tsv + │ ├── short_summary.json + │ └── short_summary.txt + ├── test-bacteria_odb10-busco.batch_summary.txt -> /tmp/tmpk1nlgbf_/ae/0db07b5cd08fb23d0aba5f134ebbe2/test-bacteria_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmpk1nlgbf_/ae/0db07b5cd08fb23d0aba5f134ebbe2/versions.yml + */ +} +workflow test_busco_transcriptome { + + input = [ + [ id:'test' ], // meta map + file( params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true) + ] + + BUSCO ( + input, + 'bacteria_odb10', + [], // Download busco lineage + [], // No config + ) + + /* Output tree: + /tmp/tmpitjyvo9g/busco/ + ├── short_summary.specific.bacteria_odb10.test1.contigs.fa.json -> /tmp/tmp6wqi0eyx/4f/ed0b23f0fc807bb68091298845c135/short_summary.specific.bacteria_odb10.test1.contigs.fa.json + ├── short_summary.specific.bacteria_odb10.test1.contigs.fa.txt -> /tmp/tmp6wqi0eyx/4f/ed0b23f0fc807bb68091298845c135/short_summary.specific.bacteria_odb10.test1.contigs.fa.txt + ├── test-bacteria_odb10-busco -> /tmp/tmp6wqi0eyx/4f/ed0b23f0fc807bb68091298845c135/test-bacteria_odb10-busco/ + │ ├── logs/ + │ │ └── busco.log + │ └── test1.contigs.fa/ + │ ├── blast_db/ + │ │ ├── test1.contigs.fa.ndb + │ │ ├── test1.contigs.fa.nhr + │ │ ├── test1.contigs.fa.nin + │ │ ├── test1.contigs.fa.not + │ │ ├── test1.contigs.fa.nsq + │ │ ├── test1.contigs.fa.ntf + │ │ └── test1.contigs.fa.nto + │ ├── logs/ + │ │ ├── hmmsearch_err.log + │ │ ├── hmmsearch_out.log + │ │ ├── makeblastdb_err.log + │ │ ├── makeblastdb_out.log + │ │ ├── tblastn_err.log + │ │ └── tblastn_out.log + │ ├── run_bacteria_odb10/ + │ │ ├── blast_output/ + │ │ ├── busco_sequences/ + │ │ ├── full_table.tsv + │ │ ├── hmmer_output/ + │ │ ├── missing_busco_list.tsv + │ │ ├── short_summary.json + │ │ ├── short_summary.txt + │ │ └── single_copy_proteins.faa + │ └── translated_proteins/ + │ ├── 1024388at2.faa + │ ├── 1054741at2.faa + │ ├── 1093223at2.faa + │ ├── 1151822at2.faa + │ ├── 143460at2.faa + │ ├── 1491686at2.faa + │ ├── 1504821at2.faa + │ ├── 1574817at2.faa + │ ├── 1592033at2.faa + │ ├── 1623045at2.faa + │ ├── 1661836at2.faa + │ ├── 1674344at2.faa + │ ├── 1698718at2.faa + │ ├── 1990650at2.faa + │ ├── 223233at2.faa + │ ├── 402899at2.faa + │ ├── 505485at2.faa + │ ├── 665824at2.faa + │ ├── 776861at2.faa + │ ├── 874197at2.faa + │ ├── 932854at2.faa + │ └── 95696at2.faa + ├── test-bacteria_odb10-busco.batch_summary.txt -> /tmp/tmp6wqi0eyx/4f/ed0b23f0fc807bb68091298845c135/test-bacteria_odb10-busco.batch_summary.txt + └── versions.yml -> /tmp/tmp6wqi0eyx/4f/ed0b23f0fc807bb68091298845c135/versions.yml + */ + +} diff --git a/tests/modules/busco/nextflow.config b/tests/modules/busco/nextflow.config new file mode 100644 index 00000000..9e8f718f --- /dev/null +++ b/tests/modules/busco/nextflow.config @@ -0,0 +1,28 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: 'test_busco_genome_single_fasta:BUSCO' { + ext.args = '--mode genome' + } + + withName: 'test_busco_genome_multi_fasta:BUSCO' { + ext.args = '--mode genome' + } + + withName: 'test_busco_eukaryote_metaeuk:BUSCO' { + ext.args = '--mode genome' + } + + withName: 'test_busco_eukaryote_augustus:BUSCO' { + ext.args = '--mode genome --augustus' + } + + withName: 'test_busco_protein:BUSCO' { + ext.args = '--mode proteins' + } + + withName: 'test_busco_transcriptome:BUSCO'{ + ext.args = '--mode transcriptome' + } +} diff --git a/tests/modules/busco/test.yml b/tests/modules/busco/test.yml new file mode 100644 index 00000000..43b810ba --- /dev/null +++ b/tests/modules/busco/test.yml @@ -0,0 +1,159 @@ +- name: busco test_busco_genome_single_fasta + command: nextflow run tests/modules/busco -entry test_busco_genome_single_fasta -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fna.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fna.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/short_summary.specific.bacteroidetes_odb10.genome.fna.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteroidetes_odb10.genome.fna.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/test-bacteria_odb10-busco.batch_summary.txt + md5sum: e50690742e9ae6abdd2bf99334ff9e12 + - path: output/busco/test-bacteroidetes_odb10-busco.batch_summary.txt + md5sum: 4c1b2c4317c88398eddc30877ed740d9 + - path: output/busco/versions.yml + md5sum: 8aa830f71587d859df35c6cfab59f35d + +- name: busco test_busco_genome_multi_fasta + command: nextflow run tests/modules/busco -entry test_busco_genome_multi_fasta -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fasta.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fasta.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fna.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteria_odb10.genome.fna.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/test-bacteria_odb10-busco.batch_summary.txt + md5sum: 5360dfe83bec1f5741ee115e53e6b517 + - path: output/busco/versions.yml + md5sum: 9a959eb0a1f765777dff1ea2f5c139c0 + +- name: busco test_busco_eukaryote_metaeuk + command: nextflow run tests/modules/busco -entry test_busco_eukaryote_metaeuk -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/short_summary.specific.eukaryota_odb10.genome.fasta.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.eukaryota_odb10.genome.fasta.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/test-eukaryota_odb10-busco.batch_summary.txt + md5sum: a70806f99ba5706d7353d3353b3f1d2b + - path: output/busco/versions.yml + md5sum: 34a808c257e6db1b0456f3b4372bc477 + +- name: busco test_busco_eukaryote_augustus + command: nextflow run tests/modules/busco -entry test_busco_eukaryote_augustus -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/test-eukaryota_odb10-busco.batch_summary.txt + md5sum: 660393dd43cd6a093b952d4b8ad41e40 + - path: output/busco/versions.yml + md5sum: 2caac915461410b16a1524ac064cd0df + +- name: busco test_busco_protein + command: nextflow run tests/modules/busco -entry test_busco_protein -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/short_summary.specific.bacteria_odb10.proteome.fasta.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteria_odb10.proteome.fasta.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/test-bacteria_odb10-busco.batch_summary.txt + md5sum: fd3b4e30ce74d1fcb95d6286d6e2049f + - path: output/busco/versions.yml + md5sum: d7392261a57960a7e6aea609dce824f5 + +- name: busco test_busco_transcriptome + command: nextflow run tests/modules/busco -entry test_busco_transcriptome -c tests/config/nextflow.config + tags: + - busco + files: + - path: output/busco/short_summary.specific.bacteria_odb10.test1.contigs.fa.json + contains: + - "one_line_summary" + - "input_file" + - "mode" + - "dataset" + - path: output/busco/short_summary.specific.bacteria_odb10.test1.contigs.fa.txt + contains: + - "BUSCO version" + - "The lineage dataset is" + - "BUSCO was run in mode" + - "Complete BUSCOs" + - "Missing BUSCOs" + - "Dependencies and versions" + - path: output/busco/test-bacteria_odb10-busco.batch_summary.txt + md5sum: 9a176cafe66ac0adca89dc34ad2be13f + - path: output/busco/versions.yml + md5sum: 30eacbc7df70f6b1e72e0a7b6d02a7e1 diff --git a/tests/modules/cnvpytor/callcnvs/test.yml b/tests/modules/cnvpytor/callcnvs/test.yml index 4565151e..fd07db4c 100644 --- a/tests/modules/cnvpytor/callcnvs/test.yml +++ b/tests/modules/cnvpytor/callcnvs/test.yml @@ -4,10 +4,8 @@ - cnvpytor - cnvpytor/callcnvs files: - - path: output/cnvpytor/test.tsv - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa - name: cnvpytor callcnvs test_cnvpytor_callcnvs stub command: nextflow run tests/modules/cnvpytor/callcnvs -entry test_cnvpytor_callcnvs -c tests/config/nextflow.config -stub-run @@ -15,6 +13,5 @@ - cnvpytor - cnvpytor/callcnvs files: - - path: output/cnvpytor/test.tsv + - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa diff --git a/tests/modules/cnvpytor/histogram/test.yml b/tests/modules/cnvpytor/histogram/test.yml index 0543fcc3..f67901d4 100644 --- a/tests/modules/cnvpytor/histogram/test.yml +++ b/tests/modules/cnvpytor/histogram/test.yml @@ -5,9 +5,7 @@ - cnvpytor/histogram files: - path: output/cnvpytor/test.pytor - md5sum: aa03a8fa15b39f77816705a48e10312a - path: output/cnvpytor/versions.yml - md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2 - name: cnvpytor histogram test_cnvpytor_histogram stub command: nextflow run tests/modules/cnvpytor/histogram -entry test_cnvpytor_histogram -c tests/config/nextflow.config -stub-run @@ -17,4 +15,3 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2 diff --git a/tests/modules/cnvpytor/importreaddepth/test.yml b/tests/modules/cnvpytor/importreaddepth/test.yml index b148c38e..a2530c26 100644 --- a/tests/modules/cnvpytor/importreaddepth/test.yml +++ b/tests/modules/cnvpytor/importreaddepth/test.yml @@ -6,7 +6,6 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 5834495324c08a37f3fd73ccdd881dc8 - name: cnvpytor importreaddepth test_cnvpytor_importreaddepth stub command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth -c tests/config/nextflow.config -stub-run @@ -16,7 +15,6 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 5834495324c08a37f3fd73ccdd881dc8 - name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config @@ -26,7 +24,6 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: dfa0afb0982d985b96d1633f71ebb82a - name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram stub command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config -stub-run @@ -36,4 +33,3 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: dfa0afb0982d985b96d1633f71ebb82a diff --git a/tests/modules/cnvpytor/partition/test.yml b/tests/modules/cnvpytor/partition/test.yml index 10232097..e24a1200 100644 --- a/tests/modules/cnvpytor/partition/test.yml +++ b/tests/modules/cnvpytor/partition/test.yml @@ -5,9 +5,7 @@ - cnvpytor/partition files: - path: output/cnvpytor/test.pytor - md5sum: aa03a8fa15b39f77816705a48e10312a - path: output/cnvpytor/versions.yml - md5sum: 7fd6ec952a316463bcd324f176b46b64 - name: cnvpytor partition test_cnvpytor_partition stub command: nextflow run tests/modules/cnvpytor/partition -entry test_cnvpytor_partition -c tests/config/nextflow.config -stub-run @@ -17,4 +15,3 @@ files: - path: output/cnvpytor/test.pytor - path: output/cnvpytor/versions.yml - md5sum: 7fd6ec952a316463bcd324f176b46b64 diff --git a/tests/modules/cnvpytor/view/main.nf b/tests/modules/cnvpytor/view/main.nf new file mode 100644 index 00000000..3b99c314 --- /dev/null +++ b/tests/modules/cnvpytor/view/main.nf @@ -0,0 +1,42 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CNVPYTOR_VIEW } from '../../../../modules/cnvpytor/view/main.nf' + +workflow test_cnvpytor_view { + + input = [ + [ id:'test'], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] + ] + + bin_sizes = "10000 100000" + + CNVPYTOR_VIEW ( input, bin_sizes, [] ) +} + +workflow test_cnvpytor_view_tsvout { + + input = [ + [ id:'test'], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] + ] + + output_suffix = "tsv" + + CNVPYTOR_VIEW ( input, [], output_suffix ) +} + +workflow test_cnvpytor_view_stub { + + input = [ + [ id:'test'], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] + ] + + bin_sizes = [] + output_suffix = [] + + CNVPYTOR_VIEW ( input, bin_sizes, output_suffix ) +} diff --git a/tests/modules/cnvpytor/view/nextflow.config b/tests/modules/cnvpytor/view/nextflow.config new file mode 100644 index 00000000..6d2cc1fb --- /dev/null +++ b/tests/modules/cnvpytor/view/nextflow.config @@ -0,0 +1,7 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + withName: CNVPYTOR_VIEW { + ext.args = '10000 100000' + } +} diff --git a/tests/modules/cnvpytor/view/test.yml b/tests/modules/cnvpytor/view/test.yml new file mode 100644 index 00000000..ea8ab792 --- /dev/null +++ b/tests/modules/cnvpytor/view/test.yml @@ -0,0 +1,27 @@ +- name: cnvpytor view test_cnvpytor_view + command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view -c tests/config/nextflow.config + tags: + - cnvpytor + - cnvpytor/view + files: + - path: output/cnvpytor/test_10000.vcf + - path: output/cnvpytor/test_100000.vcf + - path: output/cnvpytor/versions.yml + +- name: cnvpytor view test_cnvpytor_view tsv + command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view_tsvout -c tests/config/nextflow.config + tags: + - cnvpytor + - cnvpytor/view + files: + - path: output/cnvpytor/test_1000.tsv + - path: output/cnvpytor/versions.yml + +- name: cnvpytor view test_cnvpytor_view stub + command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view_stub -c tests/config/nextflow.config -stub-run + tags: + - cnvpytor + - cnvpytor/view + files: + - path: output/cnvpytor/test.vcf + - path: output/cnvpytor/versions.yml diff --git a/tests/modules/custom/sratoolsncbisettings/main.nf b/tests/modules/custom/sratoolsncbisettings/main.nf new file mode 100644 index 00000000..9f49f20e --- /dev/null +++ b/tests/modules/custom/sratoolsncbisettings/main.nf @@ -0,0 +1,44 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CUSTOM_SRATOOLSNCBISETTINGS } from '../../../../modules/custom/sratoolsncbisettings/main.nf' + +workflow test_sratoolsncbisettings_with_good_existing { + + file(params.settings_path).mkdirs() + def settings = file(params.test_data['generic']['config']['ncbi_user_settings'], checkIfExists: true) + settings.copyTo(params.settings_file) + + CUSTOM_SRATOOLSNCBISETTINGS() +} + +workflow test_sratoolsncbisettings_with_bad_existing { + + file(params.settings_path).mkdirs() + def settings = file(params.settings_file) + settings.text = ''' + ## auto-generated configuration file - DO NOT EDIT ## + + config/default = "false" + /repository/remote/main/CGI/resolver-cgi = "https://trace.ncbi.nlm.nih.gov/Traces/names/names.fcgi" + /repository/remote/protected/CGI/resolver-cgi = "https://trace.ncbi.nlm.nih.gov/Traces/names/names.fcgi" + /repository/user/ad/public/apps/file/volumes/flatAd = "." + /repository/user/ad/public/apps/refseq/volumes/refseqAd = "." + /repository/user/ad/public/apps/sra/volumes/sraAd = "." + /repository/user/ad/public/apps/sraPileup/volumes/ad = "." + /repository/user/ad/public/apps/sraRealign/volumes/ad = "." + /repository/user/ad/public/apps/wgs/volumes/wgsAd = "." + /repository/user/ad/public/root = "." + /repository/user/default-path = "/root/ncbi" + '''.stripIndent() + + CUSTOM_SRATOOLSNCBISETTINGS() +} + +workflow test_sratoolsncbisettings_with_nonexisting { + def settings = file(params.settings_file) + settings.delete() + + CUSTOM_SRATOOLSNCBISETTINGS() +} diff --git a/tests/modules/custom/sratoolsncbisettings/nextflow.config b/tests/modules/custom/sratoolsncbisettings/nextflow.config new file mode 100644 index 00000000..a6c70bd3 --- /dev/null +++ b/tests/modules/custom/sratoolsncbisettings/nextflow.config @@ -0,0 +1,8 @@ +params.settings_path = '/tmp/.ncbi' +params.settings_file = "${params.settings_path}/user-settings.mkfg" + +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/custom/sratoolsncbisettings/nextflow_mount.config b/tests/modules/custom/sratoolsncbisettings/nextflow_mount.config new file mode 100644 index 00000000..853844c5 --- /dev/null +++ b/tests/modules/custom/sratoolsncbisettings/nextflow_mount.config @@ -0,0 +1,17 @@ +params.settings_path = '/tmp/.ncbi' +params.settings_file = "${params.settings_path}/user-settings.mkfg" + +env.NCBI_SETTINGS = params.settings_file + +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CUSTOM_SRATOOLSNCBISETTINGS { + containerOptions = { + (workflow.containerEngine == 'singularity') ? + "-B ${params.settings_path}:${params.settings_path}" : + "-v ${params.settings_path}:${params.settings_path}" + } + } +} diff --git a/tests/modules/custom/sratoolsncbisettings/test.yml b/tests/modules/custom/sratoolsncbisettings/test.yml new file mode 100644 index 00000000..df3cd936 --- /dev/null +++ b/tests/modules/custom/sratoolsncbisettings/test.yml @@ -0,0 +1,44 @@ +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_good_existing" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_good_existing -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow_mount.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + files: + - path: "output/custom/user-settings.mkfg" + md5sum: 955e27aff2c277c2f1f0943a098888c1 + - path: output/custom/versions.yml + contains: + - "sratools: 2.11.0" + +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_bad_existing" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_bad_existing -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow_mount.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + exit_code: 1 + stdout: + contains: + - "Command error:" + - "missing the required entries" + - "/LIBS/GUID" + - "/libs/cloud/report_instance_identity" + - "Feel free to add the following" + files: + - path: "output/custom/user-settings.mkfg" + should_exist: false + - path: output/custom/versions.yml + should_exist: false + +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_nonexisting" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_nonexisting -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + files: + - path: "output/custom/user-settings.mkfg" + contains: + - "/LIBS/GUID" + - "/libs/cloud/report_instance_identity" + - path: output/custom/versions.yml + contains: + - "sratools: 2.11.0" diff --git a/tests/modules/diamond/blastp/main.nf b/tests/modules/diamond/blastp/main.nf index 87d05bf9..ff669233 100644 --- a/tests/modules/diamond/blastp/main.nf +++ b/tests/modules/diamond/blastp/main.nf @@ -7,9 +7,22 @@ include { DIAMOND_BLASTP } from '../../../../modules/diamond/blastp/main.nf' workflow test_diamond_blastp { - db = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] - fasta = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + db = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] + fasta = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] + out_ext = 'txt' + blast_columns = 'qseqid qlen' DIAMOND_MAKEDB ( db ) - DIAMOND_BLASTP ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db ) + DIAMOND_BLASTP ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db, out_ext, blast_columns ) +} + +workflow test_diamond_blastp_daa { + + db = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] + fasta = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] + out_ext = 'daa' + blast_columns = [] + + DIAMOND_MAKEDB ( db ) + DIAMOND_BLASTP ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db, out_ext, blast_columns ) } diff --git a/tests/modules/diamond/blastp/test.yml b/tests/modules/diamond/blastp/test.yml index 32dfacaa..aff4e1c5 100644 --- a/tests/modules/diamond/blastp/test.yml +++ b/tests/modules/diamond/blastp/test.yml @@ -1,8 +1,17 @@ -- name: diamond blastp - command: nextflow run ./tests/modules/diamond/blastp -entry test_diamond_blastp -c ./tests/config/nextflow.config -c ./tests/modules/diamond/blastp/nextflow.config +- name: diamond blastp test_diamond_blastp + command: nextflow run tests/modules/diamond/blastp -entry test_diamond_blastp -c tests/config/nextflow.config tags: - - diamond - diamond/blastp + - diamond files: - - path: ./output/diamond/test.diamond_blastp.txt - md5sum: 3ca7f6290c1d8741c573370e6f8b4db0 + - path: output/diamond/test.diamond_blastp.txt + - path: output/diamond/versions.yml + +- name: diamond blastp test_diamond_blastp_daa + command: nextflow run tests/modules/diamond/blastp -entry test_diamond_blastp_daa -c tests/config/nextflow.config + tags: + - diamond/blastp + - diamond + files: + - path: output/diamond/test.diamond_blastp.daa + - path: output/diamond/versions.yml diff --git a/tests/modules/diamond/blastx/main.nf b/tests/modules/diamond/blastx/main.nf index 77eb08ea..8316aa91 100644 --- a/tests/modules/diamond/blastx/main.nf +++ b/tests/modules/diamond/blastx/main.nf @@ -7,9 +7,22 @@ include { DIAMOND_BLASTX } from '../../../../modules/diamond/blastx/main.nf' workflow test_diamond_blastx { - db = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + db = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] fasta = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + out_ext = 'tfdfdt' // Nonsense file extension to check default case. + blast_columns = 'qseqid qlen' DIAMOND_MAKEDB ( db ) - DIAMOND_BLASTX ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db ) + DIAMOND_BLASTX ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db, out_ext, blast_columns ) +} + +workflow test_diamond_blastx_daa { + + db = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] + fasta = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + out_ext = 'daa' + blast_columns = [] + + DIAMOND_MAKEDB ( db ) + DIAMOND_BLASTX ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db, out_ext, blast_columns ) } diff --git a/tests/modules/diamond/blastx/test.yml b/tests/modules/diamond/blastx/test.yml index fe7c6938..b2b6149f 100644 --- a/tests/modules/diamond/blastx/test.yml +++ b/tests/modules/diamond/blastx/test.yml @@ -1,8 +1,18 @@ -- name: diamond blastx - command: nextflow run ./tests/modules/diamond/blastx -entry test_diamond_blastx -c ./tests/config/nextflow.config -c ./tests/modules/diamond/blastx/nextflow.config +- name: diamond blastx test_diamond_blastx + command: nextflow run tests/modules/diamond/blastx -entry test_diamond_blastx -c tests/config/nextflow.config tags: - diamond - diamond/blastx files: - - path: ./output/diamond/test.diamond_blastx.txt - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/diamond/test.diamond_blastx.txt + - path: output/diamond/versions.yml + +- name: diamond blastx test_diamond_blastx_daa + command: nextflow run tests/modules/diamond/blastx -entry test_diamond_blastx_daa -c tests/config/nextflow.config + tags: + - diamond + - diamond/blastx + files: + - path: output/diamond/test.diamond_blastx.daa + md5sum: 0df4a833408416f32981415873facc11 + - path: output/diamond/versions.yml diff --git a/tests/modules/diamond/makedb/main.nf b/tests/modules/diamond/makedb/main.nf index 70982ae9..d309de6d 100644 --- a/tests/modules/diamond/makedb/main.nf +++ b/tests/modules/diamond/makedb/main.nf @@ -6,7 +6,7 @@ include { DIAMOND_MAKEDB } from '../../../../modules/diamond/makedb/main.nf' workflow test_diamond_makedb { - input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + input = [ file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) ] DIAMOND_MAKEDB ( input ) } diff --git a/tests/modules/diamond/makedb/test.yml b/tests/modules/diamond/makedb/test.yml index c8f2d79e..cdddf735 100644 --- a/tests/modules/diamond/makedb/test.yml +++ b/tests/modules/diamond/makedb/test.yml @@ -1,8 +1,9 @@ - name: diamond makedb test_diamond_makedb - command: nextflow run ./tests/modules/diamond/makedb -entry test_diamond_makedb -c ./tests/config/nextflow.config -c ./tests/modules/diamond/makedb/nextflow.config + command: nextflow run tests/modules/diamond/makedb -entry test_diamond_makedb -c tests/config/nextflow.config tags: - - diamond - diamond/makedb + - diamond files: - - path: output/diamond/genome.fasta.dmnd - md5sum: 2447fb376394c20d43ea3aad2aa5d15d + - path: output/diamond/proteome.fasta.dmnd + md5sum: fc28c50b202dd7a7c5451cddff2ba1f4 + - path: output/diamond/versions.yml diff --git a/tests/modules/elprep/merge/main.nf b/tests/modules/elprep/merge/main.nf new file mode 100644 index 00000000..b4a40ce3 --- /dev/null +++ b/tests/modules/elprep/merge/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ELPREP_SPLIT } from '../../../../modules/elprep/split/main.nf' +include { ELPREP_MERGE } from '../../../../modules/elprep/merge/main.nf' + +workflow test_elprep_merge { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + + ELPREP_SPLIT ( input ) + ELPREP_MERGE ( ELPREP_SPLIT.out.bam ) +} diff --git a/tests/modules/elprep/merge/nextflow.config b/tests/modules/elprep/merge/nextflow.config new file mode 100644 index 00000000..4e4570f4 --- /dev/null +++ b/tests/modules/elprep/merge/nextflow.config @@ -0,0 +1,5 @@ +process { + withName : ELPREP_MERGE { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + } +} diff --git a/tests/modules/elprep/merge/test.yml b/tests/modules/elprep/merge/test.yml new file mode 100644 index 00000000..ad2ecfef --- /dev/null +++ b/tests/modules/elprep/merge/test.yml @@ -0,0 +1,8 @@ +- name: elprep merge test_elprep_merge + command: nextflow run tests/modules/elprep/merge -entry test_elprep_merge -c tests/config/nextflow.config + tags: + - elprep + - elprep/merge + files: + - path: output/elprep/output/test.bam + - path: output/elprep/versions.yml diff --git a/tests/modules/ensemblvep/main.nf b/tests/modules/ensemblvep/main.nf index 223847c7..30d19957 100644 --- a/tests/modules/ensemblvep/main.nf +++ b/tests/modules/ensemblvep/main.nf @@ -10,5 +10,5 @@ workflow test_ensemblvep { file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) + ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [], [] ) } diff --git a/tests/modules/gamma/main.nf b/tests/modules/gamma/main.nf new file mode 100644 index 00000000..f9477706 --- /dev/null +++ b/tests/modules/gamma/main.nf @@ -0,0 +1,17 @@ +#!/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/nextflow.config b/tests/modules/gamma/nextflow.config new file mode 100644 index 00000000..bbbf4de0 --- /dev/null +++ b/tests/modules/gamma/nextflow.config @@ -0,0 +1,7 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + ext.args = '--fasta' + +} diff --git a/tests/modules/gamma/test.yml b/tests/modules/gamma/test.yml new file mode 100644 index 00000000..1b493b49 --- /dev/null +++ b/tests/modules/gamma/test.yml @@ -0,0 +1,13 @@ +- 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 diff --git a/tests/modules/gatk4/applybqsr/test.yml b/tests/modules/gatk4/applybqsr/test.yml index eaf1a08e..c3dd4eef 100644 --- a/tests/modules/gatk4/applybqsr/test.yml +++ b/tests/modules/gatk4/applybqsr/test.yml @@ -5,7 +5,7 @@ - gatk4/applybqsr files: - path: output/gatk4/test.bam - md5sum: d088422be886dc8507ff97fcc7dd968a + md5sum: e11b7eaf2034740a953626518e3c3d6e - path: output/gatk4/versions.yml - name: gatk4 applybqsr test_gatk4_applybqsr_intervals @@ -15,7 +15,7 @@ - gatk4/applybqsr files: - path: output/gatk4/test.bam - md5sum: 4bfa18d651abd945e240b05e70107716 + md5sum: e9e9aa753c106e43f936ad573e23d2e6 - path: output/gatk4/versions.yml - name: gatk4 applybqsr test_gatk4_applybqsr_cram @@ -25,5 +25,5 @@ - gatk4/applybqsr files: - path: output/gatk4/test.cram - md5sum: 2e0bca197af4f043a4a85152e6edbe04 + md5sum: bca9d234a5d484ce2a6f4826ca2ea308 - path: output/gatk4/versions.yml diff --git a/tests/modules/gatk4/applybqsrspark/test.yml b/tests/modules/gatk4/applybqsrspark/test.yml index d230c000..1e4f8b47 100644 --- a/tests/modules/gatk4/applybqsrspark/test.yml +++ b/tests/modules/gatk4/applybqsrspark/test.yml @@ -5,7 +5,7 @@ - gatk4/applybqsrspark files: - path: output/gatk4/test.bam - md5sum: d088422be886dc8507ff97fcc7dd968a + md5sum: 1901c819fcba0fdd5e2482e6dc8285ef - path: output/gatk4/versions.yml - name: gatk4 applybqsr test_gatk4_applybqsr_spark_intervals @@ -15,7 +15,7 @@ - gatk4/applybqsrspark files: - path: output/gatk4/test.bam - md5sum: 4bfa18d651abd945e240b05e70107716 + md5sum: 2ca2446f0125890280056fd7da822732 - path: output/gatk4/versions.yml - name: gatk4 applybqsr test_gatk4_applybqsr_spark_cram @@ -25,5 +25,5 @@ - gatk4/applybqsrspark files: - path: output/gatk4/test.cram - md5sum: 2e0bca197af4f043a4a85152e6edbe04 + md5sum: 60f7c822a9f2833e11eb7bfd16e4421f - path: output/gatk4/versions.yml diff --git a/tests/modules/gatk4/cnnscorevariants/main.nf b/tests/modules/gatk4/cnnscorevariants/main.nf new file mode 100644 index 00000000..1654c54a --- /dev/null +++ b/tests/modules/gatk4/cnnscorevariants/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_CNNSCOREVARIANTS } from '../../../../modules/gatk4/cnnscorevariants/main.nf' + +workflow test_gatk4_cnnscorevariants { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), + [], + [] + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + 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_CNNSCOREVARIANTS ( input, fasta, fai, dict, [], [] ) +} diff --git a/tests/modules/gatk4/cnnscorevariants/nextflow.config b/tests/modules/gatk4/cnnscorevariants/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/gatk4/cnnscorevariants/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/cnnscorevariants/test.yml b/tests/modules/gatk4/cnnscorevariants/test.yml new file mode 100644 index 00000000..eb2e681f --- /dev/null +++ b/tests/modules/gatk4/cnnscorevariants/test.yml @@ -0,0 +1,9 @@ +- name: gatk4 cnnscorevariants test_gatk4_cnnscorevariants + command: nextflow run ./tests/modules/gatk4/cnnscorevariants -entry test_gatk4_cnnscorevariants -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/cnnscorevariants/nextflow.config + tags: + - gatk4/cnnscorevariants + - gatk4 + files: + - path: output/gatk4/test.cnn.vcf.gz + contains: ["##ALT= + folder + }) + + + RTGTOOLS_VCFEVAL ( input, truth, truth_regions, evaluation_regions, sdf ) +} + +workflow test_rtgtools_vcfeval_no_optional_inputs { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), + [], + ] + + truth = [ + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), + [] + ] + + truth_regions = [] + + evaluation_regions = [] + + compressed_sdf = [ + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_sdf']) + ] + + sdf = UNTAR( compressed_sdf ).untar + .map({ + meta, folder -> + [folder] + }) + + RTGTOOLS_VCFEVAL ( input, truth, truth_regions, evaluation_regions, sdf ) +} diff --git a/tests/modules/rtgtools/vcfeval/nextflow.config b/tests/modules/rtgtools/vcfeval/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/rtgtools/vcfeval/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/rtgtools/vcfeval/test.yml b/tests/modules/rtgtools/vcfeval/test.yml new file mode 100644 index 00000000..33720f66 --- /dev/null +++ b/tests/modules/rtgtools/vcfeval/test.yml @@ -0,0 +1,75 @@ +- name: rtgtools vcfeval test_rtgtools_vcfeval + command: nextflow run tests/modules/rtgtools/vcfeval -entry test_rtgtools_vcfeval -c tests/config/nextflow.config + tags: + - rtgtools + - rtgtools/vcfeval + files: + - path: output/rtgtools/test_results/done + - path: output/rtgtools/test_results/fn.vcf.gz + md5sum: be9c9106055bfad4c5985bc0d33efd56 + - path: output/rtgtools/test_results/fn.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/fp.vcf.gz + md5sum: e0f0ff841dc63e9fb61fd3a5db137ced + - path: output/rtgtools/test_results/fp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/non_snp_roc.tsv.gz + md5sum: ad5bad32c48f05aef232e2c0e708877a + - path: output/rtgtools/test_results/phasing.txt + md5sum: 133677dbd8be657439ea2b03fdfb8795 + - path: output/rtgtools/test_results/progress + - path: output/rtgtools/test_results/snp_roc.tsv.gz + md5sum: 6785b83d66486e7e6c75c5a5b1574c09 + - path: output/rtgtools/test_results/summary.txt + md5sum: f4c8df93c8bdab603036bbc27b4a28c3 + - path: output/rtgtools/test_results/tp-baseline.vcf.gz + md5sum: be9c9106055bfad4c5985bc0d33efd56 + - path: output/rtgtools/test_results/tp-baseline.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/tp.vcf.gz + md5sum: e0f0ff841dc63e9fb61fd3a5db137ced + - path: output/rtgtools/test_results/tp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/vcfeval.log + - path: output/rtgtools/test_results/weighted_roc.tsv.gz + md5sum: fa7c046ea0084172f1ef91f19de07b2b + - path: output/rtgtools/versions.yml + md5sum: 270ed7a5a8e347b251eb4aa2198f98e8 + +- name: rtgtools vcfeval test_rtgtools_vcfeval_no_optional_inputs + command: nextflow run tests/modules/rtgtools/vcfeval -entry test_rtgtools_vcfeval_no_optional_inputs -c tests/config/nextflow.config + tags: + - rtgtools + - rtgtools/vcfeval + files: + - path: output/rtgtools/test_results/done + - path: output/rtgtools/test_results/fn.vcf.gz + md5sum: c11c889a4f42c8ea325748bd768ea34d + - path: output/rtgtools/test_results/fn.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/fp.vcf.gz + md5sum: 138e85c1cd79f8fea9a33e81ce0c734c + - path: output/rtgtools/test_results/fp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test_results/non_snp_roc.tsv.gz + md5sum: 34fb78a008dfc0bef02807b8a7012b07 + - path: output/rtgtools/test_results/phasing.txt + md5sum: 133677dbd8be657439ea2b03fdfb8795 + - path: output/rtgtools/test_results/progress + - path: output/rtgtools/test_results/snp_roc.tsv.gz + md5sum: a4c5761c2653e2d04fc84c1cea13b1f0 + - path: output/rtgtools/test_results/summary.txt + md5sum: f33feb32f84958fb931063044fba369b + - path: output/rtgtools/test_results/tp-baseline.vcf.gz + md5sum: d1c2d990899edf127ea5fcca8866fcb0 + - path: output/rtgtools/test_results/tp-baseline.vcf.gz.tbi + md5sum: 3307008fea47adb75c46d395c5567bc0 + - path: output/rtgtools/test_results/tp.vcf.gz + md5sum: e35b4dab82894eee9b77c81f9bc89cca + - path: output/rtgtools/test_results/tp.vcf.gz.tbi + md5sum: 45d8f8793140944f129e728299918c88 + - path: output/rtgtools/test_results/vcfeval.log + - path: output/rtgtools/test_results/weighted_roc.tsv.gz + md5sum: 5b8efc9e9381f604880412800f58e4e9 + - path: output/rtgtools/versions.yml + md5sum: 55568e4bbe5ab7e634a1f392abb89cc4 diff --git a/tests/modules/samtools/bam2fq/test.yml b/tests/modules/samtools/bam2fq/test.yml index 213c7a2d..4f9472e5 100644 --- a/tests/modules/samtools/bam2fq/test.yml +++ b/tests/modules/samtools/bam2fq/test.yml @@ -1,14 +1,15 @@ - name: samtools bam2fq test_samtools_bam2fq_nosplit - command: nextflow run ./tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_nosplit -c ./tests/config/nextflow.config -c ./tests/modules/samtools/bam2fq/nextflow.config + command: nextflow run tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_nosplit -c tests/config/nextflow.config tags: - samtools/bam2fq - samtools files: - path: output/samtools/test_interleaved.fq.gz - md5sum: d733e66d29a4b366bf9df8c42f845256 + - path: output/samtools/versions.yml + md5sum: 4973eac1b6a8f090d5fcd4456d65a894 - name: samtools bam2fq test_samtools_bam2fq_withsplit - command: nextflow run ./tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_withsplit -c ./tests/config/nextflow.config -c ./tests/modules/samtools/bam2fq/nextflow.config + command: nextflow run tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_withsplit -c tests/config/nextflow.config tags: - samtools/bam2fq - samtools @@ -21,3 +22,5 @@ md5sum: 709872fc2910431b1e8b7074bfe38c67 - path: output/samtools/test_singleton.fq.gz md5sum: 709872fc2910431b1e8b7074bfe38c67 + - path: output/samtools/versions.yml + md5sum: e92d21bbcda2fed7cb438d95c51edff0 diff --git a/tests/modules/samtools/convert/main.nf b/tests/modules/samtools/convert/main.nf new file mode 100644 index 00000000..01bdfe7f --- /dev/null +++ b/tests/modules/samtools/convert/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_CONVERT as SAMTOOLS_BAMTOCRAM } from '../../../../modules/samtools/convert/main.nf' +include { SAMTOOLS_CONVERT as SAMTOOLS_CRAMTOBAM } from '../../../../modules/samtools/convert/main.nf' + +workflow test_samtools_convert_bamtocram { + + input = [ [ id:'test', single_end:false ], // 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)] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + + SAMTOOLS_BAMTOCRAM ( input, fasta, fai ) +} + +workflow test_samtools_convert_cramtobam { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + + SAMTOOLS_CRAMTOBAM ( input, fasta, fai ) +} diff --git a/tests/modules/samtools/convert/nextflow.config b/tests/modules/samtools/convert/nextflow.config new file mode 100644 index 00000000..4f1e83f6 --- /dev/null +++ b/tests/modules/samtools/convert/nextflow.config @@ -0,0 +1,12 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:SAMTOOLS_BAMTOCRAM{ + ext.args = "-C" + } + + withName:SAMTOOLS_CRAMTOBAM{ + ext.args = "-b" + } +} diff --git a/tests/modules/samtools/convert/test.yml b/tests/modules/samtools/convert/test.yml new file mode 100644 index 00000000..979f36ca --- /dev/null +++ b/tests/modules/samtools/convert/test.yml @@ -0,0 +1,21 @@ +- name: samtools convert test_samtools_convert_bamtocram + command: nextflow run tests/modules/samtools/convert -entry test_samtools_convert_bamtocram -c tests/config/nextflow.config + tags: + - samtools + - samtools/convert + files: + - path: output/samtools/test.cram + - path: output/samtools/test.cram.crai + - path: output/samtools/versions.yml + +- name: samtools convert test_samtools_convert_cramtobam + command: nextflow run tests/modules/samtools/convert -entry test_samtools_convert_cramtobam -c tests/config/nextflow.config + tags: + - samtools + - samtools/convert + files: + - path: output/samtools/test.bam + md5sum: c262b6dc15f9b480bdb47d6d018b4b56 + - path: output/samtools/test.bam.bai + md5sum: 6e8f5034f728401bfa841c8e70c62463 + - path: output/samtools/versions.yml diff --git a/tests/modules/samtools/view/main.nf b/tests/modules/samtools/view/main.nf index 9c239066..0e3f597e 100644 --- a/tests/modules/samtools/view/main.nf +++ b/tests/modules/samtools/view/main.nf @@ -22,3 +22,12 @@ workflow test_samtools_view_cram { SAMTOOLS_VIEW ( input, fasta ) } + +workflow test_samtools_view_stubs { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + [] + ] + + SAMTOOLS_VIEW ( input, [] ) +} diff --git a/tests/modules/samtools/view/test.yml b/tests/modules/samtools/view/test.yml index 1287d455..f3ad4552 100644 --- a/tests/modules/samtools/view/test.yml +++ b/tests/modules/samtools/view/test.yml @@ -14,3 +14,11 @@ - samtools files: - path: output/samtools/test.cram + +- name: samtools view test_samtools_view_stubs + command: nextflow run ./tests/modules/samtools/view -entry test_samtools_view_stubs -c ./tests/config/nextflow.config -c ./tests/modules/samtools/view/nextflow.config -stub-run + tags: + - samtools/view + - samtools + files: + - path: output/samtools/test.bam diff --git a/tests/modules/shasum/main.nf b/tests/modules/shasum/main.nf new file mode 100644 index 00000000..817ea6f0 --- /dev/null +++ b/tests/modules/shasum/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SHASUM } from '../../../modules/shasum/main.nf' + +workflow test_shasum { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + SHASUM ( input ) +} diff --git a/tests/modules/shasum/nextflow.config b/tests/modules/shasum/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/shasum/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/shasum/test.yml b/tests/modules/shasum/test.yml new file mode 100644 index 00000000..6778d156 --- /dev/null +++ b/tests/modules/shasum/test.yml @@ -0,0 +1,8 @@ +- name: shasum test_shasum + command: nextflow run tests/modules/shasum -entry test_shasum -c tests/config/nextflow.config + tags: + - shasum + files: + - path: output/shasum/test.paired_end.bam.sha256 + md5sum: 138a19e100f09fc975ea1b717da9b6dd + - path: output/shasum/versions.yml diff --git a/tests/modules/shigatyper/main.nf b/tests/modules/shigatyper/main.nf new file mode 100644 index 00000000..eb4df084 --- /dev/null +++ b/tests/modules/shigatyper/main.nf @@ -0,0 +1,36 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SHIGATYPER } from '../../../modules/shigatyper/main.nf' + +workflow test_shigatyper_pe { + + input = [ + [ id:'test', single_end:false, is_ont: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) ] + ] + + SHIGATYPER ( input ) +} + +workflow test_shigatyper_se { + + input = [ + [ id:'test', single_end:true, is_ont:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + SHIGATYPER ( input ) +} + +workflow test_shigatyper_ont { + + input = [ + [ id:'test', single_end:true, is_ont:true ], // meta map + [ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + ] + + SHIGATYPER ( input ) +} diff --git a/tests/modules/shigatyper/nextflow.config b/tests/modules/shigatyper/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/shigatyper/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/shigatyper/test.yml b/tests/modules/shigatyper/test.yml new file mode 100644 index 00000000..9dda573b --- /dev/null +++ b/tests/modules/shigatyper/test.yml @@ -0,0 +1,29 @@ +- name: shigatyper test_shigatyper_pe + command: nextflow run tests/modules/shigatyper -entry test_shigatyper_pe -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config + tags: + - shigatyper + files: + - path: output/shigatyper/test.tsv + md5sum: 4f7d38c956993800546b9acb9881d717 + - path: output/shigatyper/versions.yml + md5sum: d8ca45ed88dfba9bc570c01e4b49773b + +- name: shigatyper test_shigatyper_se + command: nextflow run tests/modules/shigatyper -entry test_shigatyper_se -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config + tags: + - shigatyper + files: + - path: output/shigatyper/test.tsv + md5sum: 4f7d38c956993800546b9acb9881d717 + - path: output/shigatyper/versions.yml + md5sum: 8bbf165da5a5df3b7771a33aad197eec + +- name: shigatyper test_shigatyper_ont + command: nextflow run tests/modules/shigatyper -entry test_shigatyper_ont -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config + tags: + - shigatyper + files: + - path: output/shigatyper/test.tsv + md5sum: 4f7d38c956993800546b9acb9881d717 + - path: output/shigatyper/versions.yml + md5sum: 0da333e1178e9e7e84a9116ad5a5ff71 diff --git a/tests/modules/slimfastq/main.nf b/tests/modules/slimfastq/main.nf new file mode 100644 index 00000000..40d44285 --- /dev/null +++ b/tests/modules/slimfastq/main.nf @@ -0,0 +1,46 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SLIMFASTQ } from '../../../modules/slimfastq/main.nf' + +workflow test_slimfastq_single_end { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + + SLIMFASTQ ( input ) +} + +workflow test_slimfastq_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)] + ] + + SLIMFASTQ ( input ) +} + +workflow test_slimfastq_nanopore { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) + ] + + SLIMFASTQ ( input ) +} + +workflow test_slimfastq_pacbio { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs_fq_gz'], checkIfExists: true) + ] + + SLIMFASTQ ( input ) +} diff --git a/tests/modules/slimfastq/nextflow.config b/tests/modules/slimfastq/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/slimfastq/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/slimfastq/test.yml b/tests/modules/slimfastq/test.yml new file mode 100644 index 00000000..f0d8b446 --- /dev/null +++ b/tests/modules/slimfastq/test.yml @@ -0,0 +1,41 @@ +- name: slimfastq test_slimfastq_single_end + command: nextflow run tests/modules/slimfastq -entry test_slimfastq_single_end -c tests/config/nextflow.config + tags: + - slimfastq + files: + - path: output/slimfastq/test.sfq + md5sum: 6a942eeca6c99ee9a9a0cedab5d246f1 + - path: output/slimfastq/versions.yml + md5sum: f52351f5c9e6259af02745c8eae5c780 + +- name: slimfastq test_slimfastq_paired_end + command: nextflow run tests/modules/slimfastq -entry test_slimfastq_paired_end -c tests/config/nextflow.config + tags: + - slimfastq + files: + - path: output/slimfastq/test_1.sfq + md5sum: 6a942eeca6c99ee9a9a0cedab5d246f1 + - path: output/slimfastq/test_2.sfq + md5sum: 0d2c60b52a39f7c2cb7843e848d90afd + - path: output/slimfastq/versions.yml + md5sum: 6239853705877651a4851c4cb6d62da4 + +- name: slimfastq test_slimfastq_nanopore + command: nextflow run tests/modules/slimfastq -entry test_slimfastq_nanopore -c tests/config/nextflow.config + tags: + - slimfastq + files: + - path: output/slimfastq/test.sfq + md5sum: e17f14d64d3a75356b03ff2f9e8881f7 + - path: output/slimfastq/versions.yml + md5sum: 33153f1103482a2bd35cb2f4c337c5e8 + +- name: slimfastq test_slimfastq_pacbio + command: nextflow run tests/modules/slimfastq -entry test_slimfastq_pacbio -c tests/config/nextflow.config + tags: + - slimfastq + files: + - path: output/slimfastq/test.sfq + md5sum: 9e8389e47e6ddf8c25e92412dd628339 + - path: output/slimfastq/versions.yml + md5sum: 1982789c3d5c7de37c0a9351e4ae63f7 diff --git a/tests/modules/snapaligner/align/main.nf b/tests/modules/snapaligner/align/main.nf new file mode 100644 index 00000000..4f5943fe --- /dev/null +++ b/tests/modules/snapaligner/align/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SNAPALIGNER_INDEX } from '../../../../modules/snapaligner/index/main.nf' +include { SNAPALIGNER_ALIGN as SNAPALIGNER_SINGLE } from '../../../../modules/snapaligner/align/main.nf' +include { SNAPALIGNER_ALIGN as SNAPALIGNER_PAIRED } from '../../../../modules/snapaligner/align/main.nf' + +workflow test_snapaligner_single { + + input = [ + [ id:'test', single_end:true ], // meta map + [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ] + + SNAPALIGNER_INDEX ( file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),[],[],[]) + SNAPALIGNER_SINGLE ( input, SNAPALIGNER_INDEX.out.index ) +} + +workflow test_snapaligner_paired { + + 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)] + ] + + SNAPALIGNER_INDEX ( file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),[],[],[]) + SNAPALIGNER_PAIRED ( input, SNAPALIGNER_INDEX.out.index ) +} diff --git a/tests/modules/snapaligner/align/nextflow.config b/tests/modules/snapaligner/align/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/snapaligner/align/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/snapaligner/align/test.yml b/tests/modules/snapaligner/align/test.yml new file mode 100644 index 00000000..4e4fae61 --- /dev/null +++ b/tests/modules/snapaligner/align/test.yml @@ -0,0 +1,19 @@ +- name: snapaligner align test_snapaligner_single + command: nextflow run tests/modules/snapaligner/align -entry test_snapaligner_single -c tests/config/nextflow.config + tags: + - snapaligner/align + - snapaligner + files: + - path: output/snapaligner/test.bam + md5sum: 5d95594e4ef1ee23ce56e6a7cb64f0f2 + - path: output/snapaligner/versions.yml + +- name: snapaligner align test_snapaligner_paired + command: nextflow run tests/modules/snapaligner/align -entry test_snapaligner_paired -c tests/config/nextflow.config + tags: + - snapaligner/align + - snapaligner + files: + - path: output/snapaligner/test.bam + md5sum: a1405da5876f15dbe8a81516b94c2a15 + - path: output/snapaligner/versions.yml diff --git a/tests/modules/snapaligner/paired/main.nf b/tests/modules/snapaligner/paired/main.nf deleted file mode 100644 index b25ca8c2..00000000 --- a/tests/modules/snapaligner/paired/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { SNAPALIGNER_INDEX } from '../../../../modules/snapaligner/index/main.nf' -include { SNAPALIGNER_PAIRED } from '../../../../modules/snapaligner/paired/main.nf' - -workflow test_snapaligner_paired { - - 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)] - ] - - SNAPALIGNER_INDEX ( file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),[],[],[]) - SNAPALIGNER_PAIRED ( input, SNAPALIGNER_INDEX.out.index ) -} diff --git a/tests/modules/snapaligner/paired/test.yml b/tests/modules/snapaligner/paired/test.yml deleted file mode 100644 index 7df1e02b..00000000 --- a/tests/modules/snapaligner/paired/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: snapaligner paired test_snapaligner_paired - command: nextflow run tests/modules/snapaligner/paired -entry test_snapaligner_paired -c tests/config/nextflow.config - tags: - - snapaligner - - snapaligner/paired - files: - - path: output/snapaligner/test.bam - md5sum: 2ac92e9539fa246dd6db52b5de56fca5 - - path: output/snapaligner/versions.yml diff --git a/tests/modules/snapaligner/single/main.nf b/tests/modules/snapaligner/single/main.nf deleted file mode 100644 index 616e517a..00000000 --- a/tests/modules/snapaligner/single/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { SNAPALIGNER_INDEX } from '../../../../modules/snapaligner/index/main.nf' -include { SNAPALIGNER_SINGLE } from '../../../../modules/snapaligner/single/main.nf' - -workflow test_snapaligner_single { - - input = [ - [ id:'test', single_end:false ], // meta map - [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] - ] - - SNAPALIGNER_INDEX ( file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true),[],[],[]) - SNAPALIGNER_SINGLE ( input, SNAPALIGNER_INDEX.out.index ) -} diff --git a/tests/modules/snapaligner/single/test.yml b/tests/modules/snapaligner/single/test.yml deleted file mode 100644 index bbcbba1f..00000000 --- a/tests/modules/snapaligner/single/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: snapaligner single test_snapaligner_single - command: nextflow run tests/modules/snapaligner/single -entry test_snapaligner_single -c tests/config/nextflow.config - tags: - - snapaligner/single - - snapaligner - files: - - path: output/snapaligner/test.bam - md5sum: 696f7ea8e1aa5f9d7dafb9d0134fe25d - - path: output/snapaligner/versions.yml diff --git a/tests/modules/sratools/fasterqdump/main.nf b/tests/modules/sratools/fasterqdump/main.nf index c2b98526..daa7a5ae 100644 --- a/tests/modules/sratools/fasterqdump/main.nf +++ b/tests/modules/sratools/fasterqdump/main.nf @@ -13,7 +13,7 @@ workflow test_sratools_fasterqdump_single_end { def input = Channel.of([ id:'test_single_end', single_end:true ]) .combine(UNTAR.out.untar.map{ it[1] }) - SRATOOLS_FASTERQDUMP ( input ) + SRATOOLS_FASTERQDUMP(input, file(params.test_data['generic']['config']['ncbi_user_settings'], checkIfExists: true)) } workflow test_sratools_fasterqdump_paired_end { @@ -24,5 +24,5 @@ workflow test_sratools_fasterqdump_paired_end { def input = Channel.of([ id:'test_paired_end', single_end:false ]) .combine(UNTAR.out.untar.map{ it[1] }) - SRATOOLS_FASTERQDUMP ( input ) + SRATOOLS_FASTERQDUMP(input, file(params.test_data['generic']['config']['ncbi_user_settings'], checkIfExists: true)) } diff --git a/tests/modules/sratools/fasterqdump/test.yml b/tests/modules/sratools/fasterqdump/test.yml index 64cf2404..6fbf608c 100644 --- a/tests/modules/sratools/fasterqdump/test.yml +++ b/tests/modules/sratools/fasterqdump/test.yml @@ -8,6 +8,9 @@ md5sum: 1054c7b71884acdb5eed8a378f18be82 - path: output/untar/SRR13255544/SRR13255544.sra md5sum: 466d05dafb2eec672150754168010b4d + - path: output/sratools/versions.yml + contains: + - "sratools: 2.11.0" - name: sratools fasterqdump test_sratools_fasterqdump_paired_end command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow.config @@ -21,3 +24,6 @@ md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e - path: output/untar/SRR11140744/SRR11140744.sra md5sum: 065666caf5b2d5dfb0cb25d5f3abe659 + - path: output/sratools/versions.yml + contains: + - "sratools: 2.11.0" diff --git a/tests/modules/sratools/prefetch/main.nf b/tests/modules/sratools/prefetch/main.nf index aa6252a1..cf9794ab 100644 --- a/tests/modules/sratools/prefetch/main.nf +++ b/tests/modules/sratools/prefetch/main.nf @@ -8,8 +8,8 @@ workflow test_sratools_prefetch { input = [ [ id:'test', single_end:false ], // meta map - 'ERR2815334' + 'DRR000774' ] - SRATOOLS_PREFETCH ( input ) + SRATOOLS_PREFETCH(input, file(params.test_data['generic']['config']['ncbi_user_settings'], checkIfExists: true)) } diff --git a/tests/modules/sratools/prefetch/test.yml b/tests/modules/sratools/prefetch/test.yml index a2efef77..a6c213f8 100644 --- a/tests/modules/sratools/prefetch/test.yml +++ b/tests/modules/sratools/prefetch/test.yml @@ -4,5 +4,8 @@ - sratools/prefetch - sratools files: - - path: output/sratools/ERR2815334/ERR2815334.sra - md5sum: 9a98c7f6f4774b7ef94aa915b92a54ea + - path: output/sratools/DRR000774/DRR000774.sra + md5sum: 7647dba20c89c0e3d7ad13842f060eb0 + - path: output/sratools/versions.yml + contains: + - "sratools: 2.11.0" diff --git a/tests/modules/srst2/srst2/main.nf b/tests/modules/srst2/srst2/main.nf new file mode 100644 index 00000000..7d51937b --- /dev/null +++ b/tests/modules/srst2/srst2/main.nf @@ -0,0 +1,53 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SRST2_SRST2 } from '../../../../modules/srst2/srst2/main.nf' + +workflow test_srst2_srst2_exit { + + input = [ + [ id:'test', single_end:false, db:"test"], // meta map + [ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ], +// [("")] + file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') + ] + + SRST2_SRST2(input) +} + +workflow test_srst2_srst2_mlst { + + input = [ + [ id:'test', single_end:false, db:"mlst"], // meta map + [ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/SRR9067271_1.fastq.gz", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/SRR9067271_2.fastq.gz", checkIfExists: true) ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/MLST_DB.fas') + ] + + SRST2_SRST2(input) +} + +workflow test_srst2_srst2_paired_end { + + input = [ + [ id:'test', single_end:false, db:"gene"], // meta map + [ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') // Change to params.test_data syntax after the data is included in tests/config/test_data.config + ] + + SRST2_SRST2(input) +} + +workflow test_srst2_srst2_single_end { + + input = [ + [ id:'test', single_end:true, db:"gene" ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') // Change to params.test_data syntax after the data is included in tests/config/test_data.config + ] + + SRST2_SRST2(input) +} diff --git a/tests/modules/srst2/srst2/nextflow.config b/tests/modules/srst2/srst2/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/srst2/srst2/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/srst2/srst2/test.yml b/tests/modules/srst2/srst2/test.yml new file mode 100644 index 00000000..f7621f4f --- /dev/null +++ b/tests/modules/srst2/srst2/test.yml @@ -0,0 +1,51 @@ +- name: srst2 srst2 test_srst2_srst2_exit #Testing pipeline exit when not meta.db + command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_exit -c tests/config/nextflow.config + tags: + - srst2/srst2 + - srst2 + exit_code: 1 + +- name: srst2 srst2 test_srst2_srst2_mlst + command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_mlst -c tests/config/nextflow.config + tags: + - srst2/srst2 + - srst2 + files: + - path: output/srst2/test__SRR9067271.MLST_DB.pileup + contains: + - "dnaJ-1 2 C 17 .........,....... FFFFFFFFFFFFFFFFF" + - path: output/srst2/test__SRR9067271.MLST_DB.sorted.bam + - path: output/srst2/test__mlst__MLST_DB__results.txt + md5sum: ec1b1f69933401d67c57f64cad11a098 + - path: output/srst2/versions.yml + md5sum: a0c256a2fd3636069710b8ef22ee5ea7 + +- name: srst2 srst2 test_srst2_srst2_paired_end + command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_paired_end -c tests/config/nextflow.config + tags: + - srst2/srst2 + - srst2 + files: + - path: output/srst2/test__genes__resFinder_20180221_srst2__results.txt + md5sum: 099aa6cacec5524b311f606debdfb3a9 + - path: output/srst2/test__test1.resFinder_20180221_srst2.pileup + md5sum: 64b512ff495b828c456405ec7b676ad1 + - path: output/srst2/test__test1.resFinder_20180221_srst2.sorted.bam + - path: output/srst2/versions.yml + md5sum: b446a70f1a2b4f60757829bcd744a214 + +- name: srst2 srst2 test_srst2_srst2_single_end + command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_single_end -c tests/config/nextflow.config + tags: + - srst2/srst2 + - srst2 + files: + - path: output/srst2/test__fullgenes__resFinder_20180221_srst2__results.txt + md5sum: d0762ef8c38afd0e0a34cce52ed1a3db + - path: output/srst2/test__genes__resFinder_20180221_srst2__results.txt + md5sum: b8850c6644406d8b131e471ecc3f9013 + - path: output/srst2/test__test1_1.resFinder_20180221_srst2.pileup + md5sum: 5f6279dc8124aa762a9dfe3d7a871277 + - path: output/srst2/test__test1_1.resFinder_20180221_srst2.sorted.bam + - path: output/srst2/versions.yml + md5sum: 790fe00493c6634d17801a930073218b diff --git a/tests/modules/stringtie/merge/main.nf b/tests/modules/stringtie/merge/main.nf index 7851e755..3fe32902 100644 --- a/tests/modules/stringtie/merge/main.nf +++ b/tests/modules/stringtie/merge/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' -include { STRINGTIE_MERGE } from '../../../../modules/stringtie/merge/main.nf' +include { STRINGTIE_STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' +include { STRINGTIE_MERGE } from '../../../../modules/stringtie/merge/main.nf' /* * Test with forward strandedness @@ -15,8 +15,8 @@ workflow test_stringtie_forward_merge { ] annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE ( input, annotation_gtf ) - STRINGTIE + STRINGTIE_STRINGTIE ( input, annotation_gtf ) + STRINGTIE_STRINGTIE .out .transcript_gtf .map { it -> it[1] } @@ -35,8 +35,8 @@ workflow test_stringtie_reverse_merge { ] annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE ( input, annotation_gtf ) - STRINGTIE + STRINGTIE_STRINGTIE ( input, annotation_gtf ) + STRINGTIE_STRINGTIE .out .transcript_gtf .map { it -> it[1] } diff --git a/tests/modules/stringtie/merge/test.yml b/tests/modules/stringtie/merge/test.yml index 392a1d7c..fca66447 100644 --- a/tests/modules/stringtie/merge/test.yml +++ b/tests/modules/stringtie/merge/test.yml @@ -5,7 +5,7 @@ - stringtie/merge files: - path: output/stringtie/stringtie.merged.gtf - md5sum: 9fab7049ef2eafdea246fc787d1def40 + md5sum: d959eb2fab0db48ded7275e0a2e83c05 - path: output/stringtie/test.ballgown/e2t.ctab md5sum: 9ae42e056c955a88a883e5e917840d77 - path: output/stringtie/test.ballgown/e_data.ctab @@ -17,11 +17,10 @@ - path: output/stringtie/test.ballgown/t_data.ctab md5sum: 92a98902784e7406ffe054d2adbabc7c - path: output/stringtie/test.coverage.gtf - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/stringtie/test.gene.abundance.txt - md5sum: 9708811bcefe0f6384293d6f419f3250 + md5sum: 8bcd8e2730ed3337e2730186dbc184f3 - path: output/stringtie/test.transcripts.gtf - md5sum: 0e42709bfe30c2c7f2574ba664f5fa9f + md5sum: a914bd55b68a4b5f607738b17861e362 - name: stringtie merge test_stringtie_reverse_merge command: nextflow run ./tests/modules/stringtie/merge -entry test_stringtie_reverse_merge -c ./tests/config/nextflow.config -c ./tests/modules/stringtie/merge/nextflow.config @@ -30,7 +29,7 @@ - stringtie/merge files: - path: output/stringtie/stringtie.merged.gtf - md5sum: afc461bb3cbc368f268a7a45c1b54497 + md5sum: 6da479298d73d5b3216d4e1576a2bdf4 - path: output/stringtie/test.ballgown/e2t.ctab md5sum: 9ae42e056c955a88a883e5e917840d77 - path: output/stringtie/test.ballgown/e_data.ctab @@ -42,8 +41,7 @@ - path: output/stringtie/test.ballgown/t_data.ctab md5sum: 92a98902784e7406ffe054d2adbabc7c - path: output/stringtie/test.coverage.gtf - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/stringtie/test.gene.abundance.txt - md5sum: 94b85145d60ab1b80a7f0f6cf08418b0 + md5sum: f289f41b3ba1b9f0aa05d14408f1a5da - path: output/stringtie/test.transcripts.gtf - md5sum: 3196e3d50fd461aae6408e0a70acae68 + md5sum: 9dcdc9577c0fdbb25089eda210267546 diff --git a/tests/modules/stringtie/stringtie/main.nf b/tests/modules/stringtie/stringtie/main.nf index ae6abe67..463e4b98 100644 --- a/tests/modules/stringtie/stringtie/main.nf +++ b/tests/modules/stringtie/stringtie/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' +include { STRINGTIE_STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' // // Test with forward strandedness // @@ -13,7 +13,7 @@ workflow test_stringtie_forward { ] annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE ( input, annotation_gtf ) + STRINGTIE_STRINGTIE ( input, annotation_gtf ) } // @@ -26,5 +26,5 @@ workflow test_stringtie_reverse { ] annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE ( input, annotation_gtf ) + STRINGTIE_STRINGTIE ( input, annotation_gtf ) } diff --git a/tests/modules/stringtie/stringtie/test.yml b/tests/modules/stringtie/stringtie/test.yml index 732b9fd1..2815ba81 100644 --- a/tests/modules/stringtie/stringtie/test.yml +++ b/tests/modules/stringtie/stringtie/test.yml @@ -8,7 +8,6 @@ - path: ./output/stringtie/test.gene.abundance.txt md5sum: 7d8bce7f2a922e367cedccae7267c22e - path: ./output/stringtie/test.coverage.gtf - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: ./output/stringtie/test.ballgown/e_data.ctab md5sum: 6b4cf69bc03f3f69890f972a0e8b7471 - path: ./output/stringtie/test.ballgown/i_data.ctab @@ -30,7 +29,6 @@ - path: ./output/stringtie/test.gene.abundance.txt md5sum: 7385b870b955dae2c2ab78a70cf05cce - path: ./output/stringtie/test.coverage.gtf - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: ./output/stringtie/test.ballgown/e_data.ctab md5sum: 879b6696029d19c4737b562e9d149218 - path: ./output/stringtie/test.ballgown/i_data.ctab diff --git a/tests/modules/tabix/tabix/main.nf b/tests/modules/tabix/tabix/main.nf index 993ee812..da26f4d7 100644 --- a/tests/modules/tabix/tabix/main.nf +++ b/tests/modules/tabix/tabix/main.nf @@ -2,9 +2,10 @@ nextflow.enable.dsl = 2 -include { TABIX_TABIX as TABIX_BED } from '../../../../modules/tabix/tabix/main.nf' -include { TABIX_TABIX as TABIX_GFF } from '../../../../modules/tabix/tabix/main.nf' -include { TABIX_TABIX as TABIX_VCF } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_BED } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_GFF } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_VCF_TBI } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_VCF_CSI } from '../../../../modules/tabix/tabix/main.nf' workflow test_tabix_tabix_bed { input = [ [ id:'B.bed' ], // meta map @@ -22,10 +23,18 @@ workflow test_tabix_tabix_gff { TABIX_GFF ( input ) } -workflow test_tabix_tabix_vcf { +workflow test_tabix_tabix_vcf_tbi { input = [ [ id:'test.vcf' ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] ] - TABIX_VCF ( input ) + TABIX_VCF_TBI ( input ) +} + +workflow test_tabix_tabix_vcf_csi { + input = [ [ id:'test.vcf' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + ] + + TABIX_VCF_CSI ( input ) } diff --git a/tests/modules/tabix/tabix/nextflow.config b/tests/modules/tabix/tabix/nextflow.config index aa97a873..139e0865 100644 --- a/tests/modules/tabix/tabix/nextflow.config +++ b/tests/modules/tabix/tabix/nextflow.config @@ -10,8 +10,12 @@ process { ext.args = '-p gff' } - withName: TABIX_VCF { + withName: TABIX_VCF_TBI { ext.args = '-p vcf' } + withName: TABIX_VCF_CSI { + ext.args = '-p vcf --csi' + } + } diff --git a/tests/modules/tabix/tabix/test.yml b/tests/modules/tabix/tabix/test.yml index 46be28dd..6d168ef5 100644 --- a/tests/modules/tabix/tabix/test.yml +++ b/tests/modules/tabix/tabix/test.yml @@ -15,10 +15,18 @@ - path: ./output/tabix/genome.gff3.gz.tbi md5sum: f79a67d95a98076e04fbe0455d825926 - name: tabix tabix vcf - command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_vcf -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config + command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_vcf_tbi -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config tags: - tabix - tabix/tabix files: - path: output/tabix/test.vcf.gz.tbi md5sum: 36e11bf96ed0af4a92caa91a68612d64 +- name: tabix tabix vcf csi + command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_vcf_csi -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config + tags: + - tabix + - tabix/tabix + files: + - path: output/tabix/test.vcf.gz.csi + md5sum: 5f930522d2b9dcdba2807b7da4dfa3fd diff --git a/tests/modules/tiddit/sv/test.yml b/tests/modules/tiddit/sv/test.yml index 168d21c5..40ea5b4d 100644 --- a/tests/modules/tiddit/sv/test.yml +++ b/tests/modules/tiddit/sv/test.yml @@ -9,6 +9,7 @@ - path: output/tiddit/test.signals.tab md5sum: dab4b2fec4ddf8eb1c23005b0770150e - path: output/tiddit/test.vcf + md5sum: bdce14ae8292bf3deb81f6f255baf859 - name: tiddit sv no ref command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv_no_ref -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config @@ -21,3 +22,4 @@ - path: output/tiddit/test.signals.tab md5sum: dab4b2fec4ddf8eb1c23005b0770150e - path: output/tiddit/test.vcf + md5sum: 3d0e83a8199b2bdb81cfe3e6b12bf64b diff --git a/tests/modules/vardictjava/main.nf b/tests/modules/vardictjava/main.nf new file mode 100644 index 00000000..e29490f3 --- /dev/null +++ b/tests/modules/vardictjava/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VARDICTJAVA } from '../../../modules/vardictjava/main.nf' + +workflow test_vardictjava { + + bam_input_ch = Channel.value([ + [ id:'test' ], // meta map + 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), + file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + ]) + + reference = Channel.value([ + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ]) + + VARDICTJAVA ( bam_input_ch, reference ) +} diff --git a/tests/modules/vardictjava/nextflow.config b/tests/modules/vardictjava/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/vardictjava/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/vardictjava/test.yml b/tests/modules/vardictjava/test.yml new file mode 100644 index 00000000..8cb29c4e --- /dev/null +++ b/tests/modules/vardictjava/test.yml @@ -0,0 +1,9 @@ +- name: vardictjava test_vardictjava + command: nextflow run tests/modules/vardictjava -entry test_vardictjava -c tests/config/nextflow.config + tags: + - vardictjava + files: + - path: output/vardictjava/test.vcf.gz + md5sum: 3f1f227afc532bddeb58f16fd3013fc8 + - path: output/vardictjava/versions.yml + md5sum: 9b62c431a4f2680412b61c7071bdb1cd diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/main.nf b/tests/subworkflows/nf-core/annotation/ensemblvep/main.nf similarity index 69% rename from tests/subworkflows/nf-core/annotation_ensemblvep/main.nf rename to tests/subworkflows/nf-core/annotation/ensemblvep/main.nf index 0f00c62e..2c599671 100644 --- a/tests/subworkflows/nf-core/annotation_ensemblvep/main.nf +++ b/tests/subworkflows/nf-core/annotation/ensemblvep/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ANNOTATION_ENSEMBLVEP } from '../../../../subworkflows/nf-core/annotation_ensemblvep/main' +include { ANNOTATION_ENSEMBLVEP } from '../../../../../subworkflows/nf-core/annotation/ensemblvep/main' workflow annotation_ensemblvep { input = [ @@ -10,5 +10,5 @@ workflow annotation_ensemblvep { file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ANNOTATION_ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) + ANNOTATION_ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [], [] ) } diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config b/tests/subworkflows/nf-core/annotation/ensemblvep/nextflow.config similarity index 88% rename from tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config rename to tests/subworkflows/nf-core/annotation/ensemblvep/nextflow.config index 4e8d2990..806adb58 100644 --- a/tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config +++ b/tests/subworkflows/nf-core/annotation/ensemblvep/nextflow.config @@ -7,7 +7,7 @@ process { publishDir = [ enabled: false ] } - withName: ANNOTATION_BGZIPTABIX { + withName: TABIX_BGZIPTABIX { ext.prefix = { "${meta.id}_VEP.ann.vcf" } } diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/test.yml b/tests/subworkflows/nf-core/annotation/ensemblvep/test.yml similarity index 100% rename from tests/subworkflows/nf-core/annotation_ensemblvep/test.yml rename to tests/subworkflows/nf-core/annotation/ensemblvep/test.yml diff --git a/tests/subworkflows/nf-core/annotation_snpeff/main.nf b/tests/subworkflows/nf-core/annotation/snpeff/main.nf similarity index 74% rename from tests/subworkflows/nf-core/annotation_snpeff/main.nf rename to tests/subworkflows/nf-core/annotation/snpeff/main.nf index c80197ee..bb56b46b 100644 --- a/tests/subworkflows/nf-core/annotation_snpeff/main.nf +++ b/tests/subworkflows/nf-core/annotation/snpeff/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ANNOTATION_SNPEFF } from '../../../../subworkflows/nf-core/annotation_snpeff/main' +include { ANNOTATION_SNPEFF } from '../../../../../subworkflows/nf-core/annotation/snpeff/main' workflow annotation_snpeff { input = [ diff --git a/tests/subworkflows/nf-core/annotation_snpeff/nextflow.config b/tests/subworkflows/nf-core/annotation/snpeff/nextflow.config similarity index 88% rename from tests/subworkflows/nf-core/annotation_snpeff/nextflow.config rename to tests/subworkflows/nf-core/annotation/snpeff/nextflow.config index be76cb4a..31fd635b 100644 --- a/tests/subworkflows/nf-core/annotation_snpeff/nextflow.config +++ b/tests/subworkflows/nf-core/annotation/snpeff/nextflow.config @@ -7,7 +7,7 @@ process { publishDir = [ enabled: false ] } - withName: ANNOTATION_BGZIPTABIX { + withName: TABIX_BGZIPTABIX { ext.prefix = { "${meta.id}_snpEff.ann.vcf" } } diff --git a/tests/subworkflows/nf-core/annotation_snpeff/test.yml b/tests/subworkflows/nf-core/annotation/snpeff/test.yml similarity index 100% rename from tests/subworkflows/nf-core/annotation_snpeff/test.yml rename to tests/subworkflows/nf-core/annotation/snpeff/test.yml diff --git a/tests/subworkflows/nf-core/bam_qc_picard/main.nf b/tests/subworkflows/nf-core/bam_qc_picard/main.nf new file mode 100644 index 00000000..a3e2ed62 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_qc_picard/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAM_QC_PICARD } from '../../../../subworkflows/nf-core/bam_qc_picard/main' addParams([:]) + +workflow test_bam_qc_picard_wgs { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fasta_fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + + BAM_QC_PICARD ( input, fasta, fasta_fai, [], [] ) +} + +workflow test_bam_qc_picard_targetted { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fasta_fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + bait = file(params.test_data['sarscov2']['genome']['baits_interval_list'], checkIfExists: true) + target = file(params.test_data['sarscov2']['genome']['targets_interval_list'], checkIfExists: true) + + BAM_QC_PICARD ( input, fasta, fasta_fai, bait, target ) +} diff --git a/tests/subworkflows/nf-core/bam_qc_picard/nextflow.config b/tests/subworkflows/nf-core/bam_qc_picard/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_qc_picard/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/subworkflows/nf-core/bam_qc_picard/test.yml b/tests/subworkflows/nf-core/bam_qc_picard/test.yml new file mode 100644 index 00000000..7b0a6c2b --- /dev/null +++ b/tests/subworkflows/nf-core/bam_qc_picard/test.yml @@ -0,0 +1,33 @@ +- name: bam qc picard wgs + command: nextflow run ./tests/subworkflows/nf-core/bam_qc_picard -entry test_bam_qc_picard_wgs -c tests/config/nextflow.config + tags: + - subworkflows + # - subworkflows/bam_qc_picard + # Modules + # - picard + # - picard/collectmultiplemetrics + # - picard/collectwgsmetrics + files: + - path: ./output/picard/test.CollectMultipleMetrics.alignment_summary_metrics + - path: ./output/picard/test.CollectMultipleMetrics.insert_size_metrics + - path: ./output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle_metrics + - path: ./output/picard/test.CollectMultipleMetrics.quality_by_cycle_metrics + - path: ./output/picard/test.CollectMultipleMetrics.quality_distribution_metrics + - path: ./output/picard/test.CollectWgsMetrics.coverage_metrics + +- name: bam qc picard targetted + command: nextflow run ./tests/subworkflows/nf-core/bam_qc_picard -entry test_bam_qc_picard_targetted -c tests/config/nextflow.config + tags: + - subworkflows + # - subworkflows/bam_qc_picard + # Modules + # - picard + # - picard/collectmultiplemetrics + # - picard/collecthsmetrics + files: + - path: ./output/picard/test.CollectMultipleMetrics.alignment_summary_metrics + - path: ./output/picard/test.CollectMultipleMetrics.insert_size_metrics + - path: ./output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle_metrics + - path: ./output/picard/test.CollectMultipleMetrics.quality_by_cycle_metrics + - path: ./output/picard/test.CollectMultipleMetrics.quality_distribution_metrics + - path: ./output/picard/test.CollectHsMetrics.coverage_metrics diff --git a/tests/subworkflows/nf-core/sra_fastq/main.nf b/tests/subworkflows/nf-core/sra_fastq/main.nf deleted file mode 100644 index 988758f3..00000000 --- a/tests/subworkflows/nf-core/sra_fastq/main.nf +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { SRA_FASTQ } from '../../../../subworkflows/nf-core/sra_fastq/main.nf' addParams( [:] ) - -workflow test_sra_fastq_single_end { - input = [ - [ id:'test_single_end', single_end:true ], // meta map - 'SRR13255544' - ] - - SRA_FASTQ ( input ) -} - -workflow test_sra_fastq_paired_end { - input = [ - [ id:'test_paired_end', single_end:false ], // meta map - 'SRR11140744' - ] - - SRA_FASTQ ( input ) -} diff --git a/tests/subworkflows/nf-core/sra_fastq/test.yml b/tests/subworkflows/nf-core/sra_fastq/test.yml deleted file mode 100644 index 4b75431f..00000000 --- a/tests/subworkflows/nf-core/sra_fastq/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: sra fastq single-end - command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_single_end -c tests/config/nextflow.config - tags: - - subworkflows - # - subworkflows/sra_fastq - # Modules - # - sratools - # - sratools/prefetch - # - sratools/fasterqdump - files: - - path: output/sratools/SRR13255544.fastq.gz - md5sum: 1054c7b71884acdb5eed8a378f18be82 - -- name: sra fastq paired-end - command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_paired_end -c tests/config/nextflow.config - tags: - - subworkflows - # - subworkflows/sra_fastq - # Modules - # - sratools - # - sratools/prefetch - # - sratools/fasterqdump - files: - - path: output/sratools/SRR11140744_1.fastq.gz - md5sum: 193809c784a4ea132ab2a253fa4f55b6 - - path: output/sratools/SRR11140744_2.fastq.gz - md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e diff --git a/tests/subworkflows/nf-core/srafastq/main.nf b/tests/subworkflows/nf-core/srafastq/main.nf new file mode 100644 index 00000000..82c8f29d --- /dev/null +++ b/tests/subworkflows/nf-core/srafastq/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SRAFASTQ } from '../../../../subworkflows/nf-core/srafastq/main.nf' + +workflow test_srafastq_single_end { + input = Channel.of( + [ + [ id:'test_single_end1', single_end:true ], // meta map + 'DRR000774' + ], + [ + [ id:'test_single_end2', single_end:true ], // meta map + 'DRR000775' + ] + ) + + SRAFASTQ ( input ) +} + +workflow test_srafastq_paired_end { + input = [ + [ id:'test_paired_end', single_end:false ], // meta map + 'SRR11140744' + ] + + SRAFASTQ ( input ) +} diff --git a/tests/subworkflows/nf-core/srafastq/nextflow.config b/tests/subworkflows/nf-core/srafastq/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/subworkflows/nf-core/srafastq/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/subworkflows/nf-core/srafastq/test.yml b/tests/subworkflows/nf-core/srafastq/test.yml new file mode 100644 index 00000000..73424171 --- /dev/null +++ b/tests/subworkflows/nf-core/srafastq/test.yml @@ -0,0 +1,29 @@ +- name: srafastq single-end + command: nextflow run ./tests/subworkflows/nf-core/srafastq -entry test_srafastq_single_end -c tests/config/nextflow.config -c tests/subworkflows/nf-core/srafastq/nextflow.config + tags: + - subworkflows + # - subworkflows/srafastq + # Modules + # - sratools + # - sratools/prefetch + # - sratools/fasterqdump + files: + - path: output/sratools/DRR000774.fastq.gz + md5sum: 19029a1132115b55277a0d79ee089b49 + - path: output/sratools/DRR000775.fastq.gz + md5sum: 59ff24c86ecb260752668c059c2a1eaf + +- name: srafastq paired-end + command: nextflow run ./tests/subworkflows/nf-core/srafastq -entry test_srafastq_paired_end -c tests/config/nextflow.config -c tests/subworkflows/nf-core/srafastq/nextflow.config + tags: + - subworkflows + # - subworkflows/srafastq + # Modules + # - sratools + # - sratools/prefetch + # - sratools/fasterqdump + files: + - path: output/sratools/SRR11140744_1.fastq.gz + md5sum: 193809c784a4ea132ab2a253fa4f55b6 + - path: output/sratools/SRR11140744_2.fastq.gz + md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e