diff --git a/.nf-core.yml b/.nf-core.yml index d0c0ac55..b963b6a0 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -10,4 +10,4 @@ template: name: hic org: nf-core outdir: . - version: 2.2.0dev + version: 2.2.0 diff --git a/.vscode/settings.json b/.vscode/settings.json index a33b527c..af2d783f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "markdown.styles": ["public/vscode_markdown.css"] + "markdown.styles": ["public/vscode_markdown.css"], + "nextflow.telemetry.enabled": false } diff --git a/CHANGELOG.md b/CHANGELOG.md index 031a952f..c365f53b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,53 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Version 2.2.0 2026-03-02 + +### `Added` + +- Subworkflows meta.yml +- Module FAIDX for chromosomes sizes calculation +- TRIMGALORE module for 5' clipping (see #225) +- CALDER2 compartments calling (see '--compartments_caller' option) +- Local FILTER_CHROMSIZE module (in order to apply CALDER2 without error) +- Optional '--min_size' parameter for chromosome selection +- Default MIN_FRAG_SIZE, MAX_FRAG_SIZE, MIN_INSERT_SIZE and MAX_INSERT_SIZE values for Arima and ArimV2 protocols + +### `Removed` + +- Module GETCHROMSIZES (replaced by FAIDX) +- Version channels from subworkflows (tools versions gathering still a WIP) + +### `Fixed` + +- #227: MPLCONFIGDIR is set to "${baseDir}/mplconfig" +- #62: a single number can be given as BIN_SIZES without error +- #225:TRIMGALORE remove the first 5 bases of the 5' end and + fragments and inserts size min/max settings are set to recommended values if Arima/ArimaV2 is used +- Bug from COOLER_CLOAD deprecated "pairs" ext.args calling +- Bug on the cooler "add resolution" step caused by module COOLER_CLOAD update +- Logo matching template + +### `Updated` + +- All nf-core modules (including topics channel) +- Modules path +- "channel" syntax with lowercase c +- Components names in subworkflows meta.yml +- COOLER_CLOAD inputs and outputs +- BWA_MEM inputs +- SAMTOOL_SORT inputs +- UTILS_NFSCHEMA_PLUGIN inputs and outputs +- Markdown settings +- Template files +- nf-core version to 3.5.0 + ## v2.2.0dev ### `Added` - Parameter `--dnase`is now replaced by `--no_digestion` -- Add CALDER2 compartments calling (see '--compartments_caller' option) - - Add new '--balancing_opts' to update `cooler balance` arguments (#193) - New subworkflow based on `pairtools` to detect valid pairs. The user diff --git a/conf/modules.config b/conf/modules.config index f9e5c6ec..5f20e329 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -10,6 +10,10 @@ process { ext.args = '--quiet' } + withName: TRIMGALORE { + ext.args = '--clip_R1 5 --clip_R2 5' + } + withName: 'MULTIQC' { ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } publishDir = [ @@ -37,14 +41,6 @@ process { ] } - withName: 'CUSTOM_GETCHROMSIZES' { - publishDir = [ - path: { "${params.outdir}/genome" }, - mode: 'copy', - enabled: params.save_reference - ] - } - withName: 'GET_RESTRICTION_FRAGMENTS' { publishDir = [ path: { "${params.outdir}/genome" }, @@ -344,7 +340,7 @@ process { enabled : params.save_raw_maps ] ext.prefix = { "${meta.id}.${cool_bin}" } - ext.args = "pairs -c1 2 -p1 3 -c2 4 -p2 5" + ext.args = "-c1 2 -p1 3 -c2 4 -p2 5" } withName: 'COOLER_BALANCE' { diff --git a/main.nf b/main.nf index 10df6092..fa052939 100644 --- a/main.nf +++ b/main.nf @@ -47,8 +47,6 @@ workflow NFCORE_HIC { main: - ch_versions = Channel.empty() - // // SUBWORKFLOW: prepare genome annotation // @@ -57,7 +55,6 @@ workflow NFCORE_HIC { params.bwt2_index, params.bwa_index ) - ch_versions = ch_versions.mix(PREPARE_GENOME.out.versions) // // WORKFLOW: Run pipeline diff --git a/modules.json b/modules.json index 78b4becc..921caeb7 100644 --- a/modules.json +++ b/modules.json @@ -7,122 +7,127 @@ "nf-core": { "bowtie2/align": { "branch": "master", - "git_sha": "e4bad511789f16d0df39ee306b2cd50418365048", + "git_sha": "ab146e7909edbf6dcc6459de57eef29dceb61d42", "installed_by": ["modules"] }, "bowtie2/build": { "branch": "master", - "git_sha": "1fea64f5132a813ec97c1c6d3a74e0aee7142b6d", + "git_sha": "447f7bc0fa41dfc2400c8cad4c0291880dc060cf", "installed_by": ["modules"] }, "bwa/index": { "branch": "master", - "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", + "git_sha": "966ba9887e2b04d89d64db06c01508873bde13b1", "installed_by": ["modules"] }, "bwa/mem": { "branch": "master", - "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", + "git_sha": "707241c72951f24fd89982c4c80c5983a4c437ef", "installed_by": ["modules"] }, "calder2": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "cooler/balance": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5d491ae33d61ab37e13850951b92ae7d6e3f4e31", "installed_by": ["modules"] }, "cooler/cload": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5d491ae33d61ab37e13850951b92ae7d6e3f4e31", "installed_by": ["modules"] }, "cooler/dump": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5d491ae33d61ab37e13850951b92ae7d6e3f4e31", "installed_by": ["modules"] }, "cooler/makebins": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5d491ae33d61ab37e13850951b92ae7d6e3f4e31", "installed_by": ["modules"] }, "cooler/zoomify": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] - }, - "custom/getchromsizes": { - "branch": "master", - "git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7", + "git_sha": "5d491ae33d61ab37e13850951b92ae7d6e3f4e31", "installed_by": ["modules"] }, "fastqc": { "branch": "master", - "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", + "git_sha": "3009f27c4e4b6e99da4eeebe82799e13924a4a1f", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "af27af1be706e6a2bb8fe454175b0cdf77f47b49", + "git_sha": "2c73cc8fa92cf48de3da0b643fdf357a8a290b36", "installed_by": ["modules"] }, "pairix": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/dedup": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/merge": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/parse": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/restrict": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", "installed_by": ["modules"] }, "pairtools/select": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/sort": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", "installed_by": ["modules"] }, "pairtools/stats": { "branch": "master", - "git_sha": "4d3743f71f43cc40505dee2bc0747dca2df5f69a", + "git_sha": "e753770db613ce014b3c4bc94f6cba443427b726", + "installed_by": ["modules"] + }, + "samtools/faidx": { + "branch": "master", + "git_sha": "b2e78932ef01165fd85829513eaca29eff8e640a", "installed_by": ["modules"] }, "samtools/flagstat": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "1d2fbdcbca677bbe8da0f9d0d2bb7c02f2cab1c9", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "1d2fbdcbca677bbe8da0f9d0d2bb7c02f2cab1c9", "installed_by": ["modules"] }, "samtools/sort": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "5cb9a8694da0a0e550921636bb60bc8c56445fd7", + "installed_by": ["modules"] + }, + "trimgalore": { + "branch": "master", + "git_sha": "eed5d14302a6c9070dcc25feeab707a27a4b3254", "installed_by": ["modules"] } } @@ -141,7 +146,7 @@ }, "utils_nfschema_plugin": { "branch": "master", - "git_sha": "4b406a74dc0449c0401ed87d5bfff4252fd277fd", + "git_sha": "fdc08b8b1ae74f56686ce21f7ea11ad11990ce57", "installed_by": ["subworkflows"] } } diff --git a/modules/local/filter_chromsize/main.nf b/modules/local/filter_chromsize/main.nf new file mode 100644 index 00000000..b1a498e9 --- /dev/null +++ b/modules/local/filter_chromsize/main.nf @@ -0,0 +1,20 @@ +/* + * Filter chromsize + * Filter out chromosomes smaller than a given threshold + */ + +process FILTER_CHROMSIZE { + tag "${meta.id}" + label 'process_low' + + input: + tuple val(meta), path(sizes_file) + + output: + tuple val(meta), path("filtered.sizes") + + script: + """ + awk -v MIN=${params.min_size} '\$2 >= MIN' ${sizes_file} > filtered.sizes + """ +} diff --git a/modules/local/split_cooler_dump.nf b/modules/local/split_cooler_dump/main.nf similarity index 100% rename from modules/local/split_cooler_dump.nf rename to modules/local/split_cooler_dump/main.nf diff --git a/modules/nf-core/bowtie2/align/environment.yml b/modules/nf-core/bowtie2/align/environment.yml index d2796359..066ff52e 100644 --- a/modules/nf-core/bowtie2/align/environment.yml +++ b/modules/nf-core/bowtie2/align/environment.yml @@ -1,9 +1,13 @@ -name: bowtie2_align +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bowtie2=2.5.2 - - bioconda::samtools=1.18 - - conda-forge::pigz=2.6 + # renovate: datasource=conda depName=bioconda/bowtie2 + - bioconda::bowtie2=2.5.4 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.21 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.21 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/bowtie2/align/main.nf b/modules/nf-core/bowtie2/align/main.nf index 809525ad..4264bb2c 100644 --- a/modules/nf-core/bowtie2/align/main.nf +++ b/modules/nf-core/bowtie2/align/main.nf @@ -4,8 +4,8 @@ process BOWTIE2_ALIGN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:f70b31a2db15c023d641c32f433fb02cd04df5a6-0' : - 'biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:f70b31a2db15c023d641c32f433fb02cd04df5a6-0' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b4/b41b403e81883126c3227fc45840015538e8e2212f13abc9ae84e4b98891d51c/data' : + 'community.wave.seqera.io/library/bowtie2_htslib_samtools_pigz:edeb13799090a2a6' }" input: tuple val(meta) , path(reads) @@ -22,7 +22,9 @@ process BOWTIE2_ALIGN { tuple val(meta), path("*.crai") , emit: crai , optional:true tuple val(meta), path("*.log") , emit: log tuple val(meta), path("*fastq.gz") , emit: fastq , optional:true - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('bowtie2'), eval("bowtie2 --version 2>&1 | sed -n '1s/.*bowtie2-align-s version //p'"), emit: versions_bowtie2, topic: versions + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions + tuple val("${task.process}"), val('pigz'), eval("pigz --version 2>&1 | sed 's/pigz //'"), emit: versions_pigz, topic: versions when: task.ext.when == null || task.ext.when @@ -60,7 +62,7 @@ process BOWTIE2_ALIGN { --threads $task.cpus \\ $unaligned \\ $args \\ - 2> >(tee ${prefix}.bowtie2.log >&2) \\ + 2>| >(tee ${prefix}.bowtie2.log >&2) \\ | samtools $samtools_command $args2 --threads $task.cpus ${reference} -o ${prefix}.${extension} - if [ -f ${prefix}.unmapped.fastq.1.gz ]; then @@ -70,13 +72,6 @@ process BOWTIE2_ALIGN { 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 """ stub: @@ -90,7 +85,6 @@ process BOWTIE2_ALIGN { } else { create_unmapped = save_unaligned ? "touch ${prefix}.unmapped_1.fastq.gz && touch ${prefix}.unmapped_2.fastq.gz" : "" } - def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" def create_index = "" @@ -105,13 +99,6 @@ process BOWTIE2_ALIGN { ${create_index} touch ${prefix}.bowtie2.log ${create_unmapped} - - 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/nf-core/bowtie2/align/meta.yml b/modules/nf-core/bowtie2/align/meta.yml index 38610e0e..2d8051da 100644 --- a/modules/nf-core/bowtie2/align/meta.yml +++ b/modules/nf-core/bowtie2/align/meta.yml @@ -14,37 +14,41 @@ tools: sequencing reads to long reference sequences. homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml - doi: 10.1038/nmeth.1923 + doi: 10.1186/gb-2009-10-3-r25 licence: ["GPL-3.0-or-later"] + identifier: "" 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. - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test', single_end:false ] - - index: - type: file - description: Bowtie2 genome index files - pattern: "*.ebwt" - - meta3: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: Bowtie2 genome fasta file - pattern: "*.fasta" + - - 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. + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test', single_end:false ] + - index: + type: file + description: Bowtie2 genome index files + pattern: "*.ebwt" + ontologies: [] + - - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Bowtie2 genome fasta file + pattern: "*.fasta" + ontologies: [] - save_unaligned: type: boolean description: | @@ -55,38 +59,131 @@ input: description: use samtools sort (true) or samtools view (false) pattern: "true or false" output: - - sam: - type: file - description: Output SAM file containing read alignments - pattern: "*.sam" - - bam: - type: file - description: Output BAM file containing read alignments - pattern: "*.bam" - - cram: - type: file - description: Output CRAM file containing read alignments - pattern: "*.cram" - - csi: - type: file - description: Output SAM/BAM index for large inputs - pattern: "*.csi" - - crai: - type: file - description: Output CRAM index - pattern: "*.crai" - - log: - type: file - description: Aligment log - pattern: "*.log" - - fastq: - type: file - description: Unaligned FastQ files - pattern: "*.fastq.gz" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + sam: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.sam": + type: file + description: Output SAM file containing read alignments + pattern: "*.sam" + ontologies: [] + bam: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.bam": + type: file + description: Output BAM file containing read alignments + pattern: "*.bam" + ontologies: [] + cram: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.cram": + type: file + description: Output CRAM file containing read alignments + pattern: "*.cram" + ontologies: [] + csi: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.csi": + type: file + description: Output SAM/BAM index for large inputs + pattern: "*.csi" + ontologies: [] + crai: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.crai": + type: file + description: Output CRAM index + pattern: "*.crai" + ontologies: [] + log: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.log": + type: file + description: Alignment log + pattern: "*.log" + ontologies: [] + fastq: + - - meta: + type: map + description: Groovy Map containing sample information + - "*fastq.gz": + type: file + description: Unaligned FastQ files + pattern: "*.fastq.gz" + ontologies: + - edam: http://edamontology.org/format_3989 # GZIP format + versions_bowtie2: + - - ${task.process}: + type: string + description: The name of the process + - bowtie2: + type: string + description: The name of the tool + - "bowtie2 --version 2>&1 | sed -n '1s/.*bowtie2-align-s version //p'": + type: eval + description: The expression to obtain the version of bowtie2 + versions_samtools: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - "samtools version | sed '1!d;s/.* //'": + type: eval + description: The expression to obtain the version of samtools + versions_pigz: + - - ${task.process}: + type: string + description: The name of the process + - pigz: + type: string + description: The name of the tool + - "pigz --version 2>&1 | sed 's/pigz //'": + type: eval + description: The expression to obtain the version of pigz + +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - bowtie2: + type: string + description: The name of the tool + - "bowtie2 --version 2>&1 | sed -n '1s/.*bowtie2-align-s version //p'": + type: eval + description: The expression to obtain the version of bowtie2 + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - "samtools version | sed '1!d;s/.* //'": + type: eval + description: The expression to obtain the version of samtools + - - ${task.process}: + type: string + description: The name of the process + - pigz: + type: string + description: The name of the tool + - "pigz --version 2>&1 | sed 's/pigz //'": + type: eval + description: The expression to obtain the version of pigz + authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bowtie2/align/tests/large_index.config b/modules/nf-core/bowtie2/align/tests/large_index.config index fdc1c59d..b2f0c405 100644 --- a/modules/nf-core/bowtie2/align/tests/large_index.config +++ b/modules/nf-core/bowtie2/align/tests/large_index.config @@ -2,4 +2,4 @@ process { withName: BOWTIE2_BUILD { ext.args = '--large-index' } -} \ No newline at end of file +} diff --git a/modules/nf-core/bowtie2/align/tests/main.nf.test b/modules/nf-core/bowtie2/align/tests/main.nf.test index 03aeaf9e..1705b66d 100644 --- a/modules/nf-core/bowtie2/align/tests/main.nf.test +++ b/modules/nf-core/bowtie2/align/tests/main.nf.test @@ -18,7 +18,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -30,10 +30,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -47,7 +47,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -64,7 +64,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -76,10 +76,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -93,7 +93,7 @@ nextflow_process { file(process.out.sam[0][1]).readLines()[0..4], process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -110,7 +110,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -122,10 +122,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -139,7 +139,7 @@ nextflow_process { file(process.out.sam[0][1]).readLines()[0..4], process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -155,7 +155,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -167,10 +167,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -184,7 +184,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -200,7 +200,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -213,12 +213,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -232,7 +232,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -248,7 +248,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -261,12 +261,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -280,7 +280,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -297,7 +297,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -309,10 +309,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -326,7 +326,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -343,7 +343,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -356,12 +356,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -375,7 +375,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -391,7 +391,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -404,12 +404,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -423,7 +423,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -439,7 +439,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -451,10 +451,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -468,7 +468,7 @@ nextflow_process { file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -486,7 +486,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -499,12 +499,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = true //sort """ @@ -533,7 +533,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -546,12 +546,12 @@ nextflow_process { input[0] = [ [ 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) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -566,7 +566,7 @@ nextflow_process { file(process.out.csi[0][1]).name, file(process.out.log[0][1]).name, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -583,7 +583,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -595,10 +595,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[ id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[3] = false //save_unaligned input[4] = false //sort """ @@ -613,7 +613,7 @@ nextflow_process { file(process.out.csi[0][1]).name, file(process.out.log[0][1]).name, process.out.fastq, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } diff --git a/modules/nf-core/bowtie2/align/tests/main.nf.test.snap b/modules/nf-core/bowtie2/align/tests/main.nf.test.snap index 028e7da6..c8c6d4b5 100644 --- a/modules/nf-core/bowtie2/align/tests/main.nf.test.snap +++ b/modules/nf-core/bowtie2/align/tests/main.nf.test.snap @@ -14,15 +14,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:19:25.337323" + "timestamp": "2026-02-03T15:18:12.706444258" }, "sarscov2 - fastq, index, fasta, false, false - sam2": { "content": [ @@ -45,15 +65,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T12:31:40.337129939" + "timestamp": "2026-02-03T15:17:39.204319466" }, "sarscov2 - [fastq1, fastq2], index, fasta, true, true - cram": { "content": [ @@ -81,15 +121,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-03-18T12:58:55.482166476" + "timestamp": "2026-02-03T10:46:53.843035" }, "sarscov2 - fastq, index, fasta, true, false - bam": { "content": [ @@ -106,15 +166,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:19:55.741244" + "timestamp": "2026-02-03T15:18:25.788314396" }, "sarscov2 - fastq, large_index, fasta, false, false - bam": { "content": [ @@ -131,15 +211,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:19:09.604979" + "timestamp": "2026-02-03T15:18:06.123712951" }, "sarscov2 - fastq, index, fasta, false, true - bam": { "content": [ @@ -156,15 +256,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:18:22.547322" + "timestamp": "2026-02-03T15:17:45.85694104" }, "sarscov2 - fastq, index, fasta, true, false - stub": { "content": [ @@ -174,15 +294,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:02:09.557518106" + "timestamp": "2026-02-03T15:18:45.009237771" }, "sarscov2 - [fastq1, fastq2], index, fasta, false, false - bam": { "content": [ @@ -199,15 +339,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:18:38.78064" + "timestamp": "2026-02-03T15:17:52.571603438" }, "sarscov2 - [fastq1, fastq2], index, fasta, false, false - stub": { "content": [ @@ -217,15 +377,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:20:26.047111" + "timestamp": "2026-02-03T15:18:38.851739544" }, "sarscov2 - fastq, index, fasta, false, false - sam": { "content": [ @@ -248,15 +428,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T12:31:26.668053751" + "timestamp": "2026-02-03T15:17:32.669170305" }, "sarscov2 - [fastq1, fastq2], index, fasta, true, false - bam": { "content": [ @@ -273,15 +473,35 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:19:40.606135" + "timestamp": "2026-02-03T15:18:19.168328408" }, "sarscov2 - [fastq1, fastq2], index, fasta, false, true - bam": { "content": [ @@ -298,14 +518,34 @@ [ ], - [ - "versions.yml:md5,01d18ab035146ea790e9a0f70adb758f" - ] + { + "versions_bowtie2": [ + [ + "BOWTIE2_ALIGN", + "bowtie2", + "2.5.4" + ] + ], + "versions_pigz": [ + [ + "BOWTIE2_ALIGN", + "pigz", + "2.8" + ] + ], + "versions_samtools": [ + [ + "BOWTIE2_ALIGN", + "samtools", + "1.21" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-03-18T13:18:54.194648" + "timestamp": "2026-02-03T15:17:59.201650301" } } \ No newline at end of file diff --git a/modules/nf-core/bowtie2/align/tests/sam.config b/modules/nf-core/bowtie2/align/tests/sam.config index c1d8c358..14d94e9a 100644 --- a/modules/nf-core/bowtie2/align/tests/sam.config +++ b/modules/nf-core/bowtie2/align/tests/sam.config @@ -2,4 +2,4 @@ process { withName: BOWTIE2_ALIGN { ext.args2 = '--output-fmt SAM' } -} \ No newline at end of file +} diff --git a/modules/nf-core/bowtie2/align/tests/sam2.config b/modules/nf-core/bowtie2/align/tests/sam2.config index 4e85ff0e..c39156f9 100644 --- a/modules/nf-core/bowtie2/align/tests/sam2.config +++ b/modules/nf-core/bowtie2/align/tests/sam2.config @@ -2,4 +2,4 @@ process { withName: BOWTIE2_ALIGN { ext.args2 = '-O SAM' } -} \ No newline at end of file +} diff --git a/modules/nf-core/bowtie2/align/tests/tags.yml b/modules/nf-core/bowtie2/align/tests/tags.yml deleted file mode 100644 index ac47d1c8..00000000 --- a/modules/nf-core/bowtie2/align/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -bowtie2/align: - - modules/nf-core/bowtie2/align/** diff --git a/modules/nf-core/bowtie2/build/environment.yml b/modules/nf-core/bowtie2/build/environment.yml index 22bbfc37..066ff52e 100644 --- a/modules/nf-core/bowtie2/build/environment.yml +++ b/modules/nf-core/bowtie2/build/environment.yml @@ -1,7 +1,13 @@ -name: bowtie2_build +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bowtie2=2.5.2 + # renovate: datasource=conda depName=bioconda/bowtie2 + - bioconda::bowtie2=2.5.4 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.21 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.21 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/bowtie2/build/main.nf b/modules/nf-core/bowtie2/build/main.nf index 9e2e0e5e..1be06ac8 100644 --- a/modules/nf-core/bowtie2/build/main.nf +++ b/modules/nf-core/bowtie2/build/main.nf @@ -4,15 +4,15 @@ process BOWTIE2_BUILD { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bowtie2:2.5.2--py39h6fed5c7_0' : - 'biocontainers/bowtie2:2.5.2--py39h6fed5c7_0' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b4/b41b403e81883126c3227fc45840015538e8e2212f13abc9ae84e4b98891d51c/data' : + 'community.wave.seqera.io/library/bowtie2_htslib_samtools_pigz:edeb13799090a2a6' }" input: tuple val(meta), path(fasta) output: tuple val(meta), path('bowtie2') , emit: index - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('bowtie2'), eval('bowtie2 --version 2>&1 | head -1 | sed "s/^.*bowtie2-align-s version //; s/ .*//"'), emit: versions_bowtie2, topic: versions when: task.ext.when == null || task.ext.when @@ -22,10 +22,6 @@ process BOWTIE2_BUILD { """ mkdir bowtie2 bowtie2-build $args --threads $task.cpus $fasta bowtie2/${fasta.baseName} - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') - END_VERSIONS """ stub: @@ -33,10 +29,5 @@ process BOWTIE2_BUILD { mkdir bowtie2 touch bowtie2/${fasta.baseName}.{1..4}.bt2 touch bowtie2/${fasta.baseName}.rev.{1,2}.bt2 - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') - END_VERSIONS """ } diff --git a/modules/nf-core/bowtie2/build/meta.yml b/modules/nf-core/bowtie2/build/meta.yml index 2d687991..3a9d31cf 100644 --- a/modules/nf-core/bowtie2/build/meta.yml +++ b/modules/nf-core/bowtie2/build/meta.yml @@ -15,29 +15,52 @@ tools: documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml doi: 10.1038/nmeth.1923 licence: ["GPL-3.0-or-later"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: Input genome fasta file + - - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input genome fasta file + ontologies: [] output: - - meta: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test', single_end:false ] - - index: - type: file - description: Bowtie2 genome index files - pattern: "*.bt2" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + index: + - - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test', single_end:false ] + - bowtie2: + type: directory + description: Bowtie2 genome index files + pattern: "*.bt2" + ontologies: [] + versions_bowtie2: + - - ${task.process}: + type: string + description: The name of the process + - bowtie2: + type: string + description: The name of the tool + - 'bowtie2 --version 2>&1 | head -1 | sed "s/^.*bowtie2-align-s version //; s/ .*//"': + type: eval + description: The expression to obtain the version of the tool + +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - bowtie2: + type: string + description: The name of the tool + - 'bowtie2 --version 2>&1 | head -1 | sed "s/^.*bowtie2-align-s version //; s/ .*//"': + type: eval + description: The expression to obtain the version of the tool + authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bowtie2/build/tests/main.nf.test b/modules/nf-core/bowtie2/build/tests/main.nf.test index 16376025..a4bad2a1 100644 --- a/modules/nf-core/bowtie2/build/tests/main.nf.test +++ b/modules/nf-core/bowtie2/build/tests/main.nf.test @@ -1,7 +1,7 @@ nextflow_process { name "Test Process BOWTIE2_BUILD" - script "modules/nf-core/bowtie2/build/main.nf" + script "../main.nf" process "BOWTIE2_BUILD" tag "modules" tag "modules_nfcore" @@ -15,15 +15,20 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } } then { - assert process.success - assert snapshot(process.out).match() + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.index, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) } } diff --git a/modules/nf-core/bowtie2/build/tests/main.nf.test.snap b/modules/nf-core/bowtie2/build/tests/main.nf.test.snap index 6875e021..9f1bf080 100644 --- a/modules/nf-core/bowtie2/build/tests/main.nf.test.snap +++ b/modules/nf-core/bowtie2/build/tests/main.nf.test.snap @@ -1,45 +1,35 @@ { "Should run without failures": { "content": [ - { - "0": [ + [ + [ + { + "id": "test" + }, [ - { - "id": "test" - }, - [ - "genome.1.bt2:md5,cbe3d0bbea55bc57c99b4bfa25b5fbdf", - "genome.2.bt2:md5,47b153cd1319abc88dda532462651fcf", - "genome.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "genome.4.bt2:md5,c25be5f8b0378abf7a58c8a880b87626", - "genome.rev.1.bt2:md5,52be6950579598a990570fbcf5372184", - "genome.rev.2.bt2:md5,e3b4ef343dea4dd571642010a7d09597" - ] + "genome.1.bt2:md5,cbe3d0bbea55bc57c99b4bfa25b5fbdf", + "genome.2.bt2:md5,47b153cd1319abc88dda532462651fcf", + "genome.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "genome.4.bt2:md5,c25be5f8b0378abf7a58c8a880b87626", + "genome.rev.1.bt2:md5,52be6950579598a990570fbcf5372184", + "genome.rev.2.bt2:md5,e3b4ef343dea4dd571642010a7d09597" ] - ], - "1": [ - "versions.yml:md5,1df11e9b82891527271c889c880d3974" - ], - "index": [ + ] + ], + { + "versions_bowtie2": [ [ - { - "id": "test" - }, - [ - "genome.1.bt2:md5,cbe3d0bbea55bc57c99b4bfa25b5fbdf", - "genome.2.bt2:md5,47b153cd1319abc88dda532462651fcf", - "genome.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "genome.4.bt2:md5,c25be5f8b0378abf7a58c8a880b87626", - "genome.rev.1.bt2:md5,52be6950579598a990570fbcf5372184", - "genome.rev.2.bt2:md5,e3b4ef343dea4dd571642010a7d09597" - ] + "BOWTIE2_BUILD", + "bowtie2", + "2.5.4" ] - ], - "versions": [ - "versions.yml:md5,1df11e9b82891527271c889c880d3974" ] } ], - "timestamp": "2023-11-23T11:51:01.107681997" + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-28T17:52:30.165111" } } \ No newline at end of file diff --git a/modules/nf-core/bowtie2/build/tests/tags.yml b/modules/nf-core/bowtie2/build/tests/tags.yml deleted file mode 100644 index 81aa61da..00000000 --- a/modules/nf-core/bowtie2/build/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -bowtie2/build: - - modules/nf-core/bowtie2/build/** diff --git a/modules/nf-core/bwa/index/environment.yml b/modules/nf-core/bwa/index/environment.yml index 126e0034..54e67949 100644 --- a/modules/nf-core/bwa/index/environment.yml +++ b/modules/nf-core/bwa/index/environment.yml @@ -1,7 +1,13 @@ -name: bwa_index +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults + dependencies: - - bioconda::bwa=0.7.18 + # renovate: datasource=conda depName=bioconda/bwa + - bioconda::bwa=0.7.19 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 2e48b6ca..6be2c43b 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -1,18 +1,20 @@ process BWA_INDEX { tag "$fasta" - label 'process_single' + // NOTE requires 5.37N memory where N is the size of the database + // source: https://bio-bwa.sourceforge.net/bwa.shtml#8 + memory { 6.B * fasta.size() } conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bwa:0.7.18--he4a0461_0' : - 'biocontainers/bwa:0.7.18--he4a0461_0' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d7/d7e24dc1e4d93ca4d3a76a78d4c834a7be3985b0e1e56fddd61662e047863a8a/data' : + 'community.wave.seqera.io/library/bwa_htslib_samtools:83b50ff84ead50d0' }" input: tuple val(meta), path(fasta) output: - tuple val(meta), path(bwa) , emit: index - path "versions.yml" , emit: versions + tuple val(meta), path("bwa"), emit: index + tuple val("${task.process}"), val('bwa'), eval('bwa 2>&1 | sed -n "s/^Version: //p"'), topic: versions, emit: versions_bwa when: task.ext.when == null || task.ext.when @@ -27,27 +29,16 @@ process BWA_INDEX { $args \\ -p bwa/${prefix} \\ $fasta - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${fasta.baseName}" """ mkdir bwa - touch bwa/${prefix}.amb touch bwa/${prefix}.ann touch bwa/${prefix}.bwt touch bwa/${prefix}.pac touch bwa/${prefix}.sa - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') - END_VERSIONS """ } diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 6bbc87a6..f5bf7f52 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -14,33 +14,58 @@ tools: documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] + identifier: "biotools:bwa" input: - - meta: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: Input genome fasta file + - - meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input genome fasta file + ontologies: + - edam: "http://edamontology.org/data_2044" # Sequence + - edam: "http://edamontology.org/format_1929" # FASTA output: - - meta: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - - index: - type: file - description: BWA genome index files - pattern: "*.{amb,ann,bwt,pac,sa}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + index: + - - meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + - bwa: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + pattern: "*.{amb,ann,bwt,pac,sa}" + ontologies: + - edam: "http://edamontology.org/data_3210" # Genome index + versions_bwa: + - - ${task.process}: + type: string + description: The process the versions were collected from + - bwa: + type: string + description: The tool name + - 'bwa 2>&1 | sed -n "s/^Version: //p"': + type: string + description: The command used to generate the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - bwa: + type: string + description: The tool name + - 'bwa 2>&1 | sed -n "s/^Version: //p"': + type: string + description: The command used to generate the version of the tool authors: - "@drpatelh" - "@maxulysse" maintainers: - - "@drpatelh" - "@maxulysse" - "@gallvp" diff --git a/modules/nf-core/bwa/index/tests/main.nf.test b/modules/nf-core/bwa/index/tests/main.nf.test index af33e73c..f0fba82a 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test +++ b/modules/nf-core/bwa/index/tests/main.nf.test @@ -22,8 +22,32 @@ nextflow_process { } then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + + } + + test("BWA index - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success assertAll( - { assert process.success }, { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/bwa/index/tests/main.nf.test.snap b/modules/nf-core/bwa/index/tests/main.nf.test.snap index 7c8f0465..21a6f73c 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/index/tests/main.nf.test.snap @@ -1,4 +1,57 @@ { + "BWA index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "genome.amb:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.ann:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.bwt:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.pac:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.sa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] + ], + "index": [ + [ + { + "id": "test" + }, + [ + "genome.amb:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.ann:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.bwt:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.pac:md5,d41d8cd98f00b204e9800998ecf8427e", + "genome.sa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions_bwa": [ + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-23T16:58:59.966558606" + }, "BWA index": { "content": [ { @@ -17,7 +70,11 @@ ] ], "1": [ - "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] ], "index": [ [ @@ -33,15 +90,19 @@ ] ] ], - "versions": [ - "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" + "versions_bwa": [ + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-05-16T11:40:09.925307" + "timestamp": "2026-01-23T16:58:53.330725134" } } \ No newline at end of file diff --git a/modules/nf-core/bwa/index/tests/tags.yml b/modules/nf-core/bwa/index/tests/tags.yml deleted file mode 100644 index 28bb483c..00000000 --- a/modules/nf-core/bwa/index/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -bwa/index: - - modules/nf-core/bwa/index/** diff --git a/modules/nf-core/bwa/mem/environment.yml b/modules/nf-core/bwa/mem/environment.yml index 3aa9f0cc..54e67949 100644 --- a/modules/nf-core/bwa/mem/environment.yml +++ b/modules/nf-core/bwa/mem/environment.yml @@ -1,10 +1,13 @@ -name: bwa_mem +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults + dependencies: - - bwa=0.7.18 + # renovate: datasource=conda depName=bioconda/bwa + - bioconda::bwa=0.7.19 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.20 - - htslib=1.20.0 + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index 9c815f0c..e3732673 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -4,8 +4,8 @@ process BWA_MEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' : - 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d7/d7e24dc1e4d93ca4d3a76a78d4c834a7be3985b0e1e56fddd61662e047863a8a/data' : + 'community.wave.seqera.io/library/bwa_htslib_samtools:83b50ff84ead50d0' }" input: tuple val(meta) , path(reads) @@ -18,7 +18,8 @@ process BWA_MEM { tuple val(meta), path("*.cram") , emit: cram, optional: true tuple val(meta), path("*.csi") , emit: csi, optional: true tuple val(meta), path("*.crai") , emit: crai, optional: true - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('bwa'), eval('bwa 2>&1 | sed -n "s/^Version: //p"'), topic: versions, emit: versions_bwa + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools when: task.ext.when == null || task.ext.when @@ -44,19 +45,11 @@ process BWA_MEM { \$INDEX \\ $reads \\ | samtools $samtools_command $args2 ${reference} --threads $task.cpus -o ${prefix}.${extension} - - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension = args2.contains("--output-fmt sam") ? "sam" : args2.contains("--output-fmt cram") ? "cram": sort_bam && args2.contains("-O cram")? "cram": @@ -66,11 +59,5 @@ process BWA_MEM { touch ${prefix}.${extension} touch ${prefix}.csi touch ${prefix}.crai - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ } diff --git a/modules/nf-core/bwa/mem/meta.yml b/modules/nf-core/bwa/mem/meta.yml index b126dd86..450a3fe9 100644 --- a/modules/nf-core/bwa/mem/meta.yml +++ b/modules/nf-core/bwa/mem/meta.yml @@ -16,56 +16,129 @@ tools: homepage: http://bio-bwa.sourceforge.net/ documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 - licence: ["GPL-3.0-or-later"] + licence: + - "GPL-3.0-or-later" + identifier: "biotools:bwa" 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. - - meta2: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - - index: - type: file - description: BWA genome index files - pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" - - fasta: - type: file - description: Reference genome in FASTA format - pattern: "*.{fasta,fa}" + - - 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. + ontologies: + - edam: "http://edamontology.org/data_2044" + - edam: "http://edamontology.org/format_1930" + - - meta2: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + - index: + type: file + description: BWA genome index files + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + ontologies: + - edam: "http://edamontology.org/data_3210" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Reference genome in FASTA format + pattern: "*.{fasta,fa}" + ontologies: + - edam: "http://edamontology.org/data_2044" + - edam: "http://edamontology.org/format_1929" - sort_bam: type: boolean description: use samtools sort (true) or samtools view (false) pattern: "true or false" output: - - bam: - type: file - description: Output BAM file containing read alignments - pattern: "*.{bam}" - - cram: - type: file - description: Output CRAM file containing read alignments - pattern: "*.{cram}" - - csi: - type: file - description: Optional index file for BAM file - pattern: "*.{csi}" - - crai: - type: file - description: Optional index file for CRAM file - pattern: "*.{crai}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + bam: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.bam": + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + ontologies: + - edam: "http://edamontology.org/format_2572" + cram: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.cram": + type: file + description: Output CRAM file containing read alignments + pattern: "*.{cram}" + ontologies: + - edam: "http://edamontology.org/format_3462" + csi: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.csi": + type: file + description: Optional index file for BAM file + pattern: "*.{csi}" + ontologies: [] + crai: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.crai": + type: file + description: Optional index file for CRAM file + pattern: "*.{crai}" + ontologies: [] + versions_bwa: + - - ${task.process}: + type: string + description: The name of the process + - bwa: + type: string + description: The name of the tool + - 'bwa 2>&1 | sed -n "s/^Version: //p"': + type: eval + description: The expression to obtain the version of the tool + versions_samtools: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - bwa: + type: string + description: The name of the tool + - 'bwa 2>&1 | sed -n "s/^Version: //p"': + type: eval + description: The expression to obtain the version of the tool + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool authors: - "@drpatelh" - "@jeremy1805" diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index 463b76f8..6486ab00 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test +++ b/modules/nf-core/bwa/mem/tests/main.nf.test @@ -9,21 +9,21 @@ nextflow_process { script "../main.nf" process "BWA_MEM" - test("Single-End") { - - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } + setup { + run("BWA_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ } } + } + + test("Single-End") { when { process { @@ -48,8 +48,8 @@ nextflow_process { process.out.cram, process.out.csi, process.out.crai, - process.out.versions, - file(process.out.bam[0][1]).name + process.out.findAll { key, val -> key.startsWith("versions") }, + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -59,20 +59,6 @@ nextflow_process { test("Single-End Sort") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -96,8 +82,8 @@ nextflow_process { process.out.cram, process.out.csi, process.out.crai, - process.out.versions, - file(process.out.bam[0][1]).name + process.out.findAll { key, val -> key.startsWith("versions") }, + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -107,20 +93,6 @@ nextflow_process { test("Paired-End") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -145,8 +117,8 @@ nextflow_process { process.out.cram, process.out.csi, process.out.crai, - process.out.versions, - file(process.out.bam[0][1]).name + process.out.findAll { key, val -> key.startsWith("versions") }, + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -156,20 +128,6 @@ nextflow_process { test("Paired-End Sort") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -194,8 +152,8 @@ nextflow_process { process.out.cram, process.out.csi, process.out.crai, - process.out.versions, - file(process.out.bam[0][1]).name + process.out.findAll { key, val -> key.startsWith("versions") }, + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -205,20 +163,6 @@ nextflow_process { test("Paired-End - no fasta") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -243,8 +187,8 @@ nextflow_process { process.out.cram, process.out.csi, process.out.crai, - process.out.versions, - file(process.out.bam[0][1]).name + process.out.findAll { key, val -> key.startsWith("versions") }, + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -253,20 +197,9 @@ nextflow_process { } test("Single-end - stub") { + options "-stub" - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } + when { process { """ @@ -286,30 +219,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.bam[0][1]).name, - file(process.out.csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } } test("Paired-end - stub") { + options "-stub" - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } + when { process { """ @@ -330,11 +248,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.bam[0][1]).name, - file(process.out.csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test.snap b/modules/nf-core/bwa/mem/tests/main.nf.test.snap index 038ee7b7..8aca4b23 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -10,16 +10,29 @@ [ ], - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ], - "test.bam" + { + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + }, + "798439cbd7fd81cbcc5078022dc5479d" ], + "timestamp": "2026-02-18T12:42:52.901827", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:44:32.953673185" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Single-End Sort": { "content": [ @@ -32,16 +45,29 @@ [ ], - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ], - "test.bam" + { + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + }, + "94fcf617f5b994584c4e8d4044e16b4f" ], + "timestamp": "2026-02-18T12:43:01.149915", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:44:45.27066093" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Paired-End": { "content": [ @@ -54,16 +80,29 @@ [ ], - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ], - "test.bam" + { + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + }, + "57aeef88ed701a8ebc8e2f0a381b2a6" ], + "timestamp": "2026-02-18T12:43:09.528042", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:44:57.706852274" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Paired-End Sort": { "content": [ @@ -76,30 +115,128 @@ [ ], - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ], - "test.bam" + { + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + }, + "af8628d9df18b2d3d4f6fd47ef2bb872" ], + "timestamp": "2026-02-18T12:43:17.876121", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:45:10.376505036" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Single-end - stub": { "content": [ - "test.bam", - "test.csi", - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "5": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + [ + { + "id": "test", + "single_end": true + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + } ], + "timestamp": "2026-02-18T12:43:33.853248", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:46:07.182072398" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Paired-End - no fasta": { "content": [ @@ -112,29 +249,127 @@ [ ], - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ], - "test.bam" + { + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + }, + "57aeef88ed701a8ebc8e2f0a381b2a6" ], + "timestamp": "2026-02-18T12:43:26.121474", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:45:53.813076501" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "Paired-end - stub": { "content": [ - "test.bam", - "test.csi", - [ - "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "5": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_bwa": [ + [ + "BWA_MEM", + "bwa", + "0.7.19-r1273" + ] + ], + "versions_samtools": [ + [ + "BWA_MEM", + "samtools", + "1.22.1" + ] + ] + } ], + "timestamp": "2026-02-18T12:43:42.119907", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-05-20T08:46:18.412916364" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } } } \ No newline at end of file diff --git a/modules/nf-core/bwa/mem/tests/tags.yml b/modules/nf-core/bwa/mem/tests/tags.yml deleted file mode 100644 index 82992d1f..00000000 --- a/modules/nf-core/bwa/mem/tests/tags.yml +++ /dev/null @@ -1,3 +0,0 @@ -bwa/mem: - - modules/nf-core/bwa/index/** - - modules/nf-core/bwa/mem/** diff --git a/modules/nf-core/calder2/environment.yml b/modules/nf-core/calder2/environment.yml index e694b729..17e4cd31 100644 --- a/modules/nf-core/calder2/environment.yml +++ b/modules/nf-core/calder2/environment.yml @@ -1,7 +1,7 @@ -name: calder2 +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::r-calder2=0.3 + - bioconda::r-calder2=0.7 diff --git a/modules/nf-core/calder2/main.nf b/modules/nf-core/calder2/main.nf index cb77dfe9..d2300f59 100644 --- a/modules/nf-core/calder2/main.nf +++ b/modules/nf-core/calder2/main.nf @@ -1,11 +1,12 @@ process CALDER2 { - tag '$meta.id' + tag "$meta.id" label 'process_high' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-calder2:0.3--r41hdfd78af_0' : - 'biocontainers/r-calder2:0.3--r41hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/r-calder2:0.7--r43hdfd78af_1' : + 'biocontainers/r-calder2:0.7--r43hdfd78af_1' }" input: @@ -13,8 +14,8 @@ process CALDER2 { val resolution output: - tuple val(meta), path("${meta.id}/") , emit: output_folder - tuple val(meta), path("${meta.id}/intermediate_data/") , emit: intermediate_data_folder , optional: true + tuple val(meta), path("${prefix}/") , emit: output_folder + tuple val(meta), path("${prefix}/intermediate_data/") , emit: intermediate_data_folder , optional: true path "versions.yml" , emit: versions when: @@ -22,10 +23,10 @@ process CALDER2 { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" def suffix = resolution ? "::/resolutions/$resolution" : "" def cpus = task.cpus ?: 1 - def VERSION = '0.3' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '0.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ # getting binsize as mandatory input for calder binsize="\$(cooler info --field bin-size $cool$suffix)" @@ -42,4 +43,25 @@ process CALDER2 { calder: $VERSION END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + mkdir -p ${prefix}/sub_compartments + mkdir -p ${prefix}/sub_domains + + touch ${prefix}/sub_compartments/all_sub_compartments.bed + touch ${prefix}/sub_compartments/all_sub_compartments.tsv + touch ${prefix}/sub_compartments/cor_with_ref.ALL.txt + touch ${prefix}/sub_compartments/cor_with_ref.pdf + touch ${prefix}/sub_compartments/cor_with_ref.txt + + touch ${prefix}/sub_domains/all_nested_boundaries.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + calder: $VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/calder2/meta.yml b/modules/nf-core/calder2/meta.yml index fef6a2cf..9e353380 100644 --- a/modules/nf-core/calder2/meta.yml +++ b/modules/nf-core/calder2/meta.yml @@ -15,31 +15,47 @@ tools: tool_dev_url: "https://github.com/CSOgroup/CALDER2" doi: "10.1038/s41467-021-22666-3" licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false ] - - input: - type: file - description: Path to COOL file - pattern: "*.{cool.mcool}" + - - meta: + type: map + description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false + ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool.mcool}" + ontologies: [] - resolution: - type: value - description: In case a .mcool file is provided, which resolution level to use for the analysis + type: integer + description: In case a .mcool file is provided, which resolution level to use + for the analysis 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" - - output: - type: directory - description: Output folder containing sub-compartment (.tsv/.bed) and domain boundaries calls (.bed) - - intermediate_data: - type: directory - description: Output folder containing intermediate data produced during the computation + output_folder: + - - meta: + type: map + description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false + ] + - ${prefix}/: + type: directory + description: Output folder containing sub-compartment (.tsv/.bed) and domain + boundaries calls (.bed) + intermediate_data_folder: + - - meta: + type: map + description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false + ] + - ${prefix}/intermediate_data/: + type: directory + description: Output folder containing intermediate data produced during the + computation + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@lucananni93" maintainers: diff --git a/modules/nf-core/calder2/tests/main.nf.test b/modules/nf-core/calder2/tests/main.nf.test new file mode 100644 index 00000000..7833470e --- /dev/null +++ b/modules/nf-core/calder2/tests/main.nf.test @@ -0,0 +1,135 @@ +import groovy.io.FileType + +nextflow_process { + + name "Test Process CALDER2" + script "../main.nf" + process "CALDER2" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "calder2" + + test("test-calder2-cool") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], //meta map + file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.cool', checkIfExists: true) + ] + + input[1] = [:] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { + def all_files = [] + + file(process.out.output_folder[0][1]).eachFileRecurse (FileType.FILES) { file -> + all_files << file + } + + def all_file_names = all_files.collect { it.name }.toSorted() + + def stable_file_names = [ + 'all_sub_compartments.bed', + 'all_sub_compartments.tsv', + 'cor_with_ref.ALL.txt', + 'cor_with_ref.txt', + 'all_nested_boundaries.bed' + ] + + def stable_files = all_files.findAll { it.name in stable_file_names }.toSorted() + + assert snapshot( + all_file_names, + stable_files, + process.out.versions[0] + ).match() + } + ) + } + } + + test("test-calder2-mcool") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], //meta map + file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.mcool', checkIfExists: true) + ] + + input[1] = 100000 + + """ + } + } + + then { + assertAll( + { assert process.success }, + { + def all_files = [] + + file(process.out.output_folder[0][1]).eachFileRecurse (FileType.FILES) { file -> + all_files << file + } + + def all_file_names = all_files.collect { it.name }.toSorted() + + def stable_file_names = [ + 'all_sub_compartments.bed', + 'all_sub_compartments.tsv', + 'cor_with_ref.ALL.txt', + 'cor_with_ref.txt', + 'all_nested_boundaries.bed' + ] + + def stable_files = all_files.findAll { it.name in stable_file_names }.toSorted() + + assert snapshot( + all_file_names, + stable_files, + process.out.versions[0] + ).match() + } + ) + } + } + + test("test-calder2-mcool-stub") { + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], //meta map + file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.mcool', checkIfExists: true) + ] + + input[1] = 100000 + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/calder2/tests/main.nf.test.snap b/modules/nf-core/calder2/tests/main.nf.test.snap new file mode 100644 index 00000000..22312cd2 --- /dev/null +++ b/modules/nf-core/calder2/tests/main.nf.test.snap @@ -0,0 +1,113 @@ +{ + "test-calder2-mcool-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + [ + "all_sub_compartments.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "all_sub_compartments.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.ALL.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "all_nested_boundaries.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,b312ffd67c18a79a5db11b78777c00d0" + ], + "intermediate_data_folder": [ + + ], + "output_folder": [ + [ + { + "id": "test" + }, + [ + [ + "all_sub_compartments.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "all_sub_compartments.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.ALL.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "cor_with_ref.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "all_nested_boundaries.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,b312ffd67c18a79a5db11b78777c00d0" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T15:17:11.435944" + }, + "test-calder2-cool": { + "content": [ + [ + "all_nested_boundaries.bed", + "all_sub_compartments.bed", + "all_sub_compartments.tsv", + "cor_with_ref.ALL.txt", + "cor_with_ref.pdf", + "cor_with_ref.txt" + ], + [ + "all_sub_compartments.bed:md5,1ba23032928f207bf4c7f77b3a0cdf15", + "all_sub_compartments.tsv:md5,059bf7738512ff5f8684d0e69f7897fe", + "cor_with_ref.ALL.txt:md5,05fd4e65c0ba139b87ca36712a5a5b6a", + "cor_with_ref.txt:md5,54f954d92df161db5cae7845d2786ad2", + "all_nested_boundaries.bed:md5,56172ee755f573ad57320273ca0f52cd" + ], + "versions.yml:md5,b312ffd67c18a79a5db11b78777c00d0" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T15:16:37.504391" + }, + "test-calder2-mcool": { + "content": [ + [ + "all_nested_boundaries.bed", + "all_sub_compartments.bed", + "all_sub_compartments.tsv", + "cor_with_ref.ALL.txt", + "cor_with_ref.pdf", + "cor_with_ref.txt" + ], + [ + "all_sub_compartments.bed:md5,21b32c66d7ebe5acd2459a32a6592534", + "all_sub_compartments.tsv:md5,743c841b4d4aaa97c5a197c9921fba92", + "cor_with_ref.ALL.txt:md5,5cef6f44386930f637b8c4c4c3b5ee3b", + "cor_with_ref.txt:md5,f748876d367d0fdb751bd00e8e9bf60a", + "all_nested_boundaries.bed:md5,c066de5e2e789e3fe65b900a3b0a4876" + ], + "versions.yml:md5,b312ffd67c18a79a5db11b78777c00d0" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T15:17:06.081233" + } +} \ No newline at end of file diff --git a/modules/nf-core/calder2/tests/nextflow.config b/modules/nf-core/calder2/tests/nextflow.config new file mode 100644 index 00000000..7bc72018 --- /dev/null +++ b/modules/nf-core/calder2/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = '--genome hg38' +} diff --git a/modules/nf-core/cooler/balance/environment.yml b/modules/nf-core/cooler/balance/environment.yml index b39304de..0a8647f5 100644 --- a/modules/nf-core/cooler/balance/environment.yml +++ b/modules/nf-core/cooler/balance/environment.yml @@ -1,7 +1,7 @@ -name: cooler_balance +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::cooler=0.9.2 + - bioconda::cooler=0.10.4 diff --git a/modules/nf-core/cooler/balance/main.nf b/modules/nf-core/cooler/balance/main.nf index 8e0f3935..547da95a 100644 --- a/modules/nf-core/cooler/balance/main.nf +++ b/modules/nf-core/cooler/balance/main.nf @@ -4,15 +4,15 @@ process COOLER_BALANCE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cooler:0.9.2--pyh7cba7a3_0' : - 'biocontainers/cooler:0.9.2--pyh7cba7a3_0' }" + 'https://depot.galaxyproject.org/singularity/cooler:0.10.4--pyhdfd78af_0' : + 'biocontainers/cooler:0.10.4--pyhdfd78af_0' }" input: tuple val(meta), path(cool), val(resolution) output: tuple val(meta), path("${prefix}.${extension}"), emit: cool - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('cooler'), eval('cooler --version 2>&1 | sed "s/cooler, version //"'), emit: versions_cooler, topic: versions when: task.ext.when == null || task.ext.when @@ -24,16 +24,20 @@ process COOLER_BALANCE { extension = cool.getExtension() if ("$cool" == "${prefix}.${extension}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ - cp ${cool} ${prefix}.${extension} + ln -s ${cool} ${prefix}.${extension} cooler balance \\ $args \\ -p ${task.cpus} \\ ${prefix}.${extension}${suffix} + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS + stub: + prefix = task.ext.prefix ?: "${meta.id}" + suffix = resolution ? "::/resolutions/$resolution" : "" + extension = cool.getExtension() + def creation_cmd = suffix.endsWith(".gz") ? "echo '' | gzip -c >" : "touch" + """ + ${creation_cmd} ${prefix}.${extension}${suffix} """ } diff --git a/modules/nf-core/cooler/balance/meta.yml b/modules/nf-core/cooler/balance/meta.yml index 9b890638..06acdd2a 100644 --- a/modules/nf-core/cooler/balance/meta.yml +++ b/modules/nf-core/cooler/balance/meta.yml @@ -4,7 +4,6 @@ keywords: - cooler/balance - cooler - cool - - cooler tools: - "cooler": description: Sparse binary format for genomic interaction matrices @@ -12,34 +11,56 @@ tools: documentation: https://cooler.readthedocs.io/en/latest/index.html tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" - licence: ["BSD-3-Clause"] + licence: + - "BSD-3-Clause" + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - cool: - type: file - description: Path to COOL file - pattern: "*.{cool,mcool}" - - resolution: - type: integer - description: Resolution + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool,mcool}" + ontologies: [] + - resolution: + type: integer + description: Resolution 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" - - cool: - type: file - description: Output COOL file balancing weigths - pattern: "*.cool" + cool: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${extension}: + type: file + description: Output COOL file balancing weights + pattern: "*.cool" + ontologies: [] + versions_cooler: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool authors: - "@nservant" - "@muffato" diff --git a/modules/nf-core/cooler/balance/tests/main.nf.test b/modules/nf-core/cooler/balance/tests/main.nf.test new file mode 100644 index 00000000..a9e591b3 --- /dev/null +++ b/modules/nf-core/cooler/balance/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process COOLER_BALANCE" + + script "../main.nf" + process "COOLER_BALANCE" + + tag "modules" + tag "modules_nfcore" + tag "cooler" + tag "cooler/balance" + + test("test_cooler_balance") { + when { + + process { + """ + input[0] = [ + [id:'test'],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool', checkIfExists:true), + '' + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.findAll { key, val -> key.startsWith("versions")}, + process.out.cool.collect{ file(it[1]).name } + ).match() } + ) + } + } + + test("test_cooler_balance - stub") { + + options "-stub" + + when { + + process { + """ + input[0] = input[0] = [ + [id:'test'],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool', checkIfExists:true), + '' + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/cooler/balance/tests/main.nf.test.snap b/modules/nf-core/cooler/balance/tests/main.nf.test.snap new file mode 100644 index 00000000..a8e3f6e9 --- /dev/null +++ b/modules/nf-core/cooler/balance/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "test_cooler_balance - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.cool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "COOLER_BALANCE", + "cooler", + "0.10.4" + ] + ], + "cool": [ + [ + { + "id": "test" + }, + "test.cool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_cooler": [ + [ + "COOLER_BALANCE", + "cooler", + "0.10.4" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:56:53.088011" + }, + "test_cooler_balance": { + "content": [ + { + "versions_cooler": [ + [ + "COOLER_BALANCE", + "cooler", + "0.10.4" + ] + ] + }, + [ + "test.cool" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:56:47.719373" + } +} \ No newline at end of file diff --git a/modules/nf-core/cooler/cload/environment.yml b/modules/nf-core/cooler/cload/environment.yml index 03abee73..0a8647f5 100644 --- a/modules/nf-core/cooler/cload/environment.yml +++ b/modules/nf-core/cooler/cload/environment.yml @@ -1,7 +1,7 @@ -name: cooler_cload +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::cooler=0.9.2 + - bioconda::cooler=0.10.4 diff --git a/modules/nf-core/cooler/cload/main.nf b/modules/nf-core/cooler/cload/main.nf index b170a5d0..109beac6 100644 --- a/modules/nf-core/cooler/cload/main.nf +++ b/modules/nf-core/cooler/cload/main.nf @@ -1,50 +1,41 @@ process COOLER_CLOAD { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cooler:0.9.2--pyh7cba7a3_0' : - 'biocontainers/cooler:0.9.2--pyh7cba7a3_0' }" + 'https://depot.galaxyproject.org/singularity/cooler:0.10.4--pyhdfd78af_0' : + 'biocontainers/cooler:0.10.4--pyhdfd78af_0' }" input: - tuple val(meta), path(pairs), path(index), val(cool_bin) - path chromsizes + tuple val(meta), path(contacts), path(index) + tuple val(meta2), path(chromsizes) + val(mode) + val(cool_bin) output: - tuple val(meta), path("*.cool"), val(cool_bin), emit: cool - path "versions.yml" , emit: versions + tuple val(meta), path("*.cool"), emit: cool + tuple val("${task.process}"), val('cooler'), eval('cooler --version 2>&1 | sed "s/cooler, version //"'), emit: versions_cooler, topic: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def nproc = args.contains('pairix') || args.contains('tabix')? "--nproc $task.cpus" : '' - + def nproc = mode in ["pairix", "tabix"] ? "--nproc ${task.cpus}" : "" """ - cooler cload \\ - $args \\ - $nproc \\ + cooler cload ${mode} \\ + ${args} \\ + ${nproc} \\ ${chromsizes}:${cool_bin} \\ - $pairs \\ + ${contacts} \\ ${prefix}.cool - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.cool - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS """ } diff --git a/modules/nf-core/cooler/cload/meta.yml b/modules/nf-core/cooler/cload/meta.yml index fa5474ae..e7a79b15 100644 --- a/modules/nf-core/cooler/cload/meta.yml +++ b/modules/nf-core/cooler/cload/meta.yml @@ -13,41 +13,73 @@ tools: tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" licence: ["BSD-3-clause"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - pairs: - type: file - description: Path to contacts (i.e. read pairs) file. - - index: - type: file - description: Path to index file of the contacts. - - cool_bin: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - contacts: + type: file + description: Path to contacts (e.g. read pairs, pairix, tabix) file. + ontologies: + - edam: http://edamontology.org/format_3475 # TSV + - index: + type: file + description: Path to index file of the contacts. + ontologies: + - edam: http://edamontology.org/format_3475 # TSV + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - chromsizes: + type: file + description: Path to a chromsizes file. + ontologies: + - edam: http://edamontology.org/format_3475 # TSV + - mode: type: integer - description: Bins size in bp - - chromsizes: - type: file - description: Path to a chromsizes file. -output: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - version: - type: file - description: File containing software version - pattern: "versions.yml" - - cool: - type: file - description: Output COOL file path - pattern: "*.cool" + Input mode for cooler cload - one of pairs, pairix, tabix - cool_bin: type: integer description: Bins size in bp +output: + cool: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.cool": + type: file + description: Output COOL file path + pattern: "*.cool" + ontologies: [] + versions_cooler: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool authors: - "@jianhong" - "@muffato" diff --git a/modules/nf-core/cooler/cload/tests/main.nf.test b/modules/nf-core/cooler/cload/tests/main.nf.test new file mode 100644 index 00000000..7ee4ec86 --- /dev/null +++ b/modules/nf-core/cooler/cload/tests/main.nf.test @@ -0,0 +1,167 @@ +nextflow_process { + + name "Test Process COOLER_CLOAD" + config "./nextflow.config" + script "../main.nf" + process "COOLER_CLOAD" + + tag "modules" + tag "modules_nfcore" + tag "cooler" + tag "cooler/cload" + tag "cooler/dump" + + test("test_cooler_cload_pairix") { + when { + + params { + module_args = "" + } + + process { + """ + input[0] = [ + [id:'test_pairix', single_end:false],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2', checkIfExists:true) + ] + input[1] = [ + [id:'test_pairix', single_end:false], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes', checkIfExists:true) + ] + input[2] = "pairix" + input[3] = 2000000 + """ + } + } + + then { + + assertAll( + { assert process.success }, + { assert snapshot( + process.out.findAll { key, val -> key.startsWith("versions")}, + process.out.cool.collect{file(it[1]).name} + ).match() } + ) + + } + } + + + test("test_cooler_cload_pairs") { + + when { + + params { + module_args = '--chrom1 1 --pos1 2 --chrom2 4 --pos2 5 -N' + } + + process { + """ + input[0] = [ + [id:'test_pairs', single_end:false],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.sample1.pairs', checkIfExists:true), + [] + ] + input[1] = [ + [id:'test_pairs', single_end:false], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes', checkIfExists:true) + ] + input[2] = "pairs" + input[3] = 2000000 + """ + } + } + + then { + + assertAll( + { assert process.success }, + { assert snapshot( + process.out.findAll { key, val -> key.startsWith("versions")}, + process.out.cool.collect{file(it[1]).name} + ).match() } + ) + + } + } + + + test("test_cooler_cload_tabix") { + + when { + + params { + module_args = "" + } + + process { + """ + input[0] = [ + [id:'test_tabix', single_end:false],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz.tbi', checkIfExists:true) + ] + input[1] = [ + [id:'test_tabix', single_end:false], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes',checkIfExists:true) + ] + input[2] = "tabix" + input[3] = 2000000 + """ + } + } + + then { + + assertAll( + { assert process.success }, + { assert snapshot( + process.out.findAll { key, val -> key.startsWith("versions")}, + process.out.cool.collect{file(it[1]).name} + ).match() } + ) + + } + + } + + + test("test_cooler_cload_pairix - stub") { + + options '-stub' + + when { + + params { + module_args = "" + } + + process { + """ + input[0] = [ + [id:'test_pairix', single_end:false],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2', checkIfExists:true) + ] + input[1] = [ + [id:'test_pairix', single_end:false], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes', checkIfExists:true) + ] + input[2] = "pairix" + input[3] = 2000000 + """ + } + } + + then { + + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + + } + } +} diff --git a/modules/nf-core/cooler/cload/tests/main.nf.test.snap b/modules/nf-core/cooler/cload/tests/main.nf.test.snap new file mode 100644 index 00000000..80476396 --- /dev/null +++ b/modules/nf-core/cooler/cload/tests/main.nf.test.snap @@ -0,0 +1,108 @@ +{ + "test_cooler_cload_pairs": { + "content": [ + { + "versions_cooler": [ + [ + "COOLER_CLOAD", + "cooler", + "0.10.4" + ] + ] + }, + [ + "test_pairs.cool" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:57:13.675799" + }, + "test_cooler_cload_tabix": { + "content": [ + { + "versions_cooler": [ + [ + "COOLER_CLOAD", + "cooler", + "0.10.4" + ] + ] + }, + [ + "test_tabix.cool" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:57:23.827346" + }, + "test_cooler_cload_pairix": { + "content": [ + { + "versions_cooler": [ + [ + "COOLER_CLOAD", + "cooler", + "0.10.4" + ] + ] + }, + [ + "test_pairix.cool" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:57:05.111461" + }, + "test_cooler_cload_pairix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_pairix", + "single_end": false + }, + "test_pairix.cool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "COOLER_CLOAD", + "cooler", + "0.10.4" + ] + ], + "cool": [ + [ + { + "id": "test_pairix", + "single_end": false + }, + "test_pairix.cool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_cooler": [ + [ + "COOLER_CLOAD", + "cooler", + "0.10.4" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:57:29.005184" + } +} \ No newline at end of file diff --git a/modules/nf-core/cooler/cload/tests/nextflow.config b/modules/nf-core/cooler/cload/tests/nextflow.config new file mode 100644 index 00000000..095becee --- /dev/null +++ b/modules/nf-core/cooler/cload/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: "COOLER_CLOAD" { + ext.args = params.module_args + } +} diff --git a/modules/nf-core/cooler/dump/environment.yml b/modules/nf-core/cooler/dump/environment.yml index b4d88e92..4cb91d27 100644 --- a/modules/nf-core/cooler/dump/environment.yml +++ b/modules/nf-core/cooler/dump/environment.yml @@ -1,7 +1,7 @@ -name: cooler_dump +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::cooler=0.9.2 + - bioconda::cooler=0.10.3 diff --git a/modules/nf-core/cooler/dump/main.nf b/modules/nf-core/cooler/dump/main.nf index 3bb6162c..ea179835 100644 --- a/modules/nf-core/cooler/dump/main.nf +++ b/modules/nf-core/cooler/dump/main.nf @@ -4,32 +4,33 @@ process COOLER_DUMP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cooler:0.9.2--pyh7cba7a3_0' : - 'biocontainers/cooler:0.9.2--pyh7cba7a3_0' }" + 'https://depot.galaxyproject.org/singularity/cooler:0.10.3--pyhdfd78af_0' : + 'biocontainers/cooler:0.10.3--pyhdfd78af_0' }" input: tuple val(meta), path(cool), val(resolution) output: tuple val(meta), path("*.bedpe"), emit: bedpe - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('cooler'), eval('cooler --version 2>&1 | sed "s/cooler, version //"'), emit: versions_cooler, topic: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = resolution ? "::/resolutions/$resolution" : "" + def suffix = resolution ? "::/resolutions/$resolution" : "" """ cooler dump \\ - $args \\ + ${args} \\ -o ${prefix}.bedpe \\ - $cool$suffix + ${cool}${suffix} + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bedpe """ } diff --git a/modules/nf-core/cooler/dump/meta.yml b/modules/nf-core/cooler/dump/meta.yml index 2f882aeb..c77992c3 100644 --- a/modules/nf-core/cooler/dump/meta.yml +++ b/modules/nf-core/cooler/dump/meta.yml @@ -12,33 +12,54 @@ tools: tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" licence: ["BSD-3-Clause"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - cool: - type: file - description: Path to COOL file - pattern: "*.{cool,mcool}" - - resolution: - type: integer - description: Resolution + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool,mcool}" + ontologies: [] + - resolution: + type: integer + description: Resolution 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" - - bedpe: - type: file - description: Output text file - pattern: "*.bedpe" + bedpe: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bedpe": + type: file + description: Output text file + pattern: "*.bedpe" + ontologies: [] + versions_cooler: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool authors: - "@jianhong" - "@muffato" diff --git a/modules/nf-core/cooler/dump/tests/main.nf.test b/modules/nf-core/cooler/dump/tests/main.nf.test new file mode 100644 index 00000000..2fdf1a72 --- /dev/null +++ b/modules/nf-core/cooler/dump/tests/main.nf.test @@ -0,0 +1,53 @@ + +nextflow_process { + + name "Test Process COOLER_DUMP" + script "../main.nf" + process "COOLER_DUMP" + + tag "modules" + tag "modules_nfcore" + tag "cooler" + tag "cooler/dump" + + test("test-cooler-dump") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file("https://raw.githubusercontent.com/open2c/cooler/master/tests/data/toy.asymm.16.cool", checkIfExists: true), + [:] // resolution if any + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } + + test("test-cooler-dump-stub") { + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file("https://raw.githubusercontent.com/open2c/cooler/master/tests/data/toy.asymm.16.cool", checkIfExists: true), + [:] // resolution if any + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } +} diff --git a/modules/nf-core/cooler/dump/tests/main.nf.test.snap b/modules/nf-core/cooler/dump/tests/main.nf.test.snap new file mode 100644 index 00000000..644ea24d --- /dev/null +++ b/modules/nf-core/cooler/dump/tests/main.nf.test.snap @@ -0,0 +1,84 @@ +{ + "test-cooler-dump-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bedpe:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "COOLER_DUMP", + "cooler", + "0.10.3" + ] + ], + "bedpe": [ + [ + { + "id": "test" + }, + "test.bedpe:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_cooler": [ + [ + "COOLER_DUMP", + "cooler", + "0.10.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:58:21.563411" + }, + "test-cooler-dump": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bedpe:md5,38e9b0b8cc74f55a15e8ab01023048bd" + ] + ], + "1": [ + [ + "COOLER_DUMP", + "cooler", + "0.10.3" + ] + ], + "bedpe": [ + [ + { + "id": "test" + }, + "test.bedpe:md5,38e9b0b8cc74f55a15e8ab01023048bd" + ] + ], + "versions_cooler": [ + [ + "COOLER_DUMP", + "cooler", + "0.10.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:58:14.616531" + } +} \ No newline at end of file diff --git a/modules/nf-core/cooler/makebins/environment.yml b/modules/nf-core/cooler/makebins/environment.yml index e48b3a17..0a8647f5 100644 --- a/modules/nf-core/cooler/makebins/environment.yml +++ b/modules/nf-core/cooler/makebins/environment.yml @@ -1,7 +1,7 @@ -name: cooler_makebins +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::cooler=0.9.2 + - bioconda::cooler=0.10.4 diff --git a/modules/nf-core/cooler/makebins/main.nf b/modules/nf-core/cooler/makebins/main.nf index 8a415567..764eec5e 100644 --- a/modules/nf-core/cooler/makebins/main.nf +++ b/modules/nf-core/cooler/makebins/main.nf @@ -1,18 +1,18 @@ process COOLER_MAKEBINS { - tag "${meta.id}}" + tag "${meta.id}" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cooler:0.9.2--pyh7cba7a3_0' : - 'biocontainers/cooler:0.9.2--pyh7cba7a3_0' }" + 'https://depot.galaxyproject.org/singularity/cooler:0.10.4--pyhdfd78af_0' : + 'biocontainers/cooler:0.10.4--pyhdfd78af_0' }" input: tuple val(meta), path(chromsizes), val(cool_bin) output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('cooler'), eval('cooler --version 2>&1 | sed "s/cooler, version //"'), emit: versions_cooler, topic: versions when: task.ext.when == null || task.ext.when @@ -25,10 +25,11 @@ process COOLER_MAKEBINS { $args \\ ${chromsizes} \\ ${cool_bin} > ${prefix}.bed + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bed """ } diff --git a/modules/nf-core/cooler/makebins/meta.yml b/modules/nf-core/cooler/makebins/meta.yml index 16e2c598..6acde891 100644 --- a/modules/nf-core/cooler/makebins/meta.yml +++ b/modules/nf-core/cooler/makebins/meta.yml @@ -12,22 +12,51 @@ tools: tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" licence: ["BSD-3-Clause"] + identifier: "" input: - - chromsize: - type: file - description: Path to chromosome size file - - cool_bin: - type: integer - description: Resolution (bin size) in base pairs + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - chromsizes: + type: file + description: Path to a chromsizes file. + ontologies: [] + - cool_bin: + type: integer + description: Resolution (bin size) in base pairs output: - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - bed: - type: file - description: Genome segmentation at a fixed resolution as a BED file. - pattern: "*.bed" + bed: + - - meta: + type: map + description: Groovy Map containing sample information + - "*.bed": + type: file + description: Genome segmentation at a fixed resolution as a BED file. + pattern: "*.bed" + ontologies: [] + versions_cooler: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool authors: - "@nservant" - "@muffato" diff --git a/modules/nf-core/cooler/makebins/tests/main.nf.test b/modules/nf-core/cooler/makebins/tests/main.nf.test new file mode 100644 index 00000000..dc058bd1 --- /dev/null +++ b/modules/nf-core/cooler/makebins/tests/main.nf.test @@ -0,0 +1,59 @@ + +nextflow_process { + + name "Test Process COOLER_MAKEBINS" + script "../main.nf" + process "COOLER_MAKEBINS" + + tag "modules" + tag "modules_nfcore" + tag "cooler" + tag "cooler/makebins" + + test("test-cooler-makebins") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes', checkIfExists: true), + "1000000" + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-cooler-makebins - stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes', checkIfExists: true), + "1000000" + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/cooler/makebins/tests/main.nf.test.snap b/modules/nf-core/cooler/makebins/tests/main.nf.test.snap new file mode 100644 index 00000000..91c795f0 --- /dev/null +++ b/modules/nf-core/cooler/makebins/tests/main.nf.test.snap @@ -0,0 +1,84 @@ +{ + "test-cooler-makebins - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "COOLER_MAKEBINS", + "cooler", + "0.10.4" + ] + ], + "bed": [ + [ + { + "id": "test" + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_cooler": [ + [ + "COOLER_MAKEBINS", + "cooler", + "0.10.4" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:58:34.746836" + }, + "test-cooler-makebins": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,99e887ba1237ebcdcf31954476ab0adf" + ] + ], + "1": [ + [ + "COOLER_MAKEBINS", + "cooler", + "0.10.4" + ] + ], + "bed": [ + [ + { + "id": "test" + }, + "test.bed:md5,99e887ba1237ebcdcf31954476ab0adf" + ] + ], + "versions_cooler": [ + [ + "COOLER_MAKEBINS", + "cooler", + "0.10.4" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:58:29.59093" + } +} \ No newline at end of file diff --git a/modules/nf-core/cooler/zoomify/environment.yml b/modules/nf-core/cooler/zoomify/environment.yml index 2288f376..be496d89 100644 --- a/modules/nf-core/cooler/zoomify/environment.yml +++ b/modules/nf-core/cooler/zoomify/environment.yml @@ -1,7 +1,8 @@ -name: cooler_zoomify +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::cooler=0.9.2 + - bioconda::cooler=0.10.4 + - conda-forge::numpy=1.26.4 diff --git a/modules/nf-core/cooler/zoomify/main.nf b/modules/nf-core/cooler/zoomify/main.nf index f9933dff..b2a5b2b7 100644 --- a/modules/nf-core/cooler/zoomify/main.nf +++ b/modules/nf-core/cooler/zoomify/main.nf @@ -4,15 +4,15 @@ process COOLER_ZOOMIFY { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cooler:0.9.2--pyh7cba7a3_0' : - 'biocontainers/cooler:0.9.2--pyh7cba7a3_0' }" + 'https://depot.galaxyproject.org/singularity/cooler:0.10.4--pyhdfd78af_0' : + 'biocontainers/cooler:0.10.4--pyhdfd78af_0' }" input: tuple val(meta), path(cool) output: tuple val(meta), path("*.mcool"), emit: mcool - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('cooler'), eval('cooler --version 2>&1 | sed "s/cooler, version //"'), emit: versions_cooler, topic: versions when: task.ext.when == null || task.ext.when @@ -26,21 +26,11 @@ process COOLER_ZOOMIFY { -n $task.cpus \\ -o ${prefix}.mcool \\ $cool - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.mcool - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') - END_VERSIONS """ } diff --git a/modules/nf-core/cooler/zoomify/meta.yml b/modules/nf-core/cooler/zoomify/meta.yml index d87aaf29..4bfc50ce 100644 --- a/modules/nf-core/cooler/zoomify/meta.yml +++ b/modules/nf-core/cooler/zoomify/meta.yml @@ -12,30 +12,51 @@ tools: tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" licence: ["BSD-3-clause"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - cool: - type: file - description: Path to COOL file - pattern: "*.{cool,mcool}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool,mcool}" + ontologies: [] 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" - - mcool: - type: file - description: Output mcool file - pattern: "*.mcool" + mcool: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.mcool": + type: file + description: Output mcool file + pattern: "*.mcool" + ontologies: [] + versions_cooler: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - cooler: + type: string + description: The name of the tool + - cooler --version 2>&1 | sed "s/cooler, version //": + type: eval + description: The expression to obtain the version of the tool authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/cooler/zoomify/tests/main.nf.test b/modules/nf-core/cooler/zoomify/tests/main.nf.test new file mode 100644 index 00000000..bc8ae4c1 --- /dev/null +++ b/modules/nf-core/cooler/zoomify/tests/main.nf.test @@ -0,0 +1,64 @@ +nextflow_process { + + name "Test Process COOLER_ZOOMIFY" + config "./nextflow.config" + script "../main.nf" + process "COOLER_ZOOMIFY" + + tag "modules" + tag "modules_nfcore" + tag "cooler" + tag "cooler/zoomify" + + test("test_cooler_zoomify") { + + when { + params { + module_args = '-r 2,4,8' + } + process { + """ + input[0] = [ + [id:'test'],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool', checkIfExists:true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.findAll { key, val -> key.startsWith("versions")}, + process.out.mcool.collect{ file(it[1]).name } + ).match() } + ) + } + } + + + test("test_cooler_zoomify -- stub") { + + options '-stub' + + when { + params { + module_args = '-r 2,4,8' + } + process { + """ + input[0] = [ + [id:'test'],// meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool', checkIfExists:true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/cooler/zoomify/tests/main.nf.test.snap b/modules/nf-core/cooler/zoomify/tests/main.nf.test.snap new file mode 100644 index 00000000..5d5a207b --- /dev/null +++ b/modules/nf-core/cooler/zoomify/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "test_cooler_zoomify -- stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.mcool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "COOLER_ZOOMIFY", + "cooler", + "0.10.4" + ] + ], + "mcool": [ + [ + { + "id": "test" + }, + "test.mcool:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_cooler": [ + [ + "COOLER_ZOOMIFY", + "cooler", + "0.10.4" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:59:02.183744" + }, + "test_cooler_zoomify": { + "content": [ + { + "versions_cooler": [ + [ + "COOLER_ZOOMIFY", + "cooler", + "0.10.4" + ] + ] + }, + [ + "test.mcool" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T12:58:56.885229" + } +} \ No newline at end of file diff --git a/modules/nf-core/cooler/zoomify/tests/nextflow.config b/modules/nf-core/cooler/zoomify/tests/nextflow.config new file mode 100644 index 00000000..606da9f6 --- /dev/null +++ b/modules/nf-core/cooler/zoomify/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: "COOLER_ZOOMIFY" { + ext.args = params.module_args + } +} diff --git a/modules/nf-core/custom/getchromsizes/environment.yml b/modules/nf-core/custom/getchromsizes/environment.yml deleted file mode 100644 index 2ecd0128..00000000 --- a/modules/nf-core/custom/getchromsizes/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: custom_getchromsizes -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 diff --git a/modules/nf-core/custom/getchromsizes/main.nf b/modules/nf-core/custom/getchromsizes/main.nf deleted file mode 100644 index 3edf7c22..00000000 --- a/modules/nf-core/custom/getchromsizes/main.nf +++ /dev/null @@ -1,47 +0,0 @@ -process CUSTOM_GETCHROMSIZES { - tag "$fasta" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" - - input: - tuple val(meta), path(fasta) - - output: - tuple val(meta), path ("*.sizes"), emit: sizes - tuple val(meta), path ("*.fai") , emit: fai - tuple val(meta), path ("*.gzi") , emit: gzi, optional: true - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - """ - samtools faidx $fasta - cut -f 1,2 ${fasta}.fai > ${fasta}.sizes - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ - - stub: - """ - touch ${fasta}.fai - touch ${fasta}.sizes - if [[ "${fasta.extension}" == "gz" ]]; then - touch ${fasta}.gzi - fi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ -} diff --git a/modules/nf-core/custom/getchromsizes/meta.yml b/modules/nf-core/custom/getchromsizes/meta.yml deleted file mode 100644 index 529be07e..00000000 --- a/modules/nf-core/custom/getchromsizes/meta.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: custom_getchromsizes -description: Generates a FASTA file of chromosome sizes and a fasta index file -keywords: - - fasta - - chromosome - - indexing -tools: - - samtools: - description: Tools for dealing with SAM, BAM and CRAM files - homepage: http://www.htslib.org/ - documentation: http://www.htslib.org/doc/samtools.html - tool_dev_url: https://github.com/samtools/samtools - doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] -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,fna,fas}" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - sizes: - type: file - description: File containing chromosome lengths - pattern: "*.{sizes}" - - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" - - gzi: - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@tamara-hodgetts" - - "@chris-cheshire" - - "@muffato" -maintainers: - - "@tamara-hodgetts" - - "@chris-cheshire" - - "@muffato" diff --git a/modules/nf-core/custom/getchromsizes/tests/main.nf.test b/modules/nf-core/custom/getchromsizes/tests/main.nf.test deleted file mode 100644 index 2f741a4b..00000000 --- a/modules/nf-core/custom/getchromsizes/tests/main.nf.test +++ /dev/null @@ -1,99 +0,0 @@ -nextflow_process { - - name "Test Process CUSTOM_GETCHROMSIZES" - script "../main.nf" - process "CUSTOM_GETCHROMSIZES" - - tag "modules" - tag "modules_nfcore" - tag "custom" - tag "custom/getchromsizes" - - test("test_custom_getchromsizes") { - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_custom_getchromsizes_bgzip") { - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_custom_getchromsizes - stub") { - - options "-stub" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_custom_getchromsizes_bgzip - stub") { - - options "-stub" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } -} diff --git a/modules/nf-core/custom/getchromsizes/tests/tags.yml b/modules/nf-core/custom/getchromsizes/tests/tags.yml deleted file mode 100644 index d89a805f..00000000 --- a/modules/nf-core/custom/getchromsizes/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/getchromsizes: - - modules/nf-core/custom/getchromsizes/** diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 23e16634..f5629527 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -1,6 +1,6 @@ process FASTQC { tag "${meta.id}" - label 'process_medium' + label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -11,9 +11,9 @@ process FASTQC { tuple val(meta), path(reads) output: - tuple val(meta), path("*.html"), emit: html - tuple val(meta), path("*.zip") , emit: zip - path "versions.yml" , emit: versions + tuple val(meta) , path("*.html") , emit: html + tuple val(meta) , path("*.zip") , emit: zip + tuple val("${task.process}"), val('fastqc'), eval('fastqc --version | sed "/FastQC v/!d; s/.*v//"'), emit: versions_fastqc, topic: versions when: task.ext.when == null || task.ext.when @@ -43,11 +43,6 @@ process FASTQC { --threads ${task.cpus} \\ --memory ${fastqc_memory} \\ ${renamed_files} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) - END_VERSIONS """ stub: @@ -55,10 +50,5 @@ process FASTQC { """ touch ${prefix}.html touch ${prefix}.zip - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) - END_VERSIONS """ } diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index c8d9d025..49164c88 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -53,13 +53,28 @@ output: description: FastQC report archive pattern: "*_{fastqc.zip}" ontologies: [] + versions_fastqc: + - - ${task.process}: + type: string + description: The process the versions were collected from + - fastqc: + type: string + description: The tool name + - fastqc --version | sed "/FastQC v/!d; s/.*v//": + type: eval + description: The expression to obtain the version of the tool + +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - - ${task.process}: + type: string + description: The process the versions were collected from + - fastqc: + type: string + description: The tool name + - fastqc --version | sed "/FastQC v/!d; s/.*v//": + type: eval + description: The expression to obtain the version of the tool authors: - "@drpatelh" - "@grst" @@ -70,3 +85,27 @@ maintainers: - "@grst" - "@ewels" - "@FelixKrueger" +containers: + conda: + linux_amd64: + lock_file: https://wave.seqera.io/v1alpha1/builds/bd-af7a5314d5015c29_1/condalock + linux_arm64: + lock_file: https://wave.seqera.io/v1alpha1/builds/bd-df99cb252670875a_2/condalock + docker: + linux_amd64: + build_id: bd-af7a5314d5015c29_1 + name: community.wave.seqera.io/library/fastqc:0.12.1--af7a5314d5015c29 + scanId: sc-a618548acbee5a8a_30 + linux_arm64: + build_id: bd-df99cb252670875a_2 + name: community.wave.seqera.io/library/fastqc:0.12.1--df99cb252670875a + scanId: sc-b5913ed5d42b22d2_18 + singularity: + linux_amd64: + build_id: bd-104d26ddd9519960_1 + name: oras://community.wave.seqera.io/library/fastqc:0.12.1--104d26ddd9519960 + https: https://community.wave.seqera.io/v2/library/fastqc/blobs/sha256:e0c976cb2eca5fee72618a581537a4f8ea42fcae24c9b201e2e0f764fd28648a + linux_arm64: + build_id: bd-d56b505a93aef38a_1 + name: oras://community.wave.seqera.io/library/fastqc:0.12.1--d56b505a93aef38a + https: https://community.wave.seqera.io/v2/library/fastqc/blobs/sha256:fd39534bf298698cbe3ee4d4a6f1e73330ec4bca44c38dd9a4d06cb5ea838017 diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index e9d79a07..66c44da9 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -30,7 +30,7 @@ nextflow_process { { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } @@ -58,7 +58,7 @@ nextflow_process { { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } @@ -82,7 +82,7 @@ nextflow_process { { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } @@ -106,7 +106,7 @@ nextflow_process { { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } @@ -142,7 +142,7 @@ nextflow_process { { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } @@ -166,7 +166,7 @@ nextflow_process { { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out).findAll { key, val -> key != 'html' && key != 'zip' }).match() } ) } } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index d5db3092..c8ee120f 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,15 +1,21 @@ { "sarscov2 custom_prefix": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:16.374038" + "timestamp": "2025-10-28T16:39:14.518503" }, "sarscov2 single-end [fastq] - stub": { "content": [ @@ -33,7 +39,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -44,8 +54,12 @@ "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -59,10 +73,10 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:24.993809" + "timestamp": "2025-10-28T16:39:19.309008" }, "sarscov2 custom_prefix - stub": { "content": [ @@ -86,7 +100,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -97,8 +115,12 @@ "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -112,58 +134,82 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:03:10.93942" + "timestamp": "2025-10-28T16:39:44.94888" }, "sarscov2 interleaved [fastq]": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:01:42.355718" + "timestamp": "2025-10-28T16:38:45.168496" }, "sarscov2 paired-end [bam]": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:01:53.276274" + "timestamp": "2025-10-28T16:38:53.268919" }, "sarscov2 multiple [fastq]": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:05.527626" + "timestamp": "2025-10-28T16:39:05.050305" }, "sarscov2 paired-end [fastq]": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:01:31.188871" + "timestamp": "2025-10-28T16:38:37.2373" }, "sarscov2 paired-end [fastq] - stub": { "content": [ @@ -187,7 +233,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -198,8 +248,12 @@ "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -213,10 +267,10 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:34.273566" + "timestamp": "2025-10-28T16:39:24.450398" }, "sarscov2 multiple [fastq] - stub": { "content": [ @@ -240,7 +294,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -251,8 +309,12 @@ "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -266,22 +328,28 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:03:02.304411" + "timestamp": "2025-10-28T16:39:39.758762" }, "sarscov2 single-end [fastq]": { "content": [ - [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:01:19.095607" + "timestamp": "2025-10-28T16:38:29.555068" }, "sarscov2 interleaved [fastq] - stub": { "content": [ @@ -305,7 +373,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -316,8 +388,12 @@ "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -331,10 +407,10 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:44.640184" + "timestamp": "2025-10-28T16:39:29.193136" }, "sarscov2 paired-end [bam] - stub": { "content": [ @@ -358,7 +434,11 @@ ] ], "2": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "html": [ [ @@ -369,8 +449,12 @@ "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + "versions_fastqc": [ + [ + "FASTQC", + "fastqc", + "0.12.1" + ] ], "zip": [ [ @@ -384,9 +468,9 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "25.10.0" }, - "timestamp": "2024-07-22T11:02:53.550742" + "timestamp": "2025-10-28T16:39:34.144919" } } \ No newline at end of file diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index d02016a0..009874d4 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::multiqc=1.32 + - bioconda::multiqc=1.33 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index c1158fb0..5376aea1 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -1,24 +1,21 @@ process MULTIQC { + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/8c/8c6c120d559d7ee04c7442b61ad7cf5a9e8970be5feefb37d68eeaa60c1034eb/data' : - 'community.wave.seqera.io/library/multiqc:1.32--d58f60e4deb769bf' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/34/34e733a9ae16a27e80fe00f863ea1479c96416017f24a907996126283e7ecd4d/data' + : 'community.wave.seqera.io/library/multiqc:1.33--ee7739d47738383b'}" input: - path multiqc_files, stageAs: "?/*" - path(multiqc_config) - path(extra_multiqc_config) - path(multiqc_logo) - path(replace_names) - path(sample_names) + tuple val(meta), path(multiqc_files, stageAs: "?/*"), path(multiqc_config, stageAs: "?/*"), path(multiqc_logo), path(replace_names), path(sample_names) output: - path "*multiqc_report.html", emit: report - path "*_data" , emit: data - path "*_plots" , optional:true, emit: plots - path "versions.yml" , emit: versions + tuple val(meta), path("*.html"), emit: report + tuple val(meta), path("*_data"), emit: data + tuple val(meta), path("*_plots"), emit: plots, optional: true + // MultiQC should not push its versions to the `versions` topic. Its input depends on the versions topic to be resolved thus outputting to the topic will let the pipeline hang forever + tuple val("${task.process}"), val('multiqc'), eval('multiqc --version | sed "s/.* //g"'), emit: versions when: task.ext.when == null || task.ext.when @@ -26,38 +23,28 @@ process MULTIQC { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : '' - def config = multiqc_config ? "--config $multiqc_config" : '' - def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' + def config = multiqc_config ? multiqc_config instanceof List ? "--config ${multiqc_config.join(' --config ')}" : "--config ${multiqc_config}" : "" def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' def replace = replace_names ? "--replace-names ${replace_names}" : '' def samples = sample_names ? "--sample-names ${sample_names}" : '' """ multiqc \\ --force \\ - $args \\ - $config \\ - $prefix \\ - $extra_config \\ - $logo \\ - $replace \\ - $samples \\ + ${args} \\ + ${config} \\ + ${prefix} \\ + ${logo} \\ + ${replace} \\ + ${samples} \\ . - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) - END_VERSIONS """ stub: """ mkdir multiqc_data + touch multiqc_data/.stub mkdir multiqc_plots + touch multiqc_plots/.stub touch multiqc_report.html - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) - END_VERSIONS """ } diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index ce30eb73..ef434a9a 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,6 +1,6 @@ name: multiqc -description: Aggregate results from bioinformatics analyses across many samples into - a single report +description: Aggregate results from bioinformatics analyses across many samples + into a single report keywords: - QC - bioinformatics tools @@ -12,74 +12,91 @@ tools: It's a general use tool, perfect for summarising the output from numerous bioinformatics tools. homepage: https://multiqc.info/ documentation: https://multiqc.info/docs/ - licence: ["GPL-3.0-or-later"] + licence: + - "GPL-3.0-or-later" identifier: biotools:multiqc input: - - multiqc_files: - type: file - description: | - List of reports / files recognised by MultiQC, for example the html and zip output of FastQC - ontologies: [] - - multiqc_config: - type: file - description: Optional config yml for MultiQC - pattern: "*.{yml,yaml}" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML - - extra_multiqc_config: - type: file - description: Second optional config yml for MultiQC. Will override common sections - in multiqc_config. - pattern: "*.{yml,yaml}" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML - - multiqc_logo: - type: file - description: Optional logo file for MultiQC - pattern: "*.{png}" - ontologies: [] - - replace_names: - type: file - description: | - Optional two-column sample renaming file. First column a set of - patterns, second column a set of corresponding replacements. Passed via - MultiQC's `--replace-names` option. - pattern: "*.{tsv}" - ontologies: - - edam: http://edamontology.org/format_3475 # TSV - - sample_names: - type: file - description: | - Optional TSV file with headers, passed to the MultiQC --sample_names - argument. - pattern: "*.{tsv}" - ontologies: - - edam: http://edamontology.org/format_3475 # TSV -output: - report: - - "*multiqc_report.html": + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1', single_end:false ] + - multiqc_files: type: file - description: MultiQC report file - pattern: "multiqc_report.html" + description: | + List of reports / files recognised by MultiQC, for example the html and zip output of FastQC ontologies: [] - data: - - "*_data": - type: directory - description: MultiQC data dir - pattern: "multiqc_data" - plots: - - "*_plots": + - multiqc_config: + type: file + description: Optional config yml for MultiQC + pattern: "*.{yml,yaml}" + ontologies: + - edam: http://edamontology.org/format_3750 + - multiqc_logo: type: file - description: Plots created by MultiQC - pattern: "*_data" + description: Optional logo file for MultiQC + pattern: "*.{png}" ontologies: [] - versions: - - versions.yml: + - replace_names: + type: file + description: | + Optional two-column sample renaming file. First column a set of + patterns, second column a set of corresponding replacements. Passed via + MultiQC's `--replace-names` option. + pattern: "*.{tsv}" + ontologies: + - edam: http://edamontology.org/format_3475 + - sample_names: type: file - description: File containing software versions - pattern: "versions.yml" + description: | + Optional TSV file with headers, passed to the MultiQC --sample_names + argument. + pattern: "*.{tsv}" ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - edam: http://edamontology.org/format_3475 +output: + report: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1', single_end:false ] + - "*.html": + type: file + description: MultiQC report file + pattern: ".html" + ontologies: [] + data: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1', single_end:false ] + - "*_data": + type: directory + description: MultiQC data dir + pattern: "multiqc_data" + plots: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1', single_end:false ] + - "*_plots": + type: file + description: Plots created by MultiQC + pattern: "*_plots" + ontologies: [] + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - multiqc: + type: string + description: The tool name + - multiqc --version | sed "s/.* //g": + type: eval + description: The expression to obtain the version of the tool authors: - "@abhi18av" - "@bunop" @@ -90,3 +107,27 @@ maintainers: - "@bunop" - "@drpatelh" - "@jfy133" +containers: + conda: + linux/amd64: + lock_file: https://wave.seqera.io/v1alpha1/builds/bd-ee7739d47738383b_1/condalock + linux/arm64: + lock_file: https://wave.seqera.io/v1alpha1/builds/bd-58d7dee710ab3aa8_1/condalock + docker: + linux/amd64: + build_id: bd-ee7739d47738383b_1 + name: community.wave.seqera.io/library/multiqc:1.33--ee7739d47738383b + scanId: sc-6ddec592dcadd583_4 + linux/arm64: + build_id: bd-58d7dee710ab3aa8_1 + name: community.wave.seqera.io/library/multiqc:1.33--58d7dee710ab3aa8 + scanId: sc-a04c42273e34c55c_2 + singularity: + linux/amd64: + build_id: bd-e3576ddf588fa00d_1 + https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/34/34e733a9ae16a27e80fe00f863ea1479c96416017f24a907996126283e7ecd4d/data + name: oras://community.wave.seqera.io/library/multiqc:1.33--e3576ddf588fa00d + linux/arm64: + build_id: bd-2537ca5f8445e3c2_1 + https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/78/78b89e91d89e9cc99ad5ade5be311f347838cb2acbfb4f13bc343b170be09ce4/data + name: oras://community.wave.seqera.io/library/multiqc:1.33--2537ca5f8445e3c2 diff --git a/modules/nf-core/multiqc/tests/custom_prefix.config b/modules/nf-core/multiqc/tests/custom_prefix.config new file mode 100644 index 00000000..b30b1358 --- /dev/null +++ b/modules/nf-core/multiqc/tests/custom_prefix.config @@ -0,0 +1,5 @@ +process { + withName: 'MULTIQC' { + ext.prefix = "custom_prefix" + } +} diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test index 33316a7d..0e422eaa 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test +++ b/modules/nf-core/multiqc/tests/main.nf.test @@ -15,25 +15,58 @@ nextflow_process { when { process { """ - input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) - input[1] = [] - input[2] = [] - input[3] = [] - input[4] = [] - input[5] = [] + input[0] = channel.of([ + [ id: 'FASTQC' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true), + [], + [], + [], + [] + ]) """ } } then { + assert process.success assertAll( - { assert process.success }, - { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, - { assert process.out.data[0] ==~ ".*/multiqc_data" }, - { assert snapshot(process.out.versions).match("multiqc_versions_single") } + { assert snapshot( + file(process.out.report[0][1]).name, + file(process.out.data[0][1]).name, + process.out.findAll { key, val -> key.startsWith("versions") + }).match() } ) } + } + + test("sarscov2 single-end [fastqc] - custom prefix") { + config "./custom_prefix.config" + + when { + process { + """ + input[0] = channel.of([ + [ id: 'FASTQC' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true), + [], + [], + [], + [] + ]) + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.report[0][1]).name, + file(process.out.data[0][1]).name, + process.out.findAll { key, val -> key.startsWith("versions") + }).match() } + ) + } } test("sarscov2 single-end [fastqc] [config]") { @@ -41,22 +74,60 @@ nextflow_process { when { process { """ - input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) - input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) - input[2] = [] - input[3] = [] - input[4] = [] - input[5] = [] + input[0] = channel.of([ + [ id: 'FASTQC' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true), + file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true), + [], + [], + [] + ]) + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.report[0][1]).name, + file(process.out.data[0][1]).name, + file(process.out.plots[0][1]).name, + process.out.findAll { key, val -> key.startsWith("versions") + }).match() } + ) + } + } + + test("sarscov2 single-end [fastqc] [multiple configs]") { + + when { + process { + """ + input[0] = channel.of([ + [ id: 'FASTQC' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true), + [ + file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true), + file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true) + ], + [], + [], + [] + ]) """ } } then { + assert process.success assertAll( - { assert process.success }, - { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, - { assert process.out.data[0] ==~ ".*/multiqc_data" }, - { assert snapshot(process.out.versions).match("multiqc_versions_config") } + { assert snapshot( + file(process.out.report[0][1]).name, + file(process.out.data[0][1]).name, + file(process.out.plots[0][1]).name, + process.out.findAll { key, val -> key.startsWith("versions") + }).match() } ) } } @@ -68,25 +139,23 @@ nextflow_process { when { process { """ - input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) - input[1] = [] - input[2] = [] - input[3] = [] - input[4] = [] - input[5] = [] + input[0] = channel.of([ + [ id: 'FASTQC' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true), + [], + [], + [], + [] + ]) """ } } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out.report.collect { file(it).getName() } + - process.out.data.collect { file(it).getName() } + - process.out.plots.collect { file(it).getName() } + - process.out.versions ).match("multiqc_stub") } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } - } } diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap index a88bafd6..c022701f 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test.snap +++ b/modules/nf-core/multiqc/tests/main.nf.test.snap @@ -1,41 +1,130 @@ { - "multiqc_versions_single": { + "sarscov2 single-end [fastqc] [multiple configs]": { "content": [ - [ - "versions.yml:md5,737bb2c7cad54ffc2ec020791dc48b8f" - ] + "multiqc_report.html", + "multiqc_data", + "multiqc_plots", + { + "versions": [ + [ + "MULTIQC", + "multiqc", + "1.33" + ] + ] + } ], "meta": { "nf-test": "0.9.3", - "nextflow": "24.10.4" + "nextflow": "25.10.4" }, - "timestamp": "2025-10-27T13:33:24.356715" + "timestamp": "2026-02-26T20:21:35.851707" }, - "multiqc_stub": { + "sarscov2 single-end [fastqc]": { "content": [ - [ - "multiqc_report.html", - "multiqc_data", - "multiqc_plots", - "versions.yml:md5,737bb2c7cad54ffc2ec020791dc48b8f" - ] + "multiqc_report.html", + "multiqc_data", + { + "versions": [ + [ + "MULTIQC", + "multiqc", + "1.33" + ] + ] + } ], "meta": { - "nf-test": "0.9.3", - "nextflow": "24.10.4" + "nf-test": "0.9.4", + "nextflow": "25.10.4" }, - "timestamp": "2025-10-27T13:34:11.103619" + "timestamp": "2026-02-26T15:10:36.019680076" }, - "multiqc_versions_config": { + "sarscov2 single-end [fastqc] - stub": { "content": [ - [ - "versions.yml:md5,737bb2c7cad54ffc2ec020791dc48b8f" - ] + { + "data": [ + [ + { + "id": "FASTQC" + }, + [ + ".stub:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "plots": [ + [ + { + "id": "FASTQC" + }, + [ + ".stub:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "report": [ + [ + { + "id": "FASTQC" + }, + "multiqc_report.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + [ + "MULTIQC", + "multiqc", + "1.33" + ] + ] + } ], "meta": { - "nf-test": "0.9.3", - "nextflow": "24.10.4" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + }, + "timestamp": "2026-02-26T15:14:39.789193051" + }, + "sarscov2 single-end [fastqc] [config]": { + "content": [ + "multiqc_report.html", + "multiqc_data", + "multiqc_plots", + { + "versions": [ + [ + "MULTIQC", + "multiqc", + "1.33" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + }, + "timestamp": "2026-02-26T15:21:29.116129274" + }, + "sarscov2 single-end [fastqc] - custom prefix": { + "content": [ + "custom_prefix.html", + "custom_prefix_data", + { + "versions": [ + [ + "MULTIQC", + "multiqc", + "1.33" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" }, - "timestamp": "2025-10-27T13:34:04.615233" + "timestamp": "2026-02-26T15:10:43.419877592" } } \ No newline at end of file diff --git a/modules/nf-core/pairix/environment.yml b/modules/nf-core/pairix/environment.yml index 51ab4007..a41df61c 100644 --- a/modules/nf-core/pairix/environment.yml +++ b/modules/nf-core/pairix/environment.yml @@ -1,7 +1,7 @@ -name: pairix +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairix=0.3.7 diff --git a/modules/nf-core/pairix/meta.yml b/modules/nf-core/pairix/meta.yml index 2b837d12..1117e0a5 100644 --- a/modules/nf-core/pairix/meta.yml +++ b/modules/nf-core/pairix/meta.yml @@ -4,6 +4,8 @@ description: | containing pairs of genomic coordinates keywords: - index + - block-compressed + - pairs tools: - pairix: description: 2D indexing on bgzipped text files of paired genomic coordinates @@ -11,29 +13,41 @@ tools: documentation: "https://github.com/4dn-dcic/pairix" tool_dev_url: "https://github.com/4dn-dcic/pairix" licence: ["MIT"] + identifier: biotools:pairix input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - pair: - type: file - description: pair file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pair: + type: file + description: pair file + ontologies: [] 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" - - index: - type: file - description: pair index file - pattern: "*.px2" + index: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pair: + type: file + description: pair index file + pattern: "*.px2" + ontologies: [] + - "*.px2": + type: file + description: pair index file + pattern: "*.px2" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/pairix/tests/main.nf.test b/modules/nf-core/pairix/tests/main.nf.test new file mode 100644 index 00000000..69bf7759 --- /dev/null +++ b/modules/nf-core/pairix/tests/main.nf.test @@ -0,0 +1,32 @@ + +nextflow_process { + + name "Test Process PAIRIX" + script "../main.nf" + process "PAIRIX" + + tag "modules" + tag "modules_nfcore" + tag "pairix" + + test("test-pairix") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file("https://raw.githubusercontent.com/4dn-dcic/pairix/master/samples/4dn.bsorted.chr21_22_only.nontriangle.pairs.gz", checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/pairix/tests/main.nf.test.snap b/modules/nf-core/pairix/tests/main.nf.test.snap new file mode 100644 index 00000000..d11b4bb4 --- /dev/null +++ b/modules/nf-core/pairix/tests/main.nf.test.snap @@ -0,0 +1,39 @@ +{ + "test-pairix": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "4dn.bsorted.chr21_22_only.nontriangle.pairs.gz:md5,ee90dc99987ece492d598ed939d54561", + "4dn.bsorted.chr21_22_only.nontriangle.pairs.gz.px2:md5,a6e41cc7cff16fd15b5ee505549ec99a" + ] + ], + "1": [ + "versions.yml:md5,848c8be602ec36645d30010ea30f0684" + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "4dn.bsorted.chr21_22_only.nontriangle.pairs.gz:md5,ee90dc99987ece492d598ed939d54561", + "4dn.bsorted.chr21_22_only.nontriangle.pairs.gz.px2:md5,a6e41cc7cff16fd15b5ee505549ec99a" + ] + ], + "versions": [ + "versions.yml:md5,848c8be602ec36645d30010ea30f0684" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:25:18.874503" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/dedup/environment.yml b/modules/nf-core/pairtools/dedup/environment.yml index 2f7ccc10..d2523556 100644 --- a/modules/nf-core/pairtools/dedup/environment.yml +++ b/modules/nf-core/pairtools/dedup/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_dedup +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/dedup/meta.yml b/modules/nf-core/pairtools/dedup/meta.yml index 3c67e3fb..03910206 100644 --- a/modules/nf-core/pairtools/dedup/meta.yml +++ b/modules/nf-core/pairtools/dedup/meta.yml @@ -12,33 +12,47 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: pair file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: pair file + ontologies: [] 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" - - pairs: - type: file - description: Duplicates removed pairs - pattern: "*.{pairs.gz}" - - stat: - type: file - description: stats of the pairs - pattern: "*.{pairs.stat}" + pairs: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairs.gz": + type: file + description: Duplicates removed pairs + pattern: "*.{pairs.gz}" + ontologies: [] + stat: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairs.stat": + type: file + description: stats of the pairs + pattern: "*.{pairs.stat}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/pairtools/dedup/tests/main.nf.test b/modules/nf-core/pairtools/dedup/tests/main.nf.test new file mode 100644 index 00000000..c812a6ac --- /dev/null +++ b/modules/nf-core/pairtools/dedup/tests/main.nf.test @@ -0,0 +1,39 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_DEDUP" + script "../main.nf" + process "PAIRTOOLS_DEDUP" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/dedup" + + test("test-pairtools-dedup") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.4dedup.pairsam', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.pairs[0][1]).linesGzip[3..7], + process.out.stat, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/dedup/tests/main.nf.test.snap b/modules/nf-core/pairtools/dedup/tests/main.nf.test.snap new file mode 100644 index 00000000..46dcf965 --- /dev/null +++ b/modules/nf-core/pairtools/dedup/tests/main.nf.test.snap @@ -0,0 +1,30 @@ +{ + "test-pairtools-dedup": { + "content": [ + [ + "#genome_assembly: unknown", + "#chromosomes: chr1 chr2", + "#columns: readID chrom1 pos1 chrom2 pos2 strand1 strand2 pair_type sam1 sam2", + "readid3\tchr1\t1\tchr1\t20\t+\t+\tUU\t.\t.", + "readid5\tchr1\t1\tchr1\t25\t+\t+\tUU\t.\t." + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.dedup.pairs.stat:md5,94682d1bc608ade150dd11993fbfd2a3" + ] + ], + [ + "versions.yml:md5,485fbdd68f35d563c8559e1afedc4c53" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:23:16.451408" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/dedup/tests/nextflow.config b/modules/nf-core/pairtools/dedup/tests/nextflow.config new file mode 100644 index 00000000..d0cfe51f --- /dev/null +++ b/modules/nf-core/pairtools/dedup/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PAIRTOOLS_DEDUP { + ext.prefix = { "${meta.id}.dedup" } + } +} diff --git a/modules/nf-core/pairtools/merge/environment.yml b/modules/nf-core/pairtools/merge/environment.yml index f85858a7..d2523556 100644 --- a/modules/nf-core/pairtools/merge/environment.yml +++ b/modules/nf-core/pairtools/merge/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_merge +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/merge/meta.yml b/modules/nf-core/pairtools/merge/meta.yml index b7bccc3c..d76b0923 100644 --- a/modules/nf-core/pairtools/merge/meta.yml +++ b/modules/nf-core/pairtools/merge/meta.yml @@ -11,29 +11,36 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - allpairs: - type: file - description: All pair files to merge + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - allpairs: + type: file + description: All pair files to merge + ontologies: [] 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" - - pairs: - type: file - description: Merged pairs file - pattern: "*.{pairs.gz}" + pairs: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*pairs.gz": + type: file + description: Merged pairs file + pattern: "*.{pairs.gz}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@nservant" maintainers: diff --git a/modules/nf-core/pairtools/merge/tests/main.nf.test b/modules/nf-core/pairtools/merge/tests/main.nf.test new file mode 100644 index 00000000..8d2b9d8d --- /dev/null +++ b/modules/nf-core/pairtools/merge/tests/main.nf.test @@ -0,0 +1,37 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_MERGE" + script "../main.nf" + process "PAIRTOOLS_MERGE" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/merge" + + test("test-pairtools-merge") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.pairsam', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.pairs[0][1]).linesGzip[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/merge/tests/main.nf.test.snap b/modules/nf-core/pairtools/merge/tests/main.nf.test.snap new file mode 100644 index 00000000..3aabbca3 --- /dev/null +++ b/modules/nf-core/pairtools/merge/tests/main.nf.test.snap @@ -0,0 +1,21 @@ +{ + "test-pairtools-merge": { + "content": [ + [ + "#samheader: @SQ\tSN:chr1\tLN:100", + "#samheader: @SQ\tSN:chr2\tLN:100", + "#samheader: @SQ\tSN:chr3\tLN:100", + "#samheader: @PG\tID:bwa\tPN:bwa\tVN:0.7.15-r1140\tCL:bwa mem -SP /path/ucsc.hg19.fasta.gz /path/1.fastq.gz /path/2.fastq.gz", + "#chromosomes: chr2 chr3 chr1" + ], + [ + "versions.yml:md5,e0acb3bd173f64f9984f597571e80eb0" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:19:28.360208" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/parse/environment.yml b/modules/nf-core/pairtools/parse/environment.yml index 0bd69ca2..d2523556 100644 --- a/modules/nf-core/pairtools/parse/environment.yml +++ b/modules/nf-core/pairtools/parse/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_parse +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/parse/meta.yml b/modules/nf-core/pairtools/parse/meta.yml index e7e448ef..2438df7a 100644 --- a/modules/nf-core/pairtools/parse/meta.yml +++ b/modules/nf-core/pairtools/parse/meta.yml @@ -11,37 +11,52 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" 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}" + - - 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}" + ontologies: [] - chromsizes: type: file description: chromosome size file + ontologies: [] 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" - - pairsam: - type: file - description: parsed pair file - pattern: "*.{pairsam.gz}" - - stat: - type: file - description: stats of the pairs - pattern: "*.{pairsam.stat}" + pairsam: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairsam.gz": + type: file + description: parsed pair file + pattern: "*.{pairsam.gz}" + ontologies: [] + stat: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairsam.stat": + type: file + description: stats of the pairs + pattern: "*.{pairsam.stat}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/pairtools/parse/tests/main.nf.test b/modules/nf-core/pairtools/parse/tests/main.nf.test new file mode 100644 index 00000000..0535d4dd --- /dev/null +++ b/modules/nf-core/pairtools/parse/tests/main.nf.test @@ -0,0 +1,40 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_PARSE" + script "../main.nf" + process "PAIRTOOLS_PARSE" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/parse" + + test("test-pairtools-parse") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.sam', checkIfExists: true) ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.chrom.sizes', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.pairsam[0][1]).linesGzip[3..7], + process.out.stat, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/parse/tests/main.nf.test.snap b/modules/nf-core/pairtools/parse/tests/main.nf.test.snap new file mode 100644 index 00000000..c06e572c --- /dev/null +++ b/modules/nf-core/pairtools/parse/tests/main.nf.test.snap @@ -0,0 +1,30 @@ +{ + "test-pairtools-parse": { + "content": [ + [ + "#chromsize: chr1 1000", + "#chromsize: chr2 1000", + "#samheader: @SQ\tSN:chr1\tLN:1000", + "#samheader: @SQ\tSN:chr2\tLN:1000", + "#samheader: @PG\tID:mock\tPN:mock\tVN:0.0.0\tCL:mock" + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.raw.pairsam.stat:md5,054bf78ee4f0a4c447ad3eeb81f1f4ae" + ] + ], + [ + "versions.yml:md5,2c8cb00722749f8e3831464a5057c519" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:17:35.185642" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/parse/tests/nextflow.config b/modules/nf-core/pairtools/parse/tests/nextflow.config new file mode 100644 index 00000000..d662e86b --- /dev/null +++ b/modules/nf-core/pairtools/parse/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PAIRTOOLS_PARSE { + ext.prefix = { "${meta.id}.raw" } + } +} diff --git a/modules/nf-core/pairtools/restrict/environment.yml b/modules/nf-core/pairtools/restrict/environment.yml index 4ba65c72..d2523556 100644 --- a/modules/nf-core/pairtools/restrict/environment.yml +++ b/modules/nf-core/pairtools/restrict/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_restrict +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/restrict/meta.yml b/modules/nf-core/pairtools/restrict/meta.yml index 12f6b986..126aeee7 100644 --- a/modules/nf-core/pairtools/restrict/meta.yml +++ b/modules/nf-core/pairtools/restrict/meta.yml @@ -11,35 +11,43 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - pairs: - type: file - description: pairs file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pairs: + type: file + description: pairs file + ontologies: [] - frag: type: file description: | a tab-separated BED file with the positions of restriction fragments (chrom, start, end). Can be generated using cooler digest. + ontologies: [] 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" - - restrict: - type: file - description: Filtered pairs file - pattern: "*.{pairs.gz}" + restrict: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairs.gz": + type: file + description: Filtered pairs file + pattern: "*.{pairs.gz}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/pairtools/restrict/tests/main.nf.test b/modules/nf-core/pairtools/restrict/tests/main.nf.test new file mode 100644 index 00000000..b9fa5c87 --- /dev/null +++ b/modules/nf-core/pairtools/restrict/tests/main.nf.test @@ -0,0 +1,40 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_RESTRICT" + script "../main.nf" + process "PAIRTOOLS_RESTRICT" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/restrict" + + test("test-pairtools-restrict") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.4flip.pairs', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/frag.bed', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.restrict[0][1]).linesGzip[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/restrict/tests/main.nf.test.snap b/modules/nf-core/pairtools/restrict/tests/main.nf.test.snap new file mode 100644 index 00000000..b56cc90c --- /dev/null +++ b/modules/nf-core/pairtools/restrict/tests/main.nf.test.snap @@ -0,0 +1,21 @@ +{ + "test-pairtools-restrict": { + "content": [ + [ + "#chromosomes: chr1 chr2", + "#chromsize: chr1 10000", + "#chromsize: chr2 10000", + "#samheader: @SQ\tSN:chr1\tLN:10000", + "#samheader: @SQ\tSN:chr2\tLN:10000" + ], + [ + "versions.yml:md5,c67dacbd4b0c4f2f060bd65b776113da" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:15:44.880469" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/restrict/tests/nextflow.config b/modules/nf-core/pairtools/restrict/tests/nextflow.config new file mode 100644 index 00000000..49b0723b --- /dev/null +++ b/modules/nf-core/pairtools/restrict/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PAIRTOOLS_RESTRICT { + ext.prefix = { "${meta.id}.restrict" } + } +} diff --git a/modules/nf-core/pairtools/select/environment.yml b/modules/nf-core/pairtools/select/environment.yml index ef1b0d40..d2523556 100644 --- a/modules/nf-core/pairtools/select/environment.yml +++ b/modules/nf-core/pairtools/select/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_select +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/select/meta.yml b/modules/nf-core/pairtools/select/meta.yml index e9aef9a2..cad52489 100644 --- a/modules/nf-core/pairtools/select/meta.yml +++ b/modules/nf-core/pairtools/select/meta.yml @@ -11,33 +11,47 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: pairs file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: pairs file + ontologies: [] 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" - - selected: - type: file - description: Selected pairs file - pattern: "*.{selected.pairs.gz}" - - unselected: - type: file - description: Rest pairs file. - pattern: "*.{unselected.pairs.gz}" + selected: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.selected.pairs.gz": + type: file + description: Selected pairs file + pattern: "*.{selected.pairs.gz}" + ontologies: [] + unselected: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.unselected.pairs.gz": + type: file + description: Rest pairs file. + pattern: "*.{unselected.pairs.gz}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" maintainers: diff --git a/modules/nf-core/pairtools/select/tests/main.nf.test b/modules/nf-core/pairtools/select/tests/main.nf.test new file mode 100644 index 00000000..de783340 --- /dev/null +++ b/modules/nf-core/pairtools/select/tests/main.nf.test @@ -0,0 +1,39 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_SELECT" + script "../main.nf" + process "PAIRTOOLS_SELECT" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/select" + + test("test-pairtools-select") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.pairsam', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.selected[0][1]).linesGzip[3..7], + path(process.out.unselected[0][1]).linesGzip[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/select/tests/main.nf.test.snap b/modules/nf-core/pairtools/select/tests/main.nf.test.snap new file mode 100644 index 00000000..d4361209 --- /dev/null +++ b/modules/nf-core/pairtools/select/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "test-pairtools-select": { + "content": [ + [ + "#chromosomes: chr2 chr3 chr1", + "#chromsize: chr2 100", + "#chromsize: chr3 100", + "#chromsize: chr1 100", + "#samheader: @SQ\tSN:chr1\tLN:100" + ], + [ + "#chromosomes: chr2 chr3 chr1", + "#chromsize: chr2 100", + "#chromsize: chr3 100", + "#chromsize: chr1 100", + "#samheader: @SQ\tSN:chr1\tLN:100" + ], + [ + "versions.yml:md5,ca2f02d3bd0e277e9f578067ff87c19d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:13:46.44029" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/select/tests/nextflow.config b/modules/nf-core/pairtools/select/tests/nextflow.config new file mode 100644 index 00000000..67ff4e1d --- /dev/null +++ b/modules/nf-core/pairtools/select/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PAIRTOOLS_SELECT { + ext.args = "(pair_type == \'RU\') or (pair_type == \'UR\') or (pair_type == \'UU\')" + } +} diff --git a/modules/nf-core/pairtools/sort/environment.yml b/modules/nf-core/pairtools/sort/environment.yml index 21bd011a..d2523556 100644 --- a/modules/nf-core/pairtools/sort/environment.yml +++ b/modules/nf-core/pairtools/sort/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_sort +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/sort/meta.yml b/modules/nf-core/pairtools/sort/meta.yml index 987aebb0..a8239d45 100644 --- a/modules/nf-core/pairtools/sort/meta.yml +++ b/modules/nf-core/pairtools/sort/meta.yml @@ -11,29 +11,36 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: A pairs file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: A pairs file + ontologies: [] 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" - - sorted: - type: file - description: Sorted pairs file - pattern: "*.{pairs.gz}" + sorted: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairs.gz": + type: file + description: Sorted pairs file + pattern: "*.{pairs.gz}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jianhong" - "@nservant" diff --git a/modules/nf-core/pairtools/sort/tests/main.nf.test b/modules/nf-core/pairtools/sort/tests/main.nf.test new file mode 100644 index 00000000..8413a2b1 --- /dev/null +++ b/modules/nf-core/pairtools/sort/tests/main.nf.test @@ -0,0 +1,38 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_SORT" + script "../main.nf" + process "PAIRTOOLS_SORT" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/sort" + + test("test-pairtools-sort") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.pairsam', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.sorted[0][1]).linesGzip[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/sort/tests/main.nf.test.snap b/modules/nf-core/pairtools/sort/tests/main.nf.test.snap new file mode 100644 index 00000000..1b22f328 --- /dev/null +++ b/modules/nf-core/pairtools/sort/tests/main.nf.test.snap @@ -0,0 +1,21 @@ +{ + "test-pairtools-sort": { + "content": [ + [ + "#genome_assembly: unknown", + "#chromosomes: : chr1 chr2 chr3", + "#chromsize: chr2 100", + "#chromsize: chr3 100", + "#chromsize: chr1 100" + ], + [ + "versions.yml:md5,6f5e6b4260ee11d35e306d2e085fb762" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:12:01.451816" + } +} \ No newline at end of file diff --git a/modules/nf-core/pairtools/sort/tests/nextflow.config b/modules/nf-core/pairtools/sort/tests/nextflow.config new file mode 100644 index 00000000..566f8da2 --- /dev/null +++ b/modules/nf-core/pairtools/sort/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PAIRTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } +} diff --git a/modules/nf-core/pairtools/stats/environment.yml b/modules/nf-core/pairtools/stats/environment.yml index c1f95fbc..d2523556 100644 --- a/modules/nf-core/pairtools/stats/environment.yml +++ b/modules/nf-core/pairtools/stats/environment.yml @@ -1,8 +1,8 @@ -name: pairtools_stats +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::pairtools=1.0.2 - conda-forge::numpy=1.23 diff --git a/modules/nf-core/pairtools/stats/meta.yml b/modules/nf-core/pairtools/stats/meta.yml index da2a1fa3..49171b95 100644 --- a/modules/nf-core/pairtools/stats/meta.yml +++ b/modules/nf-core/pairtools/stats/meta.yml @@ -11,29 +11,36 @@ tools: documentation: http://pairtools.readthedocs.io/ tool_dev_url: https://github.com/mirnylab/pairtools licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - pairs: - type: file - description: pairs file + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pairs: + type: file + description: pairs file + ontologies: [] 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" - - stat: - type: file - description: stats of the pairs - pattern: "*.{pairs.stat}" + stats: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.pairs.stat": + type: file + description: Pairs statistics + pattern: "*{.pairs.stat}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@nservant" maintainers: diff --git a/modules/nf-core/pairtools/stats/tests/main.nf.test b/modules/nf-core/pairtools/stats/tests/main.nf.test new file mode 100644 index 00000000..4dd0e82d --- /dev/null +++ b/modules/nf-core/pairtools/stats/tests/main.nf.test @@ -0,0 +1,33 @@ + +nextflow_process { + + name "Test Process PAIRTOOLS_STATS" + script "../main.nf" + process "PAIRTOOLS_STATS" + + tag "modules" + tag "modules_nfcore" + tag "pairtools" + tag "pairtools/stats" + + test("test-pairtools-stats") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pairtools/mock.pairsam', checkIfExists: true) ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/pairtools/stats/tests/main.nf.test.snap b/modules/nf-core/pairtools/stats/tests/main.nf.test.snap new file mode 100644 index 00000000..929db454 --- /dev/null +++ b/modules/nf-core/pairtools/stats/tests/main.nf.test.snap @@ -0,0 +1,37 @@ +{ + "test-pairtools-stats": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pairs.stat:md5,77a1b2b0b146e00313435f4a707d2d0d" + ] + ], + "1": [ + "versions.yml:md5,97ccf9babab2e888f52934164b9ef0d8" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pairs.stat:md5,77a1b2b0b146e00313435f4a707d2d0d" + ] + ], + "versions": [ + "versions.yml:md5,97ccf9babab2e888f52934164b9ef0d8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:05:50.844045" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml new file mode 100644 index 00000000..89e12a64 --- /dev/null +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf new file mode 100644 index 00000000..97bfb578 --- /dev/null +++ b/modules/nf-core/samtools/faidx/main.nf @@ -0,0 +1,49 @@ +process SAMTOOLS_FAIDX { + tag "$fasta" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : + 'biocontainers/samtools:1.22.1--h96c455f_0' }" + + input: + tuple val(meta), path(fasta), path(fai) + val get_sizes + + output: + tuple val(meta), path ("*.{fa,fasta}") , emit: fa, optional: true + tuple val(meta), path ("*.sizes") , emit: sizes, optional: true + tuple val(meta), path ("*.fai") , emit: fai, optional: true + tuple val(meta), path ("*.gzi") , emit: gzi, optional: true + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def get_sizes_command = get_sizes ? "cut -f 1,2 ${fasta}.fai > ${fasta}.sizes" : '' + """ + samtools \\ + faidx \\ + $fasta \\ + $args + + ${get_sizes_command} + """ + + stub: + def match = (task.ext.args =~ /-o(?:utput)?\s(.*)\s?/).findAll() + def fastacmd = match[0] ? "touch ${match[0][1]}" : '' + def get_sizes_command = get_sizes ? "touch ${fasta}.sizes" : '' + """ + ${fastacmd} + touch ${fasta}.fai + if [[ "${fasta.extension}" == "gz" ]]; then + touch ${fasta}.gzi + fi + + ${get_sizes_command} + """ +} diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml new file mode 100644 index 00000000..80aae1da --- /dev/null +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -0,0 +1,112 @@ +name: samtools_faidx +description: Index FASTA file, and optionally generate a file of chromosome + sizes +keywords: + - index + - fasta + - faidx + - chromosome +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: http://www.htslib.org/doc/samtools.html + doi: 10.1093/bioinformatics/btp352 + licence: + - "MIT" + identifier: biotools:samtools +input: + - - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fasta: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + ontologies: [] + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" + ontologies: [] + - get_sizes: + type: boolean + description: use cut to get the sizes of the index (true) or not (false) +output: + fa: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{fa,fasta}": + type: file + description: FASTA file + pattern: "*.{fa}" + ontologies: [] + sizes: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.sizes": + type: file + description: File containing chromosome lengths + pattern: "*.{sizes}" + ontologies: [] + fai: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fai": + type: file + description: FASTA index file + pattern: "*.{fai}" + ontologies: [] + gzi: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.gzi": + type: file + description: Optional gzip index file for compressed inputs + pattern: "*.gzi" + ontologies: [] + versions_samtools: + - - ${task.process}: + type: string + description: The process the versions were collected from + - samtools: + type: string + description: The tool name + - "samtools version | sed '1!d;s/.* //'": + type: eval + description: The command used to generate the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - samtools: + type: string + description: The tool name + - "samtools version | sed '1!d;s/.* //'": + type: eval + description: The command used to generate the version of the tool +authors: + - "@drpatelh" + - "@ewels" + - "@phue" +maintainers: + - "@maxulysse" + - "@phue" diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test b/modules/nf-core/samtools/faidx/tests/main.nf.test new file mode 100644 index 00000000..9a86db86 --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test @@ -0,0 +1,253 @@ +nextflow_process { + + name "Test Process SAMTOOLS_FAIDX" + script "../main.nf" + process "SAMTOOLS_FAIDX" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/faidx" + config "./nextflow.config" + + test("test_samtools_faidx") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_bgzip") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_fasta") { + + when { + params { + module_args = 'MT192765.1 -o extract.fa' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_stub_fasta") { + + options "-stub" + when { + params { + module_args = '-o extract.fa' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_stub_fai") { + + options "-stub" + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_get_sizes") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_get_sizes_bgzip") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_get_sizes - stub") { + + options "-stub" + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + + test("test_samtools_faidx_get_sizes_bgzip - stub") { + + options "-stub" + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } + +} diff --git a/modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap similarity index 50% rename from modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap rename to modules/nf-core/samtools/faidx/tests/main.nf.test.snap index c37b284d..41697444 100644 --- a/modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -1,33 +1,44 @@ { - "test_custom_getchromsizes_bgzip - stub": { + "test_samtools_faidx": { "content": [ { - "0": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + "fa": [ + ], - "1": [ + "fai": [ [ { "id": "test" }, - "genome.fasta.gz.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" ] ], - "2": [ + "gzi": [ + + ], + "sizes": [ + + ], + "versions_samtools": [ [ - { - "id": "test" - }, - "genome.fasta.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" ] - ], - "3": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T15:39:12.541649151" + }, + "test_samtools_faidx_get_sizes_bgzip - stub": { + "content": [ + { + "fa": [ + ], "fai": [ [ @@ -53,41 +64,26 @@ "genome.fasta.gz.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-07-05T12:38:36.927106" + "timestamp": "2026-02-10T15:41:44.040426987" }, - "test_custom_getchromsizes": { + "test_samtools_faidx_get_sizes": { "content": [ { - "0": [ - [ - { - "id": "test" - }, - "genome.fasta.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" - ] - ], - "1": [ - [ - { - "id": "test" - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "2": [ + "fa": [ - ], - "3": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" ], "fai": [ [ @@ -108,29 +104,28 @@ "genome.fasta.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" ] ], - "versions": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-06-20T13:22:34.14237" + "timestamp": "2026-02-10T15:47:03.653912015" }, - "test_custom_getchromsizes_bgzip": { + "test_samtools_faidx_bgzip": { "content": [ { - "0": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" - ] + "fa": [ + ], - "1": [ + "fai": [ [ { "id": "test" @@ -138,7 +133,7 @@ "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" ] ], - "2": [ + "gzi": [ [ { "id": "test" @@ -146,56 +141,141 @@ "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" ] ], - "3": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "sizes": [ + ], - "fai": [ + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T15:50:04.023566795" + }, + "test_samtools_faidx_fasta": { + "content": [ + { + "fa": [ [ { "id": "test" }, - "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" ] + ], + "fai": [ + ], "gzi": [ + + ], + "sizes": [ + + ], + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T15:39:23.529404162" + }, + "test_samtools_faidx_get_sizes - stub": { + "content": [ + { + "fa": [ + + ], + "fai": [ [ { "id": "test" }, - "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "gzi": [ + ], "sizes": [ [ { "id": "test" }, - "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" + "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-06-20T13:23:06.241379" + "timestamp": "2026-02-10T15:41:39.039834304" }, - "test_custom_getchromsizes - stub": { + "test_samtools_faidx_stub_fasta": { "content": [ { - "0": [ + "fa": [ [ { "id": "test" }, - "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + "extract.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fai": [ + + ], + "gzi": [ + + ], + "sizes": [ + + ], + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T15:39:28.961701609" + }, + "test_samtools_faidx_stub_fai": { + "content": [ + { + "fa": [ + ], - "1": [ + "fai": [ [ { "id": "test" @@ -203,40 +283,70 @@ "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "2": [ + "gzi": [ ], - "3": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "sizes": [ + + ], + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-02-10T15:39:34.471028474" + }, + "test_samtools_faidx_get_sizes_bgzip": { + "content": [ + { + "fa": [ + ], "fai": [ [ { "id": "test" }, - "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" ] ], "gzi": [ - + [ + { + "id": "test" + }, + "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + ] ], "sizes": [ [ { "id": "test" }, - "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" ] ], - "versions": [ - "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + "versions_samtools": [ + [ + "SAMTOOLS_FAIDX", + "samtools", + "1.22.1" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-07-05T12:24:05.697845" + "timestamp": "2026-02-10T15:39:45.439016495" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/nextflow.config b/modules/nf-core/samtools/faidx/tests/nextflow.config new file mode 100644 index 00000000..202c036e --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_FAIDX { + ext.args = params.module_args + } + +} diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml index 68b81558..89e12a64 100644 --- a/modules/nf-core/samtools/flagstat/environment.yml +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -1,8 +1,10 @@ -name: samtools_flagstat +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index 754d84b7..0cfb7e87 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -4,21 +4,20 @@ process SAMTOOLS_FLAGSTAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : + 'biocontainers/samtools:1.22.1--h96c455f_0' }" input: tuple val(meta), path(bam), path(bai) output: tuple val(meta), path("*.flagstat"), emit: flagstat - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ samtools \\ @@ -26,21 +25,23 @@ process SAMTOOLS_FLAGSTAT { --threads ${task.cpus} \\ $bam \\ > ${prefix}.flagstat - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.flagstat - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS + cat <<-END_FLAGSTAT > ${prefix}.flagstat + 1000000 + 0 in total (QC-passed reads + QC-failed reads) + 0 + 0 secondary + 0 + 0 supplementary + 0 + 0 duplicates + 900000 + 0 mapped (90.00% : N/A) + 1000000 + 0 paired in sequencing + 500000 + 0 read1 + 500000 + 0 read2 + 800000 + 0 properly paired (80.00% : N/A) + 850000 + 0 with mate mapped to a different chr + 50000 + 0 with mate mapped to a different chr (mapQ>=5) + END_FLAGSTAT """ } diff --git a/modules/nf-core/samtools/flagstat/meta.yml b/modules/nf-core/samtools/flagstat/meta.yml index 97991358..8caa1bcc 100644 --- a/modules/nf-core/samtools/flagstat/meta.yml +++ b/modules/nf-core/samtools/flagstat/meta.yml @@ -1,5 +1,6 @@ name: samtools_flagstat -description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG type +description: Counts the number of alignments in a BAM/CRAM/SAM file for each + FLAG type keywords: - stats - mapping @@ -16,35 +17,58 @@ tools: homepage: http://www.htslib.org/ documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] + licence: + - "MIT" + identifier: biotools:samtools 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}" - - bai: - type: file - description: Index for BAM/CRAM/SAM file - pattern: "*.{bai,crai,sai}" + - - 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}" + ontologies: [] + - bai: + type: file + description: Index for BAM/CRAM/SAM file + pattern: "*.{bai,crai,sai}" + ontologies: [] output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - flagstat: - type: file - description: File containing samtools flagstat output - pattern: "*.{flagstat}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + flagstat: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.flagstat": + type: file + description: File containing samtools flagstat output + pattern: "*.{flagstat}" + ontologies: [] + versions_samtools: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool authors: - "@drpatelh" maintainers: diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test index 24c3c04b..3b648a37 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -11,9 +11,30 @@ nextflow_process { test("BAM") { when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("BAM - stub") { + + options "-stub" + + when { process { """ input[0] = Channel.of([ @@ -28,8 +49,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.flagstat).match("flagstat") }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap index e9f85efa..f5c882da 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -1,32 +1,88 @@ { - "flagstat": { + "BAM - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,67394650dbae96d1a4fcc70484822159" + ] + ], + "1": [ + [ + "SAMTOOLS_FLAGSTAT", + "samtools", + "1.22.1" + ] + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,67394650dbae96d1a4fcc70484822159" + ] + ], + "versions_samtools": [ + [ + "SAMTOOLS_FLAGSTAT", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-02-12T18:31:37.783927" + "timestamp": "2026-02-03T11:14:30.820969684" }, - "versions": { + "BAM": { "content": [ - [ - "versions.yml:md5,f606681ef971cbb548a4d9e3fbabdbc2" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "1": [ + [ + "SAMTOOLS_FLAGSTAT", + "samtools", + "1.22.1" + ] + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "versions_samtools": [ + [ + "SAMTOOLS_FLAGSTAT", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.3" }, - "timestamp": "2024-05-28T15:41:52.516253882" + "timestamp": "2026-02-03T11:14:25.581619424" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/flagstat/tests/tags.yml b/modules/nf-core/samtools/flagstat/tests/tags.yml deleted file mode 100644 index 2d2b7255..00000000 --- a/modules/nf-core/samtools/flagstat/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -samtools/flagstat: - - modules/nf-core/samtools/flagstat/** diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index 260d516b..89e12a64 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -1,8 +1,10 @@ -name: samtools_index +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index b523c21b..e2a0e56d 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : + 'biocontainers/samtools:1.22.1--h96c455f_0' }" input: tuple val(meta), path(input) @@ -14,7 +14,7 @@ process SAMTOOLS_INDEX { tuple val(meta), path("*.bai") , optional:true, emit: bai tuple val(meta), path("*.csi") , optional:true, emit: csi tuple val(meta), path("*.crai"), optional:true, emit: crai - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions when: task.ext.when == null || task.ext.when @@ -24,25 +24,16 @@ process SAMTOOLS_INDEX { """ samtools \\ index \\ - -@ ${task.cpus-1} \\ + -@ ${task.cpus} \\ $args \\ $input - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ stub: + def args = task.ext.args ?: '' + def extension = file(input).getExtension() == 'cram' ? + "crai" : args.contains("-c") ? "csi" : "bai" """ - touch ${input}.bai - touch ${input}.crai - touch ${input}.csi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS + touch ${input}.${extension} """ } diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index 01a4ee03..c6d4ce25 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -14,39 +14,74 @@ tools: homepage: http://www.htslib.org/ documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] + licence: + - "MIT" + identifier: biotools:samtools 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}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: input file + ontologies: [] output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" - - crai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" - - csi: - type: file - description: CSI index file - pattern: "*.{csi}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + bai: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + ontologies: [] + csi: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: CSI index file + pattern: "*.{csi}" + ontologies: [] + crai: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.crai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + ontologies: [] + versions_samtools: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - samtools: + type: string + description: The name of the tool + - samtools version | sed '1!d;s/.* //': + type: eval + description: The expression to obtain the version of the tool authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test index bb7756d1..c96cec86 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -9,11 +9,7 @@ nextflow_process { tag "samtools/index" test("bai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -27,18 +23,16 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.bai).match("bai") }, - { assert snapshot(process.out.versions).match("bai_versions") } + { assert snapshot( + process.out.bai, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } ) } } test("crai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -52,20 +46,92 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.crai).match("crai") }, - { assert snapshot(process.out.versions).match("crai_versions") } + { assert snapshot( + process.out.crai, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } ) } } test("csi") { - config "./csi.nextflow.config" when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.csi[0][1]).name, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } + + test("bai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.bai, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } + + test("crai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.crai, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } + + test("csi - stub") { + options "-stub" + config "./csi.nextflow.config" + + when { process { """ input[0] = Channel.of([ @@ -79,8 +145,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert path(process.out.csi.get(0).get(1)).exists() }, - { assert snapshot(process.out.versions).match("csi_versions") } + { assert snapshot( + process.out.csi, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } ) } } diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap index 52756e85..afc8a1ff 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -1,29 +1,59 @@ { - "crai_versions": { + "csi - stub": { "content": [ [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-05-28T15:42:04.203740976" + "timestamp": "2026-01-28T17:52:10.030187" }, - "csi_versions": { + "crai - stub": { "content": [ [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-05-28T15:42:09.57475878" + "timestamp": "2026-01-28T17:51:59.125484" }, - "crai": { + "bai - stub": { "content": [ [ [ @@ -31,17 +61,45 @@ "id": "test", "single_end": false }, - "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-02-12T18:41:38.446424" + "timestamp": "2026-01-28T17:51:47.277042" }, - "bai": { + "csi": { + "content": [ + "test.paired_end.sorted.bam.csi", + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-28T17:51:35.758735" + }, + "crai": { "content": [ [ [ @@ -49,26 +107,50 @@ "id": "test", "single_end": false }, - "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-02-12T18:40:46.579747" + "timestamp": "2026-01-28T17:51:26.561965" }, - "bai_versions": { + "bai": { "content": [ [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_INDEX", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-05-28T15:41:57.929287369" + "timestamp": "2026-01-28T17:51:15.299035" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/index/tests/tags.yml b/modules/nf-core/samtools/index/tests/tags.yml deleted file mode 100644 index e0f58a7a..00000000 --- a/modules/nf-core/samtools/index/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -samtools/index: - - modules/nf-core/samtools/index/** diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml index 36a12eab..89e12a64 100644 --- a/modules/nf-core/samtools/sort/environment.yml +++ b/modules/nf-core/samtools/sort/environment.yml @@ -1,8 +1,10 @@ -name: samtools_sort +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + # renovate: datasource=conda depName=bioconda/htslib + - bioconda::htslib=1.22.1 + # renovate: datasource=conda depName=bioconda/samtools + - bioconda::samtools=1.22.1 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 596c6f7e..6b5aa31d 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -4,35 +4,45 @@ process SAMTOOLS_SORT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : + 'biocontainers/samtools:1.22.1--h96c455f_0' }" input: tuple val(meta) , path(bam) tuple val(meta2), path(fasta) + val index_format output: - tuple val(meta), path("*.bam"), emit: bam, optional: true - tuple val(meta), path("*.cram"), emit: cram, optional: true - tuple val(meta), path("*.crai"), emit: crai, optional: true - tuple val(meta), path("*.csi"), emit: csi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}.bam"), emit: bam, optional: true + tuple val(meta), path("${prefix}.cram"), emit: cram, optional: true + tuple val(meta), path("${prefix}.sam"), emit: sam, optional: true + tuple val(meta), path("${prefix}.${extension}.crai"), emit: crai, optional: true + tuple val(meta), path("${prefix}.${extension}.csi"), emit: csi, optional: true + tuple val(meta), path("${prefix}.${extension}.bai"), emit: bai, optional: true + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def extension = args.contains("--output-fmt sam") ? "sam" : - args.contains("--output-fmt cram") ? "cram" : - "bam" + prefix = task.ext.prefix ?: "${meta.id}" + extension = args.contains("--output-fmt sam") ? "sam" : + args.contains("--output-fmt cram") ? "cram" : + "bam" def reference = fasta ? "--reference ${fasta}" : "" + output_file = index_format ? "${prefix}.${extension}##idx##${prefix}.${extension}.${index_format} --write-index" : "${prefix}.${extension}" + if (index_format) { + if (!index_format.matches('bai|csi|crai')) { + error "Index format not one of bai, csi, crai." + } else if (extension == "sam") { + error "Indexing not compatible with SAM output" + } + } if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ samtools cat \\ - --threads $task.cpus \\ ${bam} \\ | \\ samtools sort \\ @@ -40,24 +50,29 @@ process SAMTOOLS_SORT { -T ${prefix} \\ --threads $task.cpus \\ ${reference} \\ - -o ${prefix}.${extension} \\ + -o ${output_file} \\ - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + extension = args.contains("--output-fmt sam") ? "sam" : + args.contains("--output-fmt cram") ? "cram" : + "bam" + if (index_format) { + if (!index_format.matches('bai|csi|crai')) { + error "Index format not one of bai, csi, crai." + } else if (extension == "sam") { + error "Indexing not compatible with SAM output" + } + } + index = index_format ? "touch ${prefix}.${extension}.${index_format}" : "" + """ - touch ${prefix}.bam - touch ${prefix}.bam.csi + touch ${prefix}.${extension} + ${index} - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ } diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml index 341a7d0e..69968304 100644 --- a/modules/nf-core/samtools/sort/meta.yml +++ b/modules/nf-core/samtools/sort/meta.yml @@ -15,52 +15,123 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools 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(s) - pattern: "*.{bam,cram,sam}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference genome FASTA file - pattern: "*.{fa,fasta,fna}" - optional: true + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file(s) + pattern: "*.{bam,cram,sam}" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference genome FASTA file + pattern: "*.{fa,fasta,fna}" + optional: true + ontologies: [] + - index_format: + type: string + description: Index format to use (optional) + pattern: "bai|csi|crai" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: Sorted BAM file - pattern: "*.{bam}" - - cram: - type: file - description: Sorted CRAM file - pattern: "*.{cram}" - - crai: - type: file - description: CRAM index file (optional) - pattern: "*.crai" - - csi: - type: file - description: BAM index file (optional) - pattern: "*.csi" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + bam: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.bam": + type: file + description: Sorted BAM file + pattern: "*.{bam}" + ontologies: [] + cram: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.cram": + type: file + description: Sorted CRAM file + pattern: "*.{cram}" + ontologies: [] + sam: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.sam": + type: file + description: Sorted SAM file + pattern: "*.{sam}" + ontologies: [] + crai: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.${extension}.crai": + type: file + description: CRAM index file (optional) + pattern: "*.crai" + ontologies: [] + csi: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.${extension}.csi": + type: file + description: BAM index file (optional) + pattern: "*.csi" + ontologies: [] + bai: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${prefix}.${extension}.bai": + type: file + description: BAM index file (optional) + pattern: "*.bai" + ontologies: [] + versions_samtools: + - - ${task.process}: + type: string + description: The process the versions were collected from + - samtools: + type: string + description: The tool name + - "samtools version | sed '1!d;s/.* //'": + type: string + description: The command used to generate the version of the tool + +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - samtools: + type: string + description: The tool name + - "samtools version | sed '1!d;s/.* //'": + type: string + description: The command used to generate the version of the tool + authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test index fb38ed9b..df47bb25 100644 --- a/modules/nf-core/samtools/sort/tests/main.nf.test +++ b/modules/nf-core/samtools/sort/tests/main.nf.test @@ -8,7 +8,7 @@ nextflow_process { tag "samtools" tag "samtools/sort" - test("bam") { + test("bam_no_index") { config "./nextflow.config" @@ -23,6 +23,7 @@ nextflow_process { [ id:'fasta' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) + input[2] = '' """ } } @@ -32,14 +33,14 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.bam, - process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } } - ).match("test_bam") - } + process.out.bai, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} ) } } - test("cram") { + test("bam_bai_index") { config "./nextflow.config" @@ -48,12 +49,80 @@ nextflow_process { """ input[0] = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = 'bai' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.bai, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} + ) + } + } + + test("bam_csi_index") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = 'csi' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.csi, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} + ) + } + } + + test("multiple bam") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] ]) input[1] = Channel.of([ [ id:'fasta' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) + input[2] = '' """ } } @@ -62,23 +131,122 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - process.out.bam, - process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } } - ).match("test_cram") - } + process.out.bam, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} ) } } - test("bam_stub") { + test("multiple bam bai index") { config "./nextflow.config" - options "-stub" when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = 'bai' + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.bai.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} + ) + } + } + + test("multiple bam csi index") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = 'csi' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} + ) + } + } + + test("cram") { + + config "./nextflow_cram.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = '' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.cram.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.crai.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match()} + ) + } + } + + test("bam - stub") { + + options "-stub" + config "./nextflow.config" + + when { process { """ input[0] = Channel.of([ @@ -89,6 +257,67 @@ nextflow_process { [ id:'fasta' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) + input[2] = '' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() } + ) + } + } + + test("multiple bam - stub") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = '' + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() } + ) + } + } + + test("cram - stub") { + + options "-stub" + config "./nextflow_cram.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = '' """ } } @@ -96,8 +325,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("bam_stub_bam") }, - { assert snapshot(process.out.versions).match("bam_stub_versions") } + { assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() } ) } } diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test.snap b/modules/nf-core/samtools/sort/tests/main.nf.test.snap index 5a27de1d..4e618fa3 100644 --- a/modules/nf-core/samtools/sort/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/sort/tests/main.nf.test.snap @@ -7,27 +7,89 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,21c992d59615936b99f2ad008aa54400" + "test.sorted.cram" ] - ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram.crai" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T12:47:01.171084" + }, + "bam_csi_index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,72ca1dff5344a5e5e6b892fe5f6b134d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.csi:md5,01394e702c729cb478df914ffaf9f7f8" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T08:13:54.512837189" + "timestamp": "2025-10-29T12:46:00.961675" }, - "bam_stub_bam": { + "bam - stub": { "content": [ - "test.sorted.bam" + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T07:29:00.761845507" + "timestamp": "2025-10-29T12:47:12.154354" }, - "test_cram": { + "multiple bam bai index": { "content": [ [ [ @@ -35,7 +97,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,22b2093be34a7637f5fbc84272b89d06" + "test.sorted.bam:md5,3ffa2affc29f0aa6e7b36dded84625fe" ] ], [ @@ -44,17 +106,44 @@ "id": "test", "single_end": false }, - "test.sorted.bam.csi" + "test.sorted.bam.bai" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T09:16:51.924951855" + "timestamp": "2025-10-29T12:46:25.488622" }, - "test_bam": { + "cram - stub": { + "content": [ + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T12:47:28.485045" + }, + "multiple bam": { "content": [ [ [ @@ -62,38 +151,113 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,21c992d59615936b99f2ad008aa54400" + "test.sorted.bam:md5,cd4eb0077f25e9cff395366b8883dd1f" ] ], + [ + + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T12:46:13.168476" + }, + "multiple bam - stub": { + "content": [ + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T12:47:21.628088" + }, + "bam_no_index": { + "content": [ [ [ { "id": "test", "single_end": false }, - "test.sorted.bam.csi" + "test.sorted.bam:md5,26b27d1f9bcb61c25da21b562349784e" + ] + ], + [ + + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T08:28:12.15952312" + "timestamp": "2025-10-29T12:45:47.139418" }, - "bam_stub_versions": { + "multiple bam csi index": { "content": [ [ - "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" - ] + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,295503ba5342531a3310c33ad0efbc22" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.csi" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T07:29:00.765038811" + "timestamp": "2025-10-29T12:46:51.5531" }, - "bam": { + "bam_bai_index": { "content": [ [ [ @@ -101,14 +265,32 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,21c992d59615936b99f2ad008aa54400" + "test.sorted.bam:md5,cae7564cb83bb4a5911205bf94124b54" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.bai:md5,50dd467c169545a4d5d1f709f7e986e0" + ] + ], + { + "versions_samtools": [ + [ + "SAMTOOLS_SORT", + "samtools", + "1.22.1" + ] ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2024-05-31T08:13:48.538030517" + "timestamp": "2025-10-29T12:45:52.796936" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/sort/tests/nextflow.config b/modules/nf-core/samtools/sort/tests/nextflow.config index f642771f..723f62b2 100644 --- a/modules/nf-core/samtools/sort/tests/nextflow.config +++ b/modules/nf-core/samtools/sort/tests/nextflow.config @@ -2,7 +2,6 @@ process { withName: SAMTOOLS_SORT { ext.prefix = { "${meta.id}.sorted" } - ext.args = "--write-index" } } diff --git a/modules/nf-core/samtools/sort/tests/nextflow_cram.config b/modules/nf-core/samtools/sort/tests/nextflow_cram.config new file mode 100644 index 00000000..3a8c0188 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/nextflow_cram.config @@ -0,0 +1,8 @@ +process { + + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + ext.args = "--write-index --output-fmt cram" + } + +} diff --git a/modules/nf-core/samtools/sort/tests/tags.yml b/modules/nf-core/samtools/sort/tests/tags.yml deleted file mode 100644 index cd63ea20..00000000 --- a/modules/nf-core/samtools/sort/tests/tags.yml +++ /dev/null @@ -1,3 +0,0 @@ -samtools/sort: - - modules/nf-core/samtools/sort/** - - tests/modules/nf-core/samtools/sort/** diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml new file mode 100644 index 00000000..60b33ef2 --- /dev/null +++ b/modules/nf-core/trimgalore/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::trim-galore=0.6.10 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf new file mode 100644 index 00000000..5790b520 --- /dev/null +++ b/modules/nf-core/trimgalore/main.nf @@ -0,0 +1,86 @@ +process TRIMGALORE { + tag "${meta.id}" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/trim-galore:0.6.10--hdfd78af_2' : + 'biocontainers/trim-galore:0.6.10--hdfd78af_2'}" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz"), emit: reads + tuple val(meta), path("*report.txt") , emit: log , optional: true + tuple val(meta), path("*unpaired{,_1,_2}.fq.gz") , emit: unpaired, optional: true + tuple val(meta), path("*.html") , emit: html , optional: true + tuple val(meta), path("*.zip") , emit: zip , optional: true + tuple val("${task.process}"), val("trimgalore"), eval('trim_galore --version | grep -Eo "[0-9]+(\\.[0-9]+)+"'), topic: versions, emit: versions_trimgalore + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + // Calculate number of --cores for TrimGalore based on value of task.cpus + // See: https://github.com/FelixKrueger/TrimGalore/blob/master/CHANGELOG.md#version-060-release-on-1-mar-2019 + // See: https://github.com/nf-core/atacseq/pull/65 + def cores = 1 + if (task.cpus) { + cores = (task.cpus as int) - 4 + if (meta.single_end) { + cores = (task.cpus as int) - 3 + } + if (cores < 1) { + cores = 1 + } + if (cores > 8) { + cores = 8 + } + } + + // Added soft-links to original fastqs for consistent naming in MultiQC + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + def args_list = args.split("\\s(?=--)").toList() + args_list.removeAll { arg -> arg.toLowerCase().contains('_r2 ') } + """ + [ ! -f ${prefix}.fastq.gz ] && ln -s ${reads} ${prefix}.fastq.gz + trim_galore \\ + ${args_list.join(' ')} \\ + --cores ${cores} \\ + --gzip \\ + ${prefix}.fastq.gz + """ + } + else { + """ + [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz + [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz + trim_galore \\ + ${args} \\ + --cores ${cores} \\ + --paired \\ + --gzip \\ + ${prefix}_1.fastq.gz \\ + ${prefix}_2.fastq.gz + """ + } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}_trimmed.fq.gz ;" + output_command += "touch ${prefix}.fastq.gz_trimming_report.txt" + } + else { + output_command = "echo '' | gzip > ${prefix}_1_trimmed.fq.gz ;" + output_command += "touch ${prefix}_1.fastq.gz_trimming_report.txt ;" + output_command += "echo '' | gzip > ${prefix}_2_trimmed.fq.gz ;" + output_command += "touch ${prefix}_2.fastq.gz_trimming_report.txt" + } + """ + ${output_command} + """ +} diff --git a/modules/nf-core/trimgalore/meta.yml b/modules/nf-core/trimgalore/meta.yml new file mode 100644 index 00000000..dcd9b170 --- /dev/null +++ b/modules/nf-core/trimgalore/meta.yml @@ -0,0 +1,129 @@ +name: trimgalore +description: | + A wrapper around Cutadapt and FastQC to consistently apply adapter and quality trimming to FastQ files, + with extra functionality for RRBS data +keywords: + - trimming + - adapters + - sequencing + - fastq +tools: + - trimgalore: + description: | + A wrapper tool around Cutadapt and FastQC to consistently apply quality + and adapter trimming to FastQ files, with some extra functionality for + MspI-digested RRBS-type (Reduced Representation Bisufite-Seq) libraries. + homepage: https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/ + documentation: https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md + licence: ["GPL-3.0-or-later"] + identifier: biotools:trim_galore + +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. + ontologies: + - edam: "http://edamontology.org/format_1930" # FASTQ +output: + reads: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz": + type: file + description: The trimmed/modified fastq reads + pattern: "*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz" + ontologies: + - edam: "http://edamontology.org/format_1930" # FASTQ + - edam: http://edamontology.org/format_3989 # GZIP format + log: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*report.txt": + type: file + description: trimgalore log file + pattern: "*report.txt" + ontologies: + - edam: "http://edamontology.org/format_2330" # Textual format + unpaired: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*unpaired{,_1,_2}.fq.gz": + type: file + description: unpaired reads when --retain_unpaired flag is used + pattern: "*unpaired*.fq.gz" + ontologies: + - edam: "http://edamontology.org/format_1930" # FASTQ + - edam: http://edamontology.org/format_3989 # GZIP format + html: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.html": + type: file + description: FastQC HTML report after trimming when the --fastqc flag is used + pattern: "*_fastqc.html" + ontologies: + - edam: "http://edamontology.org/format_2331" # HTML + zip: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.zip": + type: file + description: FastQC report output zip after trimming when the --fastqc flag + is used + pattern: "*_fastqc.zip" + ontologies: + - edam: http://edamontology.org/format_3987 # ZIP format + versions_trimgalore: + - - ${task.process}: + type: string + description: The name of the process + - trimgalore: + type: string + description: The name of the tool + - trim_galore --version | grep -Eo "[0-9]+(\.[0-9]+)+": + type: eval + description: The expression to obtain the version of the tool + +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - trimgalore: + type: string + description: The name of the tool + - trim_galore --version | grep -Eo "[0-9]+(\.[0-9]+)+": + type: eval + description: The expression to obtain the version of the tool + +authors: + - "@drpatelh" + - "@ewels" + - "@FelixKrueger" +maintainers: + - "@drpatelh" + - "@ewels" + - "@FelixKrueger" + - "@vagkaratzas" diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test new file mode 100644 index 00000000..ac97b087 --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -0,0 +1,162 @@ +nextflow_process { + + name "Test Process TRIMGALORE" + script "../main.nf" + process "TRIMGALORE" + + tag "modules" + tag "modules_nfcore" + tag "trimgalore" + + test("sarscov2 - fastq - single-end") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads, + file(process.out.log[0][1]).readLines()[0..9], // line 11 changes + file(process.out.log[0][1]).readLines()[11..59], + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } + + test("sarscov2 - fastq - paired-end") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads[0][1][0], + process.out.reads[0][1][1], + file(process.out.log[0][1][0]).readLines()[0..9], // line 11 changes + file(process.out.log[0][1][0]).readLines()[11..58], + file(process.out.log[0][1][1]).readLines()[0..9], // line 11 changes + file(process.out.log[0][1][1]).readLines()[11..60], + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } + + test("sarscov2 - fastq - paired-end - keep-unpaired") { + + config "./nextflow.config" + + when { + params { + module_args = '--retain_unpaired --length 150' + } + + process { + """ + input[0] = [ [ id:'test', single_end:false ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads[0][1][0], + process.out.reads[0][1][1], + process.out.unpaired[0][1][0], + process.out.unpaired[0][1][1], + file(process.out.log[0][1][0]).readLines()[0..9], // line 11 changes + file(process.out.log[0][1][0]).readLines()[11..59], + file(process.out.log[0][1][1]).readLines()[0..9], // line 11 changes + file(process.out.log[0][1][1]).readLines()[11..63], + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } + + test("sarscov2 - fastq - single-end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads, + process.out.log, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } + + test("sarscov2 - fastq - paired-end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.reads, + process.out.log, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } +} diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap new file mode 100644 index 00000000..2fb55f2d --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -0,0 +1,468 @@ +{ + "sarscov2 - fastq - paired-end - stub": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + { + "versions_trimgalore": [ + [ + "TRIMGALORE", + "trimgalore", + "0.6.10" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-15T14:40:14.896140126" + }, + "sarscov2 - fastq - paired-end - keep-unpaired": { + "content": [ + "test_1_val_1.fq.gz:md5,75413e85910bbc2e1556e12f6479f935", + "test_2_val_2.fq.gz:md5,d3c588c12646ebd36a0812fe02d0bda6", + "test_1_unpaired_1.fq.gz:md5,17e0e878f6d0e93b9008a05f128660b6", + "test_2_unpaired_2.fq.gz:md5,b09a064368a867e099e66df5ef69b044", + [ + "", + "SUMMARISING RUN PARAMETERS", + "==========================", + "Input filename: test_1.fastq.gz", + "Trimming mode: paired-end", + "Trim Galore version: 0.6.10", + "Cutadapt version: 5.2", + "Number of cores used for trimming: 1", + "Quality Phred score cutoff: 20", + "Quality encoding type selected: ASCII+33" + ], + [ + "Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).", + "Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))", + "Maximum trimming error rate: 0.1 (default)", + "Minimum required adapter overlap (stringency): 1 bp", + "Minimum required sequence length for both reads before a sequence pair gets removed: 150 bp", + "Length cut-off for read 1: 35 bp (default)", + "Length cut-off for read 2: 35 bp (default)", + "Output file will be GZIP compressed", + "", + "", + "This is cutadapt 5.2 with Python 3.12.12", + "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_1.fastq.gz", + "Processing single-end reads on 1 core ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads with adapters: 31 (31.0%)", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,897 bp", + "Quality-trimmed: 0 bp (0.0%)", + "Total written (filtered): 13,851 bp (99.7%)", + "", + "=== Adapter 1 ===", + "", + "Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 31 times", + "", + "Minimum overlap: 1", + "No. of allowed errors:", + "1-9 bp: 0; 10-13 bp: 1", + "", + "Bases preceding removed adapters:", + " A: 35.5%", + " C: 25.8%", + " G: 9.7%", + " T: 29.0%", + " none/other: 0.0%", + "", + "Overview of removed sequences", + "length\tcount\texpect\tmax.err\terror counts", + "1\t19\t25.0\t0\t19", + "2\t10\t6.2\t0\t10", + "3\t1\t1.6\t0\t1", + "4\t1\t0.4\t0\t1", + "", + "RUN STATISTICS FOR INPUT FILE: test_1.fastq.gz", + "=============================================", + "100 sequences processed in total" + ], + [ + "", + "SUMMARISING RUN PARAMETERS", + "==========================", + "Input filename: test_2.fastq.gz", + "Trimming mode: paired-end", + "Trim Galore version: 0.6.10", + "Cutadapt version: 5.2", + "Number of cores used for trimming: 1", + "Quality Phred score cutoff: 20", + "Quality encoding type selected: ASCII+33" + ], + [ + "Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).", + "Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))", + "Maximum trimming error rate: 0.1 (default)", + "Minimum required adapter overlap (stringency): 1 bp", + "Minimum required sequence length for both reads before a sequence pair gets removed: 150 bp", + "Length cut-off for read 1: 35 bp (default)", + "Length cut-off for read 2: 35 bp (default)", + "Output file will be GZIP compressed", + "", + "", + "This is cutadapt 5.2 with Python 3.12.12", + "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_2.fastq.gz", + "Processing single-end reads on 1 core ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads with adapters: 40 (40.0%)", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,748 bp", + "Quality-trimmed: 0 bp (0.0%)", + "Total written (filtered): 13,693 bp (99.6%)", + "", + "=== Adapter 1 ===", + "", + "Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 40 times", + "", + "Minimum overlap: 1", + "No. of allowed errors:", + "1-9 bp: 0; 10-13 bp: 1", + "", + "Bases preceding removed adapters:", + " A: 35.0%", + " C: 25.0%", + " G: 5.0%", + " T: 35.0%", + " none/other: 0.0%", + "", + "Overview of removed sequences", + "length\tcount\texpect\tmax.err\terror counts", + "1\t28\t25.0\t0\t28", + "2\t10\t6.2\t0\t10", + "3\t1\t1.6\t0\t1", + "4\t1\t0.4\t0\t1", + "", + "RUN STATISTICS FOR INPUT FILE: test_2.fastq.gz", + "=============================================", + "100 sequences processed in total", + "", + "Total number of sequences analysed for the sequence pair length validation: 100", + "", + "Number of sequence pairs removed because at least one read was shorter than the length cutoff (150 bp): 81 (81.00%)" + ], + { + "versions_trimgalore": [ + [ + "TRIMGALORE", + "trimgalore", + "0.6.10" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-15T14:39:53.811844594" + }, + "sarscov2 - fastq - single-end - stub": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_trimgalore": [ + [ + "TRIMGALORE", + "trimgalore", + "0.6.10" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-15T14:40:03.991561892" + }, + "sarscov2 - fastq - paired-end": { + "content": [ + "test_1_val_1.fq.gz:md5,566d44cca0d22c522d6cf0e50c7165dc", + "test_2_val_2.fq.gz:md5,3c023e8e890b897821df3dc98f48c2b3", + [ + "", + "SUMMARISING RUN PARAMETERS", + "==========================", + "Input filename: test_1.fastq.gz", + "Trimming mode: paired-end", + "Trim Galore version: 0.6.10", + "Cutadapt version: 5.2", + "Number of cores used for trimming: 1", + "Quality Phred score cutoff: 20", + "Quality encoding type selected: ASCII+33" + ], + [ + "Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).", + "Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))", + "Maximum trimming error rate: 0.1 (default)", + "Minimum required adapter overlap (stringency): 1 bp", + "Minimum required sequence length for both reads before a sequence pair gets removed: 20 bp", + "Output file will be GZIP compressed", + "", + "", + "This is cutadapt 5.2 with Python 3.12.12", + "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_1.fastq.gz", + "Processing single-end reads on 1 core ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads with adapters: 31 (31.0%)", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,897 bp", + "Quality-trimmed: 0 bp (0.0%)", + "Total written (filtered): 13,851 bp (99.7%)", + "", + "=== Adapter 1 ===", + "", + "Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 31 times", + "", + "Minimum overlap: 1", + "No. of allowed errors:", + "1-9 bp: 0; 10-13 bp: 1", + "", + "Bases preceding removed adapters:", + " A: 35.5%", + " C: 25.8%", + " G: 9.7%", + " T: 29.0%", + " none/other: 0.0%", + "", + "Overview of removed sequences", + "length\tcount\texpect\tmax.err\terror counts", + "1\t19\t25.0\t0\t19", + "2\t10\t6.2\t0\t10", + "3\t1\t1.6\t0\t1", + "4\t1\t0.4\t0\t1", + "", + "RUN STATISTICS FOR INPUT FILE: test_1.fastq.gz", + "=============================================", + "100 sequences processed in total", + "" + ], + [ + "", + "SUMMARISING RUN PARAMETERS", + "==========================", + "Input filename: test_2.fastq.gz", + "Trimming mode: paired-end", + "Trim Galore version: 0.6.10", + "Cutadapt version: 5.2", + "Number of cores used for trimming: 1", + "Quality Phred score cutoff: 20", + "Quality encoding type selected: ASCII+33" + ], + [ + "Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).", + "Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))", + "Maximum trimming error rate: 0.1 (default)", + "Minimum required adapter overlap (stringency): 1 bp", + "Minimum required sequence length for both reads before a sequence pair gets removed: 20 bp", + "Output file will be GZIP compressed", + "", + "", + "This is cutadapt 5.2 with Python 3.12.12", + "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_2.fastq.gz", + "Processing single-end reads on 1 core ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads with adapters: 40 (40.0%)", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,748 bp", + "Quality-trimmed: 0 bp (0.0%)", + "Total written (filtered): 13,693 bp (99.6%)", + "", + "=== Adapter 1 ===", + "", + "Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 40 times", + "", + "Minimum overlap: 1", + "No. of allowed errors:", + "1-9 bp: 0; 10-13 bp: 1", + "", + "Bases preceding removed adapters:", + " A: 35.0%", + " C: 25.0%", + " G: 5.0%", + " T: 35.0%", + " none/other: 0.0%", + "", + "Overview of removed sequences", + "length\tcount\texpect\tmax.err\terror counts", + "1\t28\t25.0\t0\t28", + "2\t10\t6.2\t0\t10", + "3\t1\t1.6\t0\t1", + "4\t1\t0.4\t0\t1", + "", + "RUN STATISTICS FOR INPUT FILE: test_2.fastq.gz", + "=============================================", + "100 sequences processed in total", + "", + "Total number of sequences analysed for the sequence pair length validation: 100", + "" + ], + { + "versions_trimgalore": [ + [ + "TRIMGALORE", + "trimgalore", + "0.6.10" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-15T14:39:43.937555685" + }, + "sarscov2 - fastq - single-end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,566d44cca0d22c522d6cf0e50c7165dc" + ] + ], + [ + "", + "SUMMARISING RUN PARAMETERS", + "==========================", + "Input filename: test.fastq.gz", + "Trimming mode: single-end", + "Trim Galore version: 0.6.10", + "Cutadapt version: 5.2", + "Number of cores used for trimming: 1", + "Quality Phred score cutoff: 20", + "Quality encoding type selected: ASCII+33" + ], + [ + "Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).", + "Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))", + "Maximum trimming error rate: 0.1 (default)", + "Minimum required adapter overlap (stringency): 1 bp", + "Minimum required sequence length before a sequence gets removed: 20 bp", + "Output file will be GZIP compressed", + "", + "", + "This is cutadapt 5.2 with Python 3.12.12", + "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test.fastq.gz", + "Processing single-end reads on 1 core ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads with adapters: 31 (31.0%)", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,897 bp", + "Quality-trimmed: 0 bp (0.0%)", + "Total written (filtered): 13,851 bp (99.7%)", + "", + "=== Adapter 1 ===", + "", + "Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 31 times", + "", + "Minimum overlap: 1", + "No. of allowed errors:", + "1-9 bp: 0; 10-13 bp: 1", + "", + "Bases preceding removed adapters:", + " A: 35.5%", + " C: 25.8%", + " G: 9.7%", + " T: 29.0%", + " none/other: 0.0%", + "", + "Overview of removed sequences", + "length\tcount\texpect\tmax.err\terror counts", + "1\t19\t25.0\t0\t19", + "2\t10\t6.2\t0\t10", + "3\t1\t1.6\t0\t1", + "4\t1\t0.4\t0\t1", + "", + "RUN STATISTICS FOR INPUT FILE: test.fastq.gz", + "=============================================", + "100 sequences processed in total", + "Sequences removed because they became shorter than the length cutoff of 20 bp:\t0 (0.0%)", + "" + ], + { + "versions_trimgalore": [ + [ + "TRIMGALORE", + "trimgalore", + "0.6.10" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-15T14:39:33.985021562" + } +} \ No newline at end of file diff --git a/modules/nf-core/trimgalore/tests/nextflow.config b/modules/nf-core/trimgalore/tests/nextflow.config new file mode 100644 index 00000000..d8e3ac13 --- /dev/null +++ b/modules/nf-core/trimgalore/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: TRIMGALORE { + ext.args = params.module_args + } +} diff --git a/nextflow.config b/nextflow.config index f18a8c3c..3bfdb09f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -65,10 +65,10 @@ params { } } - min_restriction_fragment_size = 0 - max_restriction_fragment_size = 0 - min_insert_size = 0 - max_insert_size = 0 + min_restriction_fragment_size = (params.digest.arima || params.digest.arimaV2)? 10:0 + max_restriction_fragment_size = (params.digest.arima || params.digest.arimaV2)? 100000:0 + min_insert_size = (params.digest.arima || params.digest.arimaV2)? 100:0 + max_insert_size = (params.digest.arima || params.digest.arimaV2)? 1000:0 save_pairs_intermediates = false // Dnase/Micro-C Hi-C @@ -90,6 +90,7 @@ params { ice_eps = 0.1 // Downstream Analysis + min_size = 0 res_dist_decay = '250000' tads_caller = 'insulation' res_tads = '40000' @@ -291,6 +292,7 @@ env { R_PROFILE_USER = "/.Rprofile" R_ENVIRON_USER = "/.Renviron" JULIA_DEPOT_PATH = "/usr/local/share/julia" + MPLCONFIGDIR = "${baseDir}/mplconfig" } // Set bash options diff --git a/nextflow_schema.json b/nextflow_schema.json index d44fa876..a2f9a76b 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -262,7 +262,7 @@ "fa_icon": "fas fa-chess-board", "properties": { "bin_size": { - "type": "string", + "type": ["string", "integer"], "pattern": "^(\\d+)(,\\d+)*$", "default": "1000000", "description": "Resolution to build the maps (comma separated)" @@ -296,7 +296,7 @@ "default": "--force" }, "res_zoomify": { - "type": "string", + "type": ["string", "integer"], "description": "Maximum resolution to build mcool file" }, "save_raw_maps": { @@ -311,6 +311,11 @@ "description": "Set up downstream analysis from contact maps", "default": "", "properties": { + "min_size": { + "type": "integer", + "description": "Minimum chromosome size to be retained. Useful for Calder2, which cannot be applied to chromosomes that do not have a sufficient number of bins.", + "default": 0 + }, "res_dist_decay": { "type": "string", "pattern": "^(\\d+)(,\\d+)*$", diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index 8ff2de74..ae06e9e7 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -23,7 +23,7 @@ "@type": "Dataset", "creativeWorkStatus": "InProgress", "datePublished": "2025-11-20T09:31:58+00:00", - "description": "

\n \n \n \"nf-core/hic\"\n \n

\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/nf-core/hic)\n[![GitHub Actions CI Status](https://github.com/nf-core/hic/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/hic/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/hic/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/hic/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/hic/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.04.0-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.5.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.5.1)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/hic)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23hic-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/hic)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/hic** is a bioinformatics pipeline that ...\n\n\n\n\n1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/))\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.\n\n\n\nNow, you can run the pipeline using:\n\n\n\n```bash\nnextflow run nf-core/hic \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/hic/usage) and the [parameter documentation](https://nf-co.re/hic/parameters).\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/hic/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/hic/output).\n\n## Credits\n\nnf-core/hic was originally written by Nicolas Servant.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\nFor further information or help, don't hesitate to get in touch on the [Slack `#hic` channel](https://nfcore.slack.com/channels/hic) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\n\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", + "description": "

\n \n \n \"nf-core/hic\"\n \n

\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/nf-core/hic)\n[![GitHub Actions CI Status](https://github.com/nf-core/hic/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/hic/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/hic/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/hic/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/hic/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.2669512-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.2669512)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.04.0-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.5.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.5.1)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/hic)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23hic-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/hic)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/hic** is a bioinformatics best-practice analysis pipeline for Analysis of Chromosome Conformation Capture data (Hi-C).\n\nThe pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!\n\nOn release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources.The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/hic/results).\n\n## Pipeline summary\n\n1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))\n2. Hi-C data processing\n 1. [`HiC-Pro`](https://github.com/nservant/HiC-Pro)\n 1. Mapping using a two steps strategy to rescue reads spanning the ligation\n sites ([`bowtie2`](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml))\n 2. Detection of valid interaction products\n 3. Duplicates removal\n 4. Generate raw and normalized contact maps ([`iced`](https://github.com/hiclib/iced))\n 5. Generate `pairs` files for downstream analysis\n 2. [`Pairtools`](https://github.com/open2c/pairtools)\n 1. Mapping using [`BWA-mem`](https://github.com/lh3/bwa)\n 2. Detection of valid interaction products with [`pairtools`](https://github.com/open2c/pairtools)\n 3. Duplicates removal\n 4. Generate `pairs` files for downstream analysis\n3. Create genome-wide contact maps at various resolutions ([`cooler`](https://github.com/open2c/cooler))\n4. Contact maps normalization using balancing algorithm ([`cooler`](https://github.com/open2c/cooler))\n5. Export to various contact maps formats ([`HiC-Pro`](https://github.com/nservant/HiC-Pro), [`cooler`](https://github.com/open2c/cooler))\n6. Quality controls ([`HiC-Pro`](https://github.com/nservant/HiC-Pro), [`HiCExplorer`](https://github.com/deeptools/HiCExplorer))\n7. Compartments calling ([`cooltools`](https://cooltools.readthedocs.io/en/latest/), [`Calder2`](https://github.com/CSOgroup/CALDER2))\n8. TADs calling ([`HiCExplorer`](https://github.com/deeptools/HiCExplorer), [`cooltools`](https://cooltools.readthedocs.io/en/latest/))\n9. Quality control report ([`MultiQC`](https://multiqc.info/))\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.\n\nFirst, prepare a samplesheet with your input data that looks as follows:\n\n`samplesheet.csv`:\n\n```csv\nsample,fastq_1,fastq_2\nHIC_ES_4,SRR5339783_1.fastq.gz,SRR5339783_2.fastq.gz\n```\n\nEach row represents a pair of fastq files (paired end).\nNow, you can run the pipeline using:\n\n```bash\nnextflow run nf-core/hic \\\n -profile \\\n --input samplesheet.csv \\\n --genome GRCh37 \\\n --outdir \n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/hic/usage) and the [parameter documentation](https://nf-co.re/hic/parameters).\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/hic/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/hic/output).\n\n## Credits\n\nnf-core/hic was originally written by Nicolas Servant.\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\nFor further information or help, don't hesitate to get in touch on the [Slack `#hic` channel](https://nfcore.slack.com/channels/hic) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\nIf you use nf-core/hic for your analysis, please cite it using the following doi: [10.5281/zenodo.2669512](https://doi.org/10.5281/zenodo.2669512)\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", "hasPart": [ { "@id": "main.nf" diff --git a/subworkflows/local/compartments.nf b/subworkflows/local/compartments/main.nf similarity index 77% rename from subworkflows/local/compartments.nf rename to subworkflows/local/compartments/main.nf index 4f965d3b..e4993ead 100644 --- a/subworkflows/local/compartments.nf +++ b/subworkflows/local/compartments/main.nf @@ -1,5 +1,5 @@ -include { COOLTOOLS_EIGSCIS } from '../../modules/local/cooltools/eigscis' -include { CALDER2 } from '../../modules/nf-core/calder2/main' +include { COOLTOOLS_EIGSCIS } from '../../../modules/local/cooltools/eigscis.nf' +include { CALDER2 } from '../../../modules/nf-core/calder2/main' workflow COMPARTMENTS { @@ -9,7 +9,7 @@ workflow COMPARTMENTS { chrsize main: - ch_versions = Channel.empty() + ch_versions = channel.empty() if (params.compartments_caller =~ 'cooltools'){ COOLTOOLS_EIGSCIS( @@ -24,7 +24,7 @@ workflow COMPARTMENTS { if (params.compartments_caller =~ 'calder2'){ CALDER2( cool.map{meta, cool, res -> [meta, cool] }, - Channel.value([]) + channel.value([]) ) ch_versions = ch_versions.mix(CALDER2.out.versions) ch_comp = CALDER2.out.output_folder diff --git a/subworkflows/local/compartments/meta.yml b/subworkflows/local/compartments/meta.yml new file mode 100644 index 00000000..49295ef7 --- /dev/null +++ b/subworkflows/local/compartments/meta.yml @@ -0,0 +1,47 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "COMPARTMENTS" +description: | + Subworkflow to call genomic compartments from Hi-C data using either + Cooltools Eigscis or Calder2. Takes a .cool file, reference FASTA, + and chromosome sizes, then runs the selected caller based on the + `params.compartments_caller` parameter. Outputs compartment calls + and tool version information. +keywords: + - Eigscis + - Calder2 + - Hi-C + - Compartments + - Genomics +components: + - cooltools/eigscis + - calder2 +input: + - cool: + type: file + description: | + Input Hi-C contact map in .cool format + pattern: "*.cool" + - fasta: + type: file + description: | + Reference genome FASTA file + pattern: "*.fa" + - chrsize: + type: file + description: | + Chromosome sizes file + pattern: "*.txt" +output: + - compartments: + type: directory + description: | + Directory containing compartment calls from the selected caller + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/cooler.nf b/subworkflows/local/cooler.nf deleted file mode 100644 index 38570337..00000000 --- a/subworkflows/local/cooler.nf +++ /dev/null @@ -1,97 +0,0 @@ -/* - * COOLER MAIN WORKFLOW - * INPUT : .pair text file with the list of valid interaction - * OUTPUT : cooler files - */ - -include { COOLER_ZOOMIFY } from '../../modules/nf-core/cooler/zoomify/main' -include { COOLER_DUMP } from '../../modules/nf-core/cooler/dump/main' -include { COOLER_CLOAD } from '../../modules/nf-core/cooler/cload/main' -include { COOLER_BALANCE } from '../../modules/nf-core/cooler/balance/main' -include { COOLER_MAKEBINS } from '../../modules/nf-core/cooler/makebins/main' - -include { SPLIT_COOLER_DUMP } from '../../modules/local/split_cooler_dump' - -// add resolution in meta -def addResolution(row) { - def meta = [:] - meta.id = row[0].id - meta.resolution = row[2] - return [meta, row[1], row[2]] -} - -workflow COOLER { - - take: - pairs // [meta, pairs, index] - chromsize // [meta, chromsize] - cool_bins - - main: - ch_versions = Channel.empty() - - //***************************************** - // EXPORT BINS - - COOLER_MAKEBINS( - chromsize.combine(cool_bins) - ) - ch_versions = ch_versions.mix(COOLER_MAKEBINS.out.versions) - - //***************************************** - // BUILD COOL FILE PER RESOLUTION - // [meta, pairs, resolution] - - COOLER_CLOAD( - pairs.combine(cool_bins), - chromsize.map{it -> it[1]}.collect() - ) - ch_versions = ch_versions.mix(COOLER_CLOAD.out.versions) - - // Add resolution in meta - COOLER_CLOAD.out.cool - .map{ it -> addResolution(it) } - .set{ ch_cool } - - COOLER_BALANCE( - ch_cool.map{[it[0], it[1], ""]} - ) - ch_versions = ch_versions.mix(COOLER_BALANCE.out.versions) - - // Zoomify at minimum bin resolution - if (!params.res_zoomify){ - ch_res_zoomify = cool_bins.min() - }else{ - ch_res_zoomify = Channel.from(params.res_zoomify).splitCsv().flatten().unique().toInteger() - } - - ch_cool - .combine(ch_res_zoomify) - .filter{ it[2] == it[3] } - .map{ it->[it[0], it[1]] } - .set{ ch_cool_zoomify } - - COOLER_ZOOMIFY( - ch_cool_zoomify - ) - ch_versions = ch_versions.mix(COOLER_ZOOMIFY.out.versions) - - //***************************************** - // DUMP DATA - // [meta, cool] / resolution - - COOLER_DUMP( - COOLER_BALANCE.out.cool.map{[it[0], it[1], ""]} - ) - ch_versions = ch_versions.mix(COOLER_DUMP.out.versions) - - SPLIT_COOLER_DUMP( - COOLER_DUMP.out.bedpe - ) - ch_versions = ch_versions.mix(SPLIT_COOLER_DUMP.out.versions) - - emit: - versions = ch_versions - cool = COOLER_BALANCE.out.cool - mcool = COOLER_ZOOMIFY.out.mcool -} diff --git a/subworkflows/local/cooler/main.nf b/subworkflows/local/cooler/main.nf new file mode 100644 index 00000000..c5abcc03 --- /dev/null +++ b/subworkflows/local/cooler/main.nf @@ -0,0 +1,86 @@ +/* + * COOLER MAIN WORKFLOW + * INPUT : .pair text file with the list of valid interaction + * OUTPUT : cooler files + */ + +include { COOLER_ZOOMIFY } from '../../../modules/nf-core/cooler/zoomify/main' +include { COOLER_DUMP } from '../../../modules/nf-core/cooler/dump/main' +include { COOLER_CLOAD } from '../../../modules/nf-core/cooler/cload/main' +include { COOLER_BALANCE } from '../../../modules/nf-core/cooler/balance/main' +include { COOLER_MAKEBINS } from '../../../modules/nf-core/cooler/makebins/main' + +include { FILTER_CHROMSIZE } from '../../../modules/local/filter_chromsize' +include { SPLIT_COOLER_DUMP } from '../../../modules/local/split_cooler_dump' + +workflow COOLER { + + take: + ch_pairs // [meta, pairs, index] + ch_chromsize // [meta, chromsize] + ch_cools_bins + ch_zoom_res + + main: + + //***************************************** + // FILTER CHROMOSOMES ON SIZE + + if( params.min_size ) { + ch_chromsize = ch_chromsize | FILTER_CHROMSIZE + } + + //***************************************** + // EXPORT BINS + + COOLER_MAKEBINS( + ch_chromsize.combine(ch_cools_bins) + ) + + //***************************************** + // BUILD COOL FILE PER RESOLUTION + COOLER_CLOAD( + ch_pairs.collect(), + ch_chromsize.collect(), + "pairs", + ch_cools_bins + ) + + // Add resolution in meta + COOLER_CLOAD.out.cool + .map { meta, file -> + def id = (file.baseName =~ /(\d+)(?!.*\d)/)[0][1] + [meta + [resolution: id.toInteger()], file] + } + .set { ch_cool } + + COOLER_BALANCE( + ch_cool.map{[it[0], it[1], ""]} + ) + + ch_cool + .combine(ch_zoom_res) + .filter{ meta, cool, zoom_res -> meta.resolution == zoom_res } + .map{ it->[it[0], it[1]] } + .set{ ch_cool_zoomify } + + COOLER_ZOOMIFY( + ch_cool_zoomify + ) + + //***************************************** + // DUMP DATA + // [meta, cool] / resolution + + COOLER_DUMP( + COOLER_BALANCE.out.cool.map{[it[0], it[1], ""]} + ) + + SPLIT_COOLER_DUMP( + COOLER_DUMP.out.bedpe + ) + + emit: + cool = COOLER_BALANCE.out.cool + mcool = COOLER_ZOOMIFY.out.mcool +} diff --git a/subworkflows/local/cooler/meta.yml b/subworkflows/local/cooler/meta.yml new file mode 100644 index 00000000..668e9d31 --- /dev/null +++ b/subworkflows/local/cooler/meta.yml @@ -0,0 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "COOLER" +description: | + Main workflow to generate and process cooler files from Hi-C interaction pairs. + Takes a .pairs file of valid interactions, chromosome sizes, and bin definitions. + Builds cooler files at multiple resolutions, balances them, zoomifies at selected + resolution(s), and produces dumps for downstream analysis. +keywords: + - Hi-C + - Cooler + - Genomics + - Chromosome interactions +components: + - cooler/makebins + - cooler/cload + - cooler/balance + - cooler/zoomify + - cooler/dump + - filter/chromsize + - split/cooler/dump +input: + - pairs: + type: file + description: | + Input .pairs text file containing valid Hi-C interactions + pattern: "*.pairs" + - chromsize: + type: file + description: | + Chromosome sizes file + pattern: "*.txt" + - cool_bins: + type: file + description: | + Bin size definitions for cooler construction + pattern: "*.txt" +output: + - cool: + type: file + description: | + Balanced cooler files at specified resolutions + pattern: "*.cool" + - mcool: + type: file + description: | + Multi-resolution cooler file (zoomified) + pattern: "*.mcool" + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/hicpro.nf b/subworkflows/local/hicpro/main.nf similarity index 72% rename from subworkflows/local/hicpro.nf rename to subworkflows/local/hicpro/main.nf index 7730e21f..85667d0e 100644 --- a/subworkflows/local/hicpro.nf +++ b/subworkflows/local/hicpro/main.nf @@ -4,14 +4,14 @@ * From the raw sequencing reads to the list of valid interactions */ -include { HICPRO_MAPPING } from './hicpro_mapping' -include { GET_VALID_INTERACTION } from '../../modules/local/hicpro/get_valid_interaction' -include { GET_VALID_INTERACTION_DNASE } from '../../modules/local/hicpro/get_valid_interaction_dnase' -include { MERGE_VALID_INTERACTION } from '../../modules/local/hicpro/merge_valid_interaction' -include { MERGE_STATS } from '../../modules/local/hicpro/merge_stats' -include { HICPRO2PAIRS } from '../../modules/local/hicpro/hicpro2pairs' -include { BUILD_CONTACT_MAPS } from '../../modules/local/hicpro/build_contact_maps' -include { ICE_NORMALIZATION } from '../../modules/local/hicpro/run_ice' +include { HICPRO_MAPPING } from '../hicpro_mapping' +include { GET_VALID_INTERACTION } from '../../../modules/local/hicpro/get_valid_interaction' +include { GET_VALID_INTERACTION_DNASE } from '../../../modules/local/hicpro/get_valid_interaction_dnase' +include { MERGE_VALID_INTERACTION } from '../../../modules/local/hicpro/merge_valid_interaction' +include { MERGE_STATS } from '../../../modules/local/hicpro/merge_stats' +include { HICPRO2PAIRS } from '../../../modules/local/hicpro/hicpro2pairs' +include { BUILD_CONTACT_MAPS } from '../../../modules/local/hicpro/build_contact_maps' +include { ICE_NORMALIZATION } from '../../../modules/local/hicpro/run_ice' // Remove meta.chunks def removeChunks(row){ @@ -32,7 +32,6 @@ workflow HICPRO { map_res // values main: - ch_versions = Channel.empty() // Fastq to paired-end bam HICPRO_MAPPING( @@ -41,7 +40,6 @@ workflow HICPRO { index, ligation_site ) - ch_versions = ch_versions.mix(HICPRO_MAPPING.out.versions) //*************************************** // DIGESTION PROTOCOLS @@ -51,7 +49,6 @@ workflow HICPRO { HICPRO_MAPPING.out.bam, fragments.collect() ) - ch_versions = ch_versions.mix(GET_VALID_INTERACTION.out.versions) ch_valid_pairs = GET_VALID_INTERACTION.out.valid_pairs ch_valid_stats = GET_VALID_INTERACTION.out.stats @@ -63,7 +60,6 @@ workflow HICPRO { GET_VALID_INTERACTION_DNASE ( HICPRO_MAPPING.out.bam ) - ch_versions = ch_versions.mix(GET_VALID_INTERACTION_DNASE.out.versions) ch_valid_pairs = GET_VALID_INTERACTION_DNASE.out.valid_pairs ch_valid_stats = GET_VALID_INTERACTION_DNASE.out.stats } @@ -82,7 +78,6 @@ workflow HICPRO { MERGE_VALID_INTERACTION ( ch_valid_pairs ) - ch_versions = ch_versions.mix(MERGE_VALID_INTERACTION.out.versions) ch_hicpro_mappingstats = HICPRO_MAPPING.out.mapstats @@ -106,7 +101,6 @@ workflow HICPRO { MERGE_STATS( ch_hicpro_mappingstats.concat(ch_hicpro_pairstats, ch_hicpro_validstats) ) - ch_versions = ch_versions.mix(MERGE_STATS.out.versions) //*************************************** // CONVERTS TO PAIRS @@ -115,7 +109,6 @@ workflow HICPRO { MERGE_VALID_INTERACTION.out.valid_pairs, chrsize.collect() ) - ch_versions = ch_versions.mix(HICPRO2PAIRS.out.versions) //*************************************** // CONTACT MAPS @@ -134,15 +127,13 @@ workflow HICPRO { BUILD_CONTACT_MAPS.out.maps ) ch_hicpro_iced_maps = ICE_NORMALIZATION.out.maps - ch_versions = ch_versions.mix(ICE_NORMALIZATION.out.versions) }else{ - ch_hicpro_raw_maps = Channel.empty() - ch_hicpro_iced_maps = Channel.empty() + ch_hicpro_raw_maps = channel.empty() + ch_hicpro_iced_maps = channel.empty() } emit: - versions = ch_versions pairs = HICPRO2PAIRS.out.pairs mqc = MERGE_VALID_INTERACTION.out.mqc.concat(MERGE_STATS.out.mqc) raw_maps = ch_hicpro_raw_maps diff --git a/subworkflows/local/hicpro/meta.yml b/subworkflows/local/hicpro/meta.yml new file mode 100644 index 00000000..ab056d2f --- /dev/null +++ b/subworkflows/local/hicpro/meta.yml @@ -0,0 +1,85 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "HICPRO" +description: | + Main workflow to process raw Hi-C sequencing reads into valid interaction pairs + and contact maps. Performs mapping, digestion or DNase-like protocols, merges + interactions and statistics, converts to pairs format, and optionally builds + and normalizes contact maps. +keywords: + - Hi-C + - Hic-Pro + - Genomics + - Chromosome interactions + - Contact maps +components: + - hicpro_mapping + - get/valid/interaction + - get/valid/interaction/dnase + - merge/valid/interaction + - merge/stats + - hicpro2pairs + - build/contact/maps + - ice/normalization +input: + - reads: + type: file + description: | + Raw sequencing reads (paired-end FASTQ files) + pattern: "*.fastq.gz" + - fasta: + type: file + description: | + Reference genome FASTA file + pattern: "*.fa" + - index: + type: directory + description: | + Path to the genome index for read mapping + - fragments: + type: file + description: | + Restriction fragments file for digestion protocols + pattern: "*.txt" + - chrsize: + type: file + description: | + Chromosome sizes file + pattern: "*.txt" + - ligation_site: + type: string + description: | + Ligation site sequence used in digestion protocols + - map_res: + type: integer + description: | + Resolution(s) for building contact maps +output: + - pairs: + type: file + description: | + Valid interaction pairs in .pairs format + pattern: "*.pairs" + - mqc: + type: file + description: | + MultiQC-compatible statistics from mapping, interactions, and merging + pattern: "*.mqc" + - raw_maps: + type: file + description: | + Raw contact maps generated from valid pairs + pattern: "*.txt" + - iced_maps: + type: file + description: | + ICE-normalized contact maps + pattern: "*.txt" + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/hicpro_mapping.nf b/subworkflows/local/hicpro_mapping/main.nf similarity index 71% rename from subworkflows/local/hicpro_mapping.nf rename to subworkflows/local/hicpro_mapping/main.nf index 05ccd982..fb34f310 100644 --- a/subworkflows/local/hicpro_mapping.nf +++ b/subworkflows/local/hicpro_mapping/main.nf @@ -3,12 +3,12 @@ * From the raw sequencing reads to a paired-end bam file */ -include { BOWTIE2_ALIGN } from '../../modules/nf-core/bowtie2/align/main' -include { TRIM_READS } from '../../modules/local/hicpro/trim_reads' -include { BOWTIE2_ALIGN as BOWTIE2_ALIGN_TRIMMED } from '../../modules/nf-core/bowtie2/align/main' -include { MERGE_BOWTIE2 } from '../../modules/local/hicpro/bowtie2_merge' -include { COMBINE_MATES} from '../../modules/local/hicpro/combine_mates' -include { MAPPING_STATS_DNASE } from '../../modules/local/hicpro/dnase_mapping_stats' +include { BOWTIE2_ALIGN } from '../../../modules/nf-core/bowtie2/align/main' +include { TRIM_READS } from '../../../modules/local/hicpro/trim_reads' +include { BOWTIE2_ALIGN as BOWTIE2_ALIGN_TRIMMED } from '../../../modules/nf-core/bowtie2/align/main' +include { MERGE_BOWTIE2 } from '../../../modules/local/hicpro/bowtie2_merge' +include { COMBINE_MATES} from '../../../modules/local/hicpro/combine_mates' +include { MAPPING_STATS_DNASE } from '../../../modules/local/hicpro/dnase_mapping_stats' workflow HICPRO_MAPPING { @@ -20,7 +20,6 @@ workflow HICPRO_MAPPING { ligation_site // value main: - ch_versions = Channel.empty() // Align each mates separetly and add mates information in [meta] ch_reads_r1 = reads @@ -45,7 +44,6 @@ workflow HICPRO_MAPPING { true, false ) - ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) if (!params.no_digestion){ @@ -54,7 +52,6 @@ workflow HICPRO_MAPPING { BOWTIE2_ALIGN.out.fastq, ligation_site.collect() ) - ch_versions = ch_versions.mix(TRIM_READS.out.versions) // bowtie2 on trimmed reads - save_unaligned=false - sort_bam=false BOWTIE2_ALIGN_TRIMMED( @@ -64,7 +61,6 @@ workflow HICPRO_MAPPING { false, false ) - ch_versions = ch_versions.mix(BOWTIE2_ALIGN_TRIMMED.out.versions) // Merge the two mapping steps ch_bowtie2_align = BOWTIE2_ALIGN.out.bam @@ -73,7 +69,6 @@ workflow HICPRO_MAPPING { MERGE_BOWTIE2( ch_bowtie2_align ) - ch_versions = ch_versions.mix(MERGE_BOWTIE2.out.versions) ch_mapping_stats = MERGE_BOWTIE2.out.stats ch_bams = MERGE_BOWTIE2.out.bam @@ -88,7 +83,6 @@ workflow HICPRO_MAPPING { MAPPING_STATS_DNASE( BOWTIE2_ALIGN.out.aligned ) - ch_versions = ch_versions.mix(MAPPING_STATS_DNASE.out.versions) ch_mapping_stats = MAPPING_STATS_DNASE.out.stats ch_bams = BOWTIE2_ALIGN.out.aligned @@ -101,10 +95,8 @@ workflow HICPRO_MAPPING { COMBINE_MATES ( ch_bams ) - ch_versions = ch_versions.mix(COMBINE_MATES.out.versions) emit: - versions = ch_versions bam = COMBINE_MATES.out.bam mapstats = ch_mapping_stats pairstats = COMBINE_MATES.out.stats diff --git a/subworkflows/local/hicpro_mapping/meta.yml b/subworkflows/local/hicpro_mapping/meta.yml new file mode 100644 index 00000000..4849c3c2 --- /dev/null +++ b/subworkflows/local/hicpro_mapping/meta.yml @@ -0,0 +1,65 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "HICPRO_MAPPING" +description: | + Workflow to map raw Hi-C sequencing reads to a reference genome using Bowtie2. + Handles digestion protocols by trimming reads at ligation sites, merging mapping + steps, and computing mapping statistics. For DNase-like protocols, generates + mapping statistics directly from aligned reads. Produces paired-end BAM files + and mapping/interaction statistics. +keywords: + - Hi-C + - Hic-Pro + - Mapping + - Bowtie2 + - Genomics +components: + - bowtie2/align + - trim/reads + - merge/bowtie2 + - hicpro/combine/mates + - mapping/stats/dnase + - combine/mates +input: + - reads: + type: file + description: | + Raw sequencing reads (paired-end FASTQ files) + pattern: "*.fastq.gz" + - fasta: + type: file + description: | + Reference genome FASTA file + pattern: "*.fa" + - index: + type: directory + description: | + Path to the genome index for Bowtie2 mapping + - ligation_site: + type: string + description: | + Ligation site sequence used for trimming in digestion protocols +output: + - bam: + type: file + description: | + Paired-end BAM files after mapping and mate combination + pattern: "*.bam" + - mapstats: + type: file + description: | + Mapping statistics from Bowtie2 or DNase mapping + pattern: "*.txt" + - pairstats: + type: file + description: | + Pairing statistics from mate combination + pattern: "*.txt" + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/pairtools.nf b/subworkflows/local/pairtools.nf deleted file mode 100644 index 7f889936..00000000 --- a/subworkflows/local/pairtools.nf +++ /dev/null @@ -1,130 +0,0 @@ -/* - * PAIRTOOLS - * MAIN WORKFLOW - * From the raw sequencing reads to the list of valid interactions - */ - -//include { BWAMEM2_MEM } from '../../modules/nf-core/bwamem2/mem/main' -include { BWA_MEM } from '../../modules/nf-core/bwa/mem/main' -include { PAIRTOOLS_DEDUP } from '../../modules/nf-core/pairtools/dedup/main' -//include { PAIRTOOLS_PARSE } from '../../modules/nf-core/pairtools/parse/main' -include { PAIRTOOLS_RESTRICT } from '../../modules/nf-core/pairtools/restrict/main' -include { PAIRTOOLS_SELECT } from '../../modules/nf-core/pairtools/select/main' -include { PAIRTOOLS_SORT } from '../../modules/nf-core/pairtools/sort/main' -include { PAIRTOOLS_MERGE } from '../../modules/nf-core/pairtools/merge/main' -include { PAIRTOOLS_STATS } from '../../modules/nf-core/pairtools/stats/main' -include { SAMTOOLS_FLAGSTAT } from '../../modules/nf-core/samtools/flagstat/main' -include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' -include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main' -include { PAIRIX } from '../../modules/nf-core/pairix/main' - -//include { PAIRTOOLS_MERGE } from '../../modules/local/pairtools/pairtools_merge' -include { PAIRTOOLS_SPLIT } from '../../modules/local/pairtools/pairtools_split' -//include { PAIRTOOLS_STATS } from '../../modules/local/pairtools/pairtools_stats' -include { PAIRTOOLS_PARSE } from '../../modules/local/pairtools/pairtools_parse' - -workflow PAIRTOOLS { - - take: - reads // [meta, read1, read2] - fasta // [meta, fasta] - index // [meta2, path] - frag // path - chrsize // path - - main: - ch_versions = Channel.empty() - - BWA_MEM( - reads, - index.collect(), - fasta.collect(), - Channel.value([]) - ) - ch_versions = ch_versions.mix(BWA_MEM.out.versions) - - PAIRTOOLS_PARSE( - BWA_MEM.out.bam, - chrsize.collect() - ) - ch_versions = ch_versions.mix(PAIRTOOLS_PARSE.out.versions) - - PAIRTOOLS_RESTRICT( - PAIRTOOLS_PARSE.out.pairsam, - frag.map{it->it[1]}.collect() - ) - ch_versions = ch_versions.mix(PAIRTOOLS_RESTRICT.out.versions) - - ch_pairsam = params.no_digestion ? PAIRTOOLS_PARSE.out.pairsam : PAIRTOOLS_RESTRICT.out.restrict - PAIRTOOLS_SORT( - ch_pairsam - ) - ch_versions = ch_versions.mix(PAIRTOOLS_SORT.out.versions) - - ch_valid_pairs = PAIRTOOLS_SORT.out.sorted - .map{ meta, pairs -> - def newMeta = [ id: meta.id, single_end: meta.single_end, part:meta.part ] - [ groupKey(newMeta, meta.part), pairs ] - } - .groupTuple() - .branch { - single: it[0].part <=1 - multiple: it[0].part > 1 - } - - PAIRTOOLS_MERGE( - ch_valid_pairs.multiple - ) - ch_versions = ch_versions.mix(PAIRTOOLS_MERGE.out.versions) - - // Separate pairs/bam files - PAIRTOOLS_SPLIT( - PAIRTOOLS_MERGE.out.pairs.mix(ch_valid_pairs.single) - ) - ch_versions = ch_versions.mix(PAIRTOOLS_SPLIT.out.versions) - - // Manage BAM files - SAMTOOLS_SORT( - PAIRTOOLS_SPLIT.out.bam, - fasta - ) - ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions) - - SAMTOOLS_INDEX( - SAMTOOLS_SORT.out.bam - ) - ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions) - - SAMTOOLS_FLAGSTAT( - SAMTOOLS_SORT.out.bam.join(SAMTOOLS_INDEX.out.bai) - ) - ch_versions = ch_versions.mix(SAMTOOLS_FLAGSTAT.out.versions) - - PAIRTOOLS_DEDUP( - PAIRTOOLS_SPLIT.out.pairs - ) - ch_versions = ch_versions.mix(PAIRTOOLS_DEDUP.out.versions) - - ch_pairselect = params.keep_dups ? PAIRTOOLS_SPLIT.out.pairs : PAIRTOOLS_DEDUP.out.pairs - PAIRTOOLS_SELECT( - ch_pairselect - ) - ch_versions = ch_versions.mix(PAIRTOOLS_SELECT.out.versions) - - PAIRTOOLS_STATS( - PAIRTOOLS_SELECT.out.selected - ) - ch_versions = ch_versions.mix(PAIRTOOLS_STATS.out.versions) - - PAIRIX( - PAIRTOOLS_SELECT.out.selected - ) - ch_versions = ch_versions.mix(PAIRIX.out.versions) - - emit: - versions = ch_versions - pairs = PAIRIX.out.index - bam = PAIRTOOLS_SPLIT.out.bam.join(SAMTOOLS_INDEX.out.bai) - stats = PAIRTOOLS_STATS.out.stats.map{it->it[1]} - flagstat = SAMTOOLS_FLAGSTAT.out.flagstat -} diff --git a/subworkflows/local/pairtools/main.nf b/subworkflows/local/pairtools/main.nf new file mode 100644 index 00000000..471fba19 --- /dev/null +++ b/subworkflows/local/pairtools/main.nf @@ -0,0 +1,116 @@ +/* + * PAIRTOOLS + * MAIN WORKFLOW + * From the raw sequencing reads to the list of valid interactions + */ + +//include { BWAMEM2_MEM } from '../../../modules/nf-core/bwamem2/mem/main' +include { BWA_MEM } from '../../../modules/nf-core/bwa/mem/main' +include { PAIRTOOLS_DEDUP } from '../../../modules/nf-core/pairtools/dedup/main' +//include { PAIRTOOLS_PARSE } from '../../../modules/nf-core/pairtools/parse/main' +include { PAIRTOOLS_RESTRICT } from '../../../modules/nf-core/pairtools/restrict/main' +include { PAIRTOOLS_SELECT } from '../../../modules/nf-core/pairtools/select/main' +include { PAIRTOOLS_SORT } from '../../../modules/nf-core/pairtools/sort/main' +include { PAIRTOOLS_MERGE } from '../../../modules/nf-core/pairtools/merge/main' +include { PAIRTOOLS_STATS } from '../../../modules/nf-core/pairtools/stats/main' +include { SAMTOOLS_FLAGSTAT } from '../../../modules/nf-core/samtools/flagstat/main' +include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' +include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' +include { PAIRIX } from '../../../modules/nf-core/pairix/main' + +//include { PAIRTOOLS_MERGE } from '../../../modules/local/pairtools/pairtools_merge' +include { PAIRTOOLS_SPLIT } from '../../../modules/local/pairtools/pairtools_split' +//include { PAIRTOOLS_STATS } from '../../../modules/local/pairtools/pairtools_stats' +include { PAIRTOOLS_PARSE } from '../../../modules/local/pairtools/pairtools_parse' + +workflow PAIRTOOLS { + + take: + reads // [meta, read1, read2] + fasta // [meta, fasta] + index // [meta2, path] + frag // path + chrsize // path + + main: + + BWA_MEM( + reads, + index.collect(), + fasta.collect(), + channel.value([]) + ) + + PAIRTOOLS_PARSE( + BWA_MEM.out.bam, + chrsize.collect() + ) + + PAIRTOOLS_RESTRICT( + PAIRTOOLS_PARSE.out.pairsam, + frag.map{it->it[1]}.collect() + ) + + ch_pairsam = params.no_digestion ? PAIRTOOLS_PARSE.out.pairsam : PAIRTOOLS_RESTRICT.out.restrict + PAIRTOOLS_SORT( + ch_pairsam + ) + + ch_valid_pairs = PAIRTOOLS_SORT.out.sorted + .map{ meta, pairs -> + def newMeta = [ id: meta.id, single_end: meta.single_end, part:meta.part ] + [ groupKey(newMeta, meta.part), pairs ] + } + .groupTuple() + .branch { + single: it[0].part <=1 + multiple: it[0].part > 1 + } + + PAIRTOOLS_MERGE( + ch_valid_pairs.multiple + ) + + // Separate pairs/bam files + PAIRTOOLS_SPLIT( + PAIRTOOLS_MERGE.out.pairs.mix(ch_valid_pairs.single) + ) + + // Manage BAM files + SAMTOOLS_SORT( + PAIRTOOLS_SPLIT.out.bam, + fasta, + "bai" + ) + + SAMTOOLS_INDEX( + SAMTOOLS_SORT.out.bam + ) + + SAMTOOLS_FLAGSTAT( + SAMTOOLS_SORT.out.bam.join(SAMTOOLS_INDEX.out.bai) + ) + + PAIRTOOLS_DEDUP( + PAIRTOOLS_SPLIT.out.pairs + ) + + ch_pairselect = params.keep_dups ? PAIRTOOLS_SPLIT.out.pairs : PAIRTOOLS_DEDUP.out.pairs + PAIRTOOLS_SELECT( + ch_pairselect + ) + + PAIRTOOLS_STATS( + PAIRTOOLS_SELECT.out.selected + ) + + PAIRIX( + PAIRTOOLS_SELECT.out.selected + ) + + emit: + pairs = PAIRIX.out.index + bam = PAIRTOOLS_SPLIT.out.bam.join(SAMTOOLS_INDEX.out.bai) + stats = PAIRTOOLS_STATS.out.stats.map{it->it[1]} + flagstat = SAMTOOLS_FLAGSTAT.out.flagstat +} diff --git a/subworkflows/local/pairtools/meta.yml b/subworkflows/local/pairtools/meta.yml new file mode 100644 index 00000000..46cc7bf2 --- /dev/null +++ b/subworkflows/local/pairtools/meta.yml @@ -0,0 +1,84 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "PAIRTOOLS" +description: | + Main workflow to process raw Hi-C sequencing reads into valid interaction pairs + using the Pairtools suite. Aligns reads with BWA, parses and restricts pairs, + sorts and merges them, deduplicates or retains duplicates depending on parameters, + selects valid pairs, computes statistics, and indexes with Pairix. Also manages + BAM files with Samtools for sorting, indexing, and flagstat reporting. +keywords: + - Hi-C + - Pairtools + - Genomics + - Chromosome interactions + - Contact maps +components: + - bwa/mem + - bwamem2/mem + - pairtools/parse + - pairtools/restrict + - pairtools/sort + - pairtools/merge + - pairtools/split + - pairtools/dedup + - pairtools/select + - pairtools/stats + - pairix + - samtools/sort + - samtools/index + - samtools/flagstat +input: + - reads: + type: file + description: | + Raw sequencing reads (paired-end FASTQ files) + pattern: "*.fastq.gz" + - fasta: + type: file + description: | + Reference genome FASTA file + pattern: "*.fa" + - index: + type: directory + description: | + Path to the genome index for BWA mapping + - frag: + type: file + description: | + Restriction fragments file for digestion protocols + pattern: "*.txt" + - chrsize: + type: file + description: | + Chromosome sizes file + pattern: "*.txt" +output: + - pairs: + type: file + description: | + Indexed valid interaction pairs in .pairs format + pattern: "*.pairs" + - bam: + type: file + description: | + BAM files with corresponding index (.bai) after alignment and processing + pattern: "*.bam" + - stats: + type: file + description: | + Pairtools statistics on selected valid pairs + pattern: "*.txt" + - flagstat: + type: file + description: | + Samtools flagstat output for BAM files + pattern: "*.txt" + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome/main.nf similarity index 63% rename from subworkflows/local/prepare_genome.nf rename to subworkflows/local/prepare_genome/main.nf index af2b9d01..1840223a 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -2,10 +2,10 @@ * Prepare Annotation Genome for Hi-C data analysis */ -include { BOWTIE2_BUILD } from '../../modules/nf-core/bowtie2/build/main' -include { BWA_INDEX } from '../../modules/nf-core/bwa/index/main' -include { CUSTOM_GETCHROMSIZES } from '../../modules/nf-core/custom/getchromsizes/main' -include { GET_RESTRICTION_FRAGMENTS } from '../../modules/local/hicpro/get_restriction_fragments' +include { BOWTIE2_BUILD } from '../../../modules/nf-core/bowtie2/build/main.nf' +include { BWA_INDEX } from '../../../modules/nf-core/bwa/index/main' +include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' +include { GET_RESTRICTION_FRAGMENTS } from '../../../modules/local/hicpro/get_restriction_fragments' workflow PREPARE_GENOME { @@ -15,13 +15,12 @@ workflow PREPARE_GENOME { bwa_index main: - ch_versions = Channel.empty() // // Fasta reference genome // def genomeName = params.genome ?: fasta.substring(fasta.lastIndexOf(File.separator)+1) - ch_fasta = Channel.fromPath( fasta ) + ch_fasta = channel.fromPath( fasta ) .ifEmpty { exit 1, "Genome index: Fasta file not found: ${fasta}" } .map{it->[[id:genomeName],it]} @@ -34,9 +33,8 @@ workflow PREPARE_GENOME { ch_fasta ) ch_index = BOWTIE2_BUILD.out.index - ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions) }else{ - ch_index = Channel.fromPath( bwt2_index , checkIfExists: true) + ch_index = channel.fromPath( bwt2_index , checkIfExists: true) .map { it -> [[:], it]} .ifEmpty { exit 1, "Genome index: Provided index not found: ${params.bwt2_index}" } } @@ -51,9 +49,8 @@ workflow PREPARE_GENOME { ch_fasta ) ch_index = BWA_INDEX.out.index - ch_versions = ch_versions.mix(BWA_INDEX.out.versions) }else{ - ch_index = Channel.fromPath( bwa_index , checkIfExists: true) + ch_index = channel.fromPath( bwa_index , checkIfExists: true) .map { it -> [[:], it]} .ifEmpty { exit 1, "Genome index: Provided index not found: ${params.bwa_index}" } } @@ -63,13 +60,13 @@ workflow PREPARE_GENOME { // Chromosome size // if(!params.chromosome_size){ - CUSTOM_GETCHROMSIZES( - ch_fasta - ) - ch_chromsize = CUSTOM_GETCHROMSIZES.out.sizes - ch_versions = ch_versions.mix(CUSTOM_GETCHROMSIZES.out.versions) + SAMTOOLS_FAIDX( + ch_fasta.join(ch_index), + true + ) + ch_chromsize = SAMTOOLS_FAIDX.out.sizes }else{ - ch_chromsize = Channel.fromPath( params.chromosome_size , checkIfExists: true) + ch_chromsize = channel.fromPath( params.chromosome_size , checkIfExists: true) .map { it -> [[:], it]} } @@ -79,15 +76,15 @@ workflow PREPARE_GENOME { // if (params.digestion){ restriction_site = params.digestion ? params.digest[ params.digestion ].restriction_site ?: false : false - ch_restriction_site = Channel.value(restriction_site) + ch_restriction_site = channel.value(restriction_site) ligation_site = params.digestion ? params.digest[ params.digestion ].ligation_site ?: false : false - ch_ligation_site = Channel.value(ligation_site) + ch_ligation_site = channel.value(ligation_site) }else if (params.restriction_site && params.ligation_site){ - ch_restriction_site = Channel.value(params.restriction_site) - ch_ligation_site = Channel.value(params.ligation_site) + ch_restriction_site = channel.value(params.restriction_site) + ch_ligation_site = channel.value(params.ligation_site) }else if (params.no_digestion){ - ch_restriction_site = Channel.empty() - ch_ligation_site = Channel.empty() + ch_restriction_site = channel.empty() + ch_ligation_site = channel.empty() }else{ exit 1, "Ligation motif not found. Please either use the `--digestion` parameters or specify the `--restriction_site` and `--ligation_site`. For DNase/Micro-C Hi-C, please use '--no_digestion' option" } @@ -102,13 +99,12 @@ workflow PREPARE_GENOME { restriction_site ) ch_resfrag = GET_RESTRICTION_FRAGMENTS.out.results - ch_versions = ch_versions.mix(GET_RESTRICTION_FRAGMENTS.out.versions) }else if (!params.no_digestion){ - Channel.fromPath( params.restriction_fragments, checkIfExists: true ) + channel.fromPath( params.restriction_fragments, checkIfExists: true ) .map { it -> [[:], it] } .set {ch_resfrag} }else{ - ch_resfrag = Channel.empty() + ch_resfrag = channel.empty() } emit: @@ -118,5 +114,4 @@ workflow PREPARE_GENOME { res_frag = ch_resfrag restriction_site = ch_restriction_site ligation_site = ch_ligation_site - versions = ch_versions } diff --git a/subworkflows/local/prepare_genome/meta.yml b/subworkflows/local/prepare_genome/meta.yml new file mode 100644 index 00000000..efeab289 --- /dev/null +++ b/subworkflows/local/prepare_genome/meta.yml @@ -0,0 +1,71 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "PREPARE_GENOME" +description: | + Workflow to prepare a reference genome for Hi-C data analysis. Builds Bowtie2 or + BWA indexes depending on the processing mode, generates chromosome sizes, sets + digestion parameters (restriction and ligation sites), and computes restriction + fragments if required. Outputs ready-to-use genome resources for downstream Hi-C + workflows. +keywords: + - Hi-C + - Genome preparation + - Bowtie2 + - BWA + - Restriction fragments + - Chromosome sizes +components: + - bowtie2/build + - bwa/index + - samtools/faidx + - get/restriction/fragments +input: + - fasta: + type: file + description: | + Reference genome FASTA file + pattern: "*.fa" + - bwt2_index: + type: directory + description: | + Optional pre-built Bowtie2 index directory (used if processing mode is hicpro) + - bwa_index: + type: directory + description: | + Optional pre-built BWA index directory (used if processing mode is pairtools) +output: + - fasta: + type: file + description: | + Reference genome FASTA file with metadata + pattern: "*.fa" + - index: + type: directory + description: | + Genome index directory (Bowtie2 or BWA depending on processing mode) + - chromosome_size: + type: file + description: | + Chromosome sizes file generated from the reference genome + pattern: "*.txt" + - res_frag: + type: file + description: | + Restriction fragments file generated from the reference genome + pattern: "*.txt" + - restriction_site: + type: string + description: | + Restriction site motif used for digestion protocols + - ligation_site: + type: string + description: | + Ligation site motif used for digestion protocols + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/tads.nf b/subworkflows/local/tads/main.nf similarity index 69% rename from subworkflows/local/tads.nf rename to subworkflows/local/tads/main.nf index f70a01ff..b62e6cfc 100644 --- a/subworkflows/local/tads.nf +++ b/subworkflows/local/tads/main.nf @@ -1,5 +1,5 @@ -include { COOLTOOLS_INSULATION } from '../../modules/local/cooltools/insulation' -include { HIC_FIND_TADS } from '../../modules/local/hicexplorer/hicFindTADs' +include { COOLTOOLS_INSULATION } from '../../../modules/local/cooltools/insulation.nf' +include { HIC_FIND_TADS } from '../../../modules/local/hicexplorer/hicFindTADs' workflow TADS { @@ -7,8 +7,8 @@ workflow TADS { cool main: - ch_versions = Channel.empty() - ch_tads = Channel.empty() + ch_versions = channel.empty() + ch_tads = channel.empty() if (params.tads_caller =~ 'insulation'){ COOLTOOLS_INSULATION(cool) diff --git a/subworkflows/local/tads/meta.yml b/subworkflows/local/tads/meta.yml new file mode 100644 index 00000000..a518b018 --- /dev/null +++ b/subworkflows/local/tads/meta.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "TADS" +description: | + Workflow to identify Topologically Associating Domains (TADs) from Hi-C data. + Supports two callers: Cooltools Insulation and HiCExplorer hicFindTADs. + Takes a .cool file as input and outputs TAD calls along with tool version + information. +keywords: + - Hi-C + - TADs + - Cooltools + - HiCExplorer + - Genomics +components: + - cooltools/insulation + - hic/find/tads +input: + - cool: + type: file + description: | + Input Hi-C contact map in .cool format + pattern: "*.cool" +output: + - tads: + type: file + description: | + TAD calls generated by the selected caller (TSV or results file) + pattern: "*.tsv" + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/local/utils_nfcore_hic_pipeline/main.nf b/subworkflows/local/utils_nfcore_hic_pipeline/main.nf index 3be4df07..28af8426 100644 --- a/subworkflows/local/utils_nfcore_hic_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_hic_pipeline/main.nf @@ -7,16 +7,13 @@ IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin' -include { paramsSummaryMap } from 'plugin/nf-schema' +include { UTILS_NEXTFLOW_PIPELINE } from '../../../subworkflows/nf-core/utils_nextflow_pipeline/main.nf' +include { UTILS_NFCORE_PIPELINE } from '../../../subworkflows/nf-core/utils_nfcore_pipeline/main.nf' +include { UTILS_NFSCHEMA_PLUGIN } from '../../../subworkflows/nf-core/utils_nfschema_plugin/main.nf' +include { completionSummary } from '../../../subworkflows/nf-core/utils_nfcore_pipeline' include { samplesheetToList } from 'plugin/nf-schema' -include { paramsHelp } from 'plugin/nf-schema' -include { completionEmail } from '../../nf-core/utils_nfcore_pipeline' -include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' -include { imNotification } from '../../nf-core/utils_nfcore_pipeline' -include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' -include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' +include { paramsSummaryMap } from 'plugin/nf-schema' + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -54,35 +51,16 @@ workflow PIPELINE_INITIALISATION { // // Validate parameters and generate parameter summary to stdout // - before_text = """ --\033[2m----------------------------------------------------\033[0m- - \033[0;32m,--.\033[0;30m/\033[0;32m,-.\033[0m -\033[0;34m ___ __ __ __ ___ \033[0;32m/,-._.--~\'\033[0m -\033[0;34m |\\ | |__ __ / ` / \\ |__) |__ \033[0;33m} {\033[0m -\033[0;34m | \\| | \\__, \\__/ | \\ |___ \033[0;32m\\`-._,-`-,\033[0m - \033[0;32m`._,._,\'\033[0m -\033[0;35m nf-core/hic ${workflow.manifest.version}\033[0m --\033[2m----------------------------------------------------\033[0m- -""" - after_text = """${workflow.manifest.doi ? "\n* The pipeline\n" : ""}${workflow.manifest.doi.tokenize(",").collect { doi -> " https://doi.org/${doi.trim().replace('https://doi.org/','')}"}.join("\n")}${workflow.manifest.doi ? "\n" : ""} -* The nf-core framework - https://doi.org/10.1038/s41587-020-0439-x - -* Software dependencies - https://github.com/nf-core/hic/blob/master/CITATIONS.md -""" - command = "nextflow run ${workflow.manifest.name} -profile --input samplesheet.csv --outdir " - - UTILS_NFSCHEMA_PLUGIN ( - workflow, - validate_params, - null, - help, - help_full, - show_hidden, - before_text, - after_text, - command + UTILS_NFSCHEMA_PLUGIN( + workflow, // input_workflow + validate_params, // validate_params + null, // parameters_schema (null: will use default schema) + false, // help (true: help message) + false, // help_full (true: full help message) + false, // show_hidden (true: show hidden params) + "", // before_text (string before help message) + "", // after_text (string after help message) + "" // command (example command string) ) // diff --git a/subworkflows/local/utils_nfcore_hic_pipeline/meta.yml b/subworkflows/local/utils_nfcore_hic_pipeline/meta.yml new file mode 100644 index 00000000..1375d753 --- /dev/null +++ b/subworkflows/local/utils_nfcore_hic_pipeline/meta.yml @@ -0,0 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "PIPELINE_INITIALISATION" +description: | + Subworkflow to initialise the nf-core/hic pipeline. Handles version printing, + parameter validation, configuration checks, and creation of the input samplesheet + channel from the provided samplesheet file. +keywords: + - Hi-C + - Pipeline initialisation + - nf-core + - Parameters + - Samplesheet +components: + - utils/nextflow/pipeline + - utils/nfschema/plugin + - utils/nfcore/pipeline + - completionsummary +input: + - version: + type: boolean + description: | + Print pipeline version and exit + - validate_params: + type: boolean + description: | + Validate parameters against the schema at runtime + - monochrome_logs: + type: boolean + description: | + Disable coloured log outputs + - nextflow_cli_args: + type: array + description: | + List of positional Nextflow CLI arguments + - outdir: + type: string + description: | + Output directory where results will be saved + - input: + type: string + description: | + Path to input samplesheet +output: + - samplesheet: + type: file + description: | + Channel containing validated input samplesheet entries + - versions: + type: file + description: | + Versions of tools used in the workflow +authors: + - "@nservant" +maintainers: + - "@nservant" + - "@Thibault-Poinsignon" diff --git a/subworkflows/nf-core/utils_nfschema_plugin/main.nf b/subworkflows/nf-core/utils_nfschema_plugin/main.nf index ee4738c8..1df8b76f 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/main.nf +++ b/subworkflows/nf-core/utils_nfschema_plugin/main.nf @@ -38,7 +38,7 @@ workflow UTILS_NFSCHEMA_PLUGIN { } log.info paramsHelp( help_options, - params.help instanceof String ? params.help : "", + (params.help instanceof String && params.help != "true") ? params.help : "", ) exit 0 } @@ -71,4 +71,3 @@ workflow UTILS_NFSCHEMA_PLUGIN { emit: dummy_emit = true } - diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config index 8d8c7371..f6537cc3 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config @@ -1,5 +1,5 @@ plugins { - id "nf-schema@2.5.1" + id "nf-schema@2.6.1" } validation { diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index e3bc71e2..2c5c17fe 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -3,68 +3,35 @@ "content": [ { "BOWTIE2_ALIGN": { - "bowtie2": "2.5.2", - "pigz": 2.6, - "samtools": 1.18 + "bowtie2": "2.5.4", + "pigz": 2.8, + "samtools": 1.21 }, "BOWTIE2_ALIGN_TRIMMED": { - "bowtie2": "2.5.2", - "pigz": 2.6, - "samtools": 1.18 + "bowtie2": "2.5.4", + "pigz": 2.8, + "samtools": 1.21 }, - "COMBINE_MATES": { - "python": "3.9.12" + "BOWTIE2_BUILD": { + "bowtie2": "2.5.4" }, "COOLER_BALANCE": { - "cooler": "0.9.2" + "cooler": "0.10.4" }, "COOLER_CLOAD": { - "cooler": "0.9.2" + "cooler": "0.10.4" }, "COOLER_DUMP": { - "cooler": "0.9.2" + "cooler": "0.10.3" }, "COOLER_MAKEBINS": { - "cooler": "0.9.2" - }, - "COOLER_ZOOMIFY": { - "cooler": "0.9.2" - }, - "COOLTOOLS_EIGSCIS": { - "cooltools": "0.5.1" - }, - "COOLTOOLS_INSULATION": { - "cooltools": "0.5.1" + "cooler": "0.10.4" }, "FASTQC": { "fastqc": "0.12.1" }, - "GET_VALID_INTERACTION": { - "python": "3.9.12" - }, - "HICPRO2PAIRS": { - "pairix": "0.3.7" - }, - "HIC_FIND_TADS": { - "hicexplorer": "3.7.2" - }, - "HIC_PLOT_DIST_VS_COUNTS": { - "hicexplorer": "3.7.2" - }, - "MERGE_BOWTIE2": { - "samtools": "1.15.1" - }, - "MERGE_STATS": { - "python": "3.9.12" - }, - "MERGE_VALID_INTERACTION": { - "sort": 8.3 - }, - "SPLIT_COOLER_DUMP": { - "cooler": null - }, - "TRIM_READS": { - "gzip": 1.1 + "SAMTOOLS_FAIDX": { + "samtools": "1.22.1" }, "Workflow": { "nf-core/hic": "v2.2.0dev" @@ -82,7 +49,6 @@ "contact_maps/cool", "contact_maps/cool/SRR4292758.1000_balanced.cool", "contact_maps/cool/SRR4292758.2000_balanced.cool", - "contact_maps/cool/SRR4292758.mcool", "contact_maps/txt", "contact_maps/txt/SRR4292758.1000_balanced.txt", "contact_maps/txt/SRR4292758.2000_balanced.txt", @@ -136,6 +102,7 @@ "multiqc/multiqc_data/multiqc_sources.txt", "multiqc/multiqc_plots", "multiqc/multiqc_plots/pdf", + "multiqc/multiqc_plots/pdf/fastqc-status-check-heatmap.pdf", "multiqc/multiqc_plots/pdf/fastqc_adapter_content_plot.pdf", "multiqc/multiqc_plots/pdf/fastqc_per_base_n_content_plot.pdf", "multiqc/multiqc_plots/pdf/fastqc_per_base_sequence_quality_plot.pdf", @@ -156,6 +123,7 @@ "multiqc/multiqc_plots/pdf/hicpro_pairing_stats_plot-cnt.pdf", "multiqc/multiqc_plots/pdf/hicpro_pairing_stats_plot-pct.pdf", "multiqc/multiqc_plots/png", + "multiqc/multiqc_plots/png/fastqc-status-check-heatmap.png", "multiqc/multiqc_plots/png/fastqc_adapter_content_plot.png", "multiqc/multiqc_plots/png/fastqc_per_base_n_content_plot.png", "multiqc/multiqc_plots/png/fastqc_per_base_sequence_quality_plot.png", @@ -176,6 +144,7 @@ "multiqc/multiqc_plots/png/hicpro_pairing_stats_plot-cnt.png", "multiqc/multiqc_plots/png/hicpro_pairing_stats_plot-pct.png", "multiqc/multiqc_plots/svg", + "multiqc/multiqc_plots/svg/fastqc-status-check-heatmap.svg", "multiqc/multiqc_plots/svg/fastqc_adapter_content_plot.svg", "multiqc/multiqc_plots/svg/fastqc_per_base_n_content_plot.svg", "multiqc/multiqc_plots/svg/fastqc_per_base_sequence_quality_plot.svg", @@ -198,6 +167,9 @@ "multiqc/multiqc_report.html", "pipeline_info", "pipeline_info/nf_core_hic_software_mqc_versions.yml", + "samtools", + "samtools/W303_SGD_2015_JRIU00000000.fsa.fai", + "samtools/W303_SGD_2015_JRIU00000000.fsa.sizes", "tads", "tads/hicExplorer", "tads/hicExplorer/SRR4292758.1000_balanced_hicfindtads_boundaries.bed", @@ -212,99 +184,68 @@ [ "cooler_bins_1000.bed:md5,69b3eee6a4826015108e29487cd6288f", "cooler_bins_2000.bed:md5,b5b5c94246c99473376d4cfc4580645d", - "SRR4292758.1000_balanced.txt:md5,6d6f9dd0e2faef74c6bbcdd8ea8b8907", - "SRR4292758.2000_balanced.txt:md5,a868a2aea0b6a194ab19c2d8a72f99f8", - "SRR4292758_distcount.png:md5,5314c9ad16a1e857682fde4e584103bc", - "SRR4292758_distcount.txt:md5,bac196d56bcb489c2ef6fe2ea26e07c9", - "SRR4292758_allValidPairs.mergestat:md5,b0a81a4d69ea8e44495a714ac87701e8", - "SRR4292758.allValidPairs:md5,55e00a772766779f5d5c2bf2b6fcef6d", - "SRR4292758_contacts.pairs.gz:md5,201d59212cf443fe5da09dbddeef8677", - "SRR4292758_contacts.pairs.gz.px2:md5,6275247d930753121aa026870864aa25", + "SRR4292758.1000_balanced.txt:md5,7e6fad9ffca70a6f72c8a8727ca23251", + "SRR4292758.2000_balanced.txt:md5,853427e47ba03d0c723c9fba2e7813b3", + "SRR4292758_distcount.png:md5,421161f55fc6312dfafcab76ca943d0d", + "SRR4292758_distcount.txt:md5,ba63d855abcaab7bd8c93f48f47e6c7c", + "SRR4292758_allValidPairs.mergestat:md5,161d7d9c2f63a952edc0d25359015d96", + "SRR4292758.allValidPairs:md5,824f389cb55656139a56d8185ea3f0f4", + "SRR4292758_contacts.pairs.gz:md5,27eabbaedf0b55d675addf05e165eda2", + "SRR4292758_contacts.pairs.gz.px2:md5,db3653be8c0229a0f32d6d0f0e7fcf24", "fastqc-status-check-heatmap.txt:md5,755d1909854791c227d1000b38c977e9", - "hicpro_contact_plot.txt:md5,4a0ae6c30b400f3f7e5d14c5b4db0d5c", + "hicpro_contact_plot.txt:md5,026bd3f93ce85d7b695f2cc332ef1551", "hicpro_pairing_stats_plot.txt:md5,b2f918d8f9919aaa30a0ea15f4522876", "multiqc_citations.txt:md5,76bcbb4e4103209b523ed9da8fef74bc", + "W303_SGD_2015_JRIU00000000.fsa.fai:md5,85017cce3858d13e8731f776bd639a35", + "W303_SGD_2015_JRIU00000000.fsa.sizes:md5,a88ab0b08622c99b9dba93752bda41d4", "SRR4292758.1000_balanced_hicfindtads_boundaries.bed:md5,d41d8cd98f00b204e9800998ecf8427e", "SRR4292758.1000_balanced_hicfindtads_boundaries.gff:md5,d41d8cd98f00b204e9800998ecf8427e", "SRR4292758.1000_balanced_hicfindtads_domains.bed:md5,d41d8cd98f00b204e9800998ecf8427e", - "SRR4292758.1000_balanced_hicfindtads_score.bedgraph:md5,da38c91d9b23820e290d2c987f27ab70", - "SRR4292758.1000_balanced_hicfindtads_tad_score.bm:md5,81b33e5cd3ff14efac94c2065ac68fe1", - "SRR4292758.1000_balanced_insulation.tsv:md5,fd0a37e94600e9da4c8de0c58f07e3ed" + "SRR4292758.1000_balanced_hicfindtads_score.bedgraph:md5,e12e13b248914e62c34aff42204ea262", + "SRR4292758.1000_balanced_hicfindtads_tad_score.bm:md5,b7dfaa33f19ebea0983e428298317664", + "SRR4292758.1000_balanced_insulation.tsv:md5,e2ce1056f11fc3bf432de642341cc6ab" ] ], "meta": { "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-03-04T13:28:11.720729278" + "timestamp": "2026-03-10T10:53:26.768807069" }, "Should split fastqs": { "content": [ - 69, + 68, { "BOWTIE2_ALIGN": { - "bowtie2": "2.5.2", - "pigz": 2.6, - "samtools": 1.18 + "bowtie2": "2.5.4", + "pigz": 2.8, + "samtools": 1.21 }, "BOWTIE2_ALIGN_TRIMMED": { - "bowtie2": "2.5.2", - "pigz": 2.6, - "samtools": 1.18 + "bowtie2": "2.5.4", + "pigz": 2.8, + "samtools": 1.21 }, - "COMBINE_MATES": { - "python": "3.9.12" + "BOWTIE2_BUILD": { + "bowtie2": "2.5.4" }, "COOLER_BALANCE": { - "cooler": "0.9.2" + "cooler": "0.10.4" }, "COOLER_CLOAD": { - "cooler": "0.9.2" + "cooler": "0.10.4" }, "COOLER_DUMP": { - "cooler": "0.9.2" + "cooler": "0.10.3" }, "COOLER_MAKEBINS": { - "cooler": "0.9.2" - }, - "COOLER_ZOOMIFY": { - "cooler": "0.9.2" - }, - "COOLTOOLS_EIGSCIS": { - "cooltools": "0.5.1" - }, - "COOLTOOLS_INSULATION": { - "cooltools": "0.5.1" + "cooler": "0.10.4" }, "FASTQC": { "fastqc": "0.12.1" }, - "GET_VALID_INTERACTION": { - "python": "3.9.12" - }, - "HICPRO2PAIRS": { - "pairix": "0.3.7" - }, - "HIC_FIND_TADS": { - "hicexplorer": "3.7.2" - }, - "HIC_PLOT_DIST_VS_COUNTS": { - "hicexplorer": "3.7.2" - }, - "MERGE_BOWTIE2": { - "samtools": "1.15.1" - }, - "MERGE_STATS": { - "python": "3.9.12" - }, - "MERGE_VALID_INTERACTION": { - "sort": 8.3 - }, - "SPLIT_COOLER_DUMP": { - "cooler": null - }, - "TRIM_READS": { - "gzip": 1.1 + "SAMTOOLS_FAIDX": { + "samtools": "1.22.1" } }, [ @@ -319,7 +260,6 @@ "contact_maps/cool", "contact_maps/cool/SRR4292758.1000_balanced.cool", "contact_maps/cool/SRR4292758.2000_balanced.cool", - "contact_maps/cool/SRR4292758.mcool", "contact_maps/txt", "contact_maps/txt/SRR4292758.1000_balanced.txt", "contact_maps/txt/SRR4292758.2000_balanced.txt", @@ -376,6 +316,7 @@ "multiqc/multiqc_data/multiqc_sources.txt", "multiqc/multiqc_plots", "multiqc/multiqc_plots/pdf", + "multiqc/multiqc_plots/pdf/fastqc-status-check-heatmap.pdf", "multiqc/multiqc_plots/pdf/fastqc_adapter_content_plot.pdf", "multiqc/multiqc_plots/pdf/fastqc_per_base_n_content_plot.pdf", "multiqc/multiqc_plots/pdf/fastqc_per_base_sequence_quality_plot.pdf", @@ -396,6 +337,7 @@ "multiqc/multiqc_plots/pdf/hicpro_pairing_stats_plot-cnt.pdf", "multiqc/multiqc_plots/pdf/hicpro_pairing_stats_plot-pct.pdf", "multiqc/multiqc_plots/png", + "multiqc/multiqc_plots/png/fastqc-status-check-heatmap.png", "multiqc/multiqc_plots/png/fastqc_adapter_content_plot.png", "multiqc/multiqc_plots/png/fastqc_per_base_n_content_plot.png", "multiqc/multiqc_plots/png/fastqc_per_base_sequence_quality_plot.png", @@ -416,6 +358,7 @@ "multiqc/multiqc_plots/png/hicpro_pairing_stats_plot-cnt.png", "multiqc/multiqc_plots/png/hicpro_pairing_stats_plot-pct.png", "multiqc/multiqc_plots/svg", + "multiqc/multiqc_plots/svg/fastqc-status-check-heatmap.svg", "multiqc/multiqc_plots/svg/fastqc_adapter_content_plot.svg", "multiqc/multiqc_plots/svg/fastqc_per_base_n_content_plot.svg", "multiqc/multiqc_plots/svg/fastqc_per_base_sequence_quality_plot.svg", @@ -438,6 +381,9 @@ "multiqc/multiqc_report.html", "pipeline_info", "pipeline_info/nf_core_hic_software_mqc_versions.yml", + "samtools", + "samtools/W303_SGD_2015_JRIU00000000.fsa.fai", + "samtools/W303_SGD_2015_JRIU00000000.fsa.sizes", "tads", "tads/hicExplorer", "tads/hicExplorer/SRR4292758.1000_balanced_hicfindtads_boundaries.bed", @@ -452,30 +398,32 @@ [ "cooler_bins_1000.bed:md5,69b3eee6a4826015108e29487cd6288f", "cooler_bins_2000.bed:md5,b5b5c94246c99473376d4cfc4580645d", - "SRR4292758.1000_balanced.txt:md5,6d6f9dd0e2faef74c6bbcdd8ea8b8907", - "SRR4292758.2000_balanced.txt:md5,a868a2aea0b6a194ab19c2d8a72f99f8", - "SRR4292758_distcount.png:md5,5314c9ad16a1e857682fde4e584103bc", - "SRR4292758_distcount.txt:md5,bac196d56bcb489c2ef6fe2ea26e07c9", - "SRR4292758_allValidPairs.mergestat:md5,b0a81a4d69ea8e44495a714ac87701e8", - "SRR4292758.allValidPairs:md5,55e00a772766779f5d5c2bf2b6fcef6d", - "SRR4292758_contacts.pairs.gz:md5,201d59212cf443fe5da09dbddeef8677", - "SRR4292758_contacts.pairs.gz.px2:md5,6275247d930753121aa026870864aa25", + "SRR4292758.1000_balanced.txt:md5,7e6fad9ffca70a6f72c8a8727ca23251", + "SRR4292758.2000_balanced.txt:md5,853427e47ba03d0c723c9fba2e7813b3", + "SRR4292758_distcount.png:md5,421161f55fc6312dfafcab76ca943d0d", + "SRR4292758_distcount.txt:md5,ba63d855abcaab7bd8c93f48f47e6c7c", + "SRR4292758_allValidPairs.mergestat:md5,161d7d9c2f63a952edc0d25359015d96", + "SRR4292758.allValidPairs:md5,824f389cb55656139a56d8185ea3f0f4", + "SRR4292758_contacts.pairs.gz:md5,27eabbaedf0b55d675addf05e165eda2", + "SRR4292758_contacts.pairs.gz.px2:md5,db3653be8c0229a0f32d6d0f0e7fcf24", "fastqc-status-check-heatmap.txt:md5,755d1909854791c227d1000b38c977e9", - "hicpro_contact_plot.txt:md5,4a0ae6c30b400f3f7e5d14c5b4db0d5c", + "hicpro_contact_plot.txt:md5,026bd3f93ce85d7b695f2cc332ef1551", "hicpro_pairing_stats_plot.txt:md5,b2f918d8f9919aaa30a0ea15f4522876", "multiqc_citations.txt:md5,76bcbb4e4103209b523ed9da8fef74bc", + "W303_SGD_2015_JRIU00000000.fsa.fai:md5,85017cce3858d13e8731f776bd639a35", + "W303_SGD_2015_JRIU00000000.fsa.sizes:md5,a88ab0b08622c99b9dba93752bda41d4", "SRR4292758.1000_balanced_hicfindtads_boundaries.bed:md5,d41d8cd98f00b204e9800998ecf8427e", "SRR4292758.1000_balanced_hicfindtads_boundaries.gff:md5,d41d8cd98f00b204e9800998ecf8427e", "SRR4292758.1000_balanced_hicfindtads_domains.bed:md5,d41d8cd98f00b204e9800998ecf8427e", - "SRR4292758.1000_balanced_hicfindtads_score.bedgraph:md5,da38c91d9b23820e290d2c987f27ab70", - "SRR4292758.1000_balanced_hicfindtads_tad_score.bm:md5,81b33e5cd3ff14efac94c2065ac68fe1", - "SRR4292758.1000_balanced_insulation.tsv:md5,fd0a37e94600e9da4c8de0c58f07e3ed" + "SRR4292758.1000_balanced_hicfindtads_score.bedgraph:md5,e12e13b248914e62c34aff42204ea262", + "SRR4292758.1000_balanced_hicfindtads_tad_score.bm:md5,b7dfaa33f19ebea0983e428298317664", + "SRR4292758.1000_balanced_insulation.tsv:md5,e2ce1056f11fc3bf432de642341cc6ab" ] ], "meta": { "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-03-04T13:31:03.874257745" + "timestamp": "2026-03-10T11:50:05.416293782" } } \ No newline at end of file diff --git a/workflows/hic.nf b/workflows/hic.nf index 6b3a5794..1df493f8 100644 --- a/workflows/hic.nf +++ b/workflows/hic.nf @@ -19,48 +19,7 @@ include { PAIRTOOLS } from '../subworkflows/local/pairtools' include { COOLER } from '../subworkflows/local/cooler' include { COMPARTMENTS } from '../subworkflows/local/compartments' include { TADS } from '../subworkflows/local/tads' - -//**************************************** -// Combine all maps resolution for downstream analysis - -ch_map_res = Channel.from( params.bin_size ).splitCsv().flatten().toInteger() - -if (params.res_zoomify){ - ch_zoom_res = Channel.from( params.res_zoomify ).splitCsv().flatten().toInteger() - ch_map_res = ch_map_res.concat(ch_zoom_res) -} - -if (params.res_tads && !params.skip_tads){ - ch_tads_res = Channel.from( "${params.res_tads}" ).splitCsv().flatten().toInteger() - ch_map_res = ch_map_res.concat(ch_tads_res) -}else{ - ch_tads_res=Channel.empty() - if (!params.skip_tads){ - log.warn "[nf-core/hic] Hi-C resolution for TADs calling not specified. See --res_tads" - } -} - -if (params.res_dist_decay && !params.skip_dist_decay){ - ch_ddecay_res = Channel.from( "${params.res_dist_decay}" ).splitCsv().flatten().toInteger() - ch_map_res = ch_map_res.concat(ch_ddecay_res) -}else{ - ch_ddecay_res = Channel.empty() - if (!params.skip_dist_decay){ - log.warn "[nf-core/hic] Hi-C resolution for distance decay not specified. See --res_dist_decay" - } -} - -if (params.res_compartments && !params.skip_compartments){ - ch_comp_res = Channel.from( "${params.res_compartments}" ).splitCsv().flatten().toInteger() - ch_map_res = ch_map_res.concat(ch_comp_res) -}else{ - ch_comp_res = Channel.empty() - if (!params.skip_compartments){ - log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" - } -} - -ch_map_res = ch_map_res.unique() +include { TRIMGALORE } from '../modules/nf-core/trimgalore/main.nf' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -81,8 +40,62 @@ workflow HIC { main: + //**************************************** + // Combine all maps resolution for downstream analysis + + ch_map_res = channel.from( params.bin_size.toString()).splitCsv().flatten().toInteger() + + if (params.res_zoomify){ + ch_zoom_res = channel.from( params.res_zoomify.toString()).splitCsv().flatten().toInteger() + ch_map_res = ch_map_res.concat(ch_zoom_res) + } else { + ch_zoom_res = ch_map_res.min() + } + + if (params.res_tads && !params.skip_tads){ + ch_tads_res = channel.from( "${params.res_tads}" ).splitCsv().flatten().toInteger() + ch_map_res = ch_map_res.concat(ch_tads_res) + }else{ + ch_tads_res=channel.empty() + if (!params.skip_tads){ + log.warn "[nf-core/hic] Hi-C resolution for TADs calling not specified. See --res_tads" + } + } + + if (params.res_dist_decay && !params.skip_dist_decay){ + ch_ddecay_res = channel.from( "${params.res_dist_decay}" ).splitCsv().flatten().toInteger() + ch_map_res = ch_map_res.concat(ch_ddecay_res) + }else{ + ch_ddecay_res = channel.empty() + if (!params.skip_dist_decay){ + log.warn "[nf-core/hic] Hi-C resolution for distance decay not specified. See --res_dist_decay" + } + } + + if (params.res_compartments && !params.skip_compartments){ + ch_comp_res = channel.from( "${params.res_compartments}" ).splitCsv().flatten().toInteger() + ch_map_res = ch_map_res.concat(ch_comp_res) + }else{ + ch_comp_res = channel.empty() + if (!params.skip_compartments){ + log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" + } + } + + ch_map_res = ch_map_res.unique() ch_versions = channel.empty() ch_multiqc_files = channel.empty() + + // + // MODULE: Run trimgalore + // + if (params.digestion == 'arimaV2'){ + TRIMGALORE ( + ch_samplesheet + ) + ch_samplesheet = TRIMGALORE.out.reads + } + // // MODULE: Run FastQC // @@ -90,7 +103,7 @@ workflow HIC { ch_samplesheet ) ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}) - ch_versions = ch_versions.mix(FASTQC.out.versions.first()) + // // SUB-WORFLOW: HiC-Pro @@ -105,7 +118,6 @@ workflow HIC { ch_ligation_site, ch_map_res ) - ch_versions = ch_versions.mix(HICPRO.out.versions) ch_pairs = HICPRO.out.pairs ch_process_mqc = HICPRO.out.mqc }else if (params.processing == 'pairtools'){ @@ -116,7 +128,6 @@ workflow HIC { ch_res_frag, ch_chromosome_size ) - ch_versions = ch_versions.mix(PAIRTOOLS.out.versions) ch_pairs = PAIRTOOLS.out.pairs ch_process_mqc = PAIRTOOLS.out.stats } @@ -127,9 +138,9 @@ workflow HIC { COOLER ( ch_pairs, ch_chromosome_size, - ch_map_res + ch_map_res, + ch_zoom_res ) - ch_versions = ch_versions.mix(COOLER.out.versions) // // MODULE: HICEXPLORER/HIC_PLOT_DIST_VS_COUNTS @@ -144,7 +155,6 @@ workflow HIC { HIC_PLOT_DIST_VS_COUNTS( ch_distdecay ) - ch_versions = ch_versions.mix(HIC_PLOT_DIST_VS_COUNTS.out.versions) } // @@ -162,7 +172,6 @@ workflow HIC { ch_fasta, ch_chromosome_size ) - ch_versions = ch_versions.mix(COMPARTMENTS.out.versions) } // @@ -178,19 +187,18 @@ workflow HIC { TADS( ch_cool_tads ) - ch_versions = ch_versions.mix(TADS.out.versions) } // // Collate and save software versions // - def topic_versions = Channel.topic("versions") + + def topic_versions = channel.topic("versions") .distinct() .branch { entry -> versions_file: entry instanceof Path versions_tuple: true } - def topic_versions_string = topic_versions.versions_tuple .map { process, tool, version -> [ process[process.lastIndexOf(':')+1..-1], " ${tool}: ${version}" ] @@ -200,63 +208,46 @@ workflow HIC { tool_versions.unique().sort() "${process}:\n${tool_versions.join('\n')}" } - - softwareVersionsToYAML(ch_versions.mix(topic_versions.versions_file)) + ch_collated_versions = softwareVersionsToYAML(ch_versions.mix(topic_versions.versions_file)) .mix(topic_versions_string) - .collectFile( - storeDir: "${params.outdir}/pipeline_info", - name: 'nf_core_' + 'hic_software_' + 'mqc_' + 'versions.yml', - sort: true, - newLine: true - ).set { ch_collated_versions } - // // MODULE: MultiQC // - ch_multiqc_config = channel.fromPath( - "$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? - channel.fromPath(params.multiqc_config, checkIfExists: true) : - channel.empty() - ch_multiqc_logo = params.multiqc_logo ? - channel.fromPath(params.multiqc_logo, checkIfExists: true) : - channel.empty() - - summary_params = paramsSummaryMap( - workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = channel.value(paramsSummaryMultiqc(summary_params)) - ch_multiqc_files = ch_multiqc_files.mix( - ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - ch_multiqc_custom_methods_description = params.multiqc_methods_description ? - file(params.multiqc_methods_description, checkIfExists: true) : - file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = channel.value( - methodsDescriptionText(ch_multiqc_custom_methods_description)) - - ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) - ch_multiqc_files = ch_multiqc_files.mix( - ch_methods_description.collectFile( - name: 'methods_description_mqc.yaml', - sort: true - ) - ) + + ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions.collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_hic_software_mqc_versions.yml', sort: true, newLine: true)) + + def ch_summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + def ch_workflow_summary = channel.value(paramsSummaryMultiqc(ch_summary_params)) + ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) + + def ch_multiqc_custom_methods_description = params.multiqc_methods_description + ? file(params.multiqc_methods_description, checkIfExists: true) + : file("${projectDir}/assets/methods_description_template.yml", checkIfExists: true) + def ch_methods_description = channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) + ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: true)) if (params.processing == 'hicpro'){ ch_multiqc_files = ch_multiqc_files.mix(HICPRO.out.mqc) } - MULTIQC ( - ch_multiqc_files.collect(), - ch_multiqc_config.toList(), - ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList(), - [], - [] + MULTIQC( + ch_multiqc_files.flatten().collect().map { files -> + [ + [id: 'hic'], + files, + params.multiqc_config + ? file(params.multiqc_config, checkIfExists: true) + : file("${projectDir}/assets/multiqc_config.yml", checkIfExists: true), + params.multiqc_logo ? file(params.multiqc_logo, checkIfExists: true) : [], + [], + [], + ] + } ) - emit:multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html - versions = ch_versions // channel: [ path(versions.yml) ] + emit: + multiqc_report = MULTIQC.out.report.map { _meta, report -> [report] }.toList() // channel: /path/to/multiqc_report.html }