diff --git a/conf/modules.config b/conf/modules.config index 7232e3f9b..497f8eff2 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -1012,7 +1012,7 @@ process { } withName: MALTEXTRACT { - ext.args = [ + ext.args = { [ "-f ${params.metagenomics_maltextract_filter}", "-a ${params.metagenomics_maltextract_toppercent}", "--minPI ${params.metagenomics_maltextract_minpercentidentity}", @@ -1022,8 +1022,8 @@ process { params.metagenomics_maltextract_matches ? "--matches" : "", params.metagenomics_maltextract_megansummary ? "--meganSummary" : "", params.metagenomics_maltextract_usetopalignment ? "--useTopAlignment" : "", - { meta.strandedness } == "single" ? '--singleStranded' : '', - ].join(' ').trim() + meta.strandedness == "single" ? '--singleStranded' : '', + ].join(' ').trim() } publishDir = [ path: { "${params.outdir}/metagenomics/postprocessing/maltextract/" }, mode: params.publish_dir_mode, @@ -1391,7 +1391,7 @@ process { } withName: MALTEXTRACT { - ext.args = [ + ext.args = { [ "-f ${params.metagenomics_maltextract_filter}", "-a ${params.metagenomics_maltextract_toppercent}", "--minPI ${params.metagenomics_maltextract_minpercentidentity}", @@ -1401,8 +1401,8 @@ process { params.metagenomics_maltextract_matches ? "--matches" : "", params.metagenomics_maltextract_megansummary ? "--meganSummary" : "", params.metagenomics_maltextract_usetopalignment ? "--useTopAlignment" : "", - { meta.strandedness } == "single" ? '--singleStranded' : '', - ].join(' ').trim() + meta.strandedness == "single" ? '--singleStranded' : '', + ].join(' ').trim() } publishDir = [ [ path: { "${params.outdir}/metagenomics/maltextract/stats/" }, diff --git a/modules.json b/modules.json index 3371aebf3..4199ffe64 100644 --- a/modules.json +++ b/modules.json @@ -77,7 +77,7 @@ }, "bwa/index": { "branch": "master", - "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", + "git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120", "installed_by": ["modules"] }, "bwa/mem": { @@ -317,7 +317,7 @@ }, "samtools/mpileup": { "branch": "master", - "git_sha": "ce0b1aed7d504883061e748f492a31bf44c5777c", + "git_sha": "f0393b4566f19f0d08986c839f28a14d44901bff", "installed_by": ["modules"] }, "samtools/sort": { @@ -328,7 +328,8 @@ "samtools/view": { "branch": "master", "git_sha": "8d8f0ae52d6c9342bd41c33dda0b74b07e32153d", - "installed_by": ["bam_split_by_region"] + "installed_by": ["bam_split_by_region"], + "patch": "modules/nf-core/samtools/view/samtools-view.diff" }, "seqkit/split2": { "branch": "master", @@ -377,7 +378,8 @@ "bam_split_by_region": { "branch": "master", "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", - "installed_by": ["subworkflows"] + "installed_by": ["subworkflows"], + "patch": "subworkflows/nf-core/bam_split_by_region/bam_split_by_region.diff" }, "fastq_align_bwaaln": { "branch": "master", diff --git a/modules/nf-core/bwa/index/environment.yml b/modules/nf-core/bwa/index/environment.yml index 126e00344..54e679492 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 2e48b6caa..a1c98acee 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 { 7.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' }" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + '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 6bbc87a64..f5bf7f52a 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 5fc8d4966..f0fba82a1 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test +++ b/modules/nf-core/bwa/index/tests/main.nf.test @@ -15,19 +15,43 @@ 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 assertAll( - { assert process.success }, { 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 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 e51ad5bf2..21a6f73c3 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,0f20525da90e7489a7ebb02adca3265f" + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] ], "index": [ [ @@ -33,11 +90,19 @@ ] ] ], - "versions": [ - "versions.yml:md5,0f20525da90e7489a7ebb02adca3265f" + "versions_bwa": [ + [ + "BWA_INDEX", + "bwa", + "0.7.19-r1273" + ] ] } ], - "timestamp": "2023-10-17T17:20:20.180927714" + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "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 28bb483c4..000000000 --- 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/samtools/mpileup/environment.yml b/modules/nf-core/samtools/mpileup/environment.yml index ae6e31d35..89e12a645 100644 --- a/modules/nf-core/samtools/mpileup/environment.yml +++ b/modules/nf-core/samtools/mpileup/environment.yml @@ -1,8 +1,10 @@ -name: samtools_mpileup +--- +# 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.18 - - bioconda::htslib=1.18 + # 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/mpileup/main.nf b/modules/nf-core/samtools/mpileup/main.nf index 3e4cc409b..c33eacec9 100644 --- a/modules/nf-core/samtools/mpileup/main.nf +++ b/modules/nf-core/samtools/mpileup/main.nf @@ -4,34 +4,38 @@ process SAMTOOLS_MPILEUP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : - 'biocontainers/samtools:1.18--h50ea8bc_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : + 'biocontainers/samtools:1.22.1--h96c455f_0' }" + input: tuple val(meta), path(input), path(intervals) - path fasta + tuple val(meta2), path(fasta) output: tuple val(meta), path("*.mpileup.gz"), emit: mpileup - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('samtools'), eval('samtools --version | head -1 | sed -e "s/samtools //"'), 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}" - def intervals = intervals ? "-l ${intervals}" : "" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def fasta_cmd = fasta ? "--fasta-ref $fasta" : "" + def intervals_cmd = intervals ? "-l ${intervals}" : "" """ samtools mpileup \\ - --fasta-ref $fasta \\ + $fasta_cmd \\ --output ${prefix}.mpileup \\ $args \\ - $intervals \\ + $intervals_cmd \\ $input bgzip ${prefix}.mpileup - 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}" + """ + echo | gzip > ${prefix}.mpileup.gz """ } diff --git a/modules/nf-core/samtools/mpileup/meta.yml b/modules/nf-core/samtools/mpileup/meta.yml index 13038fbc9..4203f2313 100644 --- a/modules/nf-core/samtools/mpileup/meta.yml +++ b/modules/nf-core/samtools/mpileup/meta.yml @@ -1,5 +1,5 @@ name: samtools_mpileup -description: BAM +description: Generate text pileup output for one or multiple BAM files. Each input file produces a separate group of pileup columns in the output. keywords: - mpileup - bam @@ -15,41 +15,70 @@ 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 ] - - input: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - fasta: - type: file - description: FASTA reference file - pattern: "*.{fasta,fa}" - - intervals: - type: file - description: Interval FILE - pattern: "*.bed" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: [] + - intervals: + type: file + description: Interval FILE + pattern: "*.bed" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" + ontologies: [] output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - mpileup: - type: file - description: mpileup file - pattern: "*.{mpileup}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + mpileup: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.mpileup.gz": + type: file + description: mpileup file + pattern: "*.{mpileup}" + ontologies: [] + versions_samtools: + - - ${task.process}: + type: string + description: Name of the process + - samtools: + type: string + description: Name of the tool + - samtools --version | head -1 | sed -e "s/samtools //": + type: eval + description: The expression to obtain the version of the tool + +topics: + versions: + - - ${task.process}: + type: string + description: Name of the process + - samtools: + type: string + description: Name of the tool + - samtools --version | head -1 | sed -e "s/samtools //": + type: eval + description: The expression to obtain the version of the tool + authors: - "@drpatelh" - "@joseespinosa" maintainers: - - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/samtools/mpileup/tests/main.nf.test b/modules/nf-core/samtools/mpileup/tests/main.nf.test index 35fe453db..1650df7a2 100644 --- a/modules/nf-core/samtools/mpileup/tests/main.nf.test +++ b/modules/nf-core/samtools/mpileup/tests/main.nf.test @@ -9,58 +9,76 @@ nextflow_process { tag "samtools" tag "samtools/mpileup" - test("sarscov2 - [bam, []], fasta") { + test("bam_bed") { when { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), [] ] - input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + input[1] = [[],[]] """ } } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.mpileup[0][1]).linesGzip[0..6], - process.out.versions - ).match() } + { assert snapshot(process.out).match()} ) } - } - test("sarscov2 - [bam, bed], fasta") { + test("bam_bed_fasta") { when { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ] + input[1] = [ + [ id: 'fasta'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) """ } } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.mpileup[0][1]).linesGzip[0..6], - process.out.versions - ).match() } + { assert snapshot(process.out).match()} ) } + } + + test("bam_bed --stub") { + options '-stub' + when { + process { + """ + input[0] = [ + [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ] + input[1] = [[],[]] + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot(process.out).match()} + ) + } } } diff --git a/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap index 1c695e694..0d44126e4 100644 --- a/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap @@ -1,36 +1,125 @@ { - "sarscov2 - [bam, []], fasta": { + "bam_bed": { "content": [ - [ - "MT192765.1\t121\tT\t1\t^].\tA", - "MT192765.1\t122\tA\t1\t.\tA", - "MT192765.1\t123\tT\t1\t.\tA", - "MT192765.1\t124\tA\t1\t.\t/", - "MT192765.1\t125\tA\t1\t.\tE", - "MT192765.1\t126\tT\t1\t.\t/", - "MT192765.1\t127\tT\t1\t.\tE" - ], - [ - "versions.yml:md5,f9d81f4de0923d5620a446720a6cae7e" - ] + { + "0": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,72340047c1feda82fa632d1762080bd8" + ] + ], + "1": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ], + "mpileup": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,72340047c1feda82fa632d1762080bd8" + ] + ], + "versions_samtools": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ] + } ], - "timestamp": "2023-12-04T18:26:09.600688952" + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-22T08:56:18.583305677" }, - "sarscov2 - [bam, bed], fasta": { + "bam_bed --stub": { "content": [ - [ - "MT192765.1\t1255\tA\t1\t^],\tE", - "MT192765.1\t1256\tC\t1\t,\t/", - "MT192765.1\t1257\tG\t1\t,\t/", - "MT192765.1\t1258\tG\t1\tt\t/", - "MT192765.1\t1259\tG\t1\t,\t/", - "MT192765.1\t1260\tC\t1\t,\tE", - "MT192765.1\t1261\tG\t1\t,\t/" - ], - [ - "versions.yml:md5,f9d81f4de0923d5620a446720a6cae7e" - ] + { + "0": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ], + "mpileup": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_samtools": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ] + } ], - "timestamp": "2023-12-04T17:22:15.338792705" + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-22T08:54:55.388446375" + }, + "bam_bed_fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,958e6bead4103d72026f80153b6b5150" + ] + ], + "1": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ], + "mpileup": [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,958e6bead4103d72026f80153b6b5150" + ] + ], + "versions_samtools": [ + [ + "SAMTOOLS_MPILEUP", + "samtools", + "1.22.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-22T08:56:25.883836102" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/mpileup/tests/tags.yml b/modules/nf-core/samtools/mpileup/tests/tags.yml deleted file mode 100644 index 40332674a..000000000 --- a/modules/nf-core/samtools/mpileup/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -samtools/mpileup: - - "modules/nf-core/samtools/mpileup/**" diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index 0b5a29121..54e68b9c1 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -61,11 +61,11 @@ process SAMTOOLS_VIEW { input.getExtension() if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" - def index = args.contains("--write-index") ? "touch ${prefix}.csi" : "" + def index_cmd = args.contains("--write-index") ? "touch ${prefix}.csi" : "" """ touch ${prefix}.${file_type} - ${index} + ${index_cmd} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/view/samtools-view.diff b/modules/nf-core/samtools/view/samtools-view.diff new file mode 100644 index 000000000..3ef7f4b10 --- /dev/null +++ b/modules/nf-core/samtools/view/samtools-view.diff @@ -0,0 +1,939 @@ +Changes in component 'nf-core/samtools/view' +Changes in 'samtools/view/main.nf': +--- modules/nf-core/samtools/view/main.nf ++++ modules/nf-core/samtools/view/main.nf +@@ -61,11 +61,11 @@ + input.getExtension() + if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + +- def index = args.contains("--write-index") ? "touch ${prefix}.csi" : "" ++ def index_cmd = args.contains("--write-index") ? "touch ${prefix}.csi" : "" + + """ + touch ${prefix}.${file_type} +- ${index} ++ ${index_cmd} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + +'modules/nf-core/samtools/view/environment.yml' is unchanged +'modules/nf-core/samtools/view/meta.yml' is unchanged +'modules/nf-core/samtools/view/tests/tags.yml' is unchanged +Changes in 'samtools/view/tests/main.nf.test': +--- modules/nf-core/samtools/view/tests/main.nf.test ++++ modules/nf-core/samtools/view/tests/main.nf.test +@@ -9,16 +9,16 @@ + tag "samtools" + tag "samtools/view" + +- test("bam") { +- +- when { +- process { +- """ +- input[0] = Channel.of([ ++ test("sarscov2 - [bam, []], [], []") { ++ ++ when { ++ process { ++ """ ++ input[0] = [ + [ id:'test', single_end:false ], // meta map +- file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true), +- [] +- ]) ++ file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), ++ [] ++ ] + input[1] = [[],[]] + input[2] = [] + """ +@@ -28,136 +28,148 @@ + then { + assertAll( + { assert process.success }, +- { assert snapshot(file(process.out.bam[0][1]).name).match("bam_bam") }, +- { assert snapshot(process.out.bai).match("bam_bai") }, +- { assert snapshot(process.out.crai).match("bam_crai") }, +- { assert snapshot(process.out.cram).match("bam_cram") }, +- { assert snapshot(process.out.csi).match("bam_csi") }, +- { assert snapshot(process.out.sam).match("bam_sam") }, +- { assert snapshot(process.out.versions).match("bam_versions") } +- ) +- } +- } +- +- test("cram") { +- +- 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), +- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) +- ]) +- input[1] = Channel.of([ +- [ id:'genome' ], // 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(file(process.out.cram[0][1]).name).match("cram_cram") }, +- { assert snapshot(process.out.bai).match("cram_bai") }, +- { assert snapshot(process.out.bam).match("cram_bam") }, +- { assert snapshot(process.out.crai).match("cram_crai") }, +- { assert snapshot(process.out.csi).match("cram_csi") }, +- { assert snapshot(process.out.sam).match("cram_sam") }, +- { assert snapshot(process.out.versions).match("cram_versions") } +- ) +- } +- } +- +- test("cram_to_bam") { ++ { assert snapshot( ++ file(process.out.bam[0][1]).name, ++ process.out.cram, ++ process.out.sam, ++ process.out.bai, ++ process.out.crai, ++ process.out.csi, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ ++ test("homo_sapiens - [cram, crai], fasta, []") { ++ ++ when { ++ process { ++ """ ++ input[0] = [ ++ [ id: 'test' ], // meta map ++ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), ++ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ++ ] ++ input[1] = [ ++ [ id:'genome' ], ++ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ++ ] ++ input[2] = [] ++ """ ++ } ++ } ++ ++ then { ++ assertAll( ++ { assert process.success }, ++ { assert snapshot( ++ file(process.out.cram[0][1]).name, ++ process.out.bam, ++ process.out.sam, ++ process.out.bai, ++ process.out.crai, ++ process.out.csi, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ ++ test("homo_sapiens - [cram, []], fasta, [] - bam output") { + + config "./bam.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:'genome' ], // 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(file(process.out.bam[0][1]).name).match("cram_to_bam_bam") }, +- { assert snapshot(process.out.bai).match("cram_to_bam_bai") }, +- { assert snapshot(process.out.crai).match("cram_to_bam_crai") }, +- { assert snapshot(process.out.cram).match("cram_to_bam_cram") }, +- { assert snapshot(process.out.csi).match("cram_to_bam_csi") }, +- { assert snapshot(process.out.sam).match("cram_to_bam_sam") }, +- { assert snapshot(process.out.versions).match("cram_to_bam_versions") } +- ) +- } +- } +- +- test("cram_to_bam_index") { ++ input[0] = [ ++ [ id: 'test' ], // meta map ++ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), ++ [] ++ ] ++ input[1] = [ ++ [ id:'genome' ], ++ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ++ ] ++ input[2] = [] ++ """ ++ } ++ } ++ ++ then { ++ assertAll( ++ { assert process.success }, ++ { assert snapshot( ++ file(process.out.bam[0][1]).name, ++ process.out.cram, ++ process.out.sam, ++ process.out.bai, ++ process.out.crai, ++ process.out.csi, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ ++ test("homo_sapiens - [cram, []], fasta, [] - bam & index output") { + + config "./bam_index.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:'genome' ], // 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(file(process.out.bam[0][1]).name).match("cram_to_bam_index_bam") }, +- { assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_csi") }, +- { assert snapshot(process.out.bai).match("cram_to_bam_index_bai") }, +- { assert snapshot(process.out.crai).match("cram_to_bam_index_crai") }, +- { assert snapshot(process.out.cram).match("cram_to_bam_index_cram") }, +- { assert snapshot(process.out.sam).match("cram_to_bam_index_sam") }, +- { assert snapshot(process.out.versions).match("cram_to_bam_index_versions") } +- ) +- } +- } +- +- test("cram_to_bam_index_qname") { ++ input[0] = [ ++ [ id: 'test' ], // meta map ++ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), ++ [] ++ ] ++ input[1] = [ ++ [ id:'genome' ], ++ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ++ ] ++ input[2] = [] ++ """ ++ } ++ } ++ ++ then { ++ assertAll( ++ { assert process.success }, ++ { assert snapshot( ++ file(process.out.bam[0][1]).name, ++ process.out.cram, ++ process.out.sam, ++ file(process.out.csi[0][1]).name, ++ process.out.crai, ++ process.out.bai, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ ++ test("homo_sapiens - [cram, []], fasta, qname - bam & index output") { + + config "./bam_index.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:'genome' ], // meta map +- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) +- ]) ++ input[0] = [ ++ [ id: 'test' ], // meta map ++ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), ++ [] ++ ] ++ input[1] = [ ++ [ id:'genome' ], ++ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ++ ] + input[2] = Channel.of("testN:2817", "testN:2814").collectFile(name: "readnames.list", newLine: true) + """ + } +@@ -166,18 +178,21 @@ + then { + assertAll( + { assert process.success }, +- { assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_index_qname_bam") }, +- { assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_qname_csi") }, +- { assert snapshot(process.out.bai).match("cram_to_bam_index_qname_bai") }, +- { assert snapshot(process.out.crai).match("cram_to_bam_index_qname_crai") }, +- { assert snapshot(process.out.cram).match("cram_to_bam_index_qname_cram") }, +- { assert snapshot(process.out.sam).match("cram_to_bam_index_qname_sam") }, +- { assert snapshot(process.out.versions).match("cram_to_bam_index_qname_versions") } +- ) +- } +- } +- +- test("bam_stub") { ++ { assert snapshot( ++ file(process.out.bam[0][1]).name, ++ process.out.cram, ++ process.out.sam, ++ file(process.out.csi[0][1]).name, ++ process.out.crai, ++ process.out.bai, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ ++ test("sarscov2 - [bam, []], [], [] - stub") { + + options "-stub" + config "./bam_index.config" +@@ -199,14 +214,18 @@ + then { + assertAll( + { assert process.success }, +- { assert snapshot(file(process.out.bam[0][1]).name).match("bam_stub_bam") }, +- { assert snapshot(file(process.out.csi[0][1]).name).match("bam_stub_csi") }, +- { assert snapshot(process.out.bai).match("bam_stub_bai") }, +- { assert snapshot(process.out.crai).match("bam_stub_crai") }, +- { assert snapshot(process.out.cram).match("bam_stub_cram") }, +- { assert snapshot(process.out.sam).match("bam_stub_sam") }, +- { assert snapshot(process.out.versions).match("bam_stub_versions") } +- ) +- } +- } ++ { assert snapshot( ++ file(process.out.bam[0][1]).name, ++ process.out.cram, ++ process.out.sam, ++ file(process.out.csi[0][1]).name, ++ process.out.crai, ++ process.out.bai, ++ process.out.versions ++ ).match() } ++ ) ++ } ++ ++ } ++ + } + +'modules/nf-core/samtools/view/tests/bam_index.config' is unchanged +'modules/nf-core/samtools/view/tests/bam.config' is unchanged +Changes in 'samtools/view/tests/main.nf.test.snap': +--- modules/nf-core/samtools/view/tests/main.nf.test.snap ++++ modules/nf-core/samtools/view/tests/main.nf.test.snap +@@ -1,488 +1,140 @@ + { +- "bam_bam": { ++ "homo_sapiens - [cram, []], fasta, [] - bam output": { + "content": [ +- "test.bam" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.256068" +- }, +- "cram_to_bam_index_csi": { +- "content": [ +- "test.bam.csi" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.958617" +- }, +- "bam_stub_bam": { +- "content": [ +- "test.bam" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.065301" +- }, +- "bam_bai": { +- "content": [ ++ "test.bam", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.258578" +- }, +- "bam_stub_bai": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.071284" +- }, +- "bam_stub_versions": { +- "content": [ ++ ], ++ [ ++ ++ ], ++ [ ++ ++ ], ++ [ ++ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.082144" ++ "timestamp": "2023-12-04T17:41:17.563069206" + }, +- "cram_to_bam_index_cram": { ++ "sarscov2 - [bam, []], [], []": { + "content": [ ++ "test.bam", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.972288" +- }, +- "cram_to_bam_sam": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.999247" +- }, +- "cram_to_bam_index_sam": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.976457" +- }, +- "cram_crai": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.497581" +- }, +- "cram_csi": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.50038" +- }, +- "cram_to_bam_cram": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.992239" +- }, +- "cram_to_bam_index_qname_csi": { +- "content": [ +- "test.bam.csi" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.325496" +- }, +- "bam_stub_sam": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.079529" +- }, +- "cram_cram": { +- "content": [ +- "test.cram" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.490286" +- }, +- "bam_csi": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.262882" +- }, +- "cram_to_bam_crai": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.989247" +- }, +- "cram_to_bam_index_crai": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.967681" +- }, +- "cram_to_bam_index_qname_versions": { +- "content": [ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.340612" ++ "timestamp": "2023-12-04T17:41:03.206994564" + }, +- "cram_to_bam_bam": { ++ "homo_sapiens - [cram, []], fasta, qname - bam & index output": { + "content": [ +- "test.bam" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.982361" +- }, +- "cram_to_bam_index_bam": { +- "content": [ +- "test.bam" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.95456" +- }, +- "cram_to_bam_index_versions": { +- "content": [ ++ "test.bam", ++ [ ++ ++ ], ++ [ ++ ++ ], ++ "test.bam.csi", ++ [ ++ ++ ], ++ [ ++ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.981253" ++ "timestamp": "2023-12-04T17:44:39.165289759" + }, +- "cram_to_bam_bai": { ++ "homo_sapiens - [cram, []], fasta, [] - bam & index output": { + "content": [ ++ "test.bam", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.98601" +- }, +- "cram_to_bam_versions": { +- "content": [ ++ ], ++ [ ++ ++ ], ++ "test.bam.csi", ++ [ ++ ++ ], ++ [ ++ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:05.002788" ++ "timestamp": "2023-12-04T17:44:32.25731224" + }, +- "cram_bam": { ++ "sarscov2 - [bam, []], [], [] - stub": { + "content": [ ++ "test.bam", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.495512" +- }, +- "bam_stub_cram": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.076908" +- }, +- "cram_to_bam_index_qname_bai": { +- "content": [ ++ ], ++ "test.csi", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.328458" +- }, +- "cram_to_bam_index_qname_crai": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.330789" +- }, +- "cram_bai": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.493129" +- }, +- "bam_stub_crai": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.074313" +- }, +- "cram_to_bam_index_qname_bam": { +- "content": [ +- "test.bam" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.322874" +- }, +- "bam_versions": { +- "content": [ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.267129" ++ "timestamp": "2023-12-04T17:44:45.81037195" + }, +- "cram_to_bam_index_qname_cram": { ++ "homo_sapiens - [cram, crai], fasta, []": { + "content": [ ++ "test.cram", + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.333248" +- }, +- "bam_crai": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.259774" +- }, +- "bam_cram": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.261287" +- }, +- "cram_to_bam_csi": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:04.995454" +- }, +- "cram_sam": { +- "content": [ ++ ], + [ + +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.502625" +- }, +- "cram_versions": { +- "content": [ ++ ], + [ + "versions.yml:md5,06b9049228b111e7bed5c52fe8a98d9b" + ] + ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:56.504946" +- }, +- "bam_sam": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:37:51.264651" +- }, +- "cram_to_bam_index_bai": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:12.962863" +- }, +- "cram_to_bam_index_qname_sam": { +- "content": [ +- [ +- +- ] +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:23.337634" +- }, +- "bam_stub_csi": { +- "content": [ +- "test.csi" +- ], +- "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.04.3" +- }, +- "timestamp": "2024-02-12T19:38:32.068596" ++ "timestamp": "2023-12-04T17:41:10.730011823" + } + } +************************************************************ diff --git a/subworkflows/local/calculate_damage.nf b/subworkflows/local/calculate_damage.nf index a395e8abc..cf26e7766 100644 --- a/subworkflows/local/calculate_damage.nf +++ b/subworkflows/local/calculate_damage.nf @@ -34,10 +34,10 @@ workflow CALCULATE_DAMAGE { ch_refs ) .multiMap{ - ignore_me, meta, bam, bai, meta2, fasta, fasta_fai -> + ignore_me, meta, bam, bai, meta2, fasta_, fasta_fai_ -> bam: [ meta, bam ] - fasta: fasta - fasta_fai: fasta_fai + fasta: fasta_ + fasta_fai: fasta_fai_ } // Calculate damage if ( params.damagecalculation_tool == 'damageprofiler' ) { diff --git a/subworkflows/local/circularmapper.nf b/subworkflows/local/circularmapper.nf index 46874f987..342efd2fc 100644 --- a/subworkflows/local/circularmapper.nf +++ b/subworkflows/local/circularmapper.nf @@ -41,7 +41,7 @@ workflow CIRCULARMAPPER { .map{ // create meta consistent with rest of MAP workflow meta, bam -> - new_meta = meta + [ reference: meta.id_index ] + def new_meta = meta + [ reference: meta.id_index ] [ new_meta, bam ] } .map { diff --git a/subworkflows/local/consensus_sequence.nf b/subworkflows/local/consensus_sequence.nf index f45192f13..af37b2401 100644 --- a/subworkflows/local/consensus_sequence.nf +++ b/subworkflows/local/consensus_sequence.nf @@ -55,13 +55,13 @@ workflow CONSENSUS_SEQUENCE { } .join(ch_mvcfa_vcf_input) .join(ch_fasta_final) - .multiMap({ meta, reference_gff, reference_gff_exclude, reference_snpeff_results, vcf_inputs, fasta -> + .multiMap{ meta, reference_gff, reference_gff_exclude, reference_snpeff_results, vcf_inputs, fasta -> vcfs: [meta, vcf_inputs] reference_gff: [meta, reference_gff ?: []] reference_gff_exclude: [meta, reference_gff_exclude ?: []] reference_snpeff_results: [meta, reference_snpeff_results ?: []] reference_fasta: [meta, fasta] - }) + } MULTIVCFANALYZER( ch_mva_input.vcfs, diff --git a/subworkflows/local/deduplicate.nf b/subworkflows/local/deduplicate.nf index 3bca8f140..4f6196d13 100644 --- a/subworkflows/local/deduplicate.nf +++ b/subworkflows/local/deduplicate.nf @@ -81,10 +81,10 @@ workflow DEDUPLICATE { ch_refs ) .multiMap{ - ignore_me, meta, bam, bai, meta2, fasta, fasta_fai -> + ignore_me, meta, bam, bai, meta2, fasta_, fasta_fai_ -> bam: [ meta, bam ] - fasta: [ meta2, fasta ] - fasta_fai: [ meta2, fasta_fai ] + fasta: [ meta2, fasta_ ] + fasta_fai: [ meta2, fasta_fai_ ] } // Dedup each bam @@ -121,7 +121,7 @@ workflow DEDUPLICATE { ch_input_for_samtools_merge = ch_dedupped_bam .map { meta, bam -> - meta2 = meta.clone().findAll{ it.key != 'genomic_region' } + def meta2 = meta.clone().findAll{ it.key != 'genomic_region' } [ meta2, bam ] } .groupTuple() @@ -135,10 +135,10 @@ workflow DEDUPLICATE { ) .multiMap{ // bam here is a list of bams - ignore_me, meta, bam, meta2, fasta, fasta_fai -> - bam: [ meta, bam ] - fasta: [ meta2, fasta ] - fasta_fai: [ meta2, fasta_fai ] + _ignore_me, merged_meta, merged_bam, reference_meta, reference_fasta, reference_fasta_fai -> + bam: [ merged_meta, merged_bam ] + fasta: [ reference_meta, reference_fasta ] + fasta_fai: [ reference_meta, reference_fasta_fai ] } // Merge the bams for each region into one bam diff --git a/subworkflows/local/genotype.nf b/subworkflows/local/genotype.nf index a2b5f7525..7786eeb05 100644 --- a/subworkflows/local/genotype.nf +++ b/subworkflows/local/genotype.nf @@ -84,14 +84,14 @@ workflow GENOTYPE { ignore_me, combo_meta, bams, ref_meta, fasta, fai, dict, bed, snp -> def bedfile = bed != "" ? bed : [] bams: [ combo_meta, bams, bedfile ] - fasta: [ fasta ] + fasta: [ ref_meta, fasta ] } SAMTOOLS_MPILEUP_PILEUPCALLER( ch_mpileup_inputs.bams, ch_mpileup_inputs.fasta, ) - ch_versions = ch_versions.mix( SAMTOOLS_MPILEUP_PILEUPCALLER.out.versions.first() ) + ch_versions = ch_versions.mix( SAMTOOLS_MPILEUP_PILEUPCALLER.out.versions_samtools.first() ) ch_pileupcaller_input = SAMTOOLS_MPILEUP_PILEUPCALLER.out.mpileup .map { @@ -372,7 +372,7 @@ workflow GENOTYPE { def strandedness = metas.collect { meta -> meta.strandedness } def single_ends = metas.collect { meta -> meta.single_end } def reference = combo_meta.reference - new_meta = [ sample_id: ids, strandedness: strandedness, single_end: single_ends, reference: reference ] + def new_meta = [ sample_id: ids, strandedness: strandedness, single_end: single_ends, reference: reference ] [ combo_meta, new_meta, bams, bais ] // Drop bais } // Collect all IDs into a list in meta.sample_id. diff --git a/subworkflows/local/manipulate_damage.nf b/subworkflows/local/manipulate_damage.nf index bc8d96cba..ee103bea8 100644 --- a/subworkflows/local/manipulate_damage.nf +++ b/subworkflows/local/manipulate_damage.nf @@ -154,8 +154,8 @@ workflow MANIPULATE_DAMAGE { ch_trimbam_input = ch_to_trim .map { meta, bam -> - trim_left = meta.strandedness == 'single' ? ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_single_stranded_none_udg_left : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_single_stranded_half_udg_left : 0 ) : ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_double_stranded_none_udg_left : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_double_stranded_half_udg_left : 0 ) - trim_right = meta.strandedness == 'single' ? ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_single_stranded_none_udg_right : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_single_stranded_half_udg_right : 0 ) : ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_double_stranded_none_udg_right : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_double_stranded_half_udg_right : 0 ) + def trim_left = meta.strandedness == 'single' ? ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_single_stranded_none_udg_left : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_single_stranded_half_udg_left : 0 ) : ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_double_stranded_none_udg_left : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_double_stranded_half_udg_left : 0 ) + def trim_right = meta.strandedness == 'single' ? ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_single_stranded_none_udg_right : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_single_stranded_half_udg_right : 0 ) : ( meta.damage_treatment == 'none' ? params.damage_manipulation_bamutils_trim_double_stranded_none_udg_right : meta.damage_treatment == 'half' ? params.damage_manipulation_bamutils_trim_double_stranded_half_udg_right : 0 ) [ meta, bam, trim_left, trim_right ] } diff --git a/subworkflows/local/map.nf b/subworkflows/local/map.nf index 8b30728cf..48f4b067a 100644 --- a/subworkflows/local/map.nf +++ b/subworkflows/local/map.nf @@ -38,10 +38,10 @@ workflow MAP { sharded_reads = SEQKIT_SPLIT2.out.reads .transpose() .map { - meta, reads -> - new_meta = meta.clone() - new_meta.shard_number = reads.getName().replaceAll(/.*(part_\d+).(?:fastq|fq).gz/, '$1') - [ new_meta, reads ] + meta, reads_ -> + def new_meta = meta.clone() + new_meta.shard_number = reads_.getName().replaceAll(/.*(part_\d+).(?:fastq|fq).gz/, '$1') + [ new_meta, reads_ ] } .groupTuple() @@ -52,7 +52,7 @@ workflow MAP { } if ( params.mapping_tool == 'bwaaln' ) { - ch_index_for_mapping = index.map{ meta, index, fasta -> [ meta, index ] } + ch_index_for_mapping = index.map{ meta, index_, fasta -> [ meta, index_ ] } ch_reads_for_mapping = ch_input_for_mapping FASTQ_ALIGN_BWAALN ( ch_reads_for_mapping, ch_index_for_mapping ) @@ -61,7 +61,7 @@ workflow MAP { .map{ // create meta consistent with rest of workflow meta, bam -> - new_meta = meta + [ reference: meta.id_index ] + def new_meta = meta + [ reference: meta.id_index ] [ new_meta, bam ] } @@ -71,10 +71,10 @@ workflow MAP { ch_input_for_mapping = ch_input_for_mapping .combine( index ) .multiMap { - meta, reads, meta2, index, fasta -> - new_meta = meta + [ reference: meta2.id ] - reads: [ new_meta, reads ] - index: [ meta2, index ] + meta, reads_, meta2, index_, fasta -> + def new_meta = meta + [ reference: meta2.id ] + reads: [ new_meta, reads_ ] + index: [ meta2, index_ ] fasta: [ meta2, fasta ] } @@ -88,12 +88,12 @@ workflow MAP { } else if ( params.mapping_tool == 'bowtie2' ) { ch_input_for_mapping = ch_input_for_mapping - .combine( index.map{ meta, index, fasta -> [ meta, index ] } ) + .combine( index.map{ meta, index_, fasta -> [ meta, index_ ] } ) .multiMap { - meta, reads, meta2, index -> - new_meta = meta + [ reference: meta2.id ] - reads: [ new_meta, reads ] - index: [ meta2, index ] + meta, reads_, meta2, index_ -> + def new_meta = meta + [ reference: meta2.id ] + reads: [ new_meta, reads_ ] + index: [ meta2, index_ ] } BOWTIE2_ALIGN ( ch_input_for_mapping.reads, ch_input_for_mapping.index, false, true ) @@ -117,12 +117,12 @@ workflow MAP { ch_mapped_lane_bai = CIRCULARMAPPER.out.bai // [ [ meta ], bai/csi ] } else if ( params.mapping_tool == 'mapad' ) { ch_input_for_mapping = ch_input_for_mapping - .combine( index.map{ meta, index, fasta -> [ meta, index ] } ) + .combine( index.map{ meta, index_, fasta -> [ meta, index_ ] } ) .multiMap { - meta, reads, meta2, index -> - new_meta = meta + [ reference: meta2.id ] - reads: [ new_meta, reads ] - index: [ meta2, index ] + meta, reads_, meta2, index_ -> + def new_meta = meta + [ reference: meta2.id ] + reads: [ new_meta, reads_ ] + index: [ meta2, index_ ] strandedness: meta.strandedness=="double" } @@ -159,7 +159,7 @@ workflow MAP { .flatMap() .map { meta, bam -> - new_meta = meta.clone().findAll{ it.key !in ['lane', 'colour_chemistry', 'shard_number'] } + def new_meta = meta.clone().findAll{ it.key !in ['lane', 'colour_chemistry', 'shard_number'] } [ new_meta, bam ] } .groupTuple() diff --git a/subworkflows/local/metagenomics_postprocessing.nf b/subworkflows/local/metagenomics_postprocessing.nf index 19ea332c0..5cf4f5fa8 100644 --- a/subworkflows/local/metagenomics_postprocessing.nf +++ b/subworkflows/local/metagenomics_postprocessing.nf @@ -6,9 +6,10 @@ include { MEGAN_RMA2INFO } from '../../modules/nf-core/megan/rma2info/main workflow METAGENOMICS_POSTPROCESSING { - take: ch_postprocessing_input // different between each profiling --> postprocessing tool, defined in metagenomics profiling subworkflow - take: ch_tax_list - take: ch_ncbi_dir + take: + ch_postprocessing_input // different between each profiling --> postprocessing tool, defined in metagenomics profiling subworkflow + ch_tax_list + ch_ncbi_dir main: ch_versions = Channel.empty() diff --git a/subworkflows/local/metagenomics_profiling.nf b/subworkflows/local/metagenomics_profiling.nf index 6ad39b7e4..2400d28ab 100644 --- a/subworkflows/local/metagenomics_profiling.nf +++ b/subworkflows/local/metagenomics_profiling.nf @@ -78,14 +78,16 @@ workflow METAGENOMICS_PROFILING { // could be prevented by branching early and running the lower part twice for ss and ds individually // but this is an edge-case and might never be relevant... ch_input_for_malt = ch_reads.combine(ch_tmp_groups).map{ meta, reads, n_groups -> - [ + def result = [ [ label: label, strandedness:meta.strandedness, - id:"${meta.strandedness}stranded_${groups_counter++%n_groups}" + id:"${meta.strandedness}stranded_${groups_counter % n_groups}" ], reads ] + groups_counter += 1 + return result } .groupTuple(by:0) diff --git a/subworkflows/local/preprocessing_adapterremoval.nf b/subworkflows/local/preprocessing_adapterremoval.nf index 45778b266..752cd43ae 100644 --- a/subworkflows/local/preprocessing_adapterremoval.nf +++ b/subworkflows/local/preprocessing_adapterremoval.nf @@ -45,10 +45,10 @@ workflow PREPROCESSING_ADAPTERREMOVAL { ADAPTERREMOVAL_PAIRED.out.singles_truncated, ADAPTERREMOVAL_PAIRED.out.paired_truncated ) - .map { meta, reads -> + .map { meta, reads_ -> def meta_new = meta.clone() meta_new.single_end = true - [meta_new, reads] + [meta_new, reads_] } .groupTuple() // Paired-end reads cause a nested tuple during grouping. @@ -69,10 +69,10 @@ workflow PREPROCESSING_ADAPTERREMOVAL { ADAPTERREMOVAL_PAIRED.out.collapsed, ADAPTERREMOVAL_PAIRED.out.collapsed_truncated ) - .map { meta, reads -> + .map { meta, reads_ -> def meta_new = meta.clone() meta_new.single_end = true - [meta_new, reads] + [meta_new, reads_] } .groupTuple() .map { meta, fastq -> [meta, fastq.flatten()] } diff --git a/subworkflows/local/preprocessing_fastp.nf b/subworkflows/local/preprocessing_fastp.nf index c73866262..53e75e34c 100644 --- a/subworkflows/local/preprocessing_fastp.nf +++ b/subworkflows/local/preprocessing_fastp.nf @@ -26,19 +26,22 @@ workflow PREPROCESSING_FASTP { // Last parameter here turns on merging of PE data FASTP_PAIRED(ch_input_for_fastp.paired, adapterlist, false, !params.preprocessing_skippairmerging) ch_versions = ch_versions.mix(FASTP_PAIRED.out.versions.first()) - ch_multiqc_files = ch_multiqc_files.mix(FASTP_PAIRED.out.json) - - if (!params.preprocessing_skippairmerging) { - ch_fastp_reads_prepped_pe = FASTP_PAIRED.out.reads_merged.map { meta, reads -> - def meta_new = meta.clone() - meta_new['single_end'] = true - [meta_new, [reads].flatten()] - } - - ch_fastp_reads_prepped = ch_fastp_reads_prepped_pe.mix(FASTP_SINGLE.out.reads) - } - else { - ch_fastp_reads_prepped = FASTP_PAIRED.out.reads.mix(FASTP_SINGLE.out.reads) + ch_multiqc_files = ch_multiqc_files.mix( FASTP_PAIRED.out.json ) + + if ( !params.preprocessing_skippairmerging ) { + ch_fastp_reads_prepped_pe = FASTP_PAIRED.out.reads_merged + .map { + meta, reads_ -> + def meta_new = meta.clone() + meta_new['single_end'] = true + [ meta_new, [ reads_ ].flatten() ] + } + + ch_fastp_reads_prepped = ch_fastp_reads_prepped_pe.mix( FASTP_SINGLE.out.reads ) + + } else { + ch_fastp_reads_prepped = FASTP_PAIRED.out.reads + .mix( FASTP_SINGLE.out.reads ) } emit: diff --git a/subworkflows/local/reference_indexing_multi.nf b/subworkflows/local/reference_indexing_multi.nf index 854a03995..524e8c833 100644 --- a/subworkflows/local/reference_indexing_multi.nf +++ b/subworkflows/local/reference_indexing_multi.nf @@ -164,7 +164,7 @@ workflow REFERENCE_INDEXING_MULTI { if (params.mapping_tool == "bwaaln" || params.mapping_tool == "bwamem" || params.mapping_tool == "circularmapper") { BWA_INDEX(ch_mapindex_input.index) - ch_version = ch_versions.mix(BWA_INDEX.out.versions) + ch_version = ch_versions.mix(BWA_INDEX.out.versions_bwa) ch_indexed_forremap = BWA_INDEX.out.index } else if (params.mapping_tool == "bowtie2") { diff --git a/subworkflows/local/reference_indexing_single.nf b/subworkflows/local/reference_indexing_single.nf index f8af9df09..899cdc297 100644 --- a/subworkflows/local/reference_indexing_single.nf +++ b/subworkflows/local/reference_indexing_single.nf @@ -56,7 +56,7 @@ workflow REFERENCE_INDEXING_SINGLE { if ( !fasta_mapperindexdir ) { ch_fasta_mapperindexdir = BWA_INDEX ( ch_ungz_ref ).index - ch_versions = ch_versions.mix( BWA_INDEX.out.versions.first()) + ch_versions = ch_versions.mix( BWA_INDEX.out.versions_bwa.first()) } else { ch_fasta_mapperindexdir = Channel.fromPath(fasta_mapperindexdir).map{[[id: clean_name], it ]} } @@ -87,7 +87,7 @@ workflow REFERENCE_INDEXING_SINGLE { .join(ch_fasta_dict, failOnMismatch: true) .join(ch_fasta_mapperindexdir, failOnMismatch: true) .map{ - meta, fasta, fai, dict, mapper_index -> + meta, fasta_, fai, dict, mapper_index -> def contamination_estimation_angsd_hapmap = params.contamination_estimation_angsd_hapmap != null ? file( params.contamination_estimation_angsd_hapmap, checkIfExists: true ) : "" def pmd_masked_fasta = params.damage_manipulation_pmdtools_masked_reference != null ? file(params.damage_manipulation_pmdtools_masked_reference, checkIfExists: true ) : "" def pmd_bed_for_masking = params.damage_manipulation_pmdtools_reference_mask != null ? file(params.damage_manipulation_pmdtools_reference_mask, checkIfExists: true ) : "" @@ -103,13 +103,13 @@ workflow REFERENCE_INDEXING_SINGLE { def consensus_multivcfanalyzer_reference_gff_annotations = params.consensus_multivcfanalyzer_reference_gff_annotations != null ? file(params.consensus_multivcfanalyzer_reference_gff_annotations, checkIfExists: true ) : "" def consensus_multivcfanalyzer_reference_gff_exclude = params.consensus_multivcfanalyzer_reference_gff_exclude != null ? file(params.consensus_multivcfanalyzer_reference_gff_exclude, checkIfExists: true ) : "" def consensus_multivcfanalyzer_reference_snpeff_results = params.consensus_multivcfanalyzer_snpeff_results != null ? file(params.consensus_multivcfanalyzer_snpeff_results, checkIfExists: true ) : "" - [ meta + [ ploidy: genotyping_reference_ploidy ], fasta, fai, dict, mapper_index, params.fasta_circular_target, params.mitochondrion_header, contamination_estimation_angsd_hapmap, pmd_masked_fasta, pmd_bed_for_masking, capture_bed, pileupcaller_bed, pileupcaller_snp, sexdet_bed, bedtools_feature, genotyping_gatk_dbsnp, circularmapper_elongated_fasta, circularmapper_elongated_index, consensus_multivcfanalyzer_reference_gff_annotations, consensus_multivcfanalyzer_reference_gff_exclude, consensus_multivcfanalyzer_reference_snpeff_results ] + [ meta + [ ploidy: genotyping_reference_ploidy ], fasta_, fai, dict, mapper_index, params.fasta_circular_target, params.mitochondrion_header, contamination_estimation_angsd_hapmap, pmd_masked_fasta, pmd_bed_for_masking, capture_bed, pileupcaller_bed, pileupcaller_snp, sexdet_bed, bedtools_feature, genotyping_gatk_dbsnp, circularmapper_elongated_fasta, circularmapper_elongated_index, consensus_multivcfanalyzer_reference_gff_annotations, consensus_multivcfanalyzer_reference_gff_exclude, consensus_multivcfanalyzer_reference_snpeff_results ] } ch_ref_index_single = ch_reference_for_mapping .multiMap{ - meta, fasta, fai, dict, mapper_index, circular_target, mitochondrion_header, contamination_estimation_angsd_hapmap, pmd_masked_fasta, pmd_bed_for_masking, capture_bed, pileupcaller_bed, pileupcaller_snp, sexdet_bed, bedtools_feature, genotyping_gatk_dbsnp, circularmapper_elongated_fasta, circularmapper_elongated_index, consensus_multivcfanalyzer_reference_gff_annotations, consensus_multivcfanalyzer_reference_gff_exclude, consensus_multivcfanalyzer_reference_snpeff_results -> - reference: [ meta, fasta, fai, dict, mapper_index ] + meta, reference_fasta, reference_fai, reference_dict, reference_mapper_index, circular_target, mitochondrion_header, contamination_estimation_angsd_hapmap, pmd_masked_fasta, pmd_bed_for_masking, capture_bed, pileupcaller_bed, pileupcaller_snp, sexdet_bed, bedtools_feature, genotyping_gatk_dbsnp, circularmapper_elongated_fasta, circularmapper_elongated_index, consensus_multivcfanalyzer_reference_gff_annotations, consensus_multivcfanalyzer_reference_gff_exclude, consensus_multivcfanalyzer_reference_snpeff_results -> + reference: [ meta, reference_fasta, reference_fai, reference_dict, reference_mapper_index ] circularmapper: [ meta, circular_target, circularmapper_elongated_fasta, circularmapper_elongated_index ] mito_header: [ meta, mitochondrion_header ] hapmap: [ meta, contamination_estimation_angsd_hapmap ] diff --git a/subworkflows/local/utils_nfcore_eager_pipeline/main.nf b/subworkflows/local/utils_nfcore_eager_pipeline/main.nf index 2769e403d..70494eb99 100644 --- a/subworkflows/local/utils_nfcore_eager_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_eager_pipeline/main.nf @@ -120,7 +120,7 @@ workflow PIPELINE_INITIALISATION { ch_samplesheet_fastqs = ch_samplesheet_for_branch.fastq .map { meta, r1, r2, bam, vcf -> - reads = meta.single_end ? [ r1 ] : [ r1, r2 ] + def reads = meta.single_end ? [ r1 ] : [ r1, r2 ] [ meta - meta.subMap('pairment', 'bam_reference_id'), reads ] } @@ -439,7 +439,7 @@ def addNewMetaFromAttributes( ArrayList row, Object source_attributes, Object ta } else if ((source_attributes instanceof List) && (target_attributes instanceof List)) { if (source_attributes.size() == target_attributes.size()) { - for (int i = 0; i < source_attributes.size(); i++) { + (0.. // Option B: Both are lists of same size meta2[target_attributes[i]] = meta[source_attributes[i]] } diff --git a/subworkflows/nf-core/bam_split_by_region/bam_split_by_region.diff b/subworkflows/nf-core/bam_split_by_region/bam_split_by_region.diff new file mode 100644 index 000000000..c5b658588 --- /dev/null +++ b/subworkflows/nf-core/bam_split_by_region/bam_split_by_region.diff @@ -0,0 +1,32 @@ +Changes in component 'nf-core/bam_split_by_region' +'subworkflows/nf-core/bam_split_by_region/nextflow.config' is unchanged +Changes in 'bam_split_by_region/main.nf': +--- subworkflows/nf-core/bam_split_by_region/main.nf ++++ subworkflows/nf-core/bam_split_by_region/main.nf +@@ -26,13 +26,18 @@ + .splitCsv ( header: ['seq_name', 'start', 'stop'], sep:'\t', elem: 1) + .map{ meta, stats -> + // If the regions file contains just a sequence name provide that +- if (! stats['start'] ) [ chrom = stats['seq_name'] ] ++ if (!stats['start']) { ++ return [meta, stats['seq_name']] ++ } ++ + // If a specific position is given, use that +- else if ( ! stats['stop']) [ chrom = [ stats['seq_name'], stats['start'] ].join(":") ] ++ if (!stats['stop']) { ++ return [meta, [stats['seq_name'], stats['start']].join(":")] ++ } ++ + // If a region between specific bps is requested use that +- else [ chrom = [ [ stats['seq_name'], stats['start'] ].join(":"), stats['stop'] ].join('-') ] +- +- [ meta, chrom ] ++ def chrom = [[stats['seq_name'], stats['start']].join(":"), stats['stop']].join('-') ++ return [meta, chrom] + } + + // + +'subworkflows/nf-core/bam_split_by_region/meta.yml' is unchanged +************************************************************ diff --git a/subworkflows/nf-core/bam_split_by_region/main.nf b/subworkflows/nf-core/bam_split_by_region/main.nf index 0ec700b14..73426ebf0 100644 --- a/subworkflows/nf-core/bam_split_by_region/main.nf +++ b/subworkflows/nf-core/bam_split_by_region/main.nf @@ -26,13 +26,18 @@ workflow BAM_SPLIT_BY_REGION { .splitCsv ( header: ['seq_name', 'start', 'stop'], sep:'\t', elem: 1) .map{ meta, stats -> // If the regions file contains just a sequence name provide that - if (! stats['start'] ) [ chrom = stats['seq_name'] ] + if (!stats['start']) { + return [meta, stats['seq_name']] + } + // If a specific position is given, use that - else if ( ! stats['stop']) [ chrom = [ stats['seq_name'], stats['start'] ].join(":") ] - // If a region between specific bps is requested use that - else [ chrom = [ [ stats['seq_name'], stats['start'] ].join(":"), stats['stop'] ].join('-') ] + if (!stats['stop']) { + return [meta, [stats['seq_name'], stats['start']].join(":")] + } - [ meta, chrom ] + // If a region between specific bps is requested use that + def chrom = [[stats['seq_name'], stats['start']].join(":"), stats['stop']].join('-') + return [meta, chrom] } // diff --git a/workflows/eager.nf b/workflows/eager.nf index 8d6560fca..17da0eadd 100644 --- a/workflows/eager.nf +++ b/workflows/eager.nf @@ -319,14 +319,14 @@ workflow EAGER { ch_bam_for_host_removal = MAP.out.bam .join(MAP.out.bai) .map { meta, bam, bai -> - new_meta = meta.clone().findAll { it.key !in ['single_end', 'reference'] } + def new_meta = meta.clone().findAll { it.key !in ['single_end', 'reference'] } [new_meta, meta, bam, bai] } // Preparing fastq channel for host removal to be combined with the bam channel // The meta of the fastq channel contains additional fields when compared to the meta from the bam channel: lane, colour_chemistry, // and not necessarily matching single_end. Those fields are dropped of the meta in the map and stored in new_meta ch_fastqs_for_host_removal = ch_fastqs_for_preprocessing.map { meta, fastqs -> - new_meta = meta.clone().findAll { it.key !in ['lane', 'colour_chemistry', 'single_end'] } + def new_meta = meta.clone().findAll { it.key !in ['lane', 'colour_chemistry', 'single_end'] } [new_meta, meta, fastqs] } // We join the bam and fastq channel with now matching metas (new_meta) referred as meta_join