From d9d10ac61e93eac097fba43ca1528463720238ce Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 31 Jul 2024 13:44:32 +0200 Subject: [PATCH 01/11] Update modules and subworkflows --- modules.json | 78 +-- modules/nf-core/bowtie2/align/main.nf | 28 +- modules/nf-core/bowtie2/align/meta.yml | 43 +- .../bowtie2/align/tests/cram_crai.config | 5 + .../nf-core/bowtie2/align/tests/main.nf.test | 162 ++++-- .../bowtie2/align/tests/main.nf.test.snap | 216 +++++--- modules/nf-core/bowtie2/build/environment.yml | 7 + modules/nf-core/bowtie2/build/main.nf | 6 +- modules/nf-core/bowtie2/build/meta.yml | 3 + .../nf-core/bowtie2/build/tests/main.nf.test | 31 ++ .../bowtie2/build/tests/main.nf.test.snap | 45 ++ modules/nf-core/bowtie2/build/tests/tags.yml | 2 + modules/nf-core/bwa/index/environment.yml | 7 + modules/nf-core/bwa/index/main.nf | 22 +- modules/nf-core/bwa/index/meta.yml | 6 +- modules/nf-core/bwa/index/tests/main.nf.test | 33 ++ .../nf-core/bwa/index/tests/main.nf.test.snap | 47 ++ modules/nf-core/bwa/index/tests/tags.yml | 2 + modules/nf-core/bwa/mem/environment.yml | 5 +- modules/nf-core/bwa/mem/main.nf | 35 +- modules/nf-core/bwa/mem/meta.yml | 20 +- modules/nf-core/bwa/mem/tests/main.nf.test | 205 ++++++- .../nf-core/bwa/mem/tests/main.nf.test.snap | 230 ++++---- modules/nf-core/chromap/chromap/main.nf | 15 + .../chromap/chromap/tests/main.nf.test | 161 ++++++ .../chromap/chromap/tests/main.nf.test.snap | 219 ++++++++ .../chromap/chromap/tests/nextflow.config | 7 + .../nf-core/chromap/chromap/tests/tags.yml | 2 + modules/nf-core/chromap/index/environment.yml | 7 + modules/nf-core/chromap/index/main.nf | 17 +- modules/nf-core/chromap/index/meta.yml | 7 +- .../nf-core/chromap/index/tests/main.nf.test | 52 ++ .../chromap/index/tests/main.nf.test.snap | 57 ++ modules/nf-core/chromap/index/tests/tags.yml | 2 + .../custom/getchromsizes/environment.yml | 8 + modules/nf-core/custom/getchromsizes/main.nf | 9 +- modules/nf-core/custom/getchromsizes/meta.yml | 7 +- .../custom/getchromsizes/tests/main.nf.test | 99 ++++ .../getchromsizes/tests/main.nf.test.snap | 242 ++++++++ .../custom/getchromsizes/tests/tags.yml | 2 + .../deeptools/computematrix/environment.yml | 7 + .../nf-core/deeptools/computematrix/main.nf | 2 +- .../nf-core/deeptools/computematrix/meta.yml | 10 +- .../deeptools/plotfingerprint/environment.yml | 7 + .../nf-core/deeptools/plotfingerprint/main.nf | 2 +- .../deeptools/plotfingerprint/meta.yml | 9 +- .../deeptools/plotheatmap/environment.yml | 7 + modules/nf-core/deeptools/plotheatmap/main.nf | 2 +- .../nf-core/deeptools/plotheatmap/meta.yml | 9 +- .../deeptools/plotprofile/environment.yml | 7 + modules/nf-core/deeptools/plotprofile/main.nf | 2 +- .../nf-core/deeptools/plotprofile/meta.yml | 9 +- modules/nf-core/fastqc/tests/main.nf.test | 225 +++++--- .../nf-core/fastqc/tests/main.nf.test.snap | 370 +++++++++++-- modules/nf-core/gffread/environment.yml | 7 + modules/nf-core/gffread/main.nf | 49 +- modules/nf-core/gffread/meta.yml | 32 +- modules/nf-core/gffread/tests/main.nf.test | 223 ++++++++ .../nf-core/gffread/tests/main.nf.test.snap | 272 +++++++++ .../gffread/tests/nextflow-fasta.config | 5 + .../gffread/tests/nextflow-gff3.config | 5 + modules/nf-core/gffread/tests/nextflow.config | 5 + modules/nf-core/gffread/tests/tags.yml | 2 + modules/nf-core/gunzip/environment.yml | 9 + modules/nf-core/gunzip/main.nf | 29 +- modules/nf-core/gunzip/meta.yml | 5 + modules/nf-core/gunzip/tests/main.nf.test | 121 ++++ .../nf-core/gunzip/tests/main.nf.test.snap | 134 +++++ modules/nf-core/gunzip/tests/nextflow.config | 5 + modules/nf-core/gunzip/tests/tags.yml | 2 + .../homer/annotatepeaks/environment.yml | 7 + modules/nf-core/homer/annotatepeaks/main.nf | 3 +- modules/nf-core/homer/annotatepeaks/meta.yml | 7 + .../nf-core/khmer/uniquekmers/environment.yml | 7 + modules/nf-core/khmer/uniquekmers/main.nf | 2 +- modules/nf-core/khmer/uniquekmers/meta.yml | 6 +- modules/nf-core/multiqc/environment.yml | 2 +- modules/nf-core/multiqc/main.nf | 10 +- modules/nf-core/multiqc/meta.yml | 13 + modules/nf-core/multiqc/tests/main.nf.test | 6 + .../nf-core/multiqc/tests/main.nf.test.snap | 18 +- .../collectmultiplemetrics/environment.yml | 7 + .../picard/collectmultiplemetrics/main.nf | 8 +- .../picard/collectmultiplemetrics/meta.yml | 2 + .../picard/markduplicates/environment.yml | 2 +- modules/nf-core/picard/markduplicates/main.nf | 27 +- .../nf-core/picard/markduplicates/meta.yml | 10 +- .../picard/markduplicates/tests/main.nf.test | 109 +++- .../markduplicates/tests/main.nf.test.snap | 259 +++++++-- .../picard/mergesamfiles/environment.yml | 7 + modules/nf-core/picard/mergesamfiles/main.nf | 6 +- modules/nf-core/picard/mergesamfiles/meta.yml | 2 + .../nf-core/preseq/lcextrap/environment.yml | 7 + modules/nf-core/preseq/lcextrap/main.nf | 17 +- modules/nf-core/preseq/lcextrap/meta.yml | 9 +- .../preseq/lcextrap/tests/main.nf.test | 100 ++++ .../preseq/lcextrap/tests/main.nf.test.snap | 188 +++++++ .../nf-core/preseq/lcextrap/tests/tags.yml | 2 + .../nf-core/samtools/flagstat/environment.yml | 4 +- modules/nf-core/samtools/flagstat/main.nf | 4 +- .../samtools/flagstat/tests/main.nf.test | 36 +- .../samtools/flagstat/tests/main.nf.test.snap | 74 ++- .../nf-core/samtools/idxstats/environment.yml | 4 +- modules/nf-core/samtools/idxstats/main.nf | 4 +- .../samtools/idxstats/tests/main.nf.test | 39 +- .../samtools/idxstats/tests/main.nf.test.snap | 76 ++- .../nf-core/samtools/index/environment.yml | 4 +- modules/nf-core/samtools/index/main.nf | 11 +- .../nf-core/samtools/index/tests/main.nf.test | 111 +++- .../samtools/index/tests/main.nf.test.snap | 254 ++++++++- modules/nf-core/samtools/sort/environment.yml | 4 +- modules/nf-core/samtools/sort/main.nf | 44 +- modules/nf-core/samtools/sort/meta.yml | 32 +- .../nf-core/samtools/sort/tests/main.nf.test | 107 +++- .../samtools/sort/tests/main.nf.test.snap | 164 +++++- .../samtools/sort/tests/nextflow.config | 3 +- .../samtools/sort/tests/nextflow_cram.config | 8 + .../nf-core/samtools/stats/environment.yml | 4 +- modules/nf-core/samtools/stats/main.nf | 4 +- .../nf-core/samtools/stats/tests/main.nf.test | 106 ++-- .../samtools/stats/tests/main.nf.test.snap | 102 +++- .../subread/featurecounts/environment.yml | 7 + modules/nf-core/subread/featurecounts/main.nf | 14 +- .../nf-core/subread/featurecounts/meta.yml | 6 +- .../subread/featurecounts/tests/main.nf.test | 155 ++++++ .../featurecounts/tests/main.nf.test.snap | 323 +++++++++++ .../featurecounts/tests/nextflow.config | 9 + .../subread/featurecounts/tests/tags.yml | 2 + modules/nf-core/trimgalore/environment.yml | 3 + modules/nf-core/trimgalore/main.nf | 21 + modules/nf-core/trimgalore/tests/main.nf.test | 67 ++- .../trimgalore/tests/main.nf.test.snap | 62 ++- .../ucsc/bedgraphtobigwig/environment.yml | 7 + modules/nf-core/ucsc/bedgraphtobigwig/main.nf | 20 +- .../nf-core/ucsc/bedgraphtobigwig/meta.yml | 8 +- .../ucsc/bedgraphtobigwig/tests/main.nf.test | 53 ++ .../bedgraphtobigwig/tests/main.nf.test.snap | 68 +++ .../ucsc/bedgraphtobigwig/tests/tags.yml | 2 + .../nf-core/umitools/extract/environment.yml | 2 +- modules/nf-core/umitools/extract/main.nf | 22 +- .../umitools/extract/tests/main.nf.test | 85 ++- .../umitools/extract/tests/main.nf.test.snap | 163 +++++- modules/nf-core/untar/environment.yml | 9 + modules/nf-core/untar/main.nf | 31 +- modules/nf-core/untar/meta.yml | 5 + modules/nf-core/untar/tests/main.nf.test | 85 +++ modules/nf-core/untar/tests/main.nf.test.snap | 158 ++++++ modules/nf-core/untar/tests/tags.yml | 2 + modules/nf-core/untarfiles/environment.yml | 9 + modules/nf-core/untarfiles/main.nf | 2 +- modules/nf-core/untarfiles/meta.yml | 6 + subworkflows/local/bam_filter_bamtools.nf | 3 +- .../nf-core/bam_markduplicates_picard/main.nf | 28 +- .../bam_markduplicates_picard/meta.yml | 20 +- .../tests/main.nf.test | 75 ++- .../tests/main.nf.test.snap | 330 ++++++++++- .../nf-core/bam_sort_stats_samtools/main.nf | 2 +- .../tests/main.nf.test | 76 ++- .../tests/main.nf.test.snap | 312 +++++++++-- .../bam_stats_samtools/tests/main.nf.test | 116 +++- .../tests/main.nf.test.snap | 332 +++++++++-- .../nf-core/fastq_align_bowtie2/main.nf | 6 +- .../nf-core/fastq_align_bowtie2/meta.yml | 2 +- .../fastq_align_bowtie2/tests/main.nf.test | 189 +++++++ .../tests/main.nf.test.snap | 126 +++++ .../fastq_align_bowtie2/tests/nextflow.config | 8 + .../fastq_align_bowtie2/tests/tags.yml | 2 + subworkflows/nf-core/fastq_align_bwa/main.nf | 2 +- .../fastq_align_bwa/tests/main.nf.test | 77 +++ .../fastq_align_bwa/tests/main.nf.test.snap | 284 ++++++++++ .../fastq_align_bwa/tests/nextflow.config | 8 + .../nf-core/fastq_align_bwa/tests/tags.yml | 2 + .../tests/main.nf.test | 274 +++++++++ .../tests/main.nf.test.snap | 524 ++++++++++++++++++ .../tests/nextflow.config | 5 + .../tests/tags.yml | 2 + 176 files changed, 8956 insertions(+), 1021 deletions(-) create mode 100644 modules/nf-core/bowtie2/align/tests/cram_crai.config create mode 100644 modules/nf-core/bowtie2/build/environment.yml create mode 100644 modules/nf-core/bowtie2/build/tests/main.nf.test create mode 100644 modules/nf-core/bowtie2/build/tests/main.nf.test.snap create mode 100644 modules/nf-core/bowtie2/build/tests/tags.yml create mode 100644 modules/nf-core/bwa/index/environment.yml create mode 100644 modules/nf-core/bwa/index/tests/main.nf.test create mode 100644 modules/nf-core/bwa/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/bwa/index/tests/tags.yml create mode 100644 modules/nf-core/chromap/chromap/tests/main.nf.test create mode 100644 modules/nf-core/chromap/chromap/tests/main.nf.test.snap create mode 100644 modules/nf-core/chromap/chromap/tests/nextflow.config create mode 100644 modules/nf-core/chromap/chromap/tests/tags.yml create mode 100644 modules/nf-core/chromap/index/environment.yml create mode 100644 modules/nf-core/chromap/index/tests/main.nf.test create mode 100644 modules/nf-core/chromap/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/chromap/index/tests/tags.yml create mode 100644 modules/nf-core/custom/getchromsizes/environment.yml create mode 100644 modules/nf-core/custom/getchromsizes/tests/main.nf.test create mode 100644 modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap create mode 100644 modules/nf-core/custom/getchromsizes/tests/tags.yml create mode 100644 modules/nf-core/deeptools/computematrix/environment.yml create mode 100644 modules/nf-core/deeptools/plotfingerprint/environment.yml create mode 100644 modules/nf-core/deeptools/plotheatmap/environment.yml create mode 100644 modules/nf-core/deeptools/plotprofile/environment.yml create mode 100644 modules/nf-core/gffread/environment.yml create mode 100644 modules/nf-core/gffread/tests/main.nf.test create mode 100644 modules/nf-core/gffread/tests/main.nf.test.snap create mode 100644 modules/nf-core/gffread/tests/nextflow-fasta.config create mode 100644 modules/nf-core/gffread/tests/nextflow-gff3.config create mode 100644 modules/nf-core/gffread/tests/nextflow.config create mode 100644 modules/nf-core/gffread/tests/tags.yml create mode 100644 modules/nf-core/gunzip/environment.yml create mode 100644 modules/nf-core/gunzip/tests/main.nf.test create mode 100644 modules/nf-core/gunzip/tests/main.nf.test.snap create mode 100644 modules/nf-core/gunzip/tests/nextflow.config create mode 100644 modules/nf-core/gunzip/tests/tags.yml create mode 100644 modules/nf-core/homer/annotatepeaks/environment.yml create mode 100644 modules/nf-core/khmer/uniquekmers/environment.yml create mode 100644 modules/nf-core/picard/collectmultiplemetrics/environment.yml create mode 100644 modules/nf-core/picard/mergesamfiles/environment.yml create mode 100644 modules/nf-core/preseq/lcextrap/environment.yml mode change 100755 => 100644 modules/nf-core/preseq/lcextrap/meta.yml create mode 100644 modules/nf-core/preseq/lcextrap/tests/main.nf.test create mode 100644 modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap create mode 100644 modules/nf-core/preseq/lcextrap/tests/tags.yml create mode 100644 modules/nf-core/samtools/sort/tests/nextflow_cram.config create mode 100644 modules/nf-core/subread/featurecounts/environment.yml create mode 100644 modules/nf-core/subread/featurecounts/tests/main.nf.test create mode 100644 modules/nf-core/subread/featurecounts/tests/main.nf.test.snap create mode 100644 modules/nf-core/subread/featurecounts/tests/nextflow.config create mode 100644 modules/nf-core/subread/featurecounts/tests/tags.yml create mode 100644 modules/nf-core/ucsc/bedgraphtobigwig/environment.yml create mode 100644 modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test create mode 100644 modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test.snap create mode 100644 modules/nf-core/ucsc/bedgraphtobigwig/tests/tags.yml create mode 100644 modules/nf-core/untar/environment.yml create mode 100644 modules/nf-core/untar/tests/main.nf.test create mode 100644 modules/nf-core/untar/tests/main.nf.test.snap create mode 100644 modules/nf-core/untar/tests/tags.yml create mode 100644 modules/nf-core/untarfiles/environment.yml create mode 100644 subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test create mode 100644 subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/fastq_align_bowtie2/tests/nextflow.config create mode 100644 subworkflows/nf-core/fastq_align_bowtie2/tests/tags.yml create mode 100644 subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test create mode 100644 subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/fastq_align_bwa/tests/nextflow.config create mode 100644 subworkflows/nf-core/fastq_align_bwa/tests/tags.yml create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/nextflow.config create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/tags.yml diff --git a/modules.json b/modules.json index e8c2f7aa..7d06c2b6 100644 --- a/modules.json +++ b/modules.json @@ -7,82 +7,82 @@ "nf-core": { "bowtie2/align": { "branch": "master", - "git_sha": "3c77ca9aac783e76c3614a06db3bfe4fef619bde", + "git_sha": "e4bad511789f16d0df39ee306b2cd50418365048", "installed_by": ["fastq_align_bowtie2", "modules"] }, "bowtie2/build": { "branch": "master", - "git_sha": "6a24fbe314bb2e6fe6306c29a63076ea87e8eb3c", + "git_sha": "1fea64f5132a813ec97c1c6d3a74e0aee7142b6d", "installed_by": ["modules"] }, "bwa/index": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", "installed_by": ["modules"] }, "bwa/mem": { "branch": "master", - "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", "installed_by": ["fastq_align_bwa", "modules"] }, "chromap/chromap": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["fastq_align_chromap", "modules"] + "git_sha": "4bd9481c5718ca7bfd31459b8242c349171dac87", + "installed_by": ["modules", "fastq_align_chromap"] }, "chromap/index": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "4bd9481c5718ca7bfd31459b8242c349171dac87", "installed_by": ["modules"] }, "custom/getchromsizes": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7", "installed_by": ["modules"] }, "deeptools/computematrix": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", "installed_by": ["modules"] }, "deeptools/plotfingerprint": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", "installed_by": ["modules"] }, "deeptools/plotheatmap": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", "installed_by": ["modules"] }, "deeptools/plotprofile": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", "installed_by": ["modules"] }, "fastqc": { "branch": "master", - "git_sha": "285a50500f9e02578d90b3ce6382ea3c30216acd", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] }, "gffread": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "6c996d7fbe0816dcbb68ce587ad5f873313682a1", "installed_by": ["modules"] }, "gunzip": { "branch": "master", - "git_sha": "5c460c5a4736974abde2843294f35307ee2b0e5e", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", "installed_by": ["modules"] }, "homer/annotatepeaks": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, "khmer/uniquekmers": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, "macs3/callpeak": { @@ -92,7 +92,7 @@ }, "multiqc": { "branch": "master", - "git_sha": "b7ebe95761cd389603f9cc0e0dc384c0f663815a", + "git_sha": "b80f5fd12ff7c43938f424dd76392a2704fa2396", "installed_by": ["modules"] }, "phantompeakqualtools": { @@ -102,77 +102,77 @@ }, "picard/collectmultiplemetrics": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", "installed_by": ["modules"] }, "picard/markduplicates": { "branch": "master", - "git_sha": "ec833ac4c29db6005d18baccf3306f557c46b006", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_markduplicates_picard", "modules"] }, "picard/mergesamfiles": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", "installed_by": ["modules"] }, "preseq/lcextrap": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "2c6b1144ed58b6184ad58fc4e6b6a90219b4bf4f", "installed_by": ["modules"] }, "samtools/flagstat": { "branch": "master", - "git_sha": "ce0b1aed7d504883061e748f492a31bf44c5777c", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_stats_samtools", "modules"] }, "samtools/idxstats": { "branch": "master", - "git_sha": "ce0b1aed7d504883061e748f492a31bf44c5777c", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_stats_samtools", "modules"] }, "samtools/index": { "branch": "master", - "git_sha": "ce0b1aed7d504883061e748f492a31bf44c5777c", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools", "modules"] }, "samtools/sort": { "branch": "master", - "git_sha": "ce0b1aed7d504883061e748f492a31bf44c5777c", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_sort_stats_samtools", "modules"] }, "samtools/stats": { "branch": "master", - "git_sha": "ec833ac4c29db6005d18baccf3306f557c46b006", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["bam_stats_samtools", "modules"] }, "subread/featurecounts": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["modules"] }, "trimgalore": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] }, "ucsc/bedgraphtobigwig": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["modules"] }, "umitools/extract": { "branch": "master", - "git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["fastq_fastqc_umitools_trimgalore"] }, "untar": { "branch": "master", - "git_sha": "5c460c5a4736974abde2843294f35307ee2b0e5e", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", "installed_by": ["modules"] }, "untarfiles": { "branch": "master", - "git_sha": "5c460c5a4736974abde2843294f35307ee2b0e5e", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] } } @@ -181,27 +181,27 @@ "nf-core": { "bam_markduplicates_picard": { "branch": "master", - "git_sha": "0c38be7e652a0b2f3a37681ee4c0dbdf85677647", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["subworkflows"] }, "bam_sort_stats_samtools": { "branch": "master", - "git_sha": "0c38be7e652a0b2f3a37681ee4c0dbdf85677647", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["fastq_align_bowtie2", "fastq_align_bwa", "fastq_align_chromap"] }, "bam_stats_samtools": { "branch": "master", - "git_sha": "0c38be7e652a0b2f3a37681ee4c0dbdf85677647", + "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools"] }, "fastq_align_bowtie2": { "branch": "master", - "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", + "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", "installed_by": ["subworkflows"] }, "fastq_align_bwa": { "branch": "master", - "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", + "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", "installed_by": ["subworkflows"] }, "fastq_align_chromap": { @@ -211,7 +211,7 @@ }, "fastq_fastqc_umitools_trimgalore": { "branch": "master", - "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["subworkflows"] }, "utils_nextflow_pipeline": { diff --git a/modules/nf-core/bowtie2/align/main.nf b/modules/nf-core/bowtie2/align/main.nf index 8c405ee3..809525ad 100644 --- a/modules/nf-core/bowtie2/align/main.nf +++ b/modules/nf-core/bowtie2/align/main.nf @@ -1,6 +1,6 @@ process BOWTIE2_ALIGN { tag "$meta.id" - label "process_high" + label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -10,13 +10,18 @@ process BOWTIE2_ALIGN { input: tuple val(meta) , path(reads) tuple val(meta2), path(index) + tuple val(meta3), path(fasta) val save_unaligned val sort_bam output: - tuple val(meta), path("*.{bam,sam}"), emit: aligned + tuple val(meta), path("*.sam") , emit: sam , optional:true + tuple val(meta), path("*.bam") , emit: bam , optional:true + 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 tuple val(meta), path("*.log") , emit: log - tuple val(meta), path("*fastq.gz") , emit: fastq, optional:true + tuple val(meta), path("*fastq.gz") , emit: fastq , optional:true path "versions.yml" , emit: versions when: @@ -39,7 +44,10 @@ process BOWTIE2_ALIGN { def samtools_command = sort_bam ? 'sort' : 'view' def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ - def extension = (args2 ==~ extension_pattern) ? (args2 =~ extension_pattern)[0][2].toLowerCase() : "bam" + def extension_matcher = (args2 =~ extension_pattern) + def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" """ INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/\\.rev.1.bt2\$//"` @@ -53,7 +61,7 @@ process BOWTIE2_ALIGN { $unaligned \\ $args \\ 2> >(tee ${prefix}.bowtie2.log >&2) \\ - | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.${extension} - + | samtools $samtools_command $args2 --threads $task.cpus ${reference} -o ${prefix}.${extension} - if [ -f ${prefix}.unmapped.fastq.1.gz ]; then mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz @@ -82,9 +90,19 @@ 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 = "" + if (extension == "cram") { + create_index = "touch ${prefix}.crai" + } else if (extension == "bam") { + create_index = "touch ${prefix}.csi" + } """ touch ${prefix}.${extension} + ${create_index} touch ${prefix}.bowtie2.log ${create_unmapped} diff --git a/modules/nf-core/bowtie2/align/meta.yml b/modules/nf-core/bowtie2/align/meta.yml index e66811d0..38610e0e 100644 --- a/modules/nf-core/bowtie2/align/meta.yml +++ b/modules/nf-core/bowtie2/align/meta.yml @@ -36,6 +36,15 @@ input: 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" - save_unaligned: type: boolean description: | @@ -46,22 +55,38 @@ input: description: use samtools sort (true) or samtools view (false) pattern: "true or false" output: - - aligned: + - sam: type: file - description: Output BAM/SAM file containing read alignments - pattern: "*.{bam,sam}" - - versions: + description: Output SAM file containing read alignments + pattern: "*.sam" + - bam: type: file - description: File containing software versions - pattern: "versions.yml" - - fastq: + description: Output BAM file containing read alignments + pattern: "*.bam" + - cram: type: file - description: Unaligned FastQ files - pattern: "*.fastq.gz" + 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" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bowtie2/align/tests/cram_crai.config b/modules/nf-core/bowtie2/align/tests/cram_crai.config new file mode 100644 index 00000000..03f1d5e5 --- /dev/null +++ b/modules/nf-core/bowtie2/align/tests/cram_crai.config @@ -0,0 +1,5 @@ +process { + withName: BOWTIE2_ALIGN { + ext.args2 = '--output-fmt cram --write-index' + } +} diff --git a/modules/nf-core/bowtie2/align/tests/main.nf.test b/modules/nf-core/bowtie2/align/tests/main.nf.test index a478d17b..03aeaf9e 100644 --- a/modules/nf-core/bowtie2/align/tests/main.nf.test +++ b/modules/nf-core/bowtie2/align/tests/main.nf.test @@ -6,9 +6,10 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "bowtie2" + tag "bowtie2/build" tag "bowtie2/align" - test("sarscov2 - fastq, index, false, false - bam") { + test("sarscov2 - fastq, index, fasta, false, false - bam") { setup { run("BOWTIE2_BUILD") { @@ -32,8 +33,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -42,7 +44,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -52,7 +54,7 @@ nextflow_process { } - test("sarscov2 - fastq, index, false, false - sam") { + test("sarscov2 - fastq, index, fasta, false, false - sam") { config "./sam.config" setup { @@ -77,8 +79,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -87,7 +90,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).readLines()[0..4], + file(process.out.sam[0][1]).readLines()[0..4], process.out.log, process.out.fastq, process.out.versions @@ -97,7 +100,7 @@ nextflow_process { } - test("sarscov2 - fastq, index, false, false - sam2") { + test("sarscov2 - fastq, index, fasta, false, false - sam2") { config "./sam2.config" setup { @@ -122,8 +125,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -132,7 +136,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).readLines()[0..4], + file(process.out.sam[0][1]).readLines()[0..4], process.out.log, process.out.fastq, process.out.versions @@ -142,7 +146,7 @@ nextflow_process { } - test("sarscov2 - fastq, index, false, true - bam") { + test("sarscov2 - fastq, index, fasta, false, true - bam") { setup { run("BOWTIE2_BUILD") { @@ -166,8 +170,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = true //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -176,7 +181,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -186,7 +191,7 @@ nextflow_process { } - test("sarscov2 - [fastq1, fastq2], index, false, false - bam") { + test("sarscov2 - [fastq1, fastq2], index, fasta, false, false - bam") { setup { run("BOWTIE2_BUILD") { @@ -213,8 +218,9 @@ nextflow_process { ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -223,7 +229,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -233,7 +239,7 @@ nextflow_process { } - test("sarscov2 - [fastq1, fastq2], index, false, true - bam") { + test("sarscov2 - [fastq1, fastq2], index, fasta, false, true - bam") { setup { run("BOWTIE2_BUILD") { @@ -260,8 +266,9 @@ nextflow_process { ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = true //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -270,7 +277,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -280,7 +287,7 @@ nextflow_process { } - test("sarscov2 - fastq, large_index, false, false - bam") { + test("sarscov2 - fastq, large_index, fasta, false, false - bam") { config "./large_index.config" setup { @@ -305,8 +312,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -315,7 +323,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -325,7 +333,7 @@ nextflow_process { } - test("sarscov2 - [fastq1, fastq2], large_index, false, false - bam") { + test("sarscov2 - [fastq1, fastq2], large_index, fasta, false, false - bam") { config "./large_index.config" setup { @@ -353,8 +361,9 @@ nextflow_process { ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -363,7 +372,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -373,7 +382,7 @@ nextflow_process { } - test("sarscov2 - [fastq1, fastq2], index, true, false - bam") { + test("sarscov2 - [fastq1, fastq2], index, fasta, true, false - bam") { setup { run("BOWTIE2_BUILD") { @@ -400,8 +409,9 @@ nextflow_process { ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = true //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -410,7 +420,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -420,7 +430,7 @@ nextflow_process { } - test("sarscov2 - fastq, index, true, false - bam") { + test("sarscov2 - fastq, index, fasta, true, false - bam") { setup { run("BOWTIE2_BUILD") { @@ -444,8 +454,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = true //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -454,7 +465,7 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, process.out.log, process.out.fastq, process.out.versions @@ -465,7 +476,54 @@ nextflow_process { } - test("sarscov2 - [fastq1, fastq2], index, false, false - stub") { + test("sarscov2 - [fastq1, fastq2], index, fasta, true, true - cram") { + + config "./cram_crai.config" + setup { + run("BOWTIE2_BUILD") { + script "../../build/main.nf" + process { + """ + input[0] = [ + [ id:'test'], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + } + + when { + 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) + ] + ] + input[1] = BOWTIE2_BUILD.out.index + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = true //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.cram[0][1]).name, + file(process.out.crai[0][1]).name + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], index, fasta, false, false - stub") { options "-stub" setup { @@ -493,8 +551,9 @@ nextflow_process { ] ] input[1] = BOWTIE2_BUILD.out.index - input[2] = false //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -503,7 +562,8 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, file(process.out.log[0][1]).name, process.out.fastq, process.out.versions @@ -513,7 +573,7 @@ nextflow_process { } - test("sarscov2 - fastq, index, true, false - stub") { + test("sarscov2 - fastq, index, fasta, true, false - stub") { options "-stub" setup { @@ -538,8 +598,9 @@ nextflow_process { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] input[1] = BOWTIE2_BUILD.out.index - input[2] = true //save_unaligned - input[3] = false //sort + input[2] = [[ id:'test'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[3] = false //save_unaligned + input[4] = false //sort """ } } @@ -548,14 +609,15 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.aligned[0][1]).name, + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, file(process.out.log[0][1]).name, - file(process.out.fastq[0][1]).name, + process.out.fastq, process.out.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 883dc7ec..028e7da6 100644 --- a/modules/nf-core/bowtie2/align/tests/main.nf.test.snap +++ b/modules/nf-core/bowtie2/align/tests/main.nf.test.snap @@ -1,34 +1,38 @@ { - "sarscov2 - fastq, index, false, false - sam2": { + "sarscov2 - [fastq1, fastq2], large_index, fasta, false, false - bam": { "content": [ - [ - "ERR5069949.2151832\t16\tMT192765.1\t17453\t42\t150M\t*\t0\t0\tACGCACATTGCTAACTAAGGGCACACTAGAACCAGAATATTTCAATTCAGTGTGTAGACTTATGAAAACTATAGGTCCAGACATGTTCCTCGGAACTTGTCGGCGTTGTCCTGCTGAAATTGTTGACACTGTGAGTGCTTTGGTTTATGA\tAAAA versions.yml @@ -34,14 +35,15 @@ process BWA_INDEX { """ stub: + def prefix = task.ext.prefix ?: "${fasta.baseName}" """ mkdir bwa - touch bwa/genome.amb - touch bwa/genome.ann - touch bwa/genome.bwt - touch bwa/genome.pac - touch bwa/genome.sa + 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}": diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 2c6cfcd7..6bbc87a6 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -11,7 +11,7 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] input: @@ -40,3 +40,7 @@ output: 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 new file mode 100644 index 00000000..af33e73c --- /dev/null +++ b/modules/nf-core/bwa/index/tests/main.nf.test @@ -0,0 +1,33 @@ +nextflow_process { + + name "Test Process BWA_INDEX" + tag "modules_nfcore" + tag "modules" + tag "bwa" + tag "bwa/index" + script "../main.nf" + process "BWA_INDEX" + + test("BWA index") { + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + 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 new file mode 100644 index 00000000..7c8f0465 --- /dev/null +++ b/modules/nf-core/bwa/index/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "BWA index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "genome.amb:md5,3a68b8b2287e07dd3f5f95f4344ba76e", + "genome.ann:md5,c32e11f6c859f166c7525a9c1d583567", + "genome.bwt:md5,0469c30a1e239dd08f68afe66fde99da", + "genome.pac:md5,983e3d2cd6f36e2546e6d25a0da78d66", + "genome.sa:md5,ab3952cabf026b48cd3eb5bccbb636d1" + ] + ] + ], + "1": [ + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" + ], + "index": [ + [ + { + "id": "test" + }, + [ + "genome.amb:md5,3a68b8b2287e07dd3f5f95f4344ba76e", + "genome.ann:md5,c32e11f6c859f166c7525a9c1d583567", + "genome.bwt:md5,0469c30a1e239dd08f68afe66fde99da", + "genome.pac:md5,983e3d2cd6f36e2546e6d25a0da78d66", + "genome.sa:md5,ab3952cabf026b48cd3eb5bccbb636d1" + ] + ] + ], + "versions": [ + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-16T11:40:09.925307" + } +} \ 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 new file mode 100644 index 00000000..28bb483c --- /dev/null +++ b/modules/nf-core/bwa/index/tests/tags.yml @@ -0,0 +1,2 @@ +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 c5b2a9ce..3aa9f0cc 100644 --- a/modules/nf-core/bwa/mem/environment.yml +++ b/modules/nf-core/bwa/mem/environment.yml @@ -4,6 +4,7 @@ channels: - bioconda - defaults dependencies: - - bwa=0.7.17 + - bwa=0.7.18 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.18 + - samtools=1.20 + - htslib=1.20.0 diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index a3a82994..9c815f0c 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -4,17 +4,21 @@ 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:9c0128851101dafef65cef649826d2dbe6bedd7e-0' : - 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:9c0128851101dafef65cef649826d2dbe6bedd7e-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' : + 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' }" input: - tuple val(meta), path(reads) + tuple val(meta) , path(reads) tuple val(meta2), path(index) + tuple val(meta3), path(fasta) val sort_bam output: - tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: versions + tuple val(meta), path("*.bam") , emit: bam, optional: true + 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 when: task.ext.when == null || task.ext.when @@ -24,6 +28,13 @@ process BWA_MEM { 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": + !sort_bam && args2.contains("-C") ? "cram": + "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" """ INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` @@ -32,7 +43,7 @@ process BWA_MEM { -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - + | samtools $samtools_command $args2 ${reference} --threads $task.cpus -o ${prefix}.${extension} - cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -42,9 +53,19 @@ process BWA_MEM { """ 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": + !sort_bam && args2.contains("-C") ? "cram": + "bam" """ - touch ${prefix}.bam + touch ${prefix}.${extension} + touch ${prefix}.csi + touch ${prefix}.crai cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bwa/mem/meta.yml b/modules/nf-core/bwa/mem/meta.yml index 440fb1f9..b126dd86 100644 --- a/modules/nf-core/bwa/mem/meta.yml +++ b/modules/nf-core/bwa/mem/meta.yml @@ -14,7 +14,7 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] input: @@ -37,6 +37,10 @@ input: 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}" - sort_bam: type: boolean description: use samtools sort (true) or samtools view (false) @@ -46,6 +50,18 @@ output: 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 @@ -53,6 +69,8 @@ output: authors: - "@drpatelh" - "@jeremy1805" + - "@matthdsm" maintainers: - "@drpatelh" - "@jeremy1805" + - "@matthdsm" diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index b199bb70..463b76f8 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test +++ b/modules/nf-core/bwa/mem/tests/main.nf.test @@ -5,6 +5,7 @@ nextflow_process { tag "modules" tag "bwa" tag "bwa/mem" + tag "bwa/index" script "../main.nf" process "BWA_MEM" @@ -17,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,11 +31,12 @@ 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] = BWA_INDEX.out.index - input[2] = false + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false """ } } @@ -42,7 +44,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -57,7 +66,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) ] """ } @@ -70,11 +79,12 @@ 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] = BWA_INDEX.out.index - input[2] = true + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true """ } } @@ -82,7 +92,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -97,7 +114,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) ] """ } @@ -110,12 +127,13 @@ 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] = BWA_INDEX.out.index - input[2] = false + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false """ } } @@ -123,7 +141,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -138,7 +163,56 @@ 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) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + 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] = BWA_INDEX.out.index + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } + ) + } + + } + + 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) ] """ } @@ -151,12 +225,60 @@ 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] = BWA_INDEX.out.index + input[2] = [[:],[]] + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } + ) + } + + } + + 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 { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] ] input[1] = BWA_INDEX.out.index - input[2] = true + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false """ } } @@ -164,9 +286,56 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, + process.out.versions + ).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 { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + 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] = BWA_INDEX.out.index + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false + """ + } + } + 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() } + ) + } } } 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 bfb55fc7..038ee7b7 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -1,126 +1,140 @@ { "Single-End": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,df203d7c7e8fef351408a909570c7952" - ] - ], - "1": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ], - "bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,df203d7c7e8fef351408a909570c7952" - ] - ], - "versions": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], - "timestamp": "2023-12-04T11:01:22.483594641" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:44:32.953673185" }, "Single-End Sort": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,8a52bd78fdcecb994c1f63897d5b431c" - ] - ], - "1": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ], - "bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,8a52bd78fdcecb994c1f63897d5b431c" - ] - ], - "versions": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], - "timestamp": "2023-12-04T11:01:30.180783483" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:44:45.27066093" }, "Paired-End": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,9815aef9ec763a60c53c3879be2d73ae" - ] - ], - "1": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,9815aef9ec763a60c53c3879be2d73ae" - ] - ], - "versions": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], - "timestamp": "2023-12-04T11:01:38.761983007" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:44:57.706852274" }, "Paired-End Sort": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,0f0cda73704c4f7ba08af482edcbbe88" - ] - ], - "1": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,0f0cda73704c4f7ba08af482edcbbe88" - ] - ], - "versions": [ - "versions.yml:md5,a18ac8ef8cfcc7b2cc262c49d4c064f9" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], - "timestamp": "2023-12-04T11:01:46.284587802" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:45:10.376505036" + }, + "Single-end - stub": { + "content": [ + "test.bam", + "test.csi", + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:46:07.182072398" + }, + "Paired-End - no fasta": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:45:53.813076501" + }, + "Paired-end - stub": { + "content": [ + "test.bam", + "test.csi", + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-20T08:46:18.412916364" } } \ No newline at end of file diff --git a/modules/nf-core/chromap/chromap/main.nf b/modules/nf-core/chromap/chromap/main.nf index 2cc09a43..9b1f1395 100644 --- a/modules/nf-core/chromap/chromap/main.nf +++ b/modules/nf-core/chromap/chromap/main.nf @@ -92,4 +92,19 @@ process CHROMAP_CHROMAP { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo "" | gzip > ${prefix}.bed.gz + touch ${prefix}.bam + echo "" | gzip > ${prefix}.tagAlign.gz + echo "" | gzip > ${prefix}.pairs.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromap: \$(echo \$(chromap --version 2>&1)) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test b/modules/nf-core/chromap/chromap/tests/main.nf.test new file mode 100644 index 00000000..6752804b --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test @@ -0,0 +1,161 @@ +nextflow_process { + + name "Test Process CHROMAP_CHROMAP" + script "../main.nf" + process "CHROMAP_CHROMAP" + + tag "modules" + tag "modules_nfcore" + tag "chromap" + tag "chromap/chromap" + tag "chromap/index" + + setup { + + run("CHROMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + + run("CHROMAP_INDEX", alias: "CHROMAP_INDEX_STUB") { + options "-stub" + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + + } + + test("sarscov2 - single_end") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 - paired_end ") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + + test("sarscov2 - paired_end - bam") { + + when { + config "./nextflow.config" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.bam[0][1]).name).match() } + ) + } + + } + + test("sarscov2 - single_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX_STUB.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test.snap b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap new file mode 100644 index 00000000..1e718ac6 --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap @@ -0,0 +1,219 @@ +{ + "sarscov2 - single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ], + "bam": [ + + ], + "bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + ] + ], + "pairs": [ + + ], + "tagAlign": [ + + ], + "versions": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:14:34.016756" + }, + "sarscov2 - paired_end ": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ], + "bam": [ + + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + ] + ], + "pairs": [ + + ], + "tagAlign": [ + + ], + "versions": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:18:23.379305" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:09:02.94685" + }, + "sarscov2 - single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.tagAlign.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.pairs.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "4": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "pairs": [ + [ + { + "id": "test", + "single_end": true + }, + "test.pairs.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tagAlign": [ + [ + { + "id": "test", + "single_end": true + }, + "test.tagAlign.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:14:51.782404" + }, + "sarscov2 - paired_end - bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:14:46.389216" + } +} \ No newline at end of file diff --git a/modules/nf-core/chromap/chromap/tests/nextflow.config b/modules/nf-core/chromap/chromap/tests/nextflow.config new file mode 100644 index 00000000..51b96a98 --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: CHROMAP_CHROMAP { + ext.args = '--SAM' + } + +} diff --git a/modules/nf-core/chromap/chromap/tests/tags.yml b/modules/nf-core/chromap/chromap/tests/tags.yml new file mode 100644 index 00000000..3b288fa2 --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/tags.yml @@ -0,0 +1,2 @@ +chromap/chromap: + - modules/nf-core/chromap/chromap/** diff --git a/modules/nf-core/chromap/index/environment.yml b/modules/nf-core/chromap/index/environment.yml new file mode 100644 index 00000000..602863ab --- /dev/null +++ b/modules/nf-core/chromap/index/environment.yml @@ -0,0 +1,7 @@ +name: chromap_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::chromap=0.2.5 diff --git a/modules/nf-core/chromap/index/main.nf b/modules/nf-core/chromap/index/main.nf index fb3773f8..bd97c7c9 100644 --- a/modules/nf-core/chromap/index/main.nf +++ b/modules/nf-core/chromap/index/main.nf @@ -2,10 +2,10 @@ process CHROMAP_INDEX { tag "$fasta" label 'process_medium' - conda "bioconda::chromap=0.2.4" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/chromap:0.2.4--hd03093a_0' : - 'biocontainers/chromap:0.2.4--hd03093a_0' }" + 'https://depot.galaxyproject.org/singularity/chromap:0.2.5--hd03093a_0' : + 'biocontainers/chromap:0.2.5--hd03093a_0' }" input: tuple val(meta), path(fasta) @@ -33,4 +33,15 @@ process CHROMAP_INDEX { chromap: \$(echo \$(chromap --version 2>&1)) END_VERSIONS """ + + stub: + def prefix = fasta.baseName + """ + touch ${prefix}.index + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromap: \$(echo \$(chromap --version 2>&1)) + END_VERSIONS + """ } diff --git a/modules/nf-core/chromap/index/meta.yml b/modules/nf-core/chromap/index/meta.yml index 39c5459b..6559509c 100644 --- a/modules/nf-core/chromap/index/meta.yml +++ b/modules/nf-core/chromap/index/meta.yml @@ -11,9 +11,7 @@ tools: homepage: https://github.com/haowenz/chromap documentation: https://github.com/haowenz/chromap tool_dev_url: https://github.com/haowenz/chromap - licence: ["GPL v3"] - input: - meta: type: map @@ -23,7 +21,6 @@ input: - fasta: type: file description: Fasta reference file. - output: - versions: type: file @@ -38,7 +35,9 @@ output: type: file description: Index file of the reference genome pattern: "*.{index}" - authors: - "@mahesh-panchal" - "@joseespinosa" +maintainers: + - "@mahesh-panchal" + - "@joseespinosa" diff --git a/modules/nf-core/chromap/index/tests/main.nf.test b/modules/nf-core/chromap/index/tests/main.nf.test new file mode 100644 index 00000000..ffec974d --- /dev/null +++ b/modules/nf-core/chromap/index/tests/main.nf.test @@ -0,0 +1,52 @@ +nextflow_process { + + name "Test Process CHROMAP_INDEX" + script "../main.nf" + process "CHROMAP_INDEX" + + tag "modules" + tag "modules_nfcore" + tag "chromap" + tag "chromap/index" + + test("sarscov2 - fasta") { + + when { + process { + """ + input[0] = [ [ 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.versions).match("versions") }, + { assert snapshot(file(process.out.index[0][1]).name).match() } + ) + } + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ 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() } + ) + } + } +} diff --git a/modules/nf-core/chromap/index/tests/main.nf.test.snap b/modules/nf-core/chromap/index/tests/main.nf.test.snap new file mode 100644 index 00000000..14ba7c2f --- /dev/null +++ b/modules/nf-core/chromap/index/tests/main.nf.test.snap @@ -0,0 +1,57 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.index:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + ], + "index": [ + [ + { + "id": "test" + }, + "genome.index:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:16:24.274833" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T10:47:29.768048005" + }, + "sarscov2 - fasta": { + "content": [ + "genome.index" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T09:15:55.493443" + } +} \ No newline at end of file diff --git a/modules/nf-core/chromap/index/tests/tags.yml b/modules/nf-core/chromap/index/tests/tags.yml new file mode 100644 index 00000000..360817cb --- /dev/null +++ b/modules/nf-core/chromap/index/tests/tags.yml @@ -0,0 +1,2 @@ +chromap/index: + - modules/nf-core/chromap/index/** diff --git a/modules/nf-core/custom/getchromsizes/environment.yml b/modules/nf-core/custom/getchromsizes/environment.yml new file mode 100644 index 00000000..2ecd0128 --- /dev/null +++ b/modules/nf-core/custom/getchromsizes/environment.yml @@ -0,0 +1,8 @@ +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 index 060a2e88..3edf7c22 100644 --- a/modules/nf-core/custom/getchromsizes/main.nf +++ b/modules/nf-core/custom/getchromsizes/main.nf @@ -2,10 +2,10 @@ process CUSTOM_GETCHROMSIZES { tag "$fasta" label 'process_single' - conda "bioconda::samtools=1.16.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(fasta) @@ -35,6 +35,9 @@ process CUSTOM_GETCHROMSIZES { """ touch ${fasta}.fai touch ${fasta}.sizes + if [[ "${fasta.extension}" == "gz" ]]; then + touch ${fasta}.gzi + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/custom/getchromsizes/meta.yml b/modules/nf-core/custom/getchromsizes/meta.yml index 219ca1d8..529be07e 100644 --- a/modules/nf-core/custom/getchromsizes/meta.yml +++ b/modules/nf-core/custom/getchromsizes/meta.yml @@ -12,7 +12,6 @@ tools: tool_dev_url: https://github.com/samtools/samtools doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] - input: - meta: type: map @@ -23,7 +22,6 @@ input: type: file description: FASTA file pattern: "*.{fa,fasta,fna,fas}" - output: - meta: type: map @@ -46,8 +44,11 @@ output: 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 new file mode 100644 index 00000000..2f741a4b --- /dev/null +++ b/modules/nf-core/custom/getchromsizes/tests/main.nf.test @@ -0,0 +1,99 @@ +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/main.nf.test.snap b/modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap new file mode 100644 index 00000000..c37b284d --- /dev/null +++ b/modules/nf-core/custom/getchromsizes/tests/main.nf.test.snap @@ -0,0 +1,242 @@ +{ + "test_custom_getchromsizes_bgzip - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ], + "fai": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gzi": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "sizes": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-05T12:38:36.927106" + }, + "test_custom_getchromsizes": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.fasta.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ], + "fai": [ + [ + { + "id": "test" + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "gzi": [ + + ], + "sizes": [ + [ + { + "id": "test" + }, + "genome.fasta.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" + ] + ], + "versions": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-20T13:22:34.14237" + }, + "test_custom_getchromsizes_bgzip": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + ] + ], + "3": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ], + "fai": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "gzi": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + ] + ], + "sizes": [ + [ + { + "id": "test" + }, + "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" + ] + ], + "versions": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-20T13:23:06.241379" + }, + "test_custom_getchromsizes - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ], + "fai": [ + [ + { + "id": "test" + }, + "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gzi": [ + + ], + "sizes": [ + [ + { + "id": "test" + }, + "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0d5a7c33bddcb1edad6bf0705b258e6f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-05T12:24:05.697845" + } +} \ No newline at end of file diff --git a/modules/nf-core/custom/getchromsizes/tests/tags.yml b/modules/nf-core/custom/getchromsizes/tests/tags.yml new file mode 100644 index 00000000..d89a805f --- /dev/null +++ b/modules/nf-core/custom/getchromsizes/tests/tags.yml @@ -0,0 +1,2 @@ +custom/getchromsizes: + - modules/nf-core/custom/getchromsizes/** diff --git a/modules/nf-core/deeptools/computematrix/environment.yml b/modules/nf-core/deeptools/computematrix/environment.yml new file mode 100644 index 00000000..b1b0866d --- /dev/null +++ b/modules/nf-core/deeptools/computematrix/environment.yml @@ -0,0 +1,7 @@ +name: deeptools_computematrix +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::deeptools=3.5.1 diff --git a/modules/nf-core/deeptools/computematrix/main.nf b/modules/nf-core/deeptools/computematrix/main.nf index e77e2839..dbd88dc9 100644 --- a/modules/nf-core/deeptools/computematrix/main.nf +++ b/modules/nf-core/deeptools/computematrix/main.nf @@ -2,7 +2,7 @@ process DEEPTOOLS_COMPUTEMATRIX { tag "$meta.id" label 'process_high' - conda "bioconda::deeptools=3.5.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 'biocontainers/deeptools:3.5.1--py_0' }" diff --git a/modules/nf-core/deeptools/computematrix/meta.yml b/modules/nf-core/deeptools/computematrix/meta.yml index 8a148f5d..a48dec39 100644 --- a/modules/nf-core/deeptools/computematrix/meta.yml +++ b/modules/nf-core/deeptools/computematrix/meta.yml @@ -12,7 +12,6 @@ tools: tool_dev_url: https://github.com/deeptools/deepTools doi: "10.1093/nar/gku365" licence: ["GPL v3"] - input: - meta: type: map @@ -27,7 +26,6 @@ input: type: file description: bed file containing genomic regions pattern: "*.{bed}" - output: - meta: type: map @@ -49,9 +47,13 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@jeremy1805" - - "@emiller88" + - "@edmundmiller" + - "@drpatelh" + - "@joseespinosa" +maintainers: + - "@jeremy1805" + - "@edmundmiller" - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/deeptools/plotfingerprint/environment.yml b/modules/nf-core/deeptools/plotfingerprint/environment.yml new file mode 100644 index 00000000..14654fbb --- /dev/null +++ b/modules/nf-core/deeptools/plotfingerprint/environment.yml @@ -0,0 +1,7 @@ +name: deeptools_plotfingerprint +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::deeptools=3.5.1 diff --git a/modules/nf-core/deeptools/plotfingerprint/main.nf b/modules/nf-core/deeptools/plotfingerprint/main.nf index 3159e941..1355f46d 100644 --- a/modules/nf-core/deeptools/plotfingerprint/main.nf +++ b/modules/nf-core/deeptools/plotfingerprint/main.nf @@ -2,7 +2,7 @@ process DEEPTOOLS_PLOTFINGERPRINT { tag "$meta.id" label 'process_high' - conda "bioconda::deeptools=3.5.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 'biocontainers/deeptools:3.5.1--py_0' }" diff --git a/modules/nf-core/deeptools/plotfingerprint/meta.yml b/modules/nf-core/deeptools/plotfingerprint/meta.yml index 29ddf893..f8217440 100644 --- a/modules/nf-core/deeptools/plotfingerprint/meta.yml +++ b/modules/nf-core/deeptools/plotfingerprint/meta.yml @@ -12,7 +12,6 @@ tools: tool_dev_url: https://github.com/deeptools/deepTools doi: "10.1093/nar/gku365" licence: ["GPL v3"] - input: - meta: type: map @@ -27,7 +26,6 @@ input: type: file description: Corresponding BAM file indexes pattern: "*.bam.bai" - output: - meta: type: map @@ -53,8 +51,11 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - - "@emiller88" + - "@edmundmiller" + - "@drpatelh" + - "@joseespinosa" +maintainers: + - "@edmundmiller" - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/deeptools/plotheatmap/environment.yml b/modules/nf-core/deeptools/plotheatmap/environment.yml new file mode 100644 index 00000000..05f2b3ca --- /dev/null +++ b/modules/nf-core/deeptools/plotheatmap/environment.yml @@ -0,0 +1,7 @@ +name: deeptools_plotheatmap +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::deeptools=3.5.1 diff --git a/modules/nf-core/deeptools/plotheatmap/main.nf b/modules/nf-core/deeptools/plotheatmap/main.nf index 58309eea..3a5ba4cc 100644 --- a/modules/nf-core/deeptools/plotheatmap/main.nf +++ b/modules/nf-core/deeptools/plotheatmap/main.nf @@ -2,7 +2,7 @@ process DEEPTOOLS_PLOTHEATMAP { tag "$meta.id" label 'process_low' - conda "bioconda::deeptools=3.5.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 'biocontainers/deeptools:3.5.1--py_0' }" diff --git a/modules/nf-core/deeptools/plotheatmap/meta.yml b/modules/nf-core/deeptools/plotheatmap/meta.yml index 9296f503..54ddeb0a 100644 --- a/modules/nf-core/deeptools/plotheatmap/meta.yml +++ b/modules/nf-core/deeptools/plotheatmap/meta.yml @@ -12,7 +12,6 @@ tools: tool_dev_url: https://github.com/deeptools/deepTools doi: "10.1093/nar/gku365" licence: ["GPL v3"] - input: - meta: type: map @@ -25,7 +24,6 @@ input: gzipped matrix file produced by deeptools_ computematrix deeptools utility pattern: "*.{mat.gz}" - output: - meta: type: map @@ -47,8 +45,11 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - - "@emiller88" + - "@edmundmiller" + - "@drpatelh" + - "@joseespinosa" +maintainers: + - "@edmundmiller" - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/deeptools/plotprofile/environment.yml b/modules/nf-core/deeptools/plotprofile/environment.yml new file mode 100644 index 00000000..7ee9c7da --- /dev/null +++ b/modules/nf-core/deeptools/plotprofile/environment.yml @@ -0,0 +1,7 @@ +name: deeptools_plotprofile +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::deeptools=3.5.1 diff --git a/modules/nf-core/deeptools/plotprofile/main.nf b/modules/nf-core/deeptools/plotprofile/main.nf index b1ab454d..df799984 100644 --- a/modules/nf-core/deeptools/plotprofile/main.nf +++ b/modules/nf-core/deeptools/plotprofile/main.nf @@ -2,7 +2,7 @@ process DEEPTOOLS_PLOTPROFILE { tag "$meta.id" label 'process_low' - conda "bioconda::deeptools=3.5.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 'biocontainers/deeptools:3.5.1--py_0' }" diff --git a/modules/nf-core/deeptools/plotprofile/meta.yml b/modules/nf-core/deeptools/plotprofile/meta.yml index 44612ea9..f7f10505 100644 --- a/modules/nf-core/deeptools/plotprofile/meta.yml +++ b/modules/nf-core/deeptools/plotprofile/meta.yml @@ -12,7 +12,6 @@ tools: tool_dev_url: https://github.com/deeptools/deepTools doi: "10.1093/nar/gku365" licence: ["GPL v3"] - input: - meta: type: map @@ -25,7 +24,6 @@ input: gzipped matrix file produced by deeptools_ computematrix deeptools utility pattern: "*.{mat.gz}" - output: - meta: type: map @@ -47,8 +45,11 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - - "@emiller88" + - "@edmundmiller" + - "@drpatelh" + - "@joseespinosa" +maintainers: + - "@edmundmiller" - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index 70edae4d..e9d79a07 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -23,17 +23,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. - // looks like this:
Mon 2 Oct 2023
test.gz
- // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 - - { 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("fastqc_versions_single") } + { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. + // looks like this:
Mon 2 Oct 2023
test.gz
+ // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 + { 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() } ) } } @@ -54,16 +51,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { 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("fastqc_versions_paired") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { 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() } ) } } @@ -83,13 +78,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { 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("fastqc_versions_interleaved") } + { assert process.success }, + { 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() } ) } } @@ -109,13 +102,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { 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("fastqc_versions_bam") } + { assert process.success }, + { 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() } ) } } @@ -138,22 +129,20 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, - { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, - { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, - { assert process.out.zip[0][1][3] ==~ ".*/test_4_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 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("fastqc_versions_multiple") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, + { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, + { assert process.out.zip[0][1][3] ==~ ".*/test_4_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 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() } ) } } @@ -173,21 +162,18 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { 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("fastqc_versions_custom_prefix") } + { assert process.success }, + { 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() } ) } } test("sarscov2 single-end [fastq] - stub") { - options "-stub" - + options "-stub" when { process { """ @@ -201,12 +187,123 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out.html.collect { file(it[1]).getName() } + - process.out.zip.collect { file(it[1]).getName() } + - process.out.versions ).match("fastqc_stub") } + { assert process.success }, + { assert snapshot(process.out).match() } ) } } + test("sarscov2 paired-end [fastq] - 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/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).match() } + ) + } + } + + test("sarscov2 interleaved [fastq] - 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/fastq/test_interleaved.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 paired-end [bam] - 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).match() } + ) + } + } + + test("sarscov2 multiple [fastq] - 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/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 custom_prefix - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'mysample', single_end:true ], // meta map + 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).match() } + ) + } + } } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index 86f7c311..d5db3092 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,88 +1,392 @@ { - "fastqc_versions_interleaved": { + "sarscov2 custom_prefix": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:07.293713" + "timestamp": "2024-07-22T11:02:16.374038" }, - "fastqc_stub": { + "sarscov2 single-end [fastq] - stub": { "content": [ - [ - "test.html", - "test.zip", - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:24.993809" + }, + "sarscov2 custom_prefix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:31:01.425198" + "timestamp": "2024-07-22T11:03:10.93942" }, - "fastqc_versions_multiple": { + "sarscov2 interleaved [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:55.797907" + "timestamp": "2024-07-22T11:01:42.355718" }, - "fastqc_versions_bam": { + "sarscov2 paired-end [bam]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:26.795862" + "timestamp": "2024-07-22T11:01:53.276274" }, - "fastqc_versions_single": { + "sarscov2 multiple [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:27.043675" + "timestamp": "2024-07-22T11:02:05.527626" }, - "fastqc_versions_paired": { + "sarscov2 paired-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:31.188871" + }, + "sarscov2 paired-end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:34.273566" + }, + "sarscov2 multiple [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:47.584191" + "timestamp": "2024-07-22T11:03:02.304411" }, - "fastqc_versions_custom_prefix": { + "sarscov2 single-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:19.095607" + }, + "sarscov2 interleaved [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:44.640184" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:41:14.576531" + "timestamp": "2024-07-22T11:02:53.550742" } } \ No newline at end of file diff --git a/modules/nf-core/gffread/environment.yml b/modules/nf-core/gffread/environment.yml new file mode 100644 index 00000000..c6df58ad --- /dev/null +++ b/modules/nf-core/gffread/environment.yml @@ -0,0 +1,7 @@ +name: gffread +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::gffread=0.12.7 diff --git a/modules/nf-core/gffread/main.nf b/modules/nf-core/gffread/main.nf index f4472b0e..da55cbab 100644 --- a/modules/nf-core/gffread/main.nf +++ b/modules/nf-core/gffread/main.nf @@ -1,30 +1,57 @@ process GFFREAD { - tag "$gff" + tag "$meta.id" label 'process_low' - conda "bioconda::gffread=0.12.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0' : - 'biocontainers/gffread:0.12.1--h8b12597_0' }" + 'https://depot.galaxyproject.org/singularity/gffread:0.12.7--hdcf5f25_4' : + 'biocontainers/gffread:0.12.7--hdcf5f25_4' }" input: - path gff + tuple val(meta), path(gff) + path fasta output: - path "*.gtf" , emit: gtf - path "versions.yml" , emit: versions + tuple val(meta), path("*.gtf") , emit: gtf , optional: true + tuple val(meta), path("*.gff3") , emit: gffread_gff , optional: true + tuple val(meta), path("*.fasta"), emit: gffread_fasta , optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${gff.baseName}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("-T") ? 'gtf' : ( ( ['-w', '-x', '-y' ].any { args.contains(it) } ) ? 'fasta' : 'gff3' ) + def fasta_arg = fasta ? "-g $fasta" : '' + def output_name = "${prefix}.${extension}" + def output = extension == "fasta" ? "$output_name" : "-o $output_name" + def args_sorted = args.replaceAll(/(.*)(-[wxy])(.*)/) { all, pre, param, post -> "$pre $post $param" }.trim() + // args_sorted = Move '-w', '-x', and '-y' to the end of the args string as gffread expects the file name after these parameters + if ( "$output_name" in [ "$gff", "$fasta" ] ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ gffread \\ $gff \\ - $args \\ - -o ${prefix}.gtf + $fasta_arg \\ + $args_sorted \\ + $output + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gffread: \$(gffread --version 2>&1) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("-T") ? 'gtf' : ( ( ['-w', '-x', '-y' ].any { args.contains(it) } ) ? 'fasta' : 'gff3' ) + def output_name = "${prefix}.${extension}" + if ( "$output_name" in [ "$gff", "$fasta" ] ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + touch $output_name + cat <<-END_VERSIONS > versions.yml "${task.process}": gffread: \$(gffread --version 2>&1) diff --git a/modules/nf-core/gffread/meta.yml b/modules/nf-core/gffread/meta.yml index 20335747..c0602820 100644 --- a/modules/nf-core/gffread/meta.yml +++ b/modules/nf-core/gffread/meta.yml @@ -12,22 +12,44 @@ tools: tool_dev_url: https://github.com/gpertea/gffread doi: 10.12688/f1000research.23297.1 licence: ["MIT"] - input: + - meta: + type: map + description: | + Groovy Map containing meta data + e.g. [ id:'test' ] - gff: type: file description: A reference file in either the GFF3, GFF2 or GTF format. pattern: "*.{gff, gtf}" - + - fasta: + type: file + description: A multi-fasta file with the genomic sequences + pattern: "*.{fasta,fa,faa,fas,fsa}" output: + - meta: + type: map + description: | + Groovy Map containing meta data + e.g. [ id:'test' ] - gtf: type: file - description: GTF file resulting from the conversion of the GFF input file + description: GTF file resulting from the conversion of the GFF input file if '-T' argument is present pattern: "*.{gtf}" + - gffread_gff: + type: file + description: GFF3 file resulting from the conversion of the GFF input file if '-T' argument is absent + pattern: "*.gff3" + - gffread_fasta: + type: file + description: Fasta file produced when either of '-w', '-x', '-y' parameters is present + pattern: "*.fasta" - versions: type: file description: File containing software versions pattern: "versions.yml" - authors: - - "@emiller88" + - "@edmundmiller" +maintainers: + - "@edmundmiller" + - "@gallvp" diff --git a/modules/nf-core/gffread/tests/main.nf.test b/modules/nf-core/gffread/tests/main.nf.test new file mode 100644 index 00000000..4cd13dcd --- /dev/null +++ b/modules/nf-core/gffread/tests/main.nf.test @@ -0,0 +1,223 @@ +nextflow_process { + + name "Test Process GFFREAD" + script "../main.nf" + process "GFFREAD" + + tag "gffread" + tag "modules_nfcore" + tag "modules" + + test("sarscov2-gff3-gtf") { + + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gffread_gff == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-gtf-stub") { + + options '-stub' + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gffread_gff == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-gff3") { + + config "./nextflow-gff3.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-gff3-stub") { + + options '-stub' + config "./nextflow-gff3.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_fasta == [] } + ) + } + + } + + test("sarscov2-gff3-fasta") { + + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_gff == [] } + ) + } + + } + + test("sarscov2-gff3-fasta-stub") { + + options '-stub' + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.gtf == [] }, + { assert process.out.gffread_gff == [] } + ) + } + + } + + test("sarscov2-gff3-fasta-fail-catch") { + + options '-stub' + config "./nextflow-fasta.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'genome'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gff3", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + """ + } + } + + then { + assertAll ( + { assert ! process.success }, + { assert process.stdout.toString().contains("Input and output names are the same") } + ) + } + + } + +} diff --git a/modules/nf-core/gffread/tests/main.nf.test.snap b/modules/nf-core/gffread/tests/main.nf.test.snap new file mode 100644 index 00000000..15262320 --- /dev/null +++ b/modules/nf-core/gffread/tests/main.nf.test.snap @@ -0,0 +1,272 @@ +{ + "sarscov2-gff3-gtf": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.gtf:md5,1ea0ae98d3388e0576407dc4a24ef428" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + + ], + "gtf": [ + [ + { + "id": "test" + }, + "test.gtf:md5,1ea0ae98d3388e0576407dc4a24ef428" + ] + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:48:56.496187" + }, + "sarscov2-gff3-gff3": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,c4e5da6267c6bee5899a2c204ae1ad91" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,c4e5da6267c6bee5899a2c204ae1ad91" + ] + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:49:00.892782" + }, + "sarscov2-gff3-gtf-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + + ], + "gtf": [ + [ + { + "id": "test" + }, + "test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:26.975666" + }, + "sarscov2-gff3-fasta-stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gffread_gff": [ + + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:44.34792" + }, + "sarscov2-gff3-gff3-stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + + ], + "gffread_gff": [ + [ + { + "id": "test" + }, + "test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T11:11:35.221671" + }, + "sarscov2-gff3-fasta": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.fasta:md5,5f8108fb51739a0588ccf0a251de919a" + ] + ], + "3": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ], + "gffread_fasta": [ + [ + { + "id": "test" + }, + "test.fasta:md5,5f8108fb51739a0588ccf0a251de919a" + ] + ], + "gffread_gff": [ + + ], + "gtf": [ + + ], + "versions": [ + "versions.yml:md5,05f671c6c6e530acedad0af0a5948dbd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-09T10:54:02.88143" + } +} \ No newline at end of file diff --git a/modules/nf-core/gffread/tests/nextflow-fasta.config b/modules/nf-core/gffread/tests/nextflow-fasta.config new file mode 100644 index 00000000..ac6cb148 --- /dev/null +++ b/modules/nf-core/gffread/tests/nextflow-fasta.config @@ -0,0 +1,5 @@ +process { + withName: GFFREAD { + ext.args = '-w -S' + } +} diff --git a/modules/nf-core/gffread/tests/nextflow-gff3.config b/modules/nf-core/gffread/tests/nextflow-gff3.config new file mode 100644 index 00000000..afe0830e --- /dev/null +++ b/modules/nf-core/gffread/tests/nextflow-gff3.config @@ -0,0 +1,5 @@ +process { + withName: GFFREAD { + ext.args = '' + } +} diff --git a/modules/nf-core/gffread/tests/nextflow.config b/modules/nf-core/gffread/tests/nextflow.config new file mode 100644 index 00000000..74b25094 --- /dev/null +++ b/modules/nf-core/gffread/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GFFREAD { + ext.args = '-T' + } +} diff --git a/modules/nf-core/gffread/tests/tags.yml b/modules/nf-core/gffread/tests/tags.yml new file mode 100644 index 00000000..05576065 --- /dev/null +++ b/modules/nf-core/gffread/tests/tags.yml @@ -0,0 +1,2 @@ +gffread: + - modules/nf-core/gffread/** diff --git a/modules/nf-core/gunzip/environment.yml b/modules/nf-core/gunzip/environment.yml new file mode 100644 index 00000000..dfc02a7b --- /dev/null +++ b/modules/nf-core/gunzip/environment.yml @@ -0,0 +1,9 @@ +name: gunzip +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 diff --git a/modules/nf-core/gunzip/main.nf b/modules/nf-core/gunzip/main.nf index e7189d2f..5e67e3b9 100644 --- a/modules/nf-core/gunzip/main.nf +++ b/modules/nf-core/gunzip/main.nf @@ -2,10 +2,10 @@ process GUNZIP { tag "$archive" label 'process_single' - conda "conda-forge::sed=4.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'nf-core/ubuntu:20.04' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : + 'nf-core/ubuntu:22.04' }" input: tuple val(meta), path(archive) @@ -18,13 +18,20 @@ process GUNZIP { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - gunzip = archive.toString() - '.gz' + def args = task.ext.args ?: '' + def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".$extension" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".$extension" """ - gunzip \\ - -f \\ + # Not calling gunzip itself because it creates files + # with the original group ownership rather than the + # default one for that user / the work directory + gzip \\ + -cd \\ $args \\ - $archive + $archive \\ + > $gunzip cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -33,7 +40,11 @@ process GUNZIP { """ stub: - gunzip = archive.toString() - '.gz' + def args = task.ext.args ?: '' + def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".$extension" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".$extension" """ touch $gunzip cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/gunzip/meta.yml b/modules/nf-core/gunzip/meta.yml index 4cdcdf4c..f32973a0 100644 --- a/modules/nf-core/gunzip/meta.yml +++ b/modules/nf-core/gunzip/meta.yml @@ -33,3 +33,8 @@ authors: - "@joseespinosa" - "@drpatelh" - "@jfy133" +maintainers: + - "@joseespinosa" + - "@drpatelh" + - "@jfy133" + - "@gallvp" diff --git a/modules/nf-core/gunzip/tests/main.nf.test b/modules/nf-core/gunzip/tests/main.nf.test new file mode 100644 index 00000000..776211ad --- /dev/null +++ b/modules/nf-core/gunzip/tests/main.nf.test @@ -0,0 +1,121 @@ +nextflow_process { + + name "Test Process GUNZIP" + script "../main.nf" + process "GUNZIP" + tag "gunzip" + tag "modules_nfcore" + tag "modules" + + test("Should run without failures") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [], + 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).match() } + ) + } + + } + + test("Should run without failures - prefix") { + + config './nextflow.config' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id: 'test' ], + 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).match() } + ) + } + + } + + test("Should run without failures - stub") { + + options '-stub' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [], + 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).match() } + ) + } + + } + + test("Should run without failures - prefix - stub") { + + options '-stub' + config './nextflow.config' + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = Channel.of([ + [ id: 'test' ], + 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).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gunzip/tests/main.nf.test.snap b/modules/nf-core/gunzip/tests/main.nf.test.snap new file mode 100644 index 00000000..069967e7 --- /dev/null +++ b/modules/nf-core/gunzip/tests/main.nf.test.snap @@ -0,0 +1,134 @@ +{ + "Should run without failures - prefix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:35:10.861293" + }, + "Should run without failures - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + "test_1.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + [ + + ], + "test_1.fastq:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:35:05.857145" + }, + "Should run without failures": { + "content": [ + { + "0": [ + [ + [ + + ], + "test_1.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + [ + + ], + "test_1.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-10-17T15:35:37.690477896" + }, + "Should run without failures - prefix": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ], + "gunzip": [ + [ + { + "id": "test" + }, + "test.xyz.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions": [ + "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-25T11:33:32.921739" + } +} \ No newline at end of file diff --git a/modules/nf-core/gunzip/tests/nextflow.config b/modules/nf-core/gunzip/tests/nextflow.config new file mode 100644 index 00000000..dec77642 --- /dev/null +++ b/modules/nf-core/gunzip/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GUNZIP { + ext.prefix = { "${meta.id}.xyz" } + } +} diff --git a/modules/nf-core/gunzip/tests/tags.yml b/modules/nf-core/gunzip/tests/tags.yml new file mode 100644 index 00000000..fd3f6915 --- /dev/null +++ b/modules/nf-core/gunzip/tests/tags.yml @@ -0,0 +1,2 @@ +gunzip: + - modules/nf-core/gunzip/** diff --git a/modules/nf-core/homer/annotatepeaks/environment.yml b/modules/nf-core/homer/annotatepeaks/environment.yml new file mode 100644 index 00000000..aef00e18 --- /dev/null +++ b/modules/nf-core/homer/annotatepeaks/environment.yml @@ -0,0 +1,7 @@ +name: homer_annotatepeaks +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::homer=4.11 diff --git a/modules/nf-core/homer/annotatepeaks/main.nf b/modules/nf-core/homer/annotatepeaks/main.nf index cfc140f5..32478df4 100644 --- a/modules/nf-core/homer/annotatepeaks/main.nf +++ b/modules/nf-core/homer/annotatepeaks/main.nf @@ -3,7 +3,7 @@ process HOMER_ANNOTATEPEAKS { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - conda "bioconda::homer=4.11" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : 'biocontainers/homer:4.11--pl526hc9558a2_3' }" @@ -15,6 +15,7 @@ process HOMER_ANNOTATEPEAKS { output: tuple val(meta), path("*annotatePeaks.txt"), emit: txt + tuple val(meta), path("*annStats.txt"), emit: stats, optional: true path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/homer/annotatepeaks/meta.yml b/modules/nf-core/homer/annotatepeaks/meta.yml index b815e975..0d76caba 100644 --- a/modules/nf-core/homer/annotatepeaks/meta.yml +++ b/modules/nf-core/homer/annotatepeaks/meta.yml @@ -39,6 +39,10 @@ output: type: file description: The annotated peaks pattern: "*annotatePeaks.txt" + - annotation_stats: + type: file + description: the annStats file output from -annStats parameter + pattern: "*annStats.txt" - versions: type: file description: File containing software versions @@ -46,3 +50,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/khmer/uniquekmers/environment.yml b/modules/nf-core/khmer/uniquekmers/environment.yml new file mode 100644 index 00000000..9b7b7546 --- /dev/null +++ b/modules/nf-core/khmer/uniquekmers/environment.yml @@ -0,0 +1,7 @@ +name: khmer_uniquekmers +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::khmer=3.0.0a3 diff --git a/modules/nf-core/khmer/uniquekmers/main.nf b/modules/nf-core/khmer/uniquekmers/main.nf index 9576034f..ebb2064d 100644 --- a/modules/nf-core/khmer/uniquekmers/main.nf +++ b/modules/nf-core/khmer/uniquekmers/main.nf @@ -2,7 +2,7 @@ process KHMER_UNIQUEKMERS { tag "$fasta" label 'process_low' - conda "bioconda::khmer=3.0.0a3" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/khmer:3.0.0a3--py37haa7609a_2' : 'biocontainers/khmer:3.0.0a3--py37haa7609a_2' }" diff --git a/modules/nf-core/khmer/uniquekmers/meta.yml b/modules/nf-core/khmer/uniquekmers/meta.yml index f9f63972..bae4e644 100644 --- a/modules/nf-core/khmer/uniquekmers/meta.yml +++ b/modules/nf-core/khmer/uniquekmers/meta.yml @@ -4,7 +4,6 @@ keywords: - khmer - k-mer - effective genome size - tools: - "khmer": description: khmer k-mer counting library @@ -13,7 +12,6 @@ tools: tool_dev_url: https://github.com/dib-lab/khmer doi: "10.12688/f1000research.6924.1" licence: ["BSD License"] - input: - fasta: type: file @@ -23,7 +21,6 @@ input: type: value description: k-mer size to use pattern: "[0-9]+" - output: - report: type: file @@ -37,6 +34,7 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@JoseEspinosa" +maintainers: + - "@JoseEspinosa" diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index ca39fb67..2121492d 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::multiqc=1.21 + - bioconda::multiqc=1.23 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 47ac352f..459dfea5 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,14 +3,16 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.21--pyhdfd78af_0' : - 'biocontainers/multiqc:1.21--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.23--pyhdfd78af_0' : + 'biocontainers/multiqc:1.23--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" path(multiqc_config) path(extra_multiqc_config) path(multiqc_logo) + path(replace_names) + path(sample_names) output: path "*multiqc_report.html", emit: report @@ -26,6 +28,8 @@ process MULTIQC { def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_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 \\ @@ -33,6 +37,8 @@ process MULTIQC { $config \\ $extra_config \\ $logo \\ + $replace \\ + $samples \\ . cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index 45a9bc35..382c08cb 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -29,6 +29,19 @@ input: type: file description: Optional logo file for MultiQC pattern: "*.{png}" + - 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}" + - sample_names: + type: file + description: | + Optional TSV file with headers, passed to the MultiQC --sample_names + argument. + pattern: "*.{tsv}" output: - report: type: file diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test index f1c4242e..6aa27f4c 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test +++ b/modules/nf-core/multiqc/tests/main.nf.test @@ -17,6 +17,8 @@ nextflow_process { input[1] = [] input[2] = [] input[3] = [] + input[4] = [] + input[5] = [] """ } } @@ -41,6 +43,8 @@ nextflow_process { 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] = [] """ } } @@ -66,6 +70,8 @@ nextflow_process { input[1] = [] input[2] = [] input[3] = [] + input[4] = [] + input[5] = [] """ } } diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap index bfebd802..45e95e5d 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test.snap +++ b/modules/nf-core/multiqc/tests/main.nf.test.snap @@ -2,14 +2,14 @@ "multiqc_versions_single": { "content": [ [ - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,87904cd321df21fac35d18f0fc01bb19" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:48:55.657331" + "timestamp": "2024-07-10T12:41:34.562023" }, "multiqc_stub": { "content": [ @@ -17,25 +17,25 @@ "multiqc_report.html", "multiqc_data", "multiqc_plots", - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,87904cd321df21fac35d18f0fc01bb19" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:49:49.071937" + "timestamp": "2024-07-10T11:27:11.933869532" }, "multiqc_versions_config": { "content": [ [ - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,87904cd321df21fac35d18f0fc01bb19" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:49:25.457567" + "timestamp": "2024-07-10T11:26:56.709849369" } } \ No newline at end of file diff --git a/modules/nf-core/picard/collectmultiplemetrics/environment.yml b/modules/nf-core/picard/collectmultiplemetrics/environment.yml new file mode 100644 index 00000000..6a16f00d --- /dev/null +++ b/modules/nf-core/picard/collectmultiplemetrics/environment.yml @@ -0,0 +1,7 @@ +name: picard_collectmultiplemetrics +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::picard=3.2.0 diff --git a/modules/nf-core/picard/collectmultiplemetrics/main.nf b/modules/nf-core/picard/collectmultiplemetrics/main.nf index 91fe9170..c5555871 100644 --- a/modules/nf-core/picard/collectmultiplemetrics/main.nf +++ b/modules/nf-core/picard/collectmultiplemetrics/main.nf @@ -2,10 +2,10 @@ process PICARD_COLLECTMULTIPLEMETRICS { tag "$meta.id" label 'process_single' - conda "bioconda::picard=3.0.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : - 'biocontainers/picard:3.0.0--hdfd78af_1' }" + 'https://depot.galaxyproject.org/singularity/picard:3.2.0--hdfd78af_0' : + 'biocontainers/picard:3.2.0--hdfd78af_0' }" input: tuple val(meta) , path(bam), path(bai) @@ -14,7 +14,7 @@ process PICARD_COLLECTMULTIPLEMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics - tuple val(meta), path("*.pdf") , emit: pdf + tuple val(meta), path("*.pdf") , emit: pdf, optional: true path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/picard/collectmultiplemetrics/meta.yml b/modules/nf-core/picard/collectmultiplemetrics/meta.yml index 22656080..67bba57b 100644 --- a/modules/nf-core/picard/collectmultiplemetrics/meta.yml +++ b/modules/nf-core/picard/collectmultiplemetrics/meta.yml @@ -66,3 +66,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/picard/markduplicates/environment.yml b/modules/nf-core/picard/markduplicates/environment.yml index 58b795f5..a27db118 100644 --- a/modules/nf-core/picard/markduplicates/environment.yml +++ b/modules/nf-core/picard/markduplicates/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::picard=3.1.1 + - bioconda::picard=3.2.0 diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index 80930cc4..cf18ac35 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -4,17 +4,18 @@ process PICARD_MARKDUPLICATES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:3.1.1--hdfd78af_0' : - 'biocontainers/picard:3.1.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:3.2.0--hdfd78af_0' : + 'biocontainers/picard:3.2.0--hdfd78af_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(reads) tuple val(meta2), path(fasta) tuple val(meta3), path(fai) output: - tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*.bai") , optional:true, emit: bai + tuple val(meta), path("*.bam") , emit: bam, optional: true + tuple val(meta), path("*.bai") , emit: bai, optional: true + tuple val(meta), path("*.cram"), emit: cram, optional: true tuple val(meta), path("*.metrics.txt"), emit: metrics path "versions.yml" , emit: versions @@ -24,6 +25,8 @@ process PICARD_MARKDUPLICATES { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "${reads.getExtension()}" + def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" def avail_mem = 3072 if (!task.memory) { log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -31,16 +34,16 @@ process PICARD_MARKDUPLICATES { avail_mem = (task.memory.mega*0.8).intValue() } - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ picard \\ -Xmx${avail_mem}M \\ MarkDuplicates \\ $args \\ - --INPUT $bam \\ - --OUTPUT ${prefix}.bam \\ - --REFERENCE_SEQUENCE $fasta \\ + --INPUT $reads \\ + --OUTPUT ${prefix}.${suffix} \\ + $reference \\ --METRICS_FILE ${prefix}.MarkDuplicates.metrics.txt cat <<-END_VERSIONS > versions.yml @@ -51,10 +54,10 @@ process PICARD_MARKDUPLICATES { stub: def prefix = task.ext.prefix ?: "${meta.id}" - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + def suffix = task.ext.suffix ?: "${reads.getExtension()}" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ - touch ${prefix}.bam - touch ${prefix}.bam.bai + touch ${prefix}.${suffix} touch ${prefix}.MarkDuplicates.metrics.txt cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index 1ab90c07..1f0ffe16 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -21,9 +21,9 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - reads: type: file - description: BAM file + description: Sequence reads file, can be SAM/BAM/CRAM format pattern: "*.{bam,cram,sam}" - meta2: type: map @@ -32,7 +32,7 @@ input: e.g. [ id:'genome' ] - fasta: type: file - description: Reference genome fasta file + description: Reference genome fasta file, required for CRAM input pattern: "*.{fasta,fa}" - meta3: type: map @@ -57,6 +57,10 @@ output: type: file description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag pattern: "*.{bai}" + - cram: + type: file + description: Output CRAM file + pattern: "*.{cram}" - metrics: type: file description: Duplicate metrics file generated by picard diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test b/modules/nf-core/picard/markduplicates/tests/main.nf.test index c5a29b4b..9ed90965 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test @@ -18,14 +18,8 @@ nextflow_process { [ 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:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - input[2] = Channel.of([ - [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) - ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] """ } } @@ -33,9 +27,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("unsorted_bam_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("unsorted_bam_metrics") }, - { assert snapshot(process.out.versions).match("unsorted_bam_versions") } + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } ) } } @@ -49,13 +45,40 @@ nextflow_process { [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } + ) + } + } + + test("homo_sapiens [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) + ]) input[1] = Channel.of([ [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = Channel.of([ [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ]) """ } @@ -64,15 +87,63 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("sorted_bam_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("sorted_bam_metrics") }, - { assert snapshot(process.out.versions).match("sorted_bam_versions") } + { assert snapshot( + file(process.out.cram[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } ) } } - test("homo_sapiens [cram]") { + test("sarscov2 [unsorted bam] - 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.bam', checkIfExists: true) + ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [sorted bam] - 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) + ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + test("homo_sapiens [cram] - stub") { + options "-stub" when { process { """ @@ -95,9 +166,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("cram_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("cram_metrics") }, - { assert snapshot(process.out.versions).match("cram_versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap index 31c9130d..8b37e65b 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap @@ -1,74 +1,251 @@ { - "sorted_bam_versions": { + "sarscov2 [sorted bam] - stub": { "content": [ - [ - "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ], + "bai": [ + + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ] + } ], - "timestamp": "2024-01-19T10:26:45.092349" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:56:32.025869" }, - "unsorted_bam_name": { + "sarscov2 [unsorted bam] - stub": { "content": [ - "test.marked.bam" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ], + "bai": [ + + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ] + } ], - "timestamp": "2024-01-19T10:26:28.100755" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:56:20.497105" }, - "cram_metrics": { + "sarscov2 [unsorted bam]": { "content": [ + "test.marked.bam", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" ] ], - "timestamp": "2024-01-19T10:27:03.253071" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:50:14.881666" }, - "sorted_bam_metrics": { + "sarscov2 [sorted bam]": { "content": [ + "test.marked.bam", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" - ] - ], - "timestamp": "2024-01-19T10:26:45.086503" - }, - "cram_name": { - "content": [ - "test.marked.bam" - ], - "timestamp": "2024-01-19T10:27:03.241617" - }, - "cram_versions": { - "content": [ - [ - "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" - ] - ], - "timestamp": "2024-01-19T10:27:03.26989" - }, - "unsorted_bam_versions": { - "content": [ + ], [ - "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" ] ], - "timestamp": "2024-01-19T10:26:28.159071" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:52:03.11428" }, - "unsorted_bam_metrics": { + "homo_sapiens [cram]": { "content": [ + "test.marked.cram", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.cram --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" ] ], - "timestamp": "2024-01-19T10:26:28.143979" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:53:05.403139" }, - "sorted_bam_name": { + "homo_sapiens [cram] - stub": { "content": [ - "test.marked.bam" + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ], + "bai": [ + + ], + "bam": [ + + ], + "cram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + ] + } ], - "timestamp": "2024-01-19T10:26:45.080116" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:56:43.438188" } } \ No newline at end of file diff --git a/modules/nf-core/picard/mergesamfiles/environment.yml b/modules/nf-core/picard/mergesamfiles/environment.yml new file mode 100644 index 00000000..af6a04a1 --- /dev/null +++ b/modules/nf-core/picard/mergesamfiles/environment.yml @@ -0,0 +1,7 @@ +name: picard_mergesamfiles +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::picard=3.2.0 diff --git a/modules/nf-core/picard/mergesamfiles/main.nf b/modules/nf-core/picard/mergesamfiles/main.nf index fc23ea01..1e6e2274 100644 --- a/modules/nf-core/picard/mergesamfiles/main.nf +++ b/modules/nf-core/picard/mergesamfiles/main.nf @@ -2,10 +2,10 @@ process PICARD_MERGESAMFILES { tag "$meta.id" label 'process_medium' - conda "bioconda::picard=3.0.0" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : - 'biocontainers/picard:3.0.0--hdfd78af_1' }" + 'https://depot.galaxyproject.org/singularity/picard:3.2.0--hdfd78af_0' : + 'biocontainers/picard:3.2.0--hdfd78af_0' }" input: tuple val(meta), path(bams) diff --git a/modules/nf-core/picard/mergesamfiles/meta.yml b/modules/nf-core/picard/mergesamfiles/meta.yml index 5f07ecd0..c1ca98cf 100644 --- a/modules/nf-core/picard/mergesamfiles/meta.yml +++ b/modules/nf-core/picard/mergesamfiles/meta.yml @@ -39,3 +39,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/preseq/lcextrap/environment.yml b/modules/nf-core/preseq/lcextrap/environment.yml new file mode 100644 index 00000000..57b8b9c6 --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/environment.yml @@ -0,0 +1,7 @@ +name: preseq_lcextrap +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::preseq=3.1.2 diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index 12546f0a..3fec468e 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -1,9 +1,9 @@ process PRESEQ_LCEXTRAP { tag "$meta.id" label 'process_single' - label 'error_ignore' + label 'error_retry' - conda "bioconda::preseq=3.1.2" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h445547b_2': 'biocontainers/preseq:3.1.2--h445547b_2' }" @@ -21,6 +21,7 @@ process PRESEQ_LCEXTRAP { script: def args = task.ext.args ?: '' + args = task.attempt > 1 ? args.join(' -defects') : args // Disable testing for defects def prefix = task.ext.prefix ?: "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' """ @@ -37,4 +38,16 @@ process PRESEQ_LCEXTRAP { preseq: \$(echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.lc_extrap.txt + touch ${prefix}.command.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + preseq: \$(echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/preseq/lcextrap/meta.yml b/modules/nf-core/preseq/lcextrap/meta.yml old mode 100755 new mode 100644 index 1391961c..c00fa8ee --- a/modules/nf-core/preseq/lcextrap/meta.yml +++ b/modules/nf-core/preseq/lcextrap/meta.yml @@ -10,9 +10,7 @@ tools: homepage: http://smithlabresearch.org/software/preseq/ documentation: http://smithlabresearch.org/wp-content/uploads/manual.pdf tool_dev_url: https://github.com/smithlabcode/preseq - licence: ["GPL"] - input: - meta: type: map @@ -23,7 +21,6 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - output: - meta: type: map @@ -42,7 +39,9 @@ output: type: file description: Log file containing stderr produced by Preseq pattern: "*.{log}" - authors: - "@drpatelh" - - "@Emiller88" + - "@edmundmiller" +maintainers: + - "@drpatelh" + - "@edmundmiller" diff --git a/modules/nf-core/preseq/lcextrap/tests/main.nf.test b/modules/nf-core/preseq/lcextrap/tests/main.nf.test new file mode 100644 index 00000000..d1af1f0e --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/main.nf.test @@ -0,0 +1,100 @@ +nextflow_process { + + name "Test Process PRESEQ_LCEXTRAP" + script "../main.nf" + process "PRESEQ_LCEXTRAP" + tag "modules" + tag "modules_nfcore" + tag "preseq" + tag "preseq/lcextrap" + + test("sarscov2 - single_end") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'delete_me/preseq/SRR1003759_5M_subset.mr', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log[0][1]).name).match("single_end - log") }, + { assert snapshot(process.out.lc_extrap).match("single_end - lc_extrap") }, + { assert snapshot(process.out.versions).match("single_end - versions") } + ) + } + } + + test("sarscov2 - single_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'delete_me/preseq/SRR1003759_5M_subset.mr', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 - paired_end") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'delete_me/preseq/SRR1003759_5M_subset.mr', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.log[0][1]).name).match("paired_end - log") }, + { assert snapshot(process.out.lc_extrap).match("paired_end - lc_extrap") }, + { assert snapshot(process.out.versions).match("paired_end - versions") } + ) + } + } + + test("sarscov2 - paired_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'delete_me/preseq/SRR1003759_5M_subset.mr', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap b/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap new file mode 100644 index 00000000..3f95cd49 --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/main.nf.test.snap @@ -0,0 +1,188 @@ +{ + "single_end - lc_extrap": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.lc_extrap.txt:md5,1fa5cdd601079329618f61660bee00de" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:40.735535" + }, + "paired_end - log": { + "content": [ + "test.command.log" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:51.981746" + }, + "single_end - versions": { + "content": [ + [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:40.74601" + }, + "sarscov2 - single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.lc_extrap.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.command.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ], + "lc_extrap": [ + [ + { + "id": "test", + "single_end": true + }, + "test.lc_extrap.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.command.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-20T18:43:12.689062" + }, + "paired_end - versions": { + "content": [ + [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:52.02843" + }, + "single_end - log": { + "content": [ + "test.command.log" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:40.72985" + }, + "paired_end - lc_extrap": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.lc_extrap.txt:md5,10e5ea860e87fb6f5dc10f4f20c62040" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T17:20:51.998533" + }, + "sarscov2 - paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.lc_extrap.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.command.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ], + "lc_extrap": [ + [ + { + "id": "test", + "single_end": false + }, + "test.lc_extrap.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.command.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,9a62ff1c212c53573808ccd2137b8922" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-20T18:43:32.569811" + } +} \ No newline at end of file diff --git a/modules/nf-core/preseq/lcextrap/tests/tags.yml b/modules/nf-core/preseq/lcextrap/tests/tags.yml new file mode 100644 index 00000000..b9e25ea7 --- /dev/null +++ b/modules/nf-core/preseq/lcextrap/tests/tags.yml @@ -0,0 +1,2 @@ +preseq/lcextrap: + - modules/nf-core/preseq/lcextrap/** diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml index dd0b5c19..68b81558 100644 --- a/modules/nf-core/samtools/flagstat/environment.yml +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.18 - - bioconda::htslib=1.18 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index f1893d7c..754d84b7 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FLAGSTAT { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test index c8dd8dc9..3b648a37 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -11,16 +11,37 @@ 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] = [ + input[0] = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) - ] + 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) + ]) """ } } @@ -28,8 +49,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.flagstat).match() }, - { assert path(process.out.versions.get(0)).getText().contains("samtools") } + { 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 880019f2..23989c61 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -1,16 +1,72 @@ { + "BAM - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,f606681ef971cbb548a4d9e3fbabdbc2" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f606681ef971cbb548a4d9e3fbabdbc2" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:17:28.002887" + }, "BAM": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "1": [ + "versions.yml:md5,f606681ef971cbb548a4d9e3fbabdbc2" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "versions": [ + "versions.yml:md5,f606681ef971cbb548a4d9e3fbabdbc2" ] - ] + } ], - "timestamp": "2023-11-14T15:49:22.577133" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:17:13.330971" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/idxstats/environment.yml b/modules/nf-core/samtools/idxstats/environment.yml index de3ed47e..eb6c8809 100644 --- a/modules/nf-core/samtools/idxstats/environment.yml +++ b/modules/nf-core/samtools/idxstats/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.18 - - bioconda::htslib=1.18 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/idxstats/main.nf b/modules/nf-core/samtools/idxstats/main.nf index 00d916bb..2ea2a5cc 100644 --- a/modules/nf-core/samtools/idxstats/main.nf +++ b/modules/nf-core/samtools/idxstats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_IDXSTATS { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test b/modules/nf-core/samtools/idxstats/tests/main.nf.test index f6c92150..5fd1fc78 100644 --- a/modules/nf-core/samtools/idxstats/tests/main.nf.test +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test @@ -8,19 +8,16 @@ nextflow_process { tag "samtools" tag "samtools/idxstats" - test("BAM") { + test("bam") { when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) - ] + 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) + ]) """ } } @@ -28,9 +25,29 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.idxstats).match() }, - { assert path(process.out.versions.get(0)).getText().contains("samtools") } + { assert snapshot(process.out).match() } ) } } -} + + test("bam - 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), + 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() } + ) + } + }} diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap index 4c6c12bd..a5ac8104 100644 --- a/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap @@ -1,16 +1,72 @@ { - "BAM": { + "bam - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,7acbcb2a8ec6436ba7b2916d3ff13351" + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7acbcb2a8ec6436ba7b2916d3ff13351" ] - ] + } ], - "timestamp": "2023-11-14T15:52:19.875194" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:17:56.180093" + }, + "bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ], + "1": [ + "versions.yml:md5,7acbcb2a8ec6436ba7b2916d3ff13351" + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ], + "versions": [ + "versions.yml:md5,7acbcb2a8ec6436ba7b2916d3ff13351" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:17:41.408704" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index 81f09391..260d516b 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.18 - - bioconda::htslib=1.18 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index 8ad18fdc..e002585b 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.18--h50ea8bc_1' : - 'biocontainers/samtools:1.18--h50ea8bc_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(input) @@ -35,10 +35,11 @@ process SAMTOOLS_INDEX { """ 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 + touch ${input}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test index c76a9169..ca34fb5c 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -8,18 +8,34 @@ nextflow_process { tag "samtools" tag "samtools/index" - test("sarscov2 [BAI]") { - + test("bai") { 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(process.out).match() } + ) + } + } + + test("crai") { + when { process { """ - input[0] = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - ] + 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) + ]) """ } } @@ -27,24 +43,45 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.bai).match("bai") }, - { assert path(process.out.versions.get(0)).getText().contains("samtools") } + { assert snapshot(process.out).match() } ) } } - test("homo_sapiens [CRAI]") { + 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.versions + ).match() } + ) + } + } + + test("bai - stub") { + options "-stub" + when { process { """ - input[0] = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) - ] + 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) + ]) """ } } @@ -52,26 +89,43 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.crai).match("crai") }, - { assert path(process.out.versions.get(0)).getText().contains("samtools") } + { assert snapshot(process.out).match() } ) } } - test("homo_sapiens [CSI]") { + 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).match() } + ) + } + } + test("csi - stub") { + options "-stub" config "./csi.nextflow.config" when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - ] + 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) + ]) """ } } @@ -79,8 +133,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert path(process.out.csi.get(0).get(1)).exists() }, - { assert path(process.out.versions.get(0)).getText().contains("samtools") } + { assert snapshot(process.out).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 b3baee7f..799d199c 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -1,28 +1,250 @@ { - "crai": { + "csi - stub": { "content": [ - [ - [ - { - "id": "test" - }, - "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:53.9057" + }, + "crai - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:45.931558" + }, + "bai - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:34.807525" + }, + "csi": { + "content": [ + "test.paired_end.sorted.bam.csi", + [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] ], - "timestamp": "2023-11-15T15:17:37.30801" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:52:55.688799" + }, + "crai": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:17.609533" }, "bai": { "content": [ - [ - [ - { - "id": "test" - }, - "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] - ] + } ], - "timestamp": "2023-11-15T15:17:30.869234" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:04.16585" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml index f4064b72..36a12eab 100644 --- a/modules/nf-core/samtools/sort/environment.yml +++ b/modules/nf-core/samtools/sort/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.18 - - bioconda::htslib=1.18 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 4a666d42..8e019099 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -4,15 +4,18 @@ process SAMTOOLS_SORT { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: - tuple val(meta), path(bam) + tuple val(meta) , path(bam) + tuple val(meta2), path(fasta) output: - tuple val(meta), path("*.bam"), emit: bam - tuple val(meta), path("*.csi"), emit: csi, optional: true + 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 when: @@ -21,14 +24,24 @@ process SAMTOOLS_SORT { 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" + def reference = fasta ? "--reference ${fasta}" : "" 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 \\ $args \\ - -@ $task.cpus \\ - -o ${prefix}.bam \\ - -T $prefix \\ - $bam + -T ${prefix} \\ + --threads $task.cpus \\ + ${reference} \\ + -o ${prefix}.${extension} \\ + - cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -37,9 +50,20 @@ process SAMTOOLS_SORT { """ stub: + 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" """ - touch ${prefix}.bam + touch ${prefix}.${extension} + if [ "${extension}" == "bam" ]; + then + touch ${prefix}.${extension}.csi + elif [ "${extension}" == "cram" ]; + then + touch ${prefix}.${extension}.crai + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml index 2200de72..341a7d0e 100644 --- a/modules/nf-core/samtools/sort/meta.yml +++ b/modules/nf-core/samtools/sort/meta.yml @@ -23,8 +23,18 @@ input: e.g. [ id:'test', single_end:false ] - bam: type: file - description: BAM/CRAM/SAM 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 output: - meta: type: map @@ -33,19 +43,29 @@ output: e.g. [ id:'test', single_end:false ] - bam: type: file - description: Sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - versions: + description: Sorted BAM file + pattern: "*.{bam}" + - cram: type: file - description: File containing software versions - pattern: "versions.yml" + 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" authors: - "@drpatelh" - "@ewels" + - "@matthdsm" maintainers: - "@drpatelh" - "@ewels" + - "@matthdsm" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test index abb80978..c2ea9c72 100644 --- a/modules/nf-core/samtools/sort/tests/main.nf.test +++ b/modules/nf-core/samtools/sort/tests/main.nf.test @@ -8,22 +8,21 @@ nextflow_process { tag "samtools" tag "samtools/sort" - test("test_samtools_sort") { + test("bam") { config "./nextflow.config" when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ - [ id:'test', single_end:false ], - [ - file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) - ] - ] + 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) + ]) """ } } @@ -31,29 +30,30 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.bam, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match()} ) } - } - test("test_samtools_sort_stub") { + test("cram") { - config "./nextflow.config" - options "-stub-run" + config "./nextflow_cram.config" when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ - [ id:'test', single_end:false ], - [ - file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) - ] - ] + 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) + ]) """ } } @@ -62,12 +62,67 @@ nextflow_process { assertAll ( { assert process.success }, { assert snapshot( - file(process.out.bam[0][1]).name, + 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.versions - ).match() } + ).match()} ) } + } + + test("bam - stub") { + + options "-stub" + 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) + ]) + """ + } + } + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).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) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).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 ff722259..da38d5d1 100644 --- a/modules/nf-core/samtools/sort/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/sort/tests/main.nf.test.snap @@ -1,5 +1,35 @@ { - "test_samtools_sort": { + "cram": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram.crai" + ] + ], + [ + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:19:37.196205" + }, + "bam - stub": { "content": [ { "0": [ @@ -8,41 +38,155 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + "test.sorted.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ ], "2": [ - "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T15:54:46.580756" + }, + "cram - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" ], "bam": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ [ { "id": "test", "single_end": false }, - "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + "test.sorted.cram:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "csi": [ ], "versions": [ - "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" ] } ], - "timestamp": "2023-12-04T11:11:22.005628301" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T15:57:30.505698" }, - "test_samtools_sort_stub": { + "bam": { "content": [ - "test.sorted.bam", [ - "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,21c992d59615936b99f2ad008aa54400" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.csi" + ] + ], + [ + "versions.yml:md5,7a360de20e1d7a6f15a5e8fbe0a9c062" ] ], - "timestamp": "2023-12-04T17:47:22.314445935" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T15:54:25.872954" } } \ 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 d0f35086..f642771f 100644 --- a/modules/nf-core/samtools/sort/tests/nextflow.config +++ b/modules/nf-core/samtools/sort/tests/nextflow.config @@ -1,7 +1,8 @@ process { withName: SAMTOOLS_SORT { - ext.prefix = { "${meta.id}.sorted" } + 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/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml index b45ba90c..1cc83bd9 100644 --- a/modules/nf-core/samtools/stats/environment.yml +++ b/modules/nf-core/samtools/stats/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.18 - - bioconda::htslib=1.18 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 7539140a..982bc28e 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_STATS { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test b/modules/nf-core/samtools/stats/tests/main.nf.test index 20c3efe1..28a77db2 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test +++ b/modules/nf-core/samtools/stats/tests/main.nf.test @@ -8,71 +8,105 @@ nextflow_process { tag "samtools" tag "samtools/stats" - test("SAMTOOLS STATS Should run without failures") { + test("bam") { when { - params { - - outdir = "$outputDir" - } process { """ - // define inputs of the process here. - 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']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) - - ] + 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) + ]) input[1] = [[],[]] """ - } } then { assertAll( - {assert process.success}, - {assert snapshot(process.out).match()} + {assert process.success}, + {assert snapshot(process.out).match()} ) } - } - test("SAMTOOLS CRAM Should run without failures") { + test("cram") { when { - params { - - outdir = "$outputDir" - } process { """ - // define inputs of the process here - input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) - - ] - input[1] = [ - [ id:'genome' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] + 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.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) + ]) """ } - - } then { assertAll( - {assert process.success}, - {assert snapshot(process.out).match()} + {assert process.success}, + {assert snapshot(process.out).match()} ) } + } + + test("bam - 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } } + test("cram - 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.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) + ]) + """ + } + } + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + } } diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test.snap b/modules/nf-core/samtools/stats/tests/main.nf.test.snap index 025c83a5..3828f378 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "SAMTOOLS STATS Should run without failures": { + "cram": { "content": [ { "0": [ @@ -8,11 +8,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + "test.stats:md5,c9d39b38c22de2057fc2f89949090975" ] ], "1": [ - "versions.yml:md5,650a365c6635001436008350ae83337c" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ], "stats": [ [ @@ -20,17 +20,21 @@ "id": "test", "single_end": false }, - "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + "test.stats:md5,c9d39b38c22de2057fc2f89949090975" ] ], "versions": [ - "versions.yml:md5,650a365c6635001436008350ae83337c" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ] } ], - "timestamp": "2023-12-04T11:07:28.26821485" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:20:24.885816" }, - "SAMTOOLS CRAM Should run without failures": { + "bam - stub": { "content": [ { "0": [ @@ -39,11 +43,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ - "versions.yml:md5,650a365c6635001436008350ae83337c" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ], "stats": [ [ @@ -51,14 +55,88 @@ "id": "test", "single_end": false }, - "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ - "versions.yml:md5,650a365c6635001436008350ae83337c" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ] } ], - "timestamp": "2023-12-04T11:07:50.356233402" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:20:39.310713" + }, + "cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:21:04.771199" + }, + "bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d522a1fa016b259d6a55620ae53dcd63" + ] + ], + "1": [ + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d522a1fa016b259d6a55620ae53dcd63" + ] + ], + "versions": [ + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T14:19:06.645466" } } \ No newline at end of file diff --git a/modules/nf-core/subread/featurecounts/environment.yml b/modules/nf-core/subread/featurecounts/environment.yml new file mode 100644 index 00000000..ca19439d --- /dev/null +++ b/modules/nf-core/subread/featurecounts/environment.yml @@ -0,0 +1,7 @@ +name: subread_featurecounts +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::subread=2.0.1 diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index a524b92f..471bd16f 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -2,7 +2,7 @@ process SUBREAD_FEATURECOUNTS { tag "$meta.id" label 'process_medium' - conda "bioconda::subread=2.0.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0' : 'biocontainers/subread:2.0.1--hed695b0_0' }" @@ -44,4 +44,16 @@ process SUBREAD_FEATURECOUNTS { subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.featureCounts.txt + touch ${prefix}.featureCounts.txt.summary + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") + END_VERSIONS + """ } diff --git a/modules/nf-core/subread/featurecounts/meta.yml b/modules/nf-core/subread/featurecounts/meta.yml index cf02f1ea..38a37945 100644 --- a/modules/nf-core/subread/featurecounts/meta.yml +++ b/modules/nf-core/subread/featurecounts/meta.yml @@ -5,7 +5,6 @@ keywords: - fasta - genome - reference - tools: - featurecounts: description: featureCounts is a highly efficient general-purpose read summarization program that counts mapped reads for genomic features such as genes, exons, promoter, gene bodies, genomic bins and chromosomal locations. It can be used to count both RNA-seq and genomic DNA-seq reads. @@ -13,7 +12,6 @@ tools: documentation: http://bioinf.wehi.edu.au/subread-package/SubreadUsersGuide.pdf doi: "10.1093/bioinformatics/btt656" licence: ["GPL v3"] - input: - meta: type: map @@ -28,7 +26,6 @@ input: type: file description: Genomic features annotation in GTF or SAF pattern: "*.{gtf,saf}" - output: - meta: type: map @@ -47,6 +44,7 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@ntoda03" +maintainers: + - "@ntoda03" diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test b/modules/nf-core/subread/featurecounts/tests/main.nf.test new file mode 100644 index 00000000..3b95da33 --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test @@ -0,0 +1,155 @@ +nextflow_process { + + name "Test Process SUBREAD_FEATURECOUNTS" + script "../main.nf" + process "SUBREAD_FEATURECOUNTS" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "subread" + tag "subread/featurecounts" + + test("sarscov2 [bam] - forward") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'forward' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("forward_counts") }, + { assert snapshot(process.out.summary).match("forward_summary") }, + { assert snapshot(process.out.versions).match("forward_versions") } + ) + } + } + + test("sarscov2 [bam] - forward - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'forward' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [bam] - reverse") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'reverse' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("reverse_counts") }, + { assert snapshot(process.out.summary).match("reverse_summary") }, + { assert snapshot(process.out.versions).match("reverse_versions") } + ) + } + } + + test("sarscov2 [bam] - reverse - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'reverse' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [bam] - unstranded") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("unstranded_counts") }, + { assert snapshot(process.out.summary).match("unstranded_summary") }, + { assert snapshot(process.out.versions).match("unstranded_versions") } + ) + } + } + + test("sarscov2 [bam] - unstranded - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap new file mode 100644 index 00000000..72e8dcdd --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap @@ -0,0 +1,323 @@ +{ + "forward_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt:md5,0012df4c0a0e47eec1440017ab34f75f" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:10.685863663" + }, + "unstranded_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt:md5,3307d31b44a5d6bb3389786bb8f4e91f" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:38.67903701" + }, + "reverse_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt.summary:md5,7cfa30ad678b9bc1bc63afbb0281547b" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:25.168206514" + }, + "sarscov2 [bam] - forward - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:04:22.628032" + }, + "sarscov2 [bam] - reverse - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:04:52.371212" + }, + "reverse_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt:md5,8175816b8260ed444d59232bd7e7120b" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:25.160010804" + }, + "sarscov2 [bam] - unstranded - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:05:25.058902" + }, + "forward_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt.summary:md5,8f602ff9a8ef467af43294e80b367cdf" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:10.699024934" + }, + "forward_versions": { + "content": [ + [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:10.704797013" + }, + "unstranded_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt.summary:md5,23164b79f9f23f11c82820db61a35560" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:38.68776235" + }, + "reverse_versions": { + "content": [ + [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:25.175265594" + }, + "unstranded_versions": { + "content": [ + [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2023-11-23T15:50:38.69390501" + } +} \ No newline at end of file diff --git a/modules/nf-core/subread/featurecounts/tests/nextflow.config b/modules/nf-core/subread/featurecounts/tests/nextflow.config new file mode 100644 index 00000000..d9fd4fd5 --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SUBREAD_FEATURECOUNTS { + ext.args = '-t CDS' + } + +} diff --git a/modules/nf-core/subread/featurecounts/tests/tags.yml b/modules/nf-core/subread/featurecounts/tests/tags.yml new file mode 100644 index 00000000..6d2534bf --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/tags.yml @@ -0,0 +1,2 @@ +subread/featurecounts: + - modules/nf-core/subread/featurecounts/** diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml index 6cd0f51b..0981320c 100644 --- a/modules/nf-core/trimgalore/environment.yml +++ b/modules/nf-core/trimgalore/environment.yml @@ -1,7 +1,10 @@ name: trimgalore + channels: - conda-forge - bioconda - defaults + dependencies: + - bioconda::cutadapt=3.4 - bioconda::trim-galore=0.6.7 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index 24ead871..0e2f3290 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -72,4 +72,25 @@ process TRIMGALORE { END_VERSIONS """ } + + 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} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) + END_VERSIONS + """ } diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test index bc6812cc..2a3dbbb0 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -10,13 +10,10 @@ nextflow_process { test("test_trimgalore_single_end") { when { - params { - outdir = "$outputDir" - } 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) ] ] """ } @@ -41,23 +38,45 @@ nextflow_process { { report1_lines.each { report1_line -> { assert path(process.out.log.get(0).get(1)).getText().contains(report1_line) } } - } + }, + { assert snapshot(process.out.versions).match() } ) } } - test("test_trimgalore_paired_end") { + test("test_trimgalore_single_end - stub") { + + options "-stub" when { - params { - outdir = "$outputDir" + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ 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).match() } + ) + } + } + + test("test_trimgalore_paired_end") { + + when { 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) ] + ] """ } } @@ -98,7 +117,33 @@ nextflow_process { { report2_lines.each { report2_line -> { assert path(process.out.log.get(0).get(1).get(1)).getText().contains(report2_line) } } - } + }, + { assert snapshot(process.out.versions).match() } + ) + } + } + + test("test_trimgalore_paired_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ + 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).match() } ) } } diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap index 84feacca..6cb31c9f 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test.snap +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -1,5 +1,17 @@ { "test_trimgalore_single_end": { + "content": [ + [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T16:33:20.401347" + }, + "test_trimgalore_single_end - stub": { "content": [ { "0": [ @@ -8,7 +20,7 @@ "id": "test", "single_end": true }, - "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -17,7 +29,7 @@ "id": "test", "single_end": true }, - "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -41,7 +53,7 @@ "id": "test", "single_end": true }, - "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "reads": [ @@ -50,7 +62,7 @@ "id": "test", "single_end": true }, - "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "unpaired": [ @@ -64,9 +76,13 @@ ] } ], - "timestamp": "2023-10-17T15:24:57.782141441" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:27:44.964166" }, - "test_trimgalore_paired_end": { + "test_trimgalore_paired_end - stub": { "content": [ { "0": [ @@ -76,8 +92,8 @@ "single_end": false }, [ - "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", - "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] ], @@ -88,8 +104,8 @@ "single_end": false }, [ - "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", - "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] ], @@ -115,8 +131,8 @@ "single_end": false }, [ - "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", - "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] ], @@ -127,8 +143,8 @@ "single_end": false }, [ - "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", - "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] ], @@ -143,6 +159,22 @@ ] } ], - "timestamp": "2023-10-17T15:25:08.513589909" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:28:07.611496" + }, + "test_trimgalore_paired_end": { + "content": [ + [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T16:33:28.960497" } } \ No newline at end of file diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/environment.yml b/modules/nf-core/ucsc/bedgraphtobigwig/environment.yml new file mode 100644 index 00000000..f91e216f --- /dev/null +++ b/modules/nf-core/ucsc/bedgraphtobigwig/environment.yml @@ -0,0 +1,7 @@ +name: ucsc_bedgraphtobigwig +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::ucsc-bedgraphtobigwig=445 diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/main.nf b/modules/nf-core/ucsc/bedgraphtobigwig/main.nf index 054924e7..bff0b00a 100644 --- a/modules/nf-core/ucsc/bedgraphtobigwig/main.nf +++ b/modules/nf-core/ucsc/bedgraphtobigwig/main.nf @@ -3,10 +3,10 @@ process UCSC_BEDGRAPHTOBIGWIG { label 'process_single' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - conda "bioconda::ucsc-bedgraphtobigwig=377" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1' : - 'biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1' }" + 'https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:445--h954228d_0' : + 'biocontainers/ucsc-bedgraphtobigwig:445--h954228d_0' }" input: tuple val(meta), path(bedgraph) @@ -22,7 +22,7 @@ process UCSC_BEDGRAPHTOBIGWIG { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '377' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '445' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ bedGraphToBigWig \\ $bedgraph \\ @@ -34,4 +34,16 @@ process UCSC_BEDGRAPHTOBIGWIG { ucsc: $VERSION END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '445' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.bigWig + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/meta.yml b/modules/nf-core/ucsc/bedgraphtobigwig/meta.yml index ba8915be..a60118ab 100755 --- a/modules/nf-core/ucsc/bedgraphtobigwig/meta.yml +++ b/modules/nf-core/ucsc/bedgraphtobigwig/meta.yml @@ -3,13 +3,15 @@ description: Convert a bedGraph file to bigWig format. keywords: - bedgraph - bigwig + - ucsc + - bedgraphtobigwig + - converter tools: - ucsc: description: Convert a bedGraph file to bigWig format. homepage: http://hgdownload.cse.ucsc.edu/admin/exe/ documentation: https://genome.ucsc.edu/goldenPath/help/bigWig.html licence: ["varies; see http://genome.ucsc.edu/license"] - input: - meta: type: map @@ -24,7 +26,6 @@ input: type: file description: chromosome sizes file pattern: "*.{sizes}" - output: - meta: type: map @@ -39,6 +40,7 @@ output: type: file description: bigWig file pattern: "*.{bigWig}" - authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test b/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test new file mode 100644 index 00000000..94a799ef --- /dev/null +++ b/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test @@ -0,0 +1,53 @@ +nextflow_process { + + name "Test Process UCSC_BEDGRAPHTOBIGWIG" + script "../main.nf" + process "UCSC_BEDGRAPHTOBIGWIG" + tag "modules" + tag "modules_nfcore" + tag "ucsc" + tag "ucsc/bedgraphtobigwig" + + test("Should run without failures") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bedgraph/test.bedgraph", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.sizes", checkIfExists: true)) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bedgraph/test.bedgraph", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.sizes", checkIfExists: true)) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test.snap b/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test.snap new file mode 100644 index 00000000..7b018158 --- /dev/null +++ b/modules/nf-core/ucsc/bedgraphtobigwig/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,93b027527145a243903a3c687c3453b8" + ], + "bigwig": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,93b027527145a243903a3c687c3453b8" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T12:06:05.176746" + }, + "Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,910ecc7f57e3bbd5fac5a8edba4f615d" + ] + ], + "1": [ + "versions.yml:md5,93b027527145a243903a3c687c3453b8" + ], + "bigwig": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,910ecc7f57e3bbd5fac5a8edba4f615d" + ] + ], + "versions": [ + "versions.yml:md5,93b027527145a243903a3c687c3453b8" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T12:05:56.658148" + } +} \ No newline at end of file diff --git a/modules/nf-core/ucsc/bedgraphtobigwig/tests/tags.yml b/modules/nf-core/ucsc/bedgraphtobigwig/tests/tags.yml new file mode 100644 index 00000000..481e8b8b --- /dev/null +++ b/modules/nf-core/ucsc/bedgraphtobigwig/tests/tags.yml @@ -0,0 +1,2 @@ +ucsc/bedgraphtobigwig: + - modules/nf-core/ucsc/bedgraphtobigwig/** diff --git a/modules/nf-core/umitools/extract/environment.yml b/modules/nf-core/umitools/extract/environment.yml index 7d08ac0e..aab452d1 100644 --- a/modules/nf-core/umitools/extract/environment.yml +++ b/modules/nf-core/umitools/extract/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::umi_tools=1.1.4 + - bioconda::umi_tools=1.1.5 diff --git a/modules/nf-core/umitools/extract/main.nf b/modules/nf-core/umitools/extract/main.nf index 4bd79e79..b97900e0 100644 --- a/modules/nf-core/umitools/extract/main.nf +++ b/modules/nf-core/umitools/extract/main.nf @@ -5,8 +5,8 @@ process UMITOOLS_EXTRACT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.4--py38hbff2b2d_1' : - 'biocontainers/umi_tools:1.1.4--py38hbff2b2d_1' }" + 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.5--py39hf95cd2a_0' : + 'biocontainers/umi_tools:1.1.5--py39hf95cd2a_0' }" input: tuple val(meta), path(reads) @@ -53,4 +53,22 @@ process UMITOOLS_EXTRACT { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}.umi_extract.fastq.gz" + } else { + output_command = "echo '' | gzip > ${prefix}.umi_extract_1.fastq.gz ;" + output_command += "echo '' | gzip > ${prefix}.umi_extract_2.fastq.gz" + } + """ + touch ${prefix}.umi_extract.log + ${output_command} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test b/modules/nf-core/umitools/extract/tests/main.nf.test index 22242d1d..bb8a0658 100644 --- a/modules/nf-core/umitools/extract/tests/main.nf.test +++ b/modules/nf-core/umitools/extract/tests/main.nf.test @@ -9,27 +9,98 @@ nextflow_process { tag "umitools" tag "umitools/extract" - test("Should run without failures") { + test("single end") { when { - params { - outdir = "$outputDir" + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ 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.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("single end - stub") { + + options "-stub" + + when { 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) ] + ] """ } } then { assertAll ( - { assert process.success }, - { assert snapshot(process.out.versions).match("versions") } + { assert process.success }, + { assert snapshot(process.out).match() } ) } + } + + test("pair end") { + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ 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( + file(process.out.reads[0][1][0]).name, + file(process.out.reads[0][1][1]).name, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("pair end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ 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).match() } + ) + } } } \ No newline at end of file diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test.snap b/modules/nf-core/umitools/extract/tests/main.nf.test.snap index 6d5944f1..b1159054 100644 --- a/modules/nf-core/umitools/extract/tests/main.nf.test.snap +++ b/modules/nf-core/umitools/extract/tests/main.nf.test.snap @@ -1,10 +1,167 @@ { - "versions": { + "pair end - stub": { "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:05:20.008312" + }, + "single end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:04:12.145999" + }, + "pair end": { + "content": [ + "test.umi_extract_1.fastq.gz", + "test.umi_extract_2.fastq.gz", + [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log" + ] + ], + [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:21:09.578031" + }, + "single end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log" + ] + ], [ - "versions.yml:md5,5a18da2d3a5a4de15e7aaae9082d7abb" + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" ] ], - "timestamp": "2023-12-08T09:41:43.540658352" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:03:52.464606" } } \ No newline at end of file diff --git a/modules/nf-core/untar/environment.yml b/modules/nf-core/untar/environment.yml new file mode 100644 index 00000000..4f498244 --- /dev/null +++ b/modules/nf-core/untar/environment.yml @@ -0,0 +1,9 @@ +name: untar +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 diff --git a/modules/nf-core/untar/main.nf b/modules/nf-core/untar/main.nf index 8cd1856c..9bd8f554 100644 --- a/modules/nf-core/untar/main.nf +++ b/modules/nf-core/untar/main.nf @@ -2,10 +2,10 @@ process UNTAR { tag "$archive" label 'process_single' - conda "conda-forge::sed=4.7 bioconda::grep=3.4 conda-forge::tar=1.34" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'nf-core/ubuntu:20.04' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : + 'nf-core/ubuntu:22.04' }" input: tuple val(meta), path(archive) @@ -52,8 +52,29 @@ process UNTAR { stub: prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, "")) """ - mkdir $prefix - touch ${prefix}/file.txt + mkdir ${prefix} + ## Dry-run untaring the archive to get the files and place all in prefix + if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch \${i} + else + mkdir -p \${i} + fi + done + else + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch ${prefix}/\${i} + else + mkdir -p ${prefix}/\${i} + fi + done + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/untar/meta.yml b/modules/nf-core/untar/meta.yml index db241a6e..a9a2110f 100644 --- a/modules/nf-core/untar/meta.yml +++ b/modules/nf-core/untar/meta.yml @@ -39,3 +39,8 @@ authors: - "@drpatelh" - "@matthdsm" - "@jfy133" +maintainers: + - "@joseespinosa" + - "@drpatelh" + - "@matthdsm" + - "@jfy133" diff --git a/modules/nf-core/untar/tests/main.nf.test b/modules/nf-core/untar/tests/main.nf.test new file mode 100644 index 00000000..c957517a --- /dev/null +++ b/modules/nf-core/untar/tests/main.nf.test @@ -0,0 +1,85 @@ +nextflow_process { + + name "Test Process UNTAR" + script "../main.nf" + process "UNTAR" + tag "modules" + tag "modules_nfcore" + tag "untar" + + test("test_untar") { + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } + + test("test_untar_onlyfiles") { + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } + + test("test_untar - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } + + test("test_untar_onlyfiles - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } +} diff --git a/modules/nf-core/untar/tests/main.nf.test.snap b/modules/nf-core/untar/tests/main.nf.test.snap new file mode 100644 index 00000000..ceb91b79 --- /dev/null +++ b/modules/nf-core/untar/tests/main.nf.test.snap @@ -0,0 +1,158 @@ +{ + "test_untar_onlyfiles": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:28.231047" + }, + "test_untar_onlyfiles - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:45.773103" + }, + "test_untar - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:36.777441" + }, + "test_untar": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:19.377674" + } +} \ No newline at end of file diff --git a/modules/nf-core/untar/tests/tags.yml b/modules/nf-core/untar/tests/tags.yml new file mode 100644 index 00000000..feb6f15c --- /dev/null +++ b/modules/nf-core/untar/tests/tags.yml @@ -0,0 +1,2 @@ +untar: + - modules/nf-core/untar/** diff --git a/modules/nf-core/untarfiles/environment.yml b/modules/nf-core/untarfiles/environment.yml new file mode 100644 index 00000000..e479f80d --- /dev/null +++ b/modules/nf-core/untarfiles/environment.yml @@ -0,0 +1,9 @@ +name: untarfiles +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - conda-forge::sed=4.7 + - bioconda::grep=3.4 + - conda-forge::tar=1.34 diff --git a/modules/nf-core/untarfiles/main.nf b/modules/nf-core/untarfiles/main.nf index 59111b5f..de27e67c 100644 --- a/modules/nf-core/untarfiles/main.nf +++ b/modules/nf-core/untarfiles/main.nf @@ -2,7 +2,7 @@ process UNTARFILES { tag "$archive" label 'process_single' - conda "conda-forge::sed=4.7 bioconda::grep=3.4 conda-forge::tar=1.34" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 'nf-core/ubuntu:20.04' }" diff --git a/modules/nf-core/untarfiles/meta.yml b/modules/nf-core/untarfiles/meta.yml index 098490fa..38108826 100644 --- a/modules/nf-core/untarfiles/meta.yml +++ b/modules/nf-core/untarfiles/meta.yml @@ -40,3 +40,9 @@ authors: - "@matthdsm" - "@jfy133" - "@pinin4fjords" +maintainers: + - "@joseespinosa" + - "@drpatelh" + - "@matthdsm" + - "@jfy133" + - "@pinin4fjords" diff --git a/subworkflows/local/bam_filter_bamtools.nf b/subworkflows/local/bam_filter_bamtools.nf index a09876b2..954d0dac 100644 --- a/subworkflows/local/bam_filter_bamtools.nf +++ b/subworkflows/local/bam_filter_bamtools.nf @@ -62,7 +62,8 @@ workflow BAM_FILTER_BAMTOOLS { // Name sort PE BAM before filtering with pysam // SAMTOOLS_SORT ( - ch_bam.paired_end + ch_bam.paired_end, + ch_fasta ) ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index de8130fb..2de059b8 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -9,7 +9,7 @@ include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' workflow BAM_MARKDUPLICATES_PICARD { take: - ch_bam // channel: [ val(meta), path(bam) ] + ch_reads // channel: [ val(meta), path(reads) ] ch_fasta // channel: [ path(fasta) ] ch_fai // channel: [ path(fai) ] @@ -17,27 +17,33 @@ workflow BAM_MARKDUPLICATES_PICARD { ch_versions = Channel.empty() - PICARD_MARKDUPLICATES ( ch_bam, ch_fasta, ch_fai ) + PICARD_MARKDUPLICATES ( ch_reads, ch_fasta, ch_fai ) ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions.first()) - SAMTOOLS_INDEX ( PICARD_MARKDUPLICATES.out.bam ) + ch_markdup = PICARD_MARKDUPLICATES.out.bam.mix(PICARD_MARKDUPLICATES.out.cram) + + SAMTOOLS_INDEX ( ch_markdup ) ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) - ch_bam_bai = PICARD_MARKDUPLICATES.out.bam - .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) - .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) - .map{meta, bam, bai, csi -> - if (bai) [ meta, bam, bai ] - else [ meta, bam, csi ] + ch_reads_index = ch_markdup + .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) + .join(SAMTOOLS_INDEX.out.crai, by: [0], remainder: true) + .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) + .map{meta, reads, bai, crai, csi -> + if (bai) [ meta, reads, bai ] + else if (crai) [ meta, reads, crai ] + else [ meta, reads, csi ] } - BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) + BAM_STATS_SAMTOOLS ( ch_reads_index, ch_fasta ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) emit: bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] - metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(bam) ] + cram = PICARD_MARKDUPLICATES.out.cram // channel: [ val(meta), path(cram) ] + metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(metrics) ] bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), path(bai) ] + crai = SAMTOOLS_INDEX.out.crai // channel: [ val(meta), path(crai) ] csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), path(csi) ] stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] diff --git a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml index fe63068e..433d35b2 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml +++ b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml @@ -14,13 +14,13 @@ components: - samtools/flagstat - bam_stats_samtools input: - - ch_bam: + - ch_reads: description: | - BAM/CRAM/SAM file - Structure: [ val(meta), path(bam) ] + Sequence reads in BAM/CRAM/SAM format + Structure: [ val(meta), path(reads) ] - ch_fasta: description: | - Reference genome fasta file + Reference genome fasta file required for CRAM input Structure: [ path(fasta) ] - ch_fasta: description: | @@ -29,12 +29,20 @@ input: output: - bam: description: | - processed BAM/CRAM/SAM file + processed BAM/SAM file Structure: [ val(meta), path(bam) ] - bai: description: | - BAM/CRAM/SAM samtools index + BAM/SAM samtools index Structure: [ val(meta), path(bai) ] + - cram: + description: | + processed CRAM file + Structure: [ val(meta), path(cram) ] + - crai: + description: | + CRAM samtools index + Structure: [ val(meta), path(crai) ] - csi: description: | CSI samtools index diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test index d8d24290..420cc702 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test +++ b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test @@ -42,14 +42,15 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, + { assert path(workflow.out.metrics.get(0).get(1)).getText().contains("97") }, { assert snapshot( path(workflow.out.bam[0][1]), path(workflow.out.bai[0][1]), path(workflow.out.flagstat[0][1]), path(workflow.out.idxstats[0][1]), path(workflow.out.stats[0][1]), - ).match("sarscov2 - bam") }, - { assert path(workflow.out.metrics.get(0).get(1)).getText().contains("97") } + workflow.out.versions + ).match() } ) } } @@ -78,16 +79,78 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, + { assert path(workflow.out.metrics.get(0).get(1)).getText().contains("0.999986") }, { assert snapshot( - path(workflow.out.bam[0][1]), - path(workflow.out.bai[0][1]), + file(workflow.out.cram[0][1]).name, + path(workflow.out.crai[0][1]), path(workflow.out.flagstat[0][1]), path(workflow.out.idxstats[0][1]), path(workflow.out.stats[0][1]), - ).match("homo_sapiens - cram") }, - { assert path(workflow.out.metrics.get(0).get(1)).getText().contains("0.999986") } + workflow.out.versions + ).match() } ) } } + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + workflow { + """ + 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) + ]) + input[1] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("homo_sapiens - cram - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test' ], // 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' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap index a208d101..aecaef93 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap @@ -1,22 +1,334 @@ { "homo_sapiens - cram": { "content": [ - "test.bam:md5,6641dc05efa8384a061f378d86d922cd", - "test.bam.bai:md5,c41c60d8a94adebe53b6df80b6e90d38", + "test.cram", + "test.cram.crai:md5,cb5268070f99cdd0d86f43613e5fc7db", "test.flagstat:md5,93b0ef463df947ede1f42ff60396c34d", "test.idxstats:md5,e179601fa7b8ebce81ac3765206f6c15", - "test.stats:md5,0035ac8900d85e9a790f4c1f48b76947" + "test.stats:md5,372a7d9d9081aa009b21343a913beb14", + [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ] ], - "timestamp": "2023-12-05T17:45:12.484869" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-10T09:50:25.483402093" + }, + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:40:02.492073" + }, + "homo_sapiens - cram - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test" + }, + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test" + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test" + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test" + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ], + "bai": [ + + ], + "bam": [ + + ], + "crai": [ + [ + { + "id": "test" + }, + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + [ + { + "id": "test" + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test" + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test" + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test" + }, + "test.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test" + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:40:24.423583" }, "sarscov2 - bam": { "content": [ - "test.bam:md5,3091fe6ba1b7530f382fe40b9fd8f45b", - "test.bam.bai:md5,4d3ae8d013444b55e17aa0149a2ab404", + "test.bam:md5,d1a53820e4a6e42ca8aceab51d74cf57", + "test.bam.bai:md5,be9485a644813773fb893a0a6b9b977c", "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783", "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2", - "test.stats:md5,e32e7e49dce1fbe327a89e0fb7bc01b1" + "test.stats:md5,cca83e4fc9406fc3875b5e60055d6574", + [ + "versions.yml:md5,0d170c963555870ac9a0d438bf6c2f93", + "versions.yml:md5,3729819c49e6d8eed9ada247e5d77de1", + "versions.yml:md5,a62ca6eb27e59dd6f03a93fa8656e656", + "versions.yml:md5,adb00ecc904d3a27f552c360ac35a8a9", + "versions.yml:md5,fcf804c605f455127f2449403d70390c" + ] ], - "timestamp": "2023-12-05T17:43:58.582652" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-10T09:50:01.597322113" } -} +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf index fc1c652b..b716375b 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/main.nf +++ b/subworkflows/nf-core/bam_sort_stats_samtools/main.nf @@ -15,7 +15,7 @@ workflow BAM_SORT_STATS_SAMTOOLS { ch_versions = Channel.empty() - SAMTOOLS_SORT ( ch_bam ) + SAMTOOLS_SORT ( ch_bam, ch_fasta ) ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test index 75b5b934..821a3cf5 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test +++ b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test @@ -19,9 +19,6 @@ nextflow_workflow { test("test_bam_sort_stats_samtools_single_end") { when { - params { - outdir = "$outputDir" - } workflow { """ input[0] = Channel.of([ @@ -41,9 +38,11 @@ nextflow_workflow { { assert workflow.success}, { assert workflow.out.bam.get(0).get(1) ==~ ".*.bam"}, { assert workflow.out.bai.get(0).get(1) ==~ ".*.bai"}, - { assert snapshot(workflow.out.stats).match("test_bam_sort_stats_samtools_single_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_sort_stats_samtools_single_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_sort_stats_samtools_single_end_idxstats") } + { assert snapshot( + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.stats, + workflow.out.versions).match() } ) } } @@ -51,9 +50,6 @@ nextflow_workflow { test("test_bam_sort_stats_samtools_paired_end") { when { - params { - outdir = "$outputDir" - } workflow { """ input[0] = Channel.of([ @@ -73,9 +69,65 @@ nextflow_workflow { { assert workflow.success}, { assert workflow.out.bam.get(0).get(1) ==~ ".*.bam"}, { assert workflow.out.bai.get(0).get(1) ==~ ".*.bai"}, - { assert snapshot(workflow.out.stats).match("test_bam_sort_stats_samtools_paired_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_sort_stats_samtools_paired_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_sort_stats_samtools_paired_end_idxstats") } + { assert snapshot( + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.stats, + workflow.out.versions).match() } + ) + } + } + + test("test_bam_sort_stats_samtools_single_end - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("test_bam_sort_stats_samtools_paired_end - stub") { + + options "-stub" + + when { + workflow { + """ + 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:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } ) } } diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap index c159eef3..b7f4da17 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "test_bam_sort_stats_samtools_paired_end_flagstats": { + "test_bam_sort_stats_samtools_single_end": { "content": [ [ [ @@ -7,41 +7,42 @@ "id": "test", "single_end": false }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" ] - ] - ], - "timestamp": "2023-10-22T20:25:03.687121177" - }, - "test_bam_sort_stats_samtools_paired_end_idxstats": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + "test.idxstats:md5,613e048487662c694aa4a2f73ca96a20" ] - ] - ], - "timestamp": "2023-10-22T20:25:03.709648916" - }, - "test_bam_sort_stats_samtools_single_end_stats": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.stats:md5,f281507081517414eb1a04b2d9c855b2" + "test.stats:md5,d32de3b3716a11039cef2367c3c1a56e" ] + ], + [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" ] ], - "timestamp": "2024-01-18T17:10:02.818694" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:02:44.34964" }, - "test_bam_sort_stats_samtools_paired_end_stats": { + "test_bam_sort_stats_samtools_paired_end": { "content": [ [ [ @@ -49,38 +50,281 @@ "id": "test", "single_end": false }, - "test.stats:md5,e32e7e49dce1fbe327a89e0fb7bc01b1" + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" ] - ] - ], - "timestamp": "2023-12-04T11:06:59.253905951" - }, - "test_bam_sort_stats_samtools_single_end_idxstats": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.idxstats:md5,613e048487662c694aa4a2f73ca96a20" + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" ] - ] - ], - "timestamp": "2024-01-18T17:10:02.84631" - }, - "test_bam_sort_stats_samtools_single_end_flagstats": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + "test.stats:md5,cca83e4fc9406fc3875b5e60055d6574" ] + ], + [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" ] ], - "timestamp": "2024-01-18T17:10:02.829756" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:03:02.583095" + }, + "test_bam_sort_stats_samtools_single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:03:22.328703" + }, + "test_bam_sort_stats_samtools_paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,494b5530a1aa29fd5867cf655bebbfe1", + "versions.yml:md5,9fcb0cd845bfb1f89d83201bb20649b4", + "versions.yml:md5,bacc323ec4055d6f69f07a09089772d1", + "versions.yml:md5,ce946e97097c6a9ccf834a3f91f6da30", + "versions.yml:md5,d6c8dae685f1b7d050165fc15c7a20b5" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:03:38.833662" } } \ No newline at end of file diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test index c8b21f28..76e7a40a 100644 --- a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test +++ b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test @@ -15,9 +15,6 @@ nextflow_workflow { test("test_bam_stats_samtools_single_end") { when { - params { - outdir = "$outputDir" - } workflow { """ input[0] = Channel.of([ @@ -36,9 +33,11 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_single_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_single_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_single_end_idxstats") } + { assert snapshot( + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.stats, + workflow.out.versions).match() } ) } } @@ -46,9 +45,6 @@ nextflow_workflow { test("test_bam_stats_samtools_paired_end") { when { - params { - outdir = "$outputDir" - } workflow { """ input[0] = Channel.of([ @@ -67,9 +63,11 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_paired_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_paired_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_paired_end_idxstats") } + { assert snapshot( + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.stats, + workflow.out.versions).match() } ) } } @@ -77,9 +75,6 @@ nextflow_workflow { test("test_bam_stats_samtools_paired_end_cram") { when { - params { - outdir = "$outputDir" - } workflow { """ input[0] = Channel.of([ @@ -98,11 +93,96 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_paired_end_cram_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_paired_end_cram_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_paired_end_cram_idxstats") } + { assert snapshot( + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.stats, + workflow.out.versions).match() } ) } } + test ("test_bam_stats_samtools_single_end - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("test_bam_stats_samtools_paired_end - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // 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) + ]) + input[1] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("test_bam_stats_samtools_paired_end_cram - stub") { + + options "-stub" + + when { + workflow { + """ + 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' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } } diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap index 8bf0d379..a3ddcc5c 100644 --- a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap @@ -1,47 +1,271 @@ { - "test_bam_stats_samtools_paired_end_cram_flagstats": { + "test_bam_stats_samtools_paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:20:06.699297" + }, + "test_bam_stats_samtools_single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:19:57.708621" + }, + "test_bam_stats_samtools_paired_end_cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:20:17.051493" + }, + "test_bam_stats_samtools_single_end": { "content": [ [ [ { "id": "test", - "single_end": false + "single_end": true }, - "test.flagstat:md5,a53f3d26e2e9851f7d528442bbfe9781" + "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" ] - ] - ], - "timestamp": "2023-11-06T09:31:26.194017574" - }, - "test_bam_stats_samtools_paired_end_stats": { - "content": [ + ], [ [ { "id": "test", "single_end": true }, - "test.stats:md5,49e2b43344ff92bc4c02463a58f7ba4a" + "test.idxstats:md5,613e048487662c694aa4a2f73ca96a20" ] - ] - ], - "timestamp": "2024-01-18T17:17:27.704335" - }, - "test_bam_stats_samtools_paired_end_flagstats": { - "content": [ + ], [ [ { "id": "test", "single_end": true }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + "test.stats:md5,4a0c429c661d6aa0b60acb9309da642d" ] + ], + [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" ] ], - "timestamp": "2024-01-18T17:17:27.717482" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:19:25.801394" }, - "test_bam_stats_samtools_single_end_flagstats": { + "test_bam_stats_samtools_paired_end": { "content": [ [ [ @@ -49,80 +273,78 @@ "id": "test", "single_end": true }, - "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" ] - ] - ], - "timestamp": "2023-11-06T09:26:10.340046381" - }, - "test_bam_stats_samtools_paired_end_cram_idxstats": { - "content": [ + ], [ [ { "id": "test", - "single_end": false + "single_end": true }, - "test.idxstats:md5,e179601fa7b8ebce81ac3765206f6c15" + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" ] - ] - ], - "timestamp": "2023-11-06T09:31:26.207052003" - }, - "test_bam_stats_samtools_single_end_stats": { - "content": [ + ], [ [ { "id": "test", "single_end": true }, - "test.stats:md5,5a6667d97806e5002731e9cf23674fad" + "test.stats:md5,7afd486ad6abb9a2a3dac90c99e1d87b" ] + ], + [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" ] ], - "timestamp": "2023-12-04T11:07:06.676820877" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:19:36.158768" }, - "test_bam_stats_samtools_paired_end_idxstats": { + "test_bam_stats_samtools_paired_end_cram": { "content": [ [ [ { "id": "test", - "single_end": true + "single_end": false }, - "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + "test.flagstat:md5,a53f3d26e2e9851f7d528442bbfe9781" ] - ] - ], - "timestamp": "2024-01-18T17:17:27.726719" - }, - "test_bam_stats_samtools_single_end_idxstats": { - "content": [ + ], [ [ { "id": "test", - "single_end": true + "single_end": false }, - "test.idxstats:md5,613e048487662c694aa4a2f73ca96a20" + "test.idxstats:md5,e179601fa7b8ebce81ac3765206f6c15" ] - ] - ], - "timestamp": "2023-11-06T09:26:10.349439801" - }, - "test_bam_stats_samtools_paired_end_cram_stats": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.stats:md5,2cf2fe93596ee3d74f946097b204a629" + "test.stats:md5,16b59a1f2c99d9fe30f711adc3ebe32d" ] + ], + [ + "versions.yml:md5,3c485730f712b115bcdc235e7294133b", + "versions.yml:md5,90f593a26a2d53e0f0345df7888f448e", + "versions.yml:md5,9ae003814e63a0907d52eec64d5d3ca3" ] ], - "timestamp": "2023-12-04T11:07:22.30295557" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T12:19:46.625907" } } \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_bowtie2/main.nf b/subworkflows/nf-core/fastq_align_bowtie2/main.nf index ba4420f7..cafaa9bf 100644 --- a/subworkflows/nf-core/fastq_align_bowtie2/main.nf +++ b/subworkflows/nf-core/fastq_align_bowtie2/main.nf @@ -20,17 +20,17 @@ workflow FASTQ_ALIGN_BOWTIE2 { // // Map reads with Bowtie2 // - BOWTIE2_ALIGN ( ch_reads, ch_index, save_unaligned, sort_bam ) + BOWTIE2_ALIGN ( ch_reads, ch_index, ch_fasta, save_unaligned, sort_bam ) ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) // // Sort, index BAM file and run samtools stats, flagstat and idxstats // - BAM_SORT_STATS_SAMTOOLS ( BOWTIE2_ALIGN.out.aligned, ch_fasta ) + BAM_SORT_STATS_SAMTOOLS ( BOWTIE2_ALIGN.out.bam, ch_fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) emit: - bam_orig = BOWTIE2_ALIGN.out.aligned // channel: [ val(meta), aligned ] + bam_orig = BOWTIE2_ALIGN.out.bam // channel: [ val(meta), aligned ] log_out = BOWTIE2_ALIGN.out.log // channel: [ val(meta), log ] fastq = BOWTIE2_ALIGN.out.fastq // channel: [ val(meta), fastq ] diff --git a/subworkflows/nf-core/fastq_align_bowtie2/meta.yml b/subworkflows/nf-core/fastq_align_bowtie2/meta.yml index 58023a89..b18e4054 100644 --- a/subworkflows/nf-core/fastq_align_bowtie2/meta.yml +++ b/subworkflows/nf-core/fastq_align_bowtie2/meta.yml @@ -37,7 +37,7 @@ input: - sort_bam: type: boolean description: | - Save reads that do not map to the reference (true) or discard them (false) + Use samtools sort (true) or samtools view (false) default: false - ch_fasta: type: file diff --git a/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test new file mode 100644 index 00000000..2fabb42e --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test @@ -0,0 +1,189 @@ +nextflow_workflow { + + name "Test Subworkflow FASTQ_ALIGN_BOWTIE2" + script "../main.nf" + config "./nextflow.config" + workflow "FASTQ_ALIGN_BOWTIE2" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_align_bowtie2" + tag "subworkflows/bam_sort_stats_samtools" + tag "bowtie2" + tag "bowtie2/build" + tag "bowtie2/align" + + test("test_align_bowtie2_single_end") { + setup { + run("BOWTIE2_BUILD") { + script "../../../../modules/nf-core/bowtie2/build/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:true ], [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]]) + input[1] = BOWTIE2_BUILD.out.index + input[2] = false + input[3] = false + input[4] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + file(workflow.out.bam_orig[0][1]).name, + workflow.out.fastq, + workflow.out.log_out, + file(workflow.out.bam[0][1]).name, + file(workflow.out.bai[0][1]).name, + workflow.out.csi, + workflow.out.stats, + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.versions + ).match()} + ) + } + } + + test("test_align_bowtie2_paired_end") { + setup { + run("BOWTIE2_BUILD") { + script "../../../../modules/nf-core/bowtie2/build/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:false ], [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)]]) + input[1] = BOWTIE2_BUILD.out.index + input[2] = false + input[3] = false + input[4] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + file(workflow.out.bam_orig[0][1]).name, + workflow.out.fastq, + workflow.out.log_out, + file(workflow.out.bam[0][1]).name, + file(workflow.out.bai[0][1]).name, + workflow.out.csi, + workflow.out.stats, + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.versions + ).match()} + ) + } + } + + test("test_align_bowtie2_single_end - stub") { + + options "-stub" + + setup { + run("BOWTIE2_BUILD") { + script "../../../../modules/nf-core/bowtie2/build/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:true ], [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]]) + input[1] = BOWTIE2_BUILD.out.index + input[2] = false + input[3] = false + input[4] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + file(workflow.out.bam_orig[0][1]).name, + workflow.out.fastq, + workflow.out.log_out, + file(workflow.out.bam[0][1]).name, + file(workflow.out.bai[0][1]).name, + workflow.out.csi, + workflow.out.stats, + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.versions + ).match()} + ) + } + } + + test("test_align_bowtie2_paired_end - stub") { + + options "-stub" + + setup { + run("BOWTIE2_BUILD") { + script "../../../../modules/nf-core/bowtie2/build/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:false ], [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)]]) + input[1] = BOWTIE2_BUILD.out.index + input[2] = false + input[3] = false + input[4] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + file(workflow.out.bam_orig[0][1]).name, + workflow.out.fastq, + workflow.out.log_out, + file(workflow.out.bam[0][1]).name, + file(workflow.out.bai[0][1]).name, + workflow.out.csi, + workflow.out.stats, + workflow.out.flagstat, + workflow.out.idxstats, + workflow.out.versions + ).match()} + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test.snap new file mode 100644 index 00000000..c8490961 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bowtie2/tests/main.nf.test.snap @@ -0,0 +1,126 @@ +{ + "test_align_bowtie2_single_end": { + "content": [ + "test.bam", + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.bowtie2.log:md5,7b8a9e61b7646da1089b041333c41a87" + ] + ], + "test.sorted.bam", + "test.sorted.bam.bai", + [ + + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.stats:md5,d499a70739ffa0a96880eaad229dcf7c" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.flagstat:md5,e9ce9093133116bc54fd335cfe698372" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.idxstats:md5,e16eb632f7f462514b0873c7ac8ac905" + ] + ], + [ + "versions.yml:md5,0b1901279f738fa8e22cabea6e2a48bd", + "versions.yml:md5,60be918ac1032f74137ad27024c002ef", + "versions.yml:md5,8644be336f2fd05a04b95050a4de9094", + "versions.yml:md5,aab337e63eac9055aadb9a35cec16053", + "versions.yml:md5,dd60999d74ea42ae4f5483c9d94507f3", + "versions.yml:md5,ddb252583f75777033ee6467e4b6d545" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T13:07:32.050239" + }, + "test_align_bowtie2_paired_end": { + "content": [ + "test.bam", + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bowtie2.log:md5,bd89ce1b28c93bf822bae391ffcedd19" + ] + ], + "test.sorted.bam", + "test.sorted.bam.bai", + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.stats:md5,c02dbd116c1f49339dda208cb950261d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.flagstat:md5,49f3d51a8804ce58fe9cecd2549d279b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.idxstats:md5,29ff2fa56d35b2a47625b8f517f1a947" + ] + ], + [ + "versions.yml:md5,0b1901279f738fa8e22cabea6e2a48bd", + "versions.yml:md5,60be918ac1032f74137ad27024c002ef", + "versions.yml:md5,8644be336f2fd05a04b95050a4de9094", + "versions.yml:md5,aab337e63eac9055aadb9a35cec16053", + "versions.yml:md5,dd60999d74ea42ae4f5483c9d94507f3", + "versions.yml:md5,ddb252583f75777033ee6467e4b6d545" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-03T13:07:48.653475" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_bowtie2/tests/nextflow.config b/subworkflows/nf-core/fastq_align_bowtie2/tests/nextflow.config new file mode 100644 index 00000000..2f85e807 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bowtie2/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: '.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_.*' { + ext.prefix = { "${meta.id}.sorted" } + } + withName: '.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' { + ext.prefix = { "${meta.id}.sorted.bam" } + } +} diff --git a/subworkflows/nf-core/fastq_align_bowtie2/tests/tags.yml b/subworkflows/nf-core/fastq_align_bowtie2/tests/tags.yml new file mode 100644 index 00000000..267bcc77 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bowtie2/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_align_bowtie2: + - subworkflows/nf-core/fastq_align_bowtie2/** diff --git a/subworkflows/nf-core/fastq_align_bwa/main.nf b/subworkflows/nf-core/fastq_align_bwa/main.nf index 9192550d..c7408d08 100644 --- a/subworkflows/nf-core/fastq_align_bwa/main.nf +++ b/subworkflows/nf-core/fastq_align_bwa/main.nf @@ -19,7 +19,7 @@ workflow FASTQ_ALIGN_BWA { // Map reads with BWA // - BWA_MEM ( ch_reads, ch_index, val_sort_bam ) + BWA_MEM ( ch_reads, ch_index, ch_fasta, val_sort_bam ) ch_versions = ch_versions.mix(BWA_MEM.out.versions.first()) // diff --git a/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test b/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test new file mode 100644 index 00000000..93c3aac3 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test @@ -0,0 +1,77 @@ +nextflow_workflow { + + name "Test Subworkflow FASTQ_ALIGN_BWA" + script "../main.nf" + config "./nextflow.config" + workflow "FASTQ_ALIGN_BWA" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_align_bwa" + tag "subworkflows/bam_sort_stats_samtools" + tag "bwa" + tag "bwa/mem" + tag "bwa/index" + + + test("fastq_align_bwa_single_end") { + setup { + run("BWA_INDEX") { + script "../../../../modules/nf-core/bwa/index/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:true ],[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]]) + input[1] = BWA_INDEX.out.index + input[2] = false + input[3] = Channel.value([[id: 'genome'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match()} + ) + } + } + + test("fastq_align_bwa_paired_end") { + setup { + run("BWA_INDEX") { + script "../../../../modules/nf-core/bwa/index/main.nf" + process { + """ + input[0] = Channel.value([ [ id:'genome' ],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + } + when { + workflow { + """ + input[0] = Channel.of([[ id:'test', single_end:false ], [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)] + ] ) + input[1] = BWA_INDEX.out.index + input[2] = false + input[3] = Channel.value([[id: 'genome'], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match()} + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test.snap new file mode 100644 index 00000000..afd97b70 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test.snap @@ -0,0 +1,284 @@ +{ + "fastq_align_bwa_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,0bac6813d36636e735eae75887e70cd5" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,bfea46d006b5884fcca0653cc5b886e1" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.bai:md5,140d22f4f374b485ac49e8b8c56a59b6" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.stats:md5,42029d1e18c289f441232c0e6851fe5a" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.flagstat:md5,18d602435a02a4d721b78d1812622159" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.idxstats:md5,85d20a901eef23ca50c323638a2eb602" + ] + ], + "7": [ + "versions.yml:md5,1a2ad0aad8b5a39089079d531734bdfe", + "versions.yml:md5,4905894958d972728ef3fb67d420971d", + "versions.yml:md5,54b76f87f10cc17e260aefd4e61b73ba", + "versions.yml:md5,616f164b996173af56b58861be3e6130", + "versions.yml:md5,7d1cd2920757b85fbae766a6b28b8e27", + "versions.yml:md5,ee109695a3b368e657b190ccf0f21ab5" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.bai:md5,140d22f4f374b485ac49e8b8c56a59b6" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,bfea46d006b5884fcca0653cc5b886e1" + ] + ], + "bam_orig": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,0bac6813d36636e735eae75887e70cd5" + ] + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.flagstat:md5,18d602435a02a4d721b78d1812622159" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.idxstats:md5,85d20a901eef23ca50c323638a2eb602" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.stats:md5,42029d1e18c289f441232c0e6851fe5a" + ] + ], + "versions": [ + "versions.yml:md5,1a2ad0aad8b5a39089079d531734bdfe", + "versions.yml:md5,4905894958d972728ef3fb67d420971d", + "versions.yml:md5,54b76f87f10cc17e260aefd4e61b73ba", + "versions.yml:md5,616f164b996173af56b58861be3e6130", + "versions.yml:md5,7d1cd2920757b85fbae766a6b28b8e27", + "versions.yml:md5,ee109695a3b368e657b190ccf0f21ab5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T12:27:40.432319749" + }, + "fastq_align_bwa_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,dc633d557de438092c4d72d04195c5a8" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam:md5,c5820f18aeaab8715195824f1f693f9f" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.bai:md5,13ba4b9f3445fa6de43cea9b28342783" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.stats:md5,71846e184d196d1b6664028aeb318bac" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.idxstats:md5,613e048487662c694aa4a2f73ca96a20" + ] + ], + "7": [ + "versions.yml:md5,1a2ad0aad8b5a39089079d531734bdfe", + "versions.yml:md5,4905894958d972728ef3fb67d420971d", + "versions.yml:md5,54b76f87f10cc17e260aefd4e61b73ba", + "versions.yml:md5,616f164b996173af56b58861be3e6130", + "versions.yml:md5,7d1cd2920757b85fbae766a6b28b8e27", + "versions.yml:md5,ee109695a3b368e657b190ccf0f21ab5" + ], + "bai": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.bai:md5,13ba4b9f3445fa6de43cea9b28342783" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam:md5,c5820f18aeaab8715195824f1f693f9f" + ] + ], + "bam_orig": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,dc633d557de438092c4d72d04195c5a8" + ] + ], + "csi": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.idxstats:md5,613e048487662c694aa4a2f73ca96a20" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.stats:md5,71846e184d196d1b6664028aeb318bac" + ] + ], + "versions": [ + "versions.yml:md5,1a2ad0aad8b5a39089079d531734bdfe", + "versions.yml:md5,4905894958d972728ef3fb67d420971d", + "versions.yml:md5,54b76f87f10cc17e260aefd4e61b73ba", + "versions.yml:md5,616f164b996173af56b58861be3e6130", + "versions.yml:md5,7d1cd2920757b85fbae766a6b28b8e27", + "versions.yml:md5,ee109695a3b368e657b190ccf0f21ab5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T12:27:19.693756639" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_bwa/tests/nextflow.config b/subworkflows/nf-core/fastq_align_bwa/tests/nextflow.config new file mode 100644 index 00000000..2f85e807 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bwa/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: '.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_.*' { + ext.prefix = { "${meta.id}.sorted" } + } + withName: '.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' { + ext.prefix = { "${meta.id}.sorted.bam" } + } +} diff --git a/subworkflows/nf-core/fastq_align_bwa/tests/tags.yml b/subworkflows/nf-core/fastq_align_bwa/tests/tags.yml new file mode 100644 index 00000000..bfe89ccf --- /dev/null +++ b/subworkflows/nf-core/fastq_align_bwa/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_align_bwa: + - subworkflows/nf-core/fastq_align_bwa/** diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test new file mode 100644 index 00000000..96e05765 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test @@ -0,0 +1,274 @@ +nextflow_workflow { + + name "Test Subworkflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE" + script "../main.nf" + workflow "FASTQ_FASTQC_UMITOOLS_TRIMGALORE" + config './nextflow.config' + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_fastqc_umitools_trimgalore" + tag "fastqc" + tag "umitools/extract" + tag "trimgalore" + + tag "FASTQC" + tag "UMITOOLS_EXTRACT" + tag "TRIMGALORE" + + test("test single end read with UMI") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = false // skip_fastqc + input[2] = true // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert path(workflow.out.fastqc_html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot( + workflow.out.reads, + workflow.out.trim_read_count, + workflow.out.trim_unpaired, + workflow.out.versions).match() } + ) + } + } + + test("test paired end read with UMI") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = false // skip_fastqc + input[2] = true // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + workflow.out.reads, + workflow.out.trim_read_count, + workflow.out.trim_unpaired, + workflow.out.versions).match() } + ) + } + } + test("test paired end read without UMI") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = false // skip_fastqc + input[2] = false // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + workflow.out.reads, + workflow.out.trim_read_count, + workflow.out.trim_unpaired, + workflow.out.versions).match() } + ) + } + } + + test("test skip all steps") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = true // skip_fastqc + input[2] = true // with_umi + input[3] = true // skip_umi_extract + input[4] = true // skip_trimming + input[5] = 0 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot( + workflow.out.trim_read_count, + workflow.out.trim_unpaired, + workflow.out.versions).match() } + ) + } + } + + test("test single end read with UMI - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = false // skip_fastqc + input[2] = true // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("test paired end read with UMI - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = false // skip_fastqc + input[2] = true // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + test("test paired end read without UMI - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = false // skip_fastqc + input[2] = false // with_umi + input[3] = false // skip_umi_extract + input[4] = false // skip_trimming + input[5] = 1 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match() } + ) + } + } + + test("test skip all steps - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + 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] = true // skip_fastqc + input[2] = true // with_umi + input[3] = true // skip_umi_extract + input[4] = true // skip_trimming + input[5] = 0 // umi_discard_read + input[6] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success} + // No snapshot when skipping all as output is input + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test.snap new file mode 100644 index 00000000..03459149 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/main.nf.test.snap @@ -0,0 +1,524 @@ +{ + "test paired end read with UMI - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + 0 + ] + ], + "9": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ], + "fastqc_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + + ], + "trim_html": [ + + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": true + }, + 0 + ] + ], + "trim_unpaired": [ + + ], + "trim_zip": [ + + ], + "umi_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:06:34.919444" + }, + "test paired end read without UMI - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + 0 + ] + ], + "9": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ], + "fastqc_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + + ], + "trim_html": [ + + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 0 + ] + ], + "trim_unpaired": [ + + ], + "trim_zip": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:06:51.765414" + }, + "test paired end read without UMI": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,566d44cca0d22c522d6cf0e50c7165dc", + "test_2_val_2.fq.gz:md5,3c023e8e890b897821df3dc98f48c2b3" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + 100.0 + ] + ], + [ + + ], + [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:05:37.366404" + }, + "test single end read with UMI": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,faae784affdd7d84e2fa9da9e9425229" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + 100.0 + ] + ], + [ + + ], + [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:04:53.072227" + }, + "test paired end read with UMI": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,9c58b78ac2c7b5ce9ca6b090eee1d39c" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + 100.0 + ] + ], + [ + + ], + [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:05:16.709704" + }, + "test skip all steps": { + "content": [ + [ + + ], + [ + + ], + [ + + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:05:49.455992" + }, + "test single end read with UMI - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + 0 + ] + ], + "9": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ], + "fastqc_html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_zip": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + + ], + "trim_html": [ + + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": true + }, + 0 + ] + ], + "trim_unpaired": [ + + ], + "trim_zip": [ + + ], + "umi_log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0a5b8fa83ba29cf645bf9e9471cca150", + "versions.yml:md5,3e4b7f058c0aa96ba41c3e4d6df6e839", + "versions.yml:md5,7e740129a23c5ac21c27476e30f8a6d2" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T17:06:09.844235" + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/nextflow.config b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/nextflow.config new file mode 100644 index 00000000..06a7d07a --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/tags.yml b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/tags.yml new file mode 100644 index 00000000..5bf59db4 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_fastqc_umitools_trimgalore: + - subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/** From 48975698079293b992348d438bf6ba1bf756ba0f Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 31 Jul 2024 13:44:43 +0200 Subject: [PATCH 02/11] Update local subworkflow --- subworkflows/local/prepare_genome.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index b7878aaf..96668b2d 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -72,7 +72,7 @@ workflow PREPARE_GENOME { } else { ch_gff = Channel.value(file(gff)) } - ch_gtf = GFFREAD ( ch_gff ).gtf + ch_gtf = GFFREAD ( [ [:], ch_gff ] ).gtf ch_versions = ch_versions.mix(GFFREAD.out.versions) } From beda39ae440bfafefee7f440e7cc804b9fc5ee47 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 6 Aug 2024 12:26:41 +0200 Subject: [PATCH 03/11] Update bwa/mem --- .../nf-core/bowtie2/align/tests/main.nf.test | 90 ++++---- modules/nf-core/bwa/mem/tests/main.nf.test | 139 +++--------- .../nf-core/bwa/mem/tests/main.nf.test.snap | 203 ++++++++++++++---- 3 files changed, 241 insertions(+), 191 deletions(-) diff --git a/modules/nf-core/bowtie2/align/tests/main.nf.test b/modules/nf-core/bowtie2/align/tests/main.nf.test index 03aeaf9e..0de5950f 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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index 463b76f8..5de2c2f4 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 { @@ -49,7 +49,8 @@ nextflow_process { process.out.csi, process.out.crai, process.out.versions, - file(process.out.bam[0][1]).name + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -59,20 +60,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 { """ @@ -97,7 +84,8 @@ nextflow_process { process.out.csi, process.out.crai, process.out.versions, - file(process.out.bam[0][1]).name + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -107,20 +95,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 { """ @@ -146,7 +120,8 @@ nextflow_process { process.out.csi, process.out.crai, process.out.versions, - file(process.out.bam[0][1]).name + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -156,20 +131,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 { """ @@ -195,7 +156,8 @@ nextflow_process { process.out.csi, process.out.crai, process.out.versions, - file(process.out.bam[0][1]).name + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -205,20 +167,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 { """ @@ -244,7 +192,8 @@ nextflow_process { process.out.csi, process.out.crai, process.out.versions, - file(process.out.bam[0][1]).name + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() ).match() } ) @@ -253,20 +202,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 +224,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 +253,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..2079ea22 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -13,13 +13,14 @@ [ "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], - "test.bam" + "b6d9cb250261a4c125413c5d867d87a7", + "798439cbd7fd81cbcc5078022dc5479d" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:44:32.953673185" + "timestamp": "2024-08-02T12:22:28.051598" }, "Single-End Sort": { "content": [ @@ -35,13 +36,14 @@ [ "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], - "test.bam" + "848434ae4b79cfdcb2281c60b33663ce", + "94fcf617f5b994584c4e8d4044e16b4f" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:44:45.27066093" + "timestamp": "2024-08-02T12:22:39.671154" }, "Paired-End": { "content": [ @@ -57,13 +59,14 @@ [ "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], - "test.bam" + "5b34d31be84478761f789e3e2e805e31", + "57aeef88ed701a8ebc8e2f0a381b2a6" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:44:57.706852274" + "timestamp": "2024-08-02T12:22:51.919479" }, "Paired-End Sort": { "content": [ @@ -79,27 +82,91 @@ [ "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], - "test.bam" + "69003376d9a8952622d8587b39c3eaae", + "af8628d9df18b2d3d4f6fd47ef2bb872" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:45:10.376505036" + "timestamp": "2024-08-02T12:23:00.833562" }, "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": [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "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": [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:46:07.182072398" + "timestamp": "2024-08-02T12:31:29.46282" }, "Paired-End - no fasta": { "content": [ @@ -115,26 +182,90 @@ [ "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], - "test.bam" + "5b34d31be84478761f789e3e2e805e31", + "57aeef88ed701a8ebc8e2f0a381b2a6" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:45:53.813076501" + "timestamp": "2024-08-02T12:23:09.942545" }, "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": [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "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": [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-20T08:46:18.412916364" + "timestamp": "2024-08-02T12:31:37.757037" } } \ No newline at end of file From a3e2814b6097a617c6b8b0c55e10ef5e1ac19984 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 6 Aug 2024 12:27:14 +0200 Subject: [PATCH 04/11] Update chromap modules --- .../nf-core/chromap/chromap/environment.yml | 4 +- modules/nf-core/chromap/chromap/main.nf | 4 +- .../chromap/chromap/tests/main.nf.test | 83 ++++++++++--------- .../chromap/chromap/tests/main.nf.test.snap | 60 +++++--------- modules/nf-core/chromap/index/environment.yml | 2 +- modules/nf-core/chromap/index/main.nf | 8 +- .../nf-core/chromap/index/tests/main.nf.test | 18 ++-- .../chromap/index/tests/main.nf.test.snap | 31 +++---- .../deeptools/computematrix/environment.yml | 2 +- .../nf-core/deeptools/computematrix/main.nf | 16 +++- 10 files changed, 111 insertions(+), 117 deletions(-) diff --git a/modules/nf-core/chromap/chromap/environment.yml b/modules/nf-core/chromap/chromap/environment.yml index a630f9c5..616ea6d2 100644 --- a/modules/nf-core/chromap/chromap/environment.yml +++ b/modules/nf-core/chromap/chromap/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::chromap=0.2.4 - - bioconda::samtools=1.16.1 + - bioconda::chromap=0.2.6 + - bioconda::samtools=1.20 diff --git a/modules/nf-core/chromap/chromap/main.nf b/modules/nf-core/chromap/chromap/main.nf index 9b1f1395..1a00acbb 100644 --- a/modules/nf-core/chromap/chromap/main.nf +++ b/modules/nf-core/chromap/chromap/main.nf @@ -4,8 +4,8 @@ process CHROMAP_CHROMAP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:5b2e433ab8b3d1ef098fc944b567fd98caa23f56-0' : - 'biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:5b2e433ab8b3d1ef098fc944b567fd98caa23f56-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:6500f0fa0c9536821177168555632d9811670937-0' : + 'biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:6500f0fa0c9536821177168555632d9811670937-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test b/modules/nf-core/chromap/chromap/tests/main.nf.test index 6752804b..a20382f9 100644 --- a/modules/nf-core/chromap/chromap/tests/main.nf.test +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test @@ -13,30 +13,18 @@ nextflow_process { setup { run("CHROMAP_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = Channel.of([ - [:], // meta map - [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - ]) - """ - } - } - run("CHROMAP_INDEX", alias: "CHROMAP_INDEX_STUB") { - options "-stub" script "../../index/main.nf" + process { """ - input[0] = Channel.of([ + input[0] = [ [:], // meta map - [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - ]) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] """ } } - } test("sarscov2 - single_end") { @@ -44,11 +32,14 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test', single_end:true ], // meta map - [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] - ]) - input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + input[1] = [ + [:], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] input[2] = CHROMAP_INDEX.out.index input[3] = [] input[4] = [] @@ -71,14 +62,17 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test', single_end:false ], // meta map [ - 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) + 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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + ] + input[1] = [ + [:], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] input[2] = CHROMAP_INDEX.out.index input[3] = [] input[4] = [] @@ -100,17 +94,22 @@ nextflow_process { test("sarscov2 - paired_end - bam") { when { + config "./nextflow.config" + process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test', single_end:false ], // meta map - [ - 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) + [ + 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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + ] + input[1] = [ + [:], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] input[2] = CHROMAP_INDEX.out.index input[3] = [] input[4] = [] @@ -123,8 +122,13 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match("versions") }, - { assert snapshot(file(process.out.bam[0][1]).name).match() } + { + assert snapshot( + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5(), + process.out.versions + ) + } ) } @@ -137,12 +141,15 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test', single_end:true ], // meta map - [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] - ]) - input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) - input[2] = CHROMAP_INDEX_STUB.out.index + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + input[1] = [ + [:], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = CHROMAP_INDEX.out.index input[3] = [] input[4] = [] input[5] = [] diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test.snap b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap index 1e718ac6..1f06dc9e 100644 --- a/modules/nf-core/chromap/chromap/tests/main.nf.test.snap +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + "test.bed.gz:md5,b23aa9dae812fe84c308df6e18d850be" ] ], "1": [ @@ -21,7 +21,7 @@ ], "4": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ], "bam": [ @@ -32,7 +32,7 @@ "id": "test", "single_end": true }, - "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + "test.bed.gz:md5,b23aa9dae812fe84c308df6e18d850be" ] ], "pairs": [ @@ -42,15 +42,15 @@ ], "versions": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-06-24T09:14:34.016756" + "timestamp": "2024-08-05T17:49:22.798324749" }, "sarscov2 - paired_end ": { "content": [ @@ -61,7 +61,7 @@ "id": "test", "single_end": false }, - "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + "test.bed.gz:md5,f658c1e94adef751ad08e132aac92712" ] ], "1": [ @@ -74,7 +74,7 @@ ], "4": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ], "bam": [ @@ -85,7 +85,7 @@ "id": "test", "single_end": false }, - "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + "test.bed.gz:md5,f658c1e94adef751ad08e132aac92712" ] ], "pairs": [ @@ -95,27 +95,15 @@ ], "versions": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-06-24T09:18:23.379305" - }, - "versions": { - "content": [ - [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.1" - }, - "timestamp": "2024-05-22T19:09:02.94685" + "timestamp": "2024-08-05T17:49:29.530097947" }, "sarscov2 - single_end - stub": { "content": [ @@ -157,7 +145,7 @@ ] ], "4": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ], "bam": [ [ @@ -196,24 +184,14 @@ ] ], "versions": [ - "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + "versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-06-24T09:14:51.782404" - }, - "sarscov2 - paired_end - bam": { - "content": [ - "test.bam" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-06-24T09:14:46.389216" + "timestamp": "2024-08-05T17:49:42.086410229" } } \ No newline at end of file diff --git a/modules/nf-core/chromap/index/environment.yml b/modules/nf-core/chromap/index/environment.yml index 602863ab..d83b301a 100644 --- a/modules/nf-core/chromap/index/environment.yml +++ b/modules/nf-core/chromap/index/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::chromap=0.2.5 + - bioconda::chromap=0.2.6 diff --git a/modules/nf-core/chromap/index/main.nf b/modules/nf-core/chromap/index/main.nf index bd97c7c9..41bd99fd 100644 --- a/modules/nf-core/chromap/index/main.nf +++ b/modules/nf-core/chromap/index/main.nf @@ -4,8 +4,8 @@ process CHROMAP_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/chromap:0.2.5--hd03093a_0' : - 'biocontainers/chromap:0.2.5--hd03093a_0' }" + 'https://depot.galaxyproject.org/singularity/chromap:0.2.6--hdcf5f25_0' : + 'biocontainers/chromap:0.2.6--hdcf5f25_0' }" input: tuple val(meta), path(fasta) @@ -19,7 +19,7 @@ process CHROMAP_INDEX { script: def args = task.ext.args ?: '' - def prefix = fasta.baseName + def prefix = task.ext.prefix ?: "${fasta.baseName}" """ chromap \\ -i \\ @@ -35,7 +35,7 @@ process CHROMAP_INDEX { """ stub: - def prefix = fasta.baseName + def prefix = task.ext.prefix ?: "${fasta.baseName}" """ touch ${prefix}.index diff --git a/modules/nf-core/chromap/index/tests/main.nf.test b/modules/nf-core/chromap/index/tests/main.nf.test index ffec974d..619e085b 100644 --- a/modules/nf-core/chromap/index/tests/main.nf.test +++ b/modules/nf-core/chromap/index/tests/main.nf.test @@ -14,8 +14,10 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] """ } } @@ -23,8 +25,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match("versions") }, - { assert snapshot(file(process.out.index[0][1]).name).match() } + { assert snapshot(file(process.out.index[0][1]).name, + process.out.versions) + .match() + } ) } } @@ -36,8 +40,10 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] """ } } diff --git a/modules/nf-core/chromap/index/tests/main.nf.test.snap b/modules/nf-core/chromap/index/tests/main.nf.test.snap index 14ba7c2f..02fd2a93 100644 --- a/modules/nf-core/chromap/index/tests/main.nf.test.snap +++ b/modules/nf-core/chromap/index/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + "versions.yml:md5,d558de01f835d2a4e3c09262bf40d2d5" ], "index": [ [ @@ -22,36 +22,27 @@ ] ], "versions": [ - "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + "versions.yml:md5,d558de01f835d2a4e3c09262bf40d2d5" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-06-24T09:16:24.274833" + "timestamp": "2024-08-05T17:51:53.156411807" }, - "versions": { + "sarscov2 - fasta": { "content": [ + "genome.index", [ - "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + "versions.yml:md5,d558de01f835d2a4e3c09262bf40d2d5" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.2" - }, - "timestamp": "2024-05-22T10:47:29.768048005" - }, - "sarscov2 - fasta": { - "content": [ - "genome.index" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-06-24T09:15:55.493443" + "timestamp": "2024-08-05T17:51:48.457842431" } } \ No newline at end of file diff --git a/modules/nf-core/deeptools/computematrix/environment.yml b/modules/nf-core/deeptools/computematrix/environment.yml index b1b0866d..279d1eac 100644 --- a/modules/nf-core/deeptools/computematrix/environment.yml +++ b/modules/nf-core/deeptools/computematrix/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::deeptools=3.5.1 + - "bioconda::deeptools=3.5.5" diff --git a/modules/nf-core/deeptools/computematrix/main.nf b/modules/nf-core/deeptools/computematrix/main.nf index dbd88dc9..e8a36001 100644 --- a/modules/nf-core/deeptools/computematrix/main.nf +++ b/modules/nf-core/deeptools/computematrix/main.nf @@ -4,8 +4,8 @@ process DEEPTOOLS_COMPUTEMATRIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : - 'biocontainers/deeptools:3.5.1--py_0' }" + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.5--pyhdfd78af_0': + 'biocontainers/deeptools:3.5.5--pyhdfd78af_0' }" input: tuple val(meta), path(bigwig) @@ -36,4 +36,16 @@ process DEEPTOOLS_COMPUTEMATRIX { deeptools: \$(computeMatrix --version | sed -e "s/computeMatrix //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo "" | gzip > ${prefix}.computeMatrix.mat.gz + touch ${prefix}.computeMatrix.vals.mat.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(computeMatrix --version | sed -e "s/computeMatrix //g") + END_VERSIONS + """ } From d9e98056abf227270dc55f8f213c64c8b6e72c86 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 6 Aug 2024 12:28:14 +0200 Subject: [PATCH 05/11] Updating deeptools modules --- .../computematrix/tests/main.nf.test | 67 ++++++++++++++ .../computematrix/tests/main.nf.test.snap | 72 +++++++++++++++ .../computematrix/tests/nextflow.config | 7 ++ .../deeptools/computematrix/tests/tags.yml | 2 + .../deeptools/plotfingerprint/environment.yml | 2 +- .../nf-core/deeptools/plotfingerprint/main.nf | 17 +++- .../plotfingerprint/tests/main.nf.test | 62 +++++++++++++ .../plotfingerprint/tests/main.nf.test.snap | 90 +++++++++++++++++++ .../deeptools/plotfingerprint/tests/tags.yml | 2 + .../deeptools/plotheatmap/environment.yml | 6 +- modules/nf-core/deeptools/plotheatmap/main.nf | 16 +++- .../deeptools/plotheatmap/tests/main.nf.test | 60 +++++++++++++ .../plotheatmap/tests/main.nf.test.snap | 69 ++++++++++++++ .../deeptools/plotheatmap/tests/tags.yml | 2 + .../deeptools/plotprofile/environment.yml | 2 +- modules/nf-core/deeptools/plotprofile/main.nf | 16 +++- .../deeptools/plotprofile/tests/main.nf.test | 60 +++++++++++++ .../plotprofile/tests/main.nf.test.snap | 69 ++++++++++++++ .../deeptools/plotprofile/tests/tags.yml | 2 + 19 files changed, 613 insertions(+), 10 deletions(-) create mode 100644 modules/nf-core/deeptools/computematrix/tests/main.nf.test create mode 100644 modules/nf-core/deeptools/computematrix/tests/main.nf.test.snap create mode 100644 modules/nf-core/deeptools/computematrix/tests/nextflow.config create mode 100644 modules/nf-core/deeptools/computematrix/tests/tags.yml create mode 100644 modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test create mode 100644 modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test.snap create mode 100644 modules/nf-core/deeptools/plotfingerprint/tests/tags.yml create mode 100644 modules/nf-core/deeptools/plotheatmap/tests/main.nf.test create mode 100644 modules/nf-core/deeptools/plotheatmap/tests/main.nf.test.snap create mode 100644 modules/nf-core/deeptools/plotheatmap/tests/tags.yml create mode 100644 modules/nf-core/deeptools/plotprofile/tests/main.nf.test create mode 100644 modules/nf-core/deeptools/plotprofile/tests/main.nf.test.snap create mode 100644 modules/nf-core/deeptools/plotprofile/tests/tags.yml diff --git a/modules/nf-core/deeptools/computematrix/tests/main.nf.test b/modules/nf-core/deeptools/computematrix/tests/main.nf.test new file mode 100644 index 00000000..39873aa3 --- /dev/null +++ b/modules/nf-core/deeptools/computematrix/tests/main.nf.test @@ -0,0 +1,67 @@ +nextflow_process { + + name "Test Process DEEPTOOLS_COMPUTEMATRIX" + script "../main.nf" + process "DEEPTOOLS_COMPUTEMATRIX" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "deeptools" + tag "deeptools/computematrix" + + test("sarscov2 - bigwig - bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina//bigwig/test.bigwig', checkIfExists: true) + ] + input[1] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.matrix.get(0).get(1)).name, + process.out.table, + process.out.versions) + .match() + } + ) + } + + } + + test("sarscov2 - mat - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina//bigwig/test.bigwig', checkIfExists: true) + ] + input[1] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/deeptools/computematrix/tests/main.nf.test.snap b/modules/nf-core/deeptools/computematrix/tests/main.nf.test.snap new file mode 100644 index 00000000..a1916610 --- /dev/null +++ b/modules/nf-core/deeptools/computematrix/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "sarscov2 - mat - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.computeMatrix.mat.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.computeMatrix.vals.mat.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,ccf4527952be3b834d42b6a968193b09" + ], + "matrix": [ + [ + { + "id": "test" + }, + "test.computeMatrix.mat.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "table": [ + [ + { + "id": "test" + }, + "test.computeMatrix.vals.mat.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ccf4527952be3b834d42b6a968193b09" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:31:20.853496401" + }, + "sarscov2 - bigwig - bed": { + "content": [ + "test.computeMatrix.mat.gz", + [ + [ + { + "id": "test" + }, + "test.computeMatrix.vals.mat.tab:md5,19e22051cc44edb7db3e0f8345330d90" + ] + ], + [ + "versions.yml:md5,ccf4527952be3b834d42b6a968193b09" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:31:15.614009233" + } +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/computematrix/tests/nextflow.config b/modules/nf-core/deeptools/computematrix/tests/nextflow.config new file mode 100644 index 00000000..f9e94fb2 --- /dev/null +++ b/modules/nf-core/deeptools/computematrix/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: DEEPTOOLS_COMPUTEMATRIX { + ext.args = 'scale-regions -b 1000' + } + +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/computematrix/tests/tags.yml b/modules/nf-core/deeptools/computematrix/tests/tags.yml new file mode 100644 index 00000000..603becce --- /dev/null +++ b/modules/nf-core/deeptools/computematrix/tests/tags.yml @@ -0,0 +1,2 @@ +deeptools/computematrix: + - "modules/nf-core/deeptools/computematrix/**" diff --git a/modules/nf-core/deeptools/plotfingerprint/environment.yml b/modules/nf-core/deeptools/plotfingerprint/environment.yml index 14654fbb..b867b9a5 100644 --- a/modules/nf-core/deeptools/plotfingerprint/environment.yml +++ b/modules/nf-core/deeptools/plotfingerprint/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::deeptools=3.5.1 + - "bioconda::deeptools=3.5.5" diff --git a/modules/nf-core/deeptools/plotfingerprint/main.nf b/modules/nf-core/deeptools/plotfingerprint/main.nf index 1355f46d..0dba2ff7 100644 --- a/modules/nf-core/deeptools/plotfingerprint/main.nf +++ b/modules/nf-core/deeptools/plotfingerprint/main.nf @@ -4,8 +4,8 @@ process DEEPTOOLS_PLOTFINGERPRINT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : - 'biocontainers/deeptools:3.5.1--py_0' }" + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.5--pyhdfd78af_0': + 'biocontainers/deeptools:3.5.5--pyhdfd78af_0' }" input: tuple val(meta), path(bams), path(bais) @@ -38,4 +38,17 @@ process DEEPTOOLS_PLOTFINGERPRINT { deeptools: \$(plotFingerprint --version | sed -e "s/plotFingerprint //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.plotFingerprint.pdf + touch ${prefix}.plotFingerprint.raw.txt + touch ${prefix}.plotFingerprint.qcmetrics.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(plotFingerprint --version | sed -e "s/plotFingerprint //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test b/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test new file mode 100644 index 00000000..818c6c9f --- /dev/null +++ b/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test @@ -0,0 +1,62 @@ +nextflow_process { + + name "Test Process DEEPTOOLS_PLOTFINGERPRINT" + script "../main.nf" + process "DEEPTOOLS_PLOTFINGERPRINT" + + tag "modules" + tag "modules_nfcore" + tag "deeptools" + tag "deeptools/plotfingerprint" + + test("homo_sampiens - bam") { + + when { + process { + """ + input[0] = [ + [ 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/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.pdf.get(0).get(1)).name, + file(process.out.matrix.get(0).get(1)).name, + process.out.metrics.collect { file(it[1]).readLines().contains("0.24184576629880325") }, + process.out.versions) + .match() + } + ) + } + } + + test("homo_sampiens - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ 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/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test.snap b/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test.snap new file mode 100644 index 00000000..502f8cd6 --- /dev/null +++ b/modules/nf-core/deeptools/plotfingerprint/tests/main.nf.test.snap @@ -0,0 +1,90 @@ +{ + "homo_sampiens - bam": { + "content": [ + "test.plotFingerprint.pdf", + "test.plotFingerprint.raw.txt", + [ + false + ], + [ + "versions.yml:md5,2dd872e44f5b7284c080491607d9b42a" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:14:38.559795237" + }, + "homo_sampiens - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.raw.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.qcmetrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,2dd872e44f5b7284c080491607d9b42a" + ], + "matrix": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.raw.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.qcmetrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotFingerprint.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,2dd872e44f5b7284c080491607d9b42a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:14:45.23521809" + } +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/plotfingerprint/tests/tags.yml b/modules/nf-core/deeptools/plotfingerprint/tests/tags.yml new file mode 100644 index 00000000..372cefc9 --- /dev/null +++ b/modules/nf-core/deeptools/plotfingerprint/tests/tags.yml @@ -0,0 +1,2 @@ +deeptools/bamcoverage: + - "modules/nf-core/deeptools/bamcoverage/**" diff --git a/modules/nf-core/deeptools/plotheatmap/environment.yml b/modules/nf-core/deeptools/plotheatmap/environment.yml index 05f2b3ca..3e0f5599 100644 --- a/modules/nf-core/deeptools/plotheatmap/environment.yml +++ b/modules/nf-core/deeptools/plotheatmap/environment.yml @@ -1,7 +1,9 @@ -name: deeptools_plotheatmap +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "deeptools_plotheatmap" channels: - conda-forge - bioconda - defaults dependencies: - - bioconda::deeptools=3.5.1 + - "bioconda::deeptools=3.5.5" diff --git a/modules/nf-core/deeptools/plotheatmap/main.nf b/modules/nf-core/deeptools/plotheatmap/main.nf index 3a5ba4cc..0bc6d148 100644 --- a/modules/nf-core/deeptools/plotheatmap/main.nf +++ b/modules/nf-core/deeptools/plotheatmap/main.nf @@ -4,8 +4,8 @@ process DEEPTOOLS_PLOTHEATMAP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : - 'biocontainers/deeptools:3.5.1--py_0' }" + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.5--pyhdfd78af_0': + 'biocontainers/deeptools:3.5.5--pyhdfd78af_0' }" input: tuple val(meta), path(matrix) @@ -33,4 +33,16 @@ process DEEPTOOLS_PLOTHEATMAP { deeptools: \$(plotHeatmap --version | sed -e "s/plotHeatmap //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.plotHeatmap.pdf + touch ${prefix}.plotHeatmap.mat.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(plotFingerprint --version | sed -e "s/plotFingerprint //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test b/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test new file mode 100644 index 00000000..b0bcaa9c --- /dev/null +++ b/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process DEEPTOOLS_PLOTHEATMAP" + script "../main.nf" + process "DEEPTOOLS_PLOTHEATMAP" + + tag "modules" + tag "modules_nfcore" + tag "deeptools" + tag "deeptools/plotheatmap" + + test("sarscov2 - mat") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/deeptools/test.computeMatrix.mat.gz', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.pdf.get(0).get(1)).name, + file(process.out.table.get(0).get(1)).name, + process.out.versions) + .match() + } + ) + } + + } + + test("sarscov2 - mat - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/deeptools/test.computeMatrix.mat.gz', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test.snap b/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test.snap new file mode 100644 index 00000000..6cf07363 --- /dev/null +++ b/modules/nf-core/deeptools/plotheatmap/tests/main.nf.test.snap @@ -0,0 +1,69 @@ +{ + "sarscov2 - mat - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotHeatmap.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotHeatmap.mat.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,f4040282400b8087dc94f1fa0b1cfefc" + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotHeatmap.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotHeatmap.mat.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f4040282400b8087dc94f1fa0b1cfefc" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:17:23.70673465" + }, + "sarscov2 - mat": { + "content": [ + "test.plotHeatmap.pdf", + "test.plotHeatmap.mat.tab", + [ + "versions.yml:md5,f4040282400b8087dc94f1fa0b1cfefc" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:17:17.327116658" + } +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/plotheatmap/tests/tags.yml b/modules/nf-core/deeptools/plotheatmap/tests/tags.yml new file mode 100644 index 00000000..1c94a745 --- /dev/null +++ b/modules/nf-core/deeptools/plotheatmap/tests/tags.yml @@ -0,0 +1,2 @@ +deeptools/plotheatmap: + - "modules/nf-core/deeptools/plotheatmap/**" diff --git a/modules/nf-core/deeptools/plotprofile/environment.yml b/modules/nf-core/deeptools/plotprofile/environment.yml index 7ee9c7da..44784d3a 100644 --- a/modules/nf-core/deeptools/plotprofile/environment.yml +++ b/modules/nf-core/deeptools/plotprofile/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::deeptools=3.5.1 + - "bioconda::deeptools=3.5.5" diff --git a/modules/nf-core/deeptools/plotprofile/main.nf b/modules/nf-core/deeptools/plotprofile/main.nf index df799984..4e9b44bd 100644 --- a/modules/nf-core/deeptools/plotprofile/main.nf +++ b/modules/nf-core/deeptools/plotprofile/main.nf @@ -4,8 +4,8 @@ process DEEPTOOLS_PLOTPROFILE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : - 'biocontainers/deeptools:3.5.1--py_0' }" + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.5--pyhdfd78af_0': + 'biocontainers/deeptools:3.5.5--pyhdfd78af_0' }" input: tuple val(meta), path(matrix) @@ -33,4 +33,16 @@ process DEEPTOOLS_PLOTPROFILE { deeptools: \$(plotProfile --version | sed -e "s/plotProfile //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.plotProfile.pdf + touch ${prefix}.plotProfile.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(plotProfile --version | sed -e "s/plotProfile //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/deeptools/plotprofile/tests/main.nf.test b/modules/nf-core/deeptools/plotprofile/tests/main.nf.test new file mode 100644 index 00000000..fe52873b --- /dev/null +++ b/modules/nf-core/deeptools/plotprofile/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process DEEPTOOLS_PLOTPROFILE" + script "../main.nf" + process "DEEPTOOLS_PLOTPROFILE" + + tag "modules" + tag "modules_nfcore" + tag "deeptools" + tag "deeptools/plotprofile" + + test("sarscov2 - mat") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/deeptools/test.computeMatrix.mat.gz', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.pdf.get(0).get(1)).name, + file(process.out.table.get(0).get(1)).name, + process.out.versions) + .match() + } + ) + } + + } + + test("sarscov2 - mat - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/deeptools/test.computeMatrix.mat.gz', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/deeptools/plotprofile/tests/main.nf.test.snap b/modules/nf-core/deeptools/plotprofile/tests/main.nf.test.snap new file mode 100644 index 00000000..17bef5cf --- /dev/null +++ b/modules/nf-core/deeptools/plotprofile/tests/main.nf.test.snap @@ -0,0 +1,69 @@ +{ + "sarscov2 - mat - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotProfile.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotProfile.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,668bc5d10cff87bd952f8b9294416ac3" + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotProfile.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.plotProfile.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,668bc5d10cff87bd952f8b9294416ac3" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:20:41.694233491" + }, + "sarscov2 - mat": { + "content": [ + "test.plotProfile.pdf", + "test.plotProfile.tab", + [ + "versions.yml:md5,668bc5d10cff87bd952f8b9294416ac3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-05T10:20:35.515374962" + } +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/plotprofile/tests/tags.yml b/modules/nf-core/deeptools/plotprofile/tests/tags.yml new file mode 100644 index 00000000..60c02215 --- /dev/null +++ b/modules/nf-core/deeptools/plotprofile/tests/tags.yml @@ -0,0 +1,2 @@ +deeptools/plotprofile: + - "modules/nf-core/deeptools/plotprofile/**" From 6de603269384665cd6874687076f01754961ed6f Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 6 Aug 2024 12:28:42 +0200 Subject: [PATCH 06/11] Update modules.json --- modules.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules.json b/modules.json index 7d06c2b6..6e71feb0 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "bowtie2/align": { "branch": "master", - "git_sha": "e4bad511789f16d0df39ee306b2cd50418365048", + "git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb", "installed_by": ["fastq_align_bowtie2", "modules"] }, "bowtie2/build": { @@ -22,17 +22,17 @@ }, "bwa/mem": { "branch": "master", - "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", + "git_sha": "2201e21b09213f083832ac58e33353d410a6fde7", "installed_by": ["fastq_align_bwa", "modules"] }, "chromap/chromap": { "branch": "master", - "git_sha": "4bd9481c5718ca7bfd31459b8242c349171dac87", - "installed_by": ["modules", "fastq_align_chromap"] + "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", + "installed_by": ["fastq_align_chromap", "modules"] }, "chromap/index": { "branch": "master", - "git_sha": "4bd9481c5718ca7bfd31459b8242c349171dac87", + "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", "installed_by": ["modules"] }, "custom/getchromsizes": { @@ -42,22 +42,22 @@ }, "deeptools/computematrix": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", "installed_by": ["modules"] }, "deeptools/plotfingerprint": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", "installed_by": ["modules"] }, "deeptools/plotheatmap": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", "installed_by": ["modules"] }, "deeptools/plotprofile": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", "installed_by": ["modules"] }, "fastqc": { From cc2b13e38ffcd0cf201a1d3032dc962e1ad63ce6 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 6 Aug 2024 18:04:08 +0200 Subject: [PATCH 07/11] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc0d258..5a1af0a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[#378](https://github.com/nf-core/chipseq/issues/378)] - Switch from macs2 to macs3. - [[#347](https://github.com/nf-core/chipseq/issues/347)] - Add read group tag to bam files processed by bowtie2. - [[PR #406](https://github.com/nf-core/chipseq/pull/406)] - Update metro map to show macs3 instead of macs2. +- [[#409](https://github.com/nf-core/chipseq/issues/409)] - Bulk modules and subworkflows update. ### Software dependencies From b209c18d16e4b81dd0033014d8b76cbf077aa3d7 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 7 Aug 2024 11:38:47 +0200 Subject: [PATCH 08/11] Patch chromap/chromap module to include read group (otherwise picard/markduplicates erroring) --- conf/modules.config | 1 + modules.json | 194 ++++++++++++++---- .../chromap/chromap/chromap-chromap.diff | 41 ++++ modules/nf-core/chromap/chromap/main.nf | 7 +- 4 files changed, 196 insertions(+), 47 deletions(-) create mode 100644 modules/nf-core/chromap/chromap/chromap-chromap.diff diff --git a/conf/modules.config b/conf/modules.config index 22ae4ec0..a6d8ebf2 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -262,6 +262,7 @@ if (params.aligner == 'chromap') { withName: CHROMAP_CHROMAP { ext.args = '-l 2000 --low-mem --SAM' + ext.args3 = { meta.read_group ? "-r ${meta.read_group}" : '' } ext.prefix = { "${meta.id}.Lb" } publishDir = [ path: { "${params.outdir}/${params.aligner}/library" }, diff --git a/modules.json b/modules.json index 6e71feb0..8a0d3bdf 100644 --- a/modules.json +++ b/modules.json @@ -8,172 +8,253 @@ "bowtie2/align": { "branch": "master", "git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb", - "installed_by": ["fastq_align_bowtie2", "modules"] + "installed_by": [ + "fastq_align_bowtie2", + "modules" + ] }, "bowtie2/build": { "branch": "master", "git_sha": "1fea64f5132a813ec97c1c6d3a74e0aee7142b6d", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bwa/index": { "branch": "master", "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bwa/mem": { "branch": "master", "git_sha": "2201e21b09213f083832ac58e33353d410a6fde7", - "installed_by": ["fastq_align_bwa", "modules"] + "installed_by": [ + "fastq_align_bwa", + "modules" + ] }, "chromap/chromap": { "branch": "master", "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", - "installed_by": ["fastq_align_chromap", "modules"] + "installed_by": [ + "fastq_align_chromap", + "modules" + ], + "patch": "modules/nf-core/chromap/chromap/chromap-chromap.diff" }, "chromap/index": { "branch": "master", "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "custom/getchromsizes": { "branch": "master", "git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "deeptools/computematrix": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "deeptools/plotfingerprint": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "deeptools/plotheatmap": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "deeptools/plotprofile": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "fastqc": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] + "installed_by": [ + "fastq_fastqc_umitools_trimgalore", + "modules" + ] }, "gffread": { "branch": "master", "git_sha": "6c996d7fbe0816dcbb68ce587ad5f873313682a1", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "gunzip": { "branch": "master", "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "homer/annotatepeaks": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "khmer/uniquekmers": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "macs3/callpeak": { "branch": "master", "git_sha": "3a3f471ed42f640115b2661edee5b258e6a254c1", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "multiqc": { "branch": "master", "git_sha": "b80f5fd12ff7c43938f424dd76392a2704fa2396", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "phantompeakqualtools": { "branch": "master", "git_sha": "2dfe9afa90fefc70e320140e5f41287f01f324b0", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "picard/collectmultiplemetrics": { "branch": "master", "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "picard/markduplicates": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_markduplicates_picard", "modules"] + "installed_by": [ + "bam_markduplicates_picard", + "modules" + ] }, "picard/mergesamfiles": { "branch": "master", "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "preseq/lcextrap": { "branch": "master", "git_sha": "2c6b1144ed58b6184ad58fc4e6b6a90219b4bf4f", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/flagstat": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_stats_samtools", "modules"] + "installed_by": [ + "bam_stats_samtools", + "modules" + ] }, "samtools/idxstats": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_stats_samtools", "modules"] + "installed_by": [ + "bam_stats_samtools", + "modules" + ] }, "samtools/index": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools", "modules"] + "installed_by": [ + "bam_markduplicates_picard", + "bam_sort_stats_samtools", + "modules" + ] }, "samtools/sort": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_sort_stats_samtools", "modules"] + "installed_by": [ + "bam_sort_stats_samtools", + "modules" + ] }, "samtools/stats": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["bam_stats_samtools", "modules"] + "installed_by": [ + "bam_stats_samtools", + "modules" + ] }, "subread/featurecounts": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "trimgalore": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] + "installed_by": [ + "fastq_fastqc_umitools_trimgalore", + "modules" + ] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "umitools/extract": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": ["fastq_fastqc_umitools_trimgalore"] + "installed_by": [ + "fastq_fastqc_umitools_trimgalore" + ] }, "untar": { "branch": "master", "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "untarfiles": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] } } }, @@ -182,55 +263,78 @@ "bam_markduplicates_picard": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "bam_sort_stats_samtools": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["fastq_align_bowtie2", "fastq_align_bwa", "fastq_align_chromap"] + "installed_by": [ + "fastq_align_bowtie2", + "fastq_align_bwa", + "fastq_align_chromap" + ] }, "bam_stats_samtools": { "branch": "master", "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", - "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools"] + "installed_by": [ + "bam_markduplicates_picard", + "bam_sort_stats_samtools" + ] }, "fastq_align_bowtie2": { "branch": "master", "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "fastq_align_bwa": { "branch": "master", "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "fastq_align_chromap": { "branch": "master", "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "fastq_fastqc_umitools_trimgalore": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "utils_nextflow_pipeline": { "branch": "master", "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "utils_nfcore_pipeline": { "branch": "master", "git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "utils_nfvalidation_plugin": { "branch": "master", "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] } } } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/chromap/chromap/chromap-chromap.diff b/modules/nf-core/chromap/chromap/chromap-chromap.diff new file mode 100644 index 00000000..1abc6636 --- /dev/null +++ b/modules/nf-core/chromap/chromap/chromap-chromap.diff @@ -0,0 +1,41 @@ +Changes in module 'nf-core/chromap/chromap' +'modules/nf-core/chromap/chromap/meta.yml' is unchanged +Changes in 'chromap/chromap/main.nf': +--- modules/nf-core/chromap/chromap/main.nf ++++ modules/nf-core/chromap/chromap/main.nf +@@ -29,6 +29,7 @@ + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' ++ def args3 = task.ext.args3 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def args_list = args.tokenize() + +@@ -49,8 +50,10 @@ + def compression_cmds = "gzip -n ${prefix}.${file_extension}" + if (args.contains("--SAM")) { + compression_cmds = """ ++ samtools addreplacerg $args3 -o ${prefix}.rg.${file_extension} ${prefix}.${file_extension} + samtools view $args2 -@ $task.cpus -bh \\ +- -o ${prefix}.bam ${prefix}.${file_extension} ++ -o ${prefix}.bam ${prefix}.rg.${file_extension} ++ rm ${prefix}.rg.${file_extension} + rm ${prefix}.${file_extension} + """ + } +@@ -63,7 +66,7 @@ + -r $fasta \\ + -1 ${reads.join(',')} \\ + -o ${prefix}.${file_extension} +- ++ + $compression_cmds + + cat <<-END_VERSIONS > versions.yml + +'modules/nf-core/chromap/chromap/environment.yml' is unchanged +'modules/nf-core/chromap/chromap/tests/main.nf.test.snap' is unchanged +'modules/nf-core/chromap/chromap/tests/tags.yml' is unchanged +'modules/nf-core/chromap/chromap/tests/nextflow.config' is unchanged +'modules/nf-core/chromap/chromap/tests/main.nf.test' is unchanged +************************************************************ diff --git a/modules/nf-core/chromap/chromap/main.nf b/modules/nf-core/chromap/chromap/main.nf index 1a00acbb..61701f2e 100644 --- a/modules/nf-core/chromap/chromap/main.nf +++ b/modules/nf-core/chromap/chromap/main.nf @@ -29,6 +29,7 @@ process CHROMAP_CHROMAP { script: def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def args_list = args.tokenize() @@ -49,8 +50,10 @@ process CHROMAP_CHROMAP { def compression_cmds = "gzip -n ${prefix}.${file_extension}" if (args.contains("--SAM")) { compression_cmds = """ + samtools addreplacerg $args3 -o ${prefix}.rg.${file_extension} ${prefix}.${file_extension} samtools view $args2 -@ $task.cpus -bh \\ - -o ${prefix}.bam ${prefix}.${file_extension} + -o ${prefix}.bam ${prefix}.rg.${file_extension} + rm ${prefix}.rg.${file_extension} rm ${prefix}.${file_extension} """ } @@ -63,7 +66,7 @@ process CHROMAP_CHROMAP { -r $fasta \\ -1 ${reads.join(',')} \\ -o ${prefix}.${file_extension} - + $compression_cmds cat <<-END_VERSIONS > versions.yml From fce3e6cb2bab0e7fb2f6837b2ff8c67646d4ad7a Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Wed, 7 Aug 2024 09:44:02 +0000 Subject: [PATCH 09/11] Make lint happy --- modules.json | 193 ++++++++++++--------------------------------------- 1 file changed, 45 insertions(+), 148 deletions(-) diff --git a/modules.json b/modules.json index 8a0d3bdf..61773461 100644 --- a/modules.json +++ b/modules.json @@ -8,253 +8,173 @@ "bowtie2/align": { "branch": "master", "git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb", - "installed_by": [ - "fastq_align_bowtie2", - "modules" - ] + "installed_by": ["fastq_align_bowtie2", "modules"] }, "bowtie2/build": { "branch": "master", "git_sha": "1fea64f5132a813ec97c1c6d3a74e0aee7142b6d", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bwa/index": { "branch": "master", "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bwa/mem": { "branch": "master", "git_sha": "2201e21b09213f083832ac58e33353d410a6fde7", - "installed_by": [ - "fastq_align_bwa", - "modules" - ] + "installed_by": ["fastq_align_bwa", "modules"] }, "chromap/chromap": { "branch": "master", "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", - "installed_by": [ - "fastq_align_chromap", - "modules" - ], + "installed_by": ["fastq_align_chromap", "modules"], "patch": "modules/nf-core/chromap/chromap/chromap-chromap.diff" }, "chromap/index": { "branch": "master", "git_sha": "8438ab16df8334b8e15526cef7e8eda7f218ea20", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "custom/getchromsizes": { "branch": "master", "git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "deeptools/computematrix": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "deeptools/plotfingerprint": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "deeptools/plotheatmap": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "deeptools/plotprofile": { "branch": "master", "git_sha": "dd51244ab3b1e4a30ddeb93ba3c6ef3ce1f02ef8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "fastqc": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "fastq_fastqc_umitools_trimgalore", - "modules" - ] + "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] }, "gffread": { "branch": "master", "git_sha": "6c996d7fbe0816dcbb68ce587ad5f873313682a1", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "gunzip": { "branch": "master", "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "homer/annotatepeaks": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "khmer/uniquekmers": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "macs3/callpeak": { "branch": "master", "git_sha": "3a3f471ed42f640115b2661edee5b258e6a254c1", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "multiqc": { "branch": "master", "git_sha": "b80f5fd12ff7c43938f424dd76392a2704fa2396", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "phantompeakqualtools": { "branch": "master", "git_sha": "2dfe9afa90fefc70e320140e5f41287f01f324b0", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "picard/collectmultiplemetrics": { "branch": "master", "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "picard/markduplicates": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_markduplicates_picard", - "modules" - ] + "installed_by": ["bam_markduplicates_picard", "modules"] }, "picard/mergesamfiles": { "branch": "master", "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "preseq/lcextrap": { "branch": "master", "git_sha": "2c6b1144ed58b6184ad58fc4e6b6a90219b4bf4f", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/flagstat": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_stats_samtools", - "modules" - ] + "installed_by": ["bam_stats_samtools", "modules"] }, "samtools/idxstats": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_stats_samtools", - "modules" - ] + "installed_by": ["bam_stats_samtools", "modules"] }, "samtools/index": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_markduplicates_picard", - "bam_sort_stats_samtools", - "modules" - ] + "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools", "modules"] }, "samtools/sort": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_sort_stats_samtools", - "modules" - ] + "installed_by": ["bam_sort_stats_samtools", "modules"] }, "samtools/stats": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "bam_stats_samtools", - "modules" - ] + "installed_by": ["bam_stats_samtools", "modules"] }, "subread/featurecounts": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "trimgalore": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": [ - "fastq_fastqc_umitools_trimgalore", - "modules" - ] + "installed_by": ["fastq_fastqc_umitools_trimgalore", "modules"] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "umitools/extract": { "branch": "master", "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", - "installed_by": [ - "fastq_fastqc_umitools_trimgalore" - ] + "installed_by": ["fastq_fastqc_umitools_trimgalore"] }, "untar": { "branch": "master", "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "untarfiles": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] } } }, @@ -263,78 +183,55 @@ "bam_markduplicates_picard": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "bam_sort_stats_samtools": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "fastq_align_bowtie2", - "fastq_align_bwa", - "fastq_align_chromap" - ] + "installed_by": ["fastq_align_bowtie2", "fastq_align_bwa", "fastq_align_chromap"] }, "bam_stats_samtools": { "branch": "master", "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", - "installed_by": [ - "bam_markduplicates_picard", - "bam_sort_stats_samtools" - ] + "installed_by": ["bam_markduplicates_picard", "bam_sort_stats_samtools"] }, "fastq_align_bowtie2": { "branch": "master", "git_sha": "0eacd714effe5aac1c1de26593873960b3346cab", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "fastq_align_bwa": { "branch": "master", "git_sha": "e0ff65e1fb313677de09f5f477ae3da30ce19b7b", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "fastq_align_chromap": { "branch": "master", "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "fastq_fastqc_umitools_trimgalore": { "branch": "master", "git_sha": "46eca555142d6e597729fcb682adcc791796f514", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "utils_nextflow_pipeline": { "branch": "master", "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "utils_nfcore_pipeline": { "branch": "master", "git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] }, "utils_nfvalidation_plugin": { "branch": "master", "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", - "installed_by": [ - "subworkflows" - ] + "installed_by": ["subworkflows"] } } } } } -} \ No newline at end of file +} From ab04e585c48c19a9015673266460e6fea2f00c20 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 8 Aug 2024 19:05:43 +0200 Subject: [PATCH 10/11] Update multiqc version --- assets/multiqc_config.yml | 11 ----------- modules/local/multiqc.nf | 6 +++--- workflows/chipseq.nf | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 4f32837d..af939cf9 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -7,17 +7,6 @@ data_format: "yaml" export_plots: true -run_modules: - - custom_content - - fastqc - - cutadapt - - samtools - - picard - - preseq - - featureCounts - - deeptools - - phantompeakqualtools - exclude_modules: - "general_stats" diff --git a/modules/local/multiqc.nf b/modules/local/multiqc.nf index db64f9d7..35596842 100644 --- a/modules/local/multiqc.nf +++ b/modules/local/multiqc.nf @@ -1,10 +1,10 @@ process MULTIQC { label 'process_medium' - conda "bioconda::multiqc=1.13a" + conda "bioconda::multiqc=1.23" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.13a--pyhdfd78af_1': - 'biocontainers/multiqc:1.13a--pyhdfd78af_1' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.23--pyhdfd78af_0' : + 'biocontainers/multiqc:1.23--pyhdfd78af_0' }" input: path workflow_summary diff --git a/workflows/chipseq.nf b/workflows/chipseq.nf index 491d5f53..b79a675a 100644 --- a/workflows/chipseq.nf +++ b/workflows/chipseq.nf @@ -519,7 +519,7 @@ workflow CHIPSEQ { // Collate and save software versions // softwareVersionsToYAML(ch_versions) - .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_atacseq_software_mqc_versions.yml', sort: true, newLine: true) + .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_chipseq_software_mqc_versions.yml', sort: true, newLine: true) .set { ch_collated_versions } // From 2cc4f57708dae028ebeba875382186dc2a5abbc9 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 8 Aug 2024 19:08:55 +0200 Subject: [PATCH 11/11] Update changelog with updated versions --- CHANGELOG.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a1af0a9..652e3fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,14 +36,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Note, since the pipeline is now using Nextflow DSL2, each process will be run with its own [Biocontainer](https://biocontainers.pro/#/registry). This means that on occasion it is entirely possible for the pipeline to be using different versions of the same tool. However, the overall software dependency changes compared to the last release have been listed below for reference. -| Dependency | Old version | New version | -| ---------- | ----------- | ----------- | -| `chromap` | 0.2.1 | 0.2.4 | -| `macs2` | 2.2.7.1 | | -| `macs3` | | 3.0.1 | -| `multiqc` | 1.13 | 1.14 | -| `picard` | 2.27.4 | 3.0.0 | -| `samtools` | 1.15.1 | 1.17 | +| Dependency | Old version | New version | +| ----------------------- | ----------- | ----------- | +| `bowtie2` | 2.4.4 | 2.5.2 | +| `bwa` | 0.7.17 | 0.7.18 | +| `chromap` | 0.2.1 | 0.2.6 | +| `deeptools` | 3.5.1 | 3.5.5 | +| `fastqc` | 0.11.9 | 0.12.1 | +| `gffread` | 0.12.1 | 0.12.7 | +| `gffread` | 0.12.1 | 0.12.7 | +| `macs2` | 2.2.7.1 | | +| `macs3` | | 3.0.1 | +| `multiqc` | 1.13 | 1.23 | +| `picard` | 2.27.4 | 3.2.0 | +| `samtools` | 1.15.1 | 1.20 | +| `samtools` | 1.15.1 | 1.20 | +| `ucsc-bedgraphtobigwig` | 377 | 445 | +| `umi_tools` | | 1.1.5 | > **NB:** Dependency has been **updated** if both old and new version information is present. > **NB:** Dependency has been **added** if just the new version information is present.