From 277af7d8801f0f30af827c0a484e67e30f35a41e Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 10:17:04 +0000 Subject: [PATCH 1/8] Update FastQC and UMItools modules --- modules.json | 44 +- modules/nf-core/fastp/environment.yml | 7 + modules/nf-core/fastp/main.nf | 2 +- modules/nf-core/fastp/meta.yml | 4 +- modules/nf-core/fastp/tests/main.nf.test | 485 ++++++++++++++++++ modules/nf-core/fastp/tests/main.nf.test.snap | 52 ++ modules/nf-core/fastp/tests/nextflow.config | 6 + modules/nf-core/fastp/tests/tags.yml | 2 + modules/nf-core/fastqc/environment.yml | 7 + modules/nf-core/fastqc/main.nf | 6 +- modules/nf-core/fastqc/meta.yml | 5 + modules/nf-core/fastqc/tests/main.nf.test | 73 ++- modules/nf-core/fastqc/tests/tags.yml | 2 + .../picard/markduplicates/environment.yml | 7 + modules/nf-core/picard/markduplicates/main.nf | 6 +- .../nf-core/picard/markduplicates/meta.yml | 4 + .../picard/markduplicates/tests/main.nf.test | 111 ++++ .../markduplicates/tests/main.nf.test.snap | 44 ++ .../markduplicates/tests/nextflow.config | 6 + .../picard/markduplicates/tests/tags.yml | 2 + .../nf-core/samtools/flagstat/environment.yml | 7 + modules/nf-core/samtools/flagstat/main.nf | 6 +- modules/nf-core/samtools/flagstat/meta.yml | 2 + .../samtools/flagstat/tests/main.nf.test | 36 ++ .../samtools/flagstat/tests/main.nf.test.snap | 16 + .../nf-core/samtools/flagstat/tests/tags.yml | 2 + .../nf-core/samtools/idxstats/environment.yml | 7 + modules/nf-core/samtools/idxstats/main.nf | 6 +- modules/nf-core/samtools/idxstats/meta.yml | 2 + .../samtools/idxstats/tests/main.nf.test | 36 ++ .../samtools/idxstats/tests/main.nf.test.snap | 16 + .../nf-core/samtools/idxstats/tests/tags.yml | 2 + .../nf-core/samtools/index/environment.yml | 7 + modules/nf-core/samtools/index/main.nf | 6 +- modules/nf-core/samtools/index/meta.yml | 4 + .../samtools/index/tests/csi.nextflow.config | 7 + .../nf-core/samtools/index/tests/main.nf.test | 87 ++++ .../samtools/index/tests/main.nf.test.snap | 28 + modules/nf-core/samtools/index/tests/tags.yml | 2 + modules/nf-core/samtools/sort/environment.yml | 7 + modules/nf-core/samtools/sort/main.nf | 6 +- modules/nf-core/samtools/sort/meta.yml | 3 + .../nf-core/samtools/sort/tests/main.nf.test | 73 +++ .../samtools/sort/tests/main.nf.test.snap | 48 ++ .../samtools/sort/tests/nextflow.config | 7 + modules/nf-core/samtools/sort/tests/tags.yml | 3 + .../nf-core/samtools/stats/environment.yml | 7 + modules/nf-core/samtools/stats/main.nf | 6 +- modules/nf-core/samtools/stats/meta.yml | 4 + .../nf-core/samtools/stats/tests/main.nf.test | 78 +++ .../samtools/stats/tests/main.nf.test.snap | 64 +++ modules/nf-core/samtools/stats/tests/tags.yml | 2 + modules/nf-core/trimgalore/environment.yml | 7 + modules/nf-core/trimgalore/main.nf | 2 +- modules/nf-core/trimgalore/meta.yml | 4 + modules/nf-core/trimgalore/tests/main.nf.test | 105 ++++ .../trimgalore/tests/main.nf.test.snap | 148 ++++++ modules/nf-core/trimgalore/tests/tags.yml | 2 + .../nf-core/umitools/dedup/environment.yml | 7 + modules/nf-core/umitools/dedup/main.nf | 6 +- modules/nf-core/umitools/dedup/meta.yml | 9 +- .../nf-core/umitools/extract/environment.yml | 7 + modules/nf-core/umitools/extract/main.nf | 6 +- modules/nf-core/umitools/extract/meta.yml | 17 +- .../umitools/extract/tests/main.nf.test | 35 ++ .../umitools/extract/tests/main.nf.test.snap | 10 + .../umitools/extract/tests/nextflow.config | 9 + .../nf-core/umitools/extract/tests/tags.yml | 2 + .../meta.yml | 4 +- .../tests/main.nf.test | 51 ++ .../tests/main.nf.test.snap | 41 ++ .../tests/tags.yml | 2 + .../bam_markduplicates_picard/meta.yml | 5 +- .../nf-core/bam_sort_stats_samtools/meta.yml | 3 + .../tests/main.nf.test | 78 +++ .../tests/main.nf.test.snap | 86 ++++ .../bam_sort_stats_samtools/tests/tags.yml | 2 + .../nf-core/bam_stats_samtools/meta.yml | 2 + .../bam_stats_samtools/tests/main.nf.test | 102 ++++ .../tests/main.nf.test.snap | 128 +++++ .../nf-core/bam_stats_samtools/tests/tags.yml | 2 + .../fastq_fastqc_umitools_fastp/meta.yml | 8 +- .../tests/main.nf.test | 60 +++ .../tests/main.nf.test.snap | 81 +++ .../tests/tags.yml | 2 + .../fastq_fastqc_umitools_trimgalore/meta.yml | 10 +- 86 files changed, 2432 insertions(+), 73 deletions(-) create mode 100644 modules/nf-core/fastp/environment.yml create mode 100644 modules/nf-core/fastp/tests/main.nf.test create mode 100644 modules/nf-core/fastp/tests/main.nf.test.snap create mode 100644 modules/nf-core/fastp/tests/nextflow.config create mode 100644 modules/nf-core/fastp/tests/tags.yml create mode 100644 modules/nf-core/fastqc/environment.yml create mode 100644 modules/nf-core/fastqc/tests/tags.yml create mode 100644 modules/nf-core/picard/markduplicates/environment.yml create mode 100644 modules/nf-core/picard/markduplicates/tests/main.nf.test create mode 100644 modules/nf-core/picard/markduplicates/tests/main.nf.test.snap create mode 100644 modules/nf-core/picard/markduplicates/tests/nextflow.config create mode 100644 modules/nf-core/picard/markduplicates/tests/tags.yml create mode 100644 modules/nf-core/samtools/flagstat/environment.yml create mode 100644 modules/nf-core/samtools/flagstat/tests/main.nf.test create mode 100644 modules/nf-core/samtools/flagstat/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/flagstat/tests/tags.yml create mode 100644 modules/nf-core/samtools/idxstats/environment.yml create mode 100644 modules/nf-core/samtools/idxstats/tests/main.nf.test create mode 100644 modules/nf-core/samtools/idxstats/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/idxstats/tests/tags.yml create mode 100644 modules/nf-core/samtools/index/environment.yml create mode 100644 modules/nf-core/samtools/index/tests/csi.nextflow.config create mode 100644 modules/nf-core/samtools/index/tests/main.nf.test create mode 100644 modules/nf-core/samtools/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/index/tests/tags.yml create mode 100644 modules/nf-core/samtools/sort/environment.yml create mode 100644 modules/nf-core/samtools/sort/tests/main.nf.test create mode 100644 modules/nf-core/samtools/sort/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/sort/tests/nextflow.config create mode 100644 modules/nf-core/samtools/sort/tests/tags.yml create mode 100644 modules/nf-core/samtools/stats/environment.yml create mode 100644 modules/nf-core/samtools/stats/tests/main.nf.test create mode 100644 modules/nf-core/samtools/stats/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/stats/tests/tags.yml create mode 100644 modules/nf-core/trimgalore/environment.yml create mode 100644 modules/nf-core/trimgalore/tests/main.nf.test create mode 100644 modules/nf-core/trimgalore/tests/main.nf.test.snap create mode 100644 modules/nf-core/trimgalore/tests/tags.yml create mode 100644 modules/nf-core/umitools/dedup/environment.yml create mode 100644 modules/nf-core/umitools/extract/environment.yml create mode 100644 modules/nf-core/umitools/extract/tests/main.nf.test create mode 100644 modules/nf-core/umitools/extract/tests/main.nf.test.snap create mode 100644 modules/nf-core/umitools/extract/tests/nextflow.config create mode 100644 modules/nf-core/umitools/extract/tests/tags.yml create mode 100644 subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/tags.yml create mode 100644 subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_sort_stats_samtools/tests/tags.yml create mode 100644 subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_stats_samtools/tests/tags.yml create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml diff --git a/modules.json b/modules.json index 74bd0d197..a469fc895 100644 --- a/modules.json +++ b/modules.json @@ -27,12 +27,12 @@ }, "fastp": { "branch": "master", - "git_sha": "d497a4868ace3302016ea8ed4b395072d5e833cd", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["fastq_fastqc_umitools_fastp", "modules"] }, "fastqc": { "branch": "master", - "git_sha": "102cc9b709a6da9f7cee2373563ab1464fca9c0a", + "git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53", "installed_by": ["fastq_fastqc_umitools_trimgalore", "fastq_fastqc_umitools_fastp"] }, "fq/subsample": { @@ -77,7 +77,7 @@ }, "picard/markduplicates": { "branch": "master", - "git_sha": "2ee934606f1fdf7fc1cb05d6e8abc13bec8ab448", + "git_sha": "20b0918591d4ba20047d7e13e5094bcceba81447", "installed_by": ["bam_markduplicates_picard"] }, "preseq/lcextrap": { @@ -152,31 +152,31 @@ }, "samtools/flagstat": { "branch": "master", - "git_sha": "570ec5bcfe19c49e16c9ca35a7a116563af6cc1c", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["bam_stats_samtools"] }, "samtools/idxstats": { "branch": "master", - "git_sha": "e662ab16e0c11f1e62983e21de9871f59371a639", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["bam_stats_samtools"] }, "samtools/index": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": [ + "bam_dedup_stats_samtools_umitools", "bam_markduplicates_picard", - "bam_sort_stats_samtools", - "bam_dedup_stats_samtools_umitools" + "bam_sort_stats_samtools" ] }, "samtools/sort": { "branch": "master", - "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["bam_sort_stats_samtools"] }, "samtools/stats": { "branch": "master", - "git_sha": "735e1e04e7e01751d2d6e97055bbdb6f70683cc1", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["bam_stats_samtools"] }, "sortmerna": { @@ -206,7 +206,7 @@ }, "trimgalore": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["fastq_fastqc_umitools_trimgalore"] }, "ucsc/bedclip": { @@ -221,13 +221,13 @@ }, "umitools/dedup": { "branch": "master", - "git_sha": "7297204bf49273300a3dbfa4b7a4027c8683f1bd", + "git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53", "installed_by": ["bam_dedup_stats_samtools_umitools"] }, "umitools/extract": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["fastq_fastqc_umitools_fastp", "fastq_fastqc_umitools_trimgalore"] + "git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53", + "installed_by": ["fastq_fastqc_umitools_trimgalore", "fastq_fastqc_umitools_fastp"] }, "untar": { "branch": "master", @@ -240,12 +240,12 @@ "nf-core": { "bam_dedup_stats_samtools_umitools": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["subworkflows"] }, "bam_markduplicates_picard": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", "installed_by": ["subworkflows"] }, "bam_rseqc": { @@ -255,16 +255,16 @@ }, "bam_sort_stats_samtools": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["fastq_align_hisat2"] }, "bam_stats_samtools": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": [ - "bam_sort_stats_samtools", + "bam_dedup_stats_samtools_umitools", "bam_markduplicates_picard", - "bam_dedup_stats_samtools_umitools" + "bam_sort_stats_samtools" ] }, "bedgraph_bedclip_bedgraphtobigwig": { @@ -279,12 +279,12 @@ }, "fastq_fastqc_umitools_fastp": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "3e8b0c1144ccf60b7848efbdc2be285ff20b49ee", "installed_by": ["subworkflows"] }, "fastq_fastqc_umitools_trimgalore": { "branch": "master", - "git_sha": "dedc0e31087f3306101c38835d051bf49789445a", + "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", "installed_by": ["subworkflows"] }, "fastq_subsample_fq_salmon": { diff --git a/modules/nf-core/fastp/environment.yml b/modules/nf-core/fastp/environment.yml new file mode 100644 index 000000000..70389e664 --- /dev/null +++ b/modules/nf-core/fastp/environment.yml @@ -0,0 +1,7 @@ +name: fastp +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::fastp=0.23.4 diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index 831b7f128..c8e815aea 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -2,7 +2,7 @@ process FASTP { tag "$meta.id" label 'process_medium' - conda "bioconda::fastp=0.23.4" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/fastp:0.23.4--h5f740d0_0' : 'biocontainers/fastp:0.23.4--h5f740d0_0' }" diff --git a/modules/nf-core/fastp/meta.yml b/modules/nf-core/fastp/meta.yml index 197ea7ca6..c22a16abd 100644 --- a/modules/nf-core/fastp/meta.yml +++ b/modules/nf-core/fastp/meta.yml @@ -33,7 +33,6 @@ input: - save_merged: type: boolean description: Specify true to save all merged reads to the a file ending in `*.merged.fastq.gz` - output: - meta: type: map @@ -71,3 +70,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/fastp/tests/main.nf.test b/modules/nf-core/fastp/tests/main.nf.test new file mode 100644 index 000000000..f610b735e --- /dev/null +++ b/modules/nf-core/fastp/tests/main.nf.test @@ -0,0 +1,485 @@ +nextflow_process { + + name "Test Process FASTP" + script "../main.nf" + process "FASTP" + tag "modules" + tag "modules_nfcore" + tag "fastp" + + test("test_fastp_single_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + + input[0] = [ + [ id:'test', single_end:true ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "Q20 bases:12.922000 K (92.984097%)", + "single end (151 cycles)" ] + def log_text = [ "Q20 bases: 12922(92.9841%)", + "reads passed filter: 99" ] + def read_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { assert snapshot(process.out.json).match("test_fastp_single_end_json") }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("test_fastp_paired_end") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + + 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] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "Q20 bases:25.719000 K (93.033098%)", + "The input has little adapter percentage (~0.000000%), probably it's trimmed before."] + def log_text = [ "No adapter detected for read1", + "Q30 bases: 12281(88.3716%)"] + def json_text = ['"passed_filter_reads": 198'] + def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { json_text.each { json_part -> + { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } + } + }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("fastp test_fastp_interleaved") { + config './nextflow.config' + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_interleaved_fastq_gz'], checkIfExists: true) ] + ] + + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "Q20 bases:25.719000 K (93.033098%)", + "paired end (151 cycles + 151 cycles)"] + def log_text = [ "Q20 bases: 12922(92.9841%)", + "reads passed filter: 198"] + def read_lines = [ "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { assert snapshot(process.out.json).match("fastp test_fastp_interleaved_json") }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("test_fastp_single_end_trim_fail") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = true + save_merged = false + + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "Q20 bases:12.922000 K (92.984097%)", + "single end (151 cycles)"] + def log_text = [ "Q20 bases: 12922(92.9841%)", + "reads passed filter: 99" ] + def read_lines = [ "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } + } + }, + { failed_read_lines.each { failed_read_line -> + { assert path(process.out.reads_fail.get(0).get(1)).linesGzip.contains(failed_read_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { assert snapshot(process.out.json).match("test_fastp_single_end_trim_fail_json") }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("test_fastp_paired_end_trim_fail") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = true + save_merged = false + + 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] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "Q20 bases:25.719000 K (93.033098%)", + "The input has little adapter percentage (~0.000000%), probably it's trimmed before."] + def log_text = [ "No adapter detected for read1", + "Q30 bases: 12281(88.3716%)"] + def json_text = ['"passed_filter_reads": 198'] + def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { failed_read2_lines.each { failed_read2_line -> + { assert path(process.out.reads_fail.get(0).get(1).get(1)).linesGzip.contains(failed_read2_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { json_text.each { json_part -> + { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } + } + }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("test_fastp_paired_end_merged") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + + 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] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "
"] + def log_text = [ "Merged and filtered:", + "total reads: 75", + "total bases: 13683"] + def json_text = ['"merged_and_filtered": {', '"total_reads": 75', '"total_bases": 13683'] + def read1_lines = [ "@ERR5069949.1066259 NS500628:121:HK3MMAFX2:1:11312:18369:8333/1", + "CCTTATGACAGCAAGAACTGTGTATGATGATGGTGCTAGGAGAGTGTGGACACTTATGAATGTCTTGACACTCGTTTATAAAGTTTATTATGGTAATGCTTTAGATCAAGCCATTTCCATGTGGGCTCTTATAATCTCTGTTACTTC", + "AAAAAEAEEAEEEEEEEEEEEEEEEEAEEEEAEEEEEEEEAEEEEEEEEEEEEEEEEE/EAEEEEEE/6EEEEEEEEEEAEEAEEE/EE/AEEAEEEEEAEEEA/EEAAEAE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { read_merged_lines.each { read_merged_line -> + { assert path(process.out.reads_merged.get(0).get(1)).linesGzip.contains(read_merged_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { json_text.each { json_part -> + { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } + } + }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } + + test("test_fastp_paired_end_merged_adapterlist") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/fastp/adapters.fasta", checkIfExists: true) + save_trimmed_fail = false + save_merged = true + + 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] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + def html_text = [ "
"] + def log_text = [ "Merged and filtered:", + "total reads: 75", + "total bases: 13683"] + def json_text = ['"merged_and_filtered": {', '"total_reads": 75', '"total_bases": 13683',"--adapter_fasta"] + def read1_lines = ["@ERR5069949.1066259 NS500628:121:HK3MMAFX2:1:11312:18369:8333/1", + "CCTTATGACAGCAAGAACTGTGTATGATGATGGTGCTAGGAGAGTGTGGACACTTATGAATGTCTTGACACTCGTTTATAAAGTTTATTATGGTAATGCTTTAGATCAAGCCATTTCCATGTGGGCTCTTATAATCTCTGTTACTTC", + "AAAAAEAEEAEEEEEEEEEEEEEEEEAEEEEAEEEEEEEEAEEEEEEEEEEEEEEEEE/EAEEEEEE/6EEEEEEEEEEAEEAEEE/EE/AEEAEEEEEAEEEA/EEAAEAE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { read_merged_lines.each { read_merged_line -> + { assert path(process.out.reads_merged.get(0).get(1)).linesGzip.contains(read_merged_line) } + } + }, + { html_text.each { html_part -> + { assert path(process.out.html.get(0).get(1)).getText().contains(html_part) } + } + }, + { json_text.each { json_part -> + { assert path(process.out.json.get(0).get(1)).getText().contains(json_part) } + } + }, + { log_text.each { log_part -> + { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } + } + }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } +} diff --git a/modules/nf-core/fastp/tests/main.nf.test.snap b/modules/nf-core/fastp/tests/main.nf.test.snap new file mode 100644 index 000000000..0fa68c7d7 --- /dev/null +++ b/modules/nf-core/fastp/tests/main.nf.test.snap @@ -0,0 +1,52 @@ +{ + "fastp test_fastp_interleaved_json": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,168f516f7bd4b7b6c32da7cba87299a4" + ] + ] + ], + "timestamp": "2023-10-17T11:04:45.794175881" + }, + "test_fastp_single_end_json": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,c852d7a6dba5819e4ac8d9673bedcacc" + ] + ] + ], + "timestamp": "2023-10-17T11:04:10.566343705" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "timestamp": "2023-10-17T11:04:10.582076024" + }, + "test_fastp_single_end_trim_fail_json": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastp.json:md5,9a7ee180f000e8d00c7fb67f06293eb5" + ] + ] + ], + "timestamp": "2023-10-17T11:05:00.379878948" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastp/tests/nextflow.config b/modules/nf-core/fastp/tests/nextflow.config new file mode 100644 index 000000000..0f7849ad9 --- /dev/null +++ b/modules/nf-core/fastp/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + + withName: FASTP { + ext.args = "--interleaved_in" + } +} diff --git a/modules/nf-core/fastp/tests/tags.yml b/modules/nf-core/fastp/tests/tags.yml new file mode 100644 index 000000000..c1afcce75 --- /dev/null +++ b/modules/nf-core/fastp/tests/tags.yml @@ -0,0 +1,2 @@ +fastp: + - modules/nf-core/fastp/** diff --git a/modules/nf-core/fastqc/environment.yml b/modules/nf-core/fastqc/environment.yml new file mode 100644 index 000000000..1787b38a9 --- /dev/null +++ b/modules/nf-core/fastqc/environment.yml @@ -0,0 +1,7 @@ +name: fastqc +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::fastqc=0.12.1 diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 67209f793..9e19a74c5 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -2,7 +2,7 @@ process FASTQC { tag "$meta.id" label 'process_medium' - conda "bioconda::fastqc=0.12.1" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0' : 'biocontainers/fastqc:0.12.1--hdfd78af_0' }" @@ -37,7 +37,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml "${task.process}": - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) END_VERSIONS """ @@ -49,7 +49,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml "${task.process}": - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) END_VERSIONS """ } diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index 4da5bb5a0..ee5507e06 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -50,3 +50,8 @@ authors: - "@grst" - "@ewels" - "@FelixKrueger" +maintainers: + - "@drpatelh" + - "@grst" + - "@ewels" + - "@FelixKrueger" diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index badb67161..b9e8f926e 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -1,10 +1,11 @@ nextflow_process { name "Test Process FASTQC" - script "modules/nf-core/fastqc/main.nf" + script "../main.nf" process "FASTQC" - tag "fastqc" + tag "modules" tag "modules_nfcore" + tag "fastqc" test("Single-Read") { @@ -37,4 +38,72 @@ nextflow_process { ) } } +// TODO +// // +// // Test with paired-end data +// // +// workflow test_fastqc_paired_end { +// input = [ +// [id: 'test', single_end: false], // meta map +// [ +// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), +// file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) +// ] +// ] + +// FASTQC ( input ) +// } + +// // +// // Test with interleaved data +// // +// workflow test_fastqc_interleaved { +// input = [ +// [id: 'test', single_end: false], // meta map +// file(params.test_data['sarscov2']['illumina']['test_interleaved_fastq_gz'], checkIfExists: true) +// ] + +// FASTQC ( input ) +// } + +// // +// // Test with bam data +// // +// workflow test_fastqc_bam { +// input = [ +// [id: 'test', single_end: false], // meta map +// file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) +// ] + +// FASTQC ( input ) +// } + +// // +// // Test with multiple samples +// // +// workflow test_fastqc_multiple { +// input = [ +// [id: 'test', single_end: false], // meta map +// [ +// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), +// file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), +// file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), +// file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) +// ] +// ] + +// FASTQC ( input ) +// } + +// // +// // Test with custom prefix +// // +// workflow test_fastqc_custom_prefix { +// input = [ +// [ id:'mysample', single_end:true ], // meta map +// file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) +// ] + +// FASTQC ( input ) +// } } diff --git a/modules/nf-core/fastqc/tests/tags.yml b/modules/nf-core/fastqc/tests/tags.yml new file mode 100644 index 000000000..7834294ba --- /dev/null +++ b/modules/nf-core/fastqc/tests/tags.yml @@ -0,0 +1,2 @@ +fastqc: + - modules/nf-core/fastqc/** diff --git a/modules/nf-core/picard/markduplicates/environment.yml b/modules/nf-core/picard/markduplicates/environment.yml new file mode 100644 index 000000000..58b795f54 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/environment.yml @@ -0,0 +1,7 @@ +name: picard_markduplicates +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::picard=3.1.1 diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index ebfa0864d..80930cc41 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -2,10 +2,10 @@ process PICARD_MARKDUPLICATES { 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.1.1--hdfd78af_0' : + 'biocontainers/picard:3.1.1--hdfd78af_0' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index f7693d2f0..1ab90c075 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -69,3 +69,7 @@ authors: - "@drpatelh" - "@projectoriented" - "@ramprasadn" +maintainers: + - "@drpatelh" + - "@projectoriented" + - "@ramprasadn" diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test b/modules/nf-core/picard/markduplicates/tests/main.nf.test new file mode 100644 index 000000000..b2bba094f --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test @@ -0,0 +1,111 @@ +nextflow_process { + + name "Test Process PICARD_MARKDUPLICATES" + script "../main.nf" + process "PICARD_MARKDUPLICATES" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "picard" + tag "picard/markduplicates" + + test("sarscov2 - bam, fasta, fai - sorted bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + 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("sarscov2 - bam, fasta, fai - unsorted bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + 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, fasta, fai") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + 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() } + ) + } + } + +} diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap new file mode 100644 index 000000000..cd788a4d6 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap @@ -0,0 +1,44 @@ +{ + "sarscov2 - bam, fasta, fai - unsorted bam": { + "content": [ + "test.marked.bam", + [ + "## 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", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:37.735339781" + }, + "homo_sapiens - cram, fasta, fai": { + "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", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:48.897954543" + }, + "sarscov2 - bam, fasta, fai - 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", + "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" + ] + ], + "timestamp": "2023-11-28T10:50:26.591387512" + } +} \ No newline at end of file diff --git a/modules/nf-core/picard/markduplicates/tests/nextflow.config b/modules/nf-core/picard/markduplicates/tests/nextflow.config new file mode 100644 index 000000000..02818dd6e --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: PICARD_MARKDUPLICATES { + ext.prefix = { "${meta.id}.marked" } + ext.args = '--ASSUME_SORT_ORDER queryname' + } +} diff --git a/modules/nf-core/picard/markduplicates/tests/tags.yml b/modules/nf-core/picard/markduplicates/tests/tags.yml new file mode 100644 index 000000000..4f213d620 --- /dev/null +++ b/modules/nf-core/picard/markduplicates/tests/tags.yml @@ -0,0 +1,2 @@ +picard/markduplicates: + - modules/nf-core/picard/markduplicates/** diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml new file mode 100644 index 000000000..5efae053f --- /dev/null +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -0,0 +1,7 @@ +name: samtools_flagstat +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index b75707eca..f1893d7cc 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_FLAGSTAT { tag "$meta.id" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/samtools/flagstat/meta.yml b/modules/nf-core/samtools/flagstat/meta.yml index 954225dfc..97991358e 100644 --- a/modules/nf-core/samtools/flagstat/meta.yml +++ b/modules/nf-core/samtools/flagstat/meta.yml @@ -47,3 +47,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test new file mode 100644 index 000000000..c8dd8dc9f --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process SAMTOOLS_FLAGSTAT" + script "../main.nf" + process "SAMTOOLS_FLAGSTAT" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/flagstat" + + test("BAM") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.flagstat).match() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap new file mode 100644 index 000000000..880019f2f --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -0,0 +1,16 @@ +{ + "BAM": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ] + ], + "timestamp": "2023-11-14T15:49:22.577133" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/flagstat/tests/tags.yml b/modules/nf-core/samtools/flagstat/tests/tags.yml new file mode 100644 index 000000000..2d2b7255e --- /dev/null +++ b/modules/nf-core/samtools/flagstat/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/flagstat: + - modules/nf-core/samtools/flagstat/** diff --git a/modules/nf-core/samtools/idxstats/environment.yml b/modules/nf-core/samtools/idxstats/environment.yml new file mode 100644 index 000000000..2401db0f1 --- /dev/null +++ b/modules/nf-core/samtools/idxstats/environment.yml @@ -0,0 +1,7 @@ +name: samtools_idxstats +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/idxstats/main.nf b/modules/nf-core/samtools/idxstats/main.nf index 83c7c34b9..00d916bbf 100644 --- a/modules/nf-core/samtools/idxstats/main.nf +++ b/modules/nf-core/samtools/idxstats/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_IDXSTATS { tag "$meta.id" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/samtools/idxstats/meta.yml b/modules/nf-core/samtools/idxstats/meta.yml index dda87e1ee..344e92a3f 100644 --- a/modules/nf-core/samtools/idxstats/meta.yml +++ b/modules/nf-core/samtools/idxstats/meta.yml @@ -48,3 +48,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test b/modules/nf-core/samtools/idxstats/tests/main.nf.test new file mode 100644 index 000000000..f6c92150c --- /dev/null +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process SAMTOOLS_IDXSTATS" + script "../main.nf" + process "SAMTOOLS_IDXSTATS" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/idxstats" + + test("BAM") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.idxstats).match() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap new file mode 100644 index 000000000..4c6c12bd5 --- /dev/null +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap @@ -0,0 +1,16 @@ +{ + "BAM": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ] + ], + "timestamp": "2023-11-14T15:52:19.875194" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/idxstats/tests/tags.yml b/modules/nf-core/samtools/idxstats/tests/tags.yml new file mode 100644 index 000000000..d3057c61f --- /dev/null +++ b/modules/nf-core/samtools/idxstats/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/idxstats: + - modules/nf-core/samtools/idxstats/** diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml new file mode 100644 index 000000000..296ed99e5 --- /dev/null +++ b/modules/nf-core/samtools/index/environment.yml @@ -0,0 +1,7 @@ +name: samtools_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index 0b20aa4bb..8ad18fdc2 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index 8bd2fa6fb..01a4ee03e 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -51,3 +51,7 @@ authors: - "@drpatelh" - "@ewels" - "@maxulysse" +maintainers: + - "@drpatelh" + - "@ewels" + - "@maxulysse" diff --git a/modules/nf-core/samtools/index/tests/csi.nextflow.config b/modules/nf-core/samtools/index/tests/csi.nextflow.config new file mode 100644 index 000000000..0ed260efa --- /dev/null +++ b/modules/nf-core/samtools/index/tests/csi.nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_INDEX { + ext.args = '-c' + } + +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test new file mode 100644 index 000000000..c76a9169f --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process SAMTOOLS_INDEX" + script "../main.nf" + process "SAMTOOLS_INDEX" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/index" + + test("sarscov2 [BAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.bai).match("bai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CRAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.crai).match("crai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CSI]") { + + 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) + ] + """ + } + } + + 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") } + ) + } + } +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap new file mode 100644 index 000000000..b3baee7fb --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "crai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ] + ], + "timestamp": "2023-11-15T15:17:37.30801" + }, + "bai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ] + ], + "timestamp": "2023-11-15T15:17:30.869234" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/index/tests/tags.yml b/modules/nf-core/samtools/index/tests/tags.yml new file mode 100644 index 000000000..e0f58a7a3 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/index: + - modules/nf-core/samtools/index/** diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml new file mode 100644 index 000000000..cd50868c5 --- /dev/null +++ b/modules/nf-core/samtools/sort/environment.yml @@ -0,0 +1,7 @@ +name: samtools_sort +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 2b7753fd8..4a666d42e 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_SORT { tag "$meta.id" label 'process_medium' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml index 073284316..2200de72f 100644 --- a/modules/nf-core/samtools/sort/meta.yml +++ b/modules/nf-core/samtools/sort/meta.yml @@ -46,3 +46,6 @@ output: authors: - "@drpatelh" - "@ewels" +maintainers: + - "@drpatelh" + - "@ewels" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test new file mode 100644 index 000000000..abb80978e --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test @@ -0,0 +1,73 @@ +nextflow_process { + + name "Test Process SAMTOOLS_SORT" + script "../main.nf" + process "SAMTOOLS_SORT" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/sort" + + test("test_samtools_sort") { + + 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) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_samtools_sort_stub") { + + config "./nextflow.config" + options "-stub-run" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test.snap b/modules/nf-core/samtools/sort/tests/main.nf.test.snap new file mode 100644 index 000000000..ff7222597 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/main.nf.test.snap @@ -0,0 +1,48 @@ +{ + "test_samtools_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,ea6a0fef94eb534e901f107a05a33a06" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ] + } + ], + "timestamp": "2023-12-04T11:11:22.005628301" + }, + "test_samtools_sort_stub": { + "content": [ + "test.sorted.bam", + [ + "versions.yml:md5,33b6a403dc19a0d28e4219ccab0a1d80" + ] + ], + "timestamp": "2023-12-04T17:47:22.314445935" + } +} \ 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 new file mode 100644 index 000000000..d0f350868 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/modules/nf-core/samtools/sort/tests/tags.yml b/modules/nf-core/samtools/sort/tests/tags.yml new file mode 100644 index 000000000..cd63ea208 --- /dev/null +++ b/modules/nf-core/samtools/sort/tests/tags.yml @@ -0,0 +1,3 @@ +samtools/sort: + - modules/nf-core/samtools/sort/** + - tests/modules/nf-core/samtools/sort/** diff --git a/modules/nf-core/samtools/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml new file mode 100644 index 000000000..b89ce6475 --- /dev/null +++ b/modules/nf-core/samtools/stats/environment.yml @@ -0,0 +1,7 @@ +name: samtools_stats +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 4a2607ded..7539140ab 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_STATS { tag "$meta.id" label 'process_single' - conda "bioconda::samtools=1.17" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/samtools/stats/meta.yml b/modules/nf-core/samtools/stats/meta.yml index 90e6345f5..735ff8122 100644 --- a/modules/nf-core/samtools/stats/meta.yml +++ b/modules/nf-core/samtools/stats/meta.yml @@ -57,3 +57,7 @@ authors: - "@drpatelh" - "@FriederikeHanssen" - "@ramprasadn" +maintainers: + - "@drpatelh" + - "@FriederikeHanssen" + - "@ramprasadn" diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test b/modules/nf-core/samtools/stats/tests/main.nf.test new file mode 100644 index 000000000..20c3efe12 --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/main.nf.test @@ -0,0 +1,78 @@ +nextflow_process { + + name "Test Process SAMTOOLS_STATS" + script "../main.nf" + process "SAMTOOLS_STATS" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/stats" + + test("SAMTOOLS STATS Should run without failures") { + + 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[1] = [[],[]] + """ + + } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + + } + + test("SAMTOOLS CRAM Should run without failures") { + + 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) + ] + """ + } + + + } + + 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 new file mode 100644 index 000000000..025c83a55 --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "SAMTOOLS STATS Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + ] + ], + "1": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,045a48208b1c6f5b8af4347fe31f4def" + ] + ], + "versions": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ] + } + ], + "timestamp": "2023-12-04T11:07:28.26821485" + }, + "SAMTOOLS CRAM Should run without failures": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + ] + ], + "1": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,dfbfa130d4a6925ddd1931dcd8354a43" + ] + ], + "versions": [ + "versions.yml:md5,650a365c6635001436008350ae83337c" + ] + } + ], + "timestamp": "2023-12-04T11:07:50.356233402" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/stats/tests/tags.yml b/modules/nf-core/samtools/stats/tests/tags.yml new file mode 100644 index 000000000..7c28e30f3 --- /dev/null +++ b/modules/nf-core/samtools/stats/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/stats: + - modules/nf-core/samtools/stats/** diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml new file mode 100644 index 000000000..6cd0f51b3 --- /dev/null +++ b/modules/nf-core/trimgalore/environment.yml @@ -0,0 +1,7 @@ +name: trimgalore +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::trim-galore=0.6.7 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index dcb77ae7b..24ead8714 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -2,7 +2,7 @@ process TRIMGALORE { tag "$meta.id" label 'process_high' - conda "bioconda::trim-galore=0.6.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0' : 'biocontainers/trim-galore:0.6.7--hdfd78af_0' }" diff --git a/modules/nf-core/trimgalore/meta.yml b/modules/nf-core/trimgalore/meta.yml index f84c4d771..e649088ce 100644 --- a/modules/nf-core/trimgalore/meta.yml +++ b/modules/nf-core/trimgalore/meta.yml @@ -62,3 +62,7 @@ authors: - "@drpatelh" - "@ewels" - "@FelixKrueger" +maintainers: + - "@drpatelh" + - "@ewels" + - "@FelixKrueger" diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test new file mode 100644 index 000000000..bc6812ccd --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -0,0 +1,105 @@ +nextflow_process { + + name "Test Process TRIMGALORE" + script "../main.nf" + process "TRIMGALORE" + tag "modules" + tag "modules_nfcore" + tag "trimgalore" + + 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) ] + ] + """ + } + } + + then { + def read_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) } + } + }, + { report1_lines.each { report1_line -> + { assert path(process.out.log.get(0).get(1)).getText().contains(report1_line) } + } + } + ) + } + } + + test("test_trimgalore_paired_end") { + + when { + params { + outdir = "$outputDir" + } + 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) ] + ] + """ + } + } + + then { + def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", + "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", + "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE + { assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) } + } + }, + { read2_lines.each { read2_line -> + { assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) } + } + }, + { report1_lines.each { report1_line -> + { assert path(process.out.log.get(0).get(1).get(0)).getText().contains(report1_line) } + } + }, + { report2_lines.each { report2_line -> + { assert path(process.out.log.get(0).get(1).get(1)).getText().contains(report2_line) } + } + } + ) + } + } +} diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap new file mode 100644 index 000000000..84feacca2 --- /dev/null +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -0,0 +1,148 @@ +{ + "test_trimgalore_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,a1ab3958205f1ddf48af623242b5b429" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4" + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "timestamp": "2023-10-17T15:24:57.782141441" + }, + "test_trimgalore_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", + "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", + "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + ] + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,315d40465412f9909bbaabf52269274d", + "test_2.fastq.gz_trimming_report.txt:md5,34436303da1c78811103427a2fb57f7b" + ] + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,e0a7516b8ea8d6467d6306acb2cd13c4", + "test_2_val_2.fq.gz:md5,f3d61189e6d10202da7b8686f1dbb71b" + ] + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "timestamp": "2023-10-17T15:25:08.513589909" + } +} \ No newline at end of file diff --git a/modules/nf-core/trimgalore/tests/tags.yml b/modules/nf-core/trimgalore/tests/tags.yml new file mode 100644 index 000000000..e9937691a --- /dev/null +++ b/modules/nf-core/trimgalore/tests/tags.yml @@ -0,0 +1,2 @@ +trimgalore: + - modules/nf-core/trimgalore/** diff --git a/modules/nf-core/umitools/dedup/environment.yml b/modules/nf-core/umitools/dedup/environment.yml new file mode 100644 index 000000000..f443735f4 --- /dev/null +++ b/modules/nf-core/umitools/dedup/environment.yml @@ -0,0 +1,7 @@ +name: umitools_dedup +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::umi_tools=1.1.4 diff --git a/modules/nf-core/umitools/dedup/main.nf b/modules/nf-core/umitools/dedup/main.nf index 56ea04691..64ab8f98e 100644 --- a/modules/nf-core/umitools/dedup/main.nf +++ b/modules/nf-core/umitools/dedup/main.nf @@ -2,7 +2,7 @@ process UMITOOLS_DEDUP { tag "$meta.id" label "process_medium" - conda "bioconda::umi_tools=1.1.4" + 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' }" @@ -42,7 +42,7 @@ process UMITOOLS_DEDUP { cat <<-END_VERSIONS > versions.yml "${task.process}": - umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) END_VERSIONS """ @@ -56,7 +56,7 @@ process UMITOOLS_DEDUP { cat <<-END_VERSIONS > versions.yml "${task.process}": - umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) END_VERSIONS """ } diff --git a/modules/nf-core/umitools/dedup/meta.yml b/modules/nf-core/umitools/dedup/meta.yml index 534d4c6b0..38d3fd465 100644 --- a/modules/nf-core/umitools/dedup/meta.yml +++ b/modules/nf-core/umitools/dedup/meta.yml @@ -7,8 +7,8 @@ keywords: tools: - umi_tools: description: > - UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) - and single cell RNA-Seq cell barcodes + UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) and single cell RNA-Seq cell barcodes + documentation: https://umi-tools.readthedocs.io/en/latest/ license: ["MIT"] input: @@ -61,8 +61,11 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@drpatelh" - "@grst" - "@klkeys" +maintainers: + - "@drpatelh" + - "@grst" + - "@klkeys" diff --git a/modules/nf-core/umitools/extract/environment.yml b/modules/nf-core/umitools/extract/environment.yml new file mode 100644 index 000000000..7d08ac0ec --- /dev/null +++ b/modules/nf-core/umitools/extract/environment.yml @@ -0,0 +1,7 @@ +name: umitools_extract +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::umi_tools=1.1.4 diff --git a/modules/nf-core/umitools/extract/main.nf b/modules/nf-core/umitools/extract/main.nf index 2f94fa93e..4bd79e79f 100644 --- a/modules/nf-core/umitools/extract/main.nf +++ b/modules/nf-core/umitools/extract/main.nf @@ -3,7 +3,7 @@ process UMITOOLS_EXTRACT { label "process_single" label "process_long" - conda "bioconda::umi_tools=1.1.4" + 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' }" @@ -33,7 +33,7 @@ process UMITOOLS_EXTRACT { cat <<-END_VERSIONS > versions.yml "${task.process}": - umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) END_VERSIONS """ } else { @@ -49,7 +49,7 @@ process UMITOOLS_EXTRACT { cat <<-END_VERSIONS > versions.yml "${task.process}": - umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) END_VERSIONS """ } diff --git a/modules/nf-core/umitools/extract/meta.yml b/modules/nf-core/umitools/extract/meta.yml index db64a0f88..7695b2717 100644 --- a/modules/nf-core/umitools/extract/meta.yml +++ b/modules/nf-core/umitools/extract/meta.yml @@ -1,15 +1,16 @@ name: umitools_extract description: Extracts UMI barcode from a read and add it to the read name, leaving any sample barcode in place keywords: - - umitools + - UMI + - barcode - extract + - umitools tools: - umi_tools: description: > - UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) - and single cell RNA-Seq cell barcodes + UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) and single cell RNA-Seq cell barcodes documentation: https://umi-tools.readthedocs.io/en/latest/ - license: ["MIT"] + license: "MIT" input: - meta: type: map @@ -29,9 +30,7 @@ output: - reads: type: file description: > - Extracted FASTQ files. | - For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | - For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. + Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. pattern: "*.{fastq.gz}" - log: type: file @@ -41,7 +40,9 @@ output: type: file description: File containing software versions pattern: "versions.yml" - authors: - "@drpatelh" - "@grst" +maintainers: + - "@drpatelh" + - "@grst" diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test b/modules/nf-core/umitools/extract/tests/main.nf.test new file mode 100644 index 000000000..22242d1df --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/main.nf.test @@ -0,0 +1,35 @@ +nextflow_process { + + name "Test Process UMITOOLS_EXTRACT" + script "../main.nf" + process "UMITOOLS_EXTRACT" + config "./nextflow.config" + tag "modules_nfcore" + tag "modules" + tag "umitools" + tag "umitools/extract" + + test("Should run without failures") { + + 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } +} \ 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 new file mode 100644 index 000000000..6d5944f1d --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/main.nf.test.snap @@ -0,0 +1,10 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,5a18da2d3a5a4de15e7aaae9082d7abb" + ] + ], + "timestamp": "2023-12-08T09:41:43.540658352" + } +} \ No newline at end of file diff --git a/modules/nf-core/umitools/extract/tests/nextflow.config b/modules/nf-core/umitools/extract/tests/nextflow.config new file mode 100644 index 000000000..c866f5a00 --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } + +} diff --git a/modules/nf-core/umitools/extract/tests/tags.yml b/modules/nf-core/umitools/extract/tests/tags.yml new file mode 100644 index 000000000..c3fb23de4 --- /dev/null +++ b/modules/nf-core/umitools/extract/tests/tags.yml @@ -0,0 +1,2 @@ +umitools/extract: + - modules/nf-core/umitools/extract/** diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/meta.yml b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/meta.yml index f11e7ab6f..e655484e7 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/meta.yml +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/meta.yml @@ -53,7 +53,9 @@ output: description: | Files containing software versions Structure: [ path(versions.yml) ] - authors: - "@drpatelh" - "@KamilMaliszArdigen" +maintainers: + - "@drpatelh" + - "@KamilMaliszArdigen" diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test new file mode 100644 index 000000000..e3214d4f2 --- /dev/null +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test @@ -0,0 +1,51 @@ +nextflow_workflow { + + name "Test Workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS" + script "../main.nf" + workflow "BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_dedup_stats_samtools_umitools" + tag "subworkflows/bam_stats_samtools" + tag "bam_dedup_stats_samtools_umitools" + tag "bam_stats_samtools" + tag "samtools" + tag "samtools/index" + tag "samtools/stats" + tag "samtools/idxstats" + tag "samtools/flagstat" + tag "umitools" + tag "umitools/dedup" + + test("sarscov2_bam_bai") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + input[1] = false + """ + } + } + + then { + assertAll( + { 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_dedup_stats_samtools_umitools_stats") }, + { assert snapshot(workflow.out.flagstat).match("test_bam_dedup_stats_samtools_umitools_flagstats") }, + { assert snapshot(workflow.out.idxstats).match("test_bam_dedup_stats_samtools_umitools_idxstats") } + ) + } + + } + +} diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap new file mode 100644 index 000000000..036a63bbe --- /dev/null +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "test_bam_dedup_stats_samtools_umitools_idxstats": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" + ] + ] + ], + "timestamp": "2023-11-06T09:58:40.394333937" + }, + "test_bam_dedup_stats_samtools_umitools_flagstats": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.flagstat:md5,0bb716e40fae381b97484b58e0b16efe" + ] + ] + ], + "timestamp": "2023-11-06T09:58:40.385185447" + }, + "test_bam_dedup_stats_samtools_umitools_stats": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stats:md5,6c296bce3659651fb5a08c31db314d91" + ] + ] + ], + "timestamp": "2023-12-04T11:06:41.700472756" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/tags.yml b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/tags.yml new file mode 100644 index 000000000..bfd5e023e --- /dev/null +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/bam_dedup_stats_samtools_umitools: + - subworkflows/nf-core/bam_dedup_stats_samtools_umitools/** diff --git a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml index b924596d8..fe63068e6 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml +++ b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml @@ -6,7 +6,6 @@ keywords: - bam - sam - cram - components: - picard/markduplicates - samtools/index @@ -14,7 +13,6 @@ components: - samtools/idxstats - samtools/flagstat - bam_stats_samtools - input: - ch_bam: description: | @@ -60,3 +58,6 @@ output: authors: - "@dmarron" - "@drpatelh" +maintainers: + - "@dmarron" + - "@drpatelh" diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/meta.yml b/subworkflows/nf-core/bam_sort_stats_samtools/meta.yml index 69c16be41..e01f9ccf6 100644 --- a/subworkflows/nf-core/bam_sort_stats_samtools/meta.yml +++ b/subworkflows/nf-core/bam_sort_stats_samtools/meta.yml @@ -65,3 +65,6 @@ output: authors: - "@drpatelh" - "@ewels" +maintainers: + - "@drpatelh" + - "@ewels" 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 new file mode 100644 index 000000000..59b749d8f --- /dev/null +++ b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test @@ -0,0 +1,78 @@ +nextflow_workflow { + + name "Test Workflow BAM_SORT_STATS_SAMTOOLS" + script "../main.nf" + workflow "BAM_SORT_STATS_SAMTOOLS" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_sort_stats_samtools" + tag "bam_sort_stats_samtools" + tag "subworkflows/bam_stats_samtools" + tag "bam_stats_samtools" + tag "samtools" + tag "samtools/index" + tag "samtools/sort" + tag "samtools/stats" + tag "samtools/idxstats" + tag "samtools/flagstat" + + test("test_bam_sort_stats_samtools_single_end") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { 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") } + ) + } + } + + test("test_bam_sort_stats_samtools_paired_end") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { 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") } + ) + } + } +} 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 new file mode 100644 index 000000000..77afbf176 --- /dev/null +++ b/subworkflows/nf-core/bam_sort_stats_samtools/tests/main.nf.test.snap @@ -0,0 +1,86 @@ +{ + "test_bam_sort_stats_samtools_paired_end_flagstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ] + ], + "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" + ] + ] + ], + "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" + ] + ] + ], + "timestamp": "2023-12-04T11:06:50.951881479" + }, + "test_bam_sort_stats_samtools_paired_end_stats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,e32e7e49dce1fbe327a89e0fb7bc01b1" + ] + ] + ], + "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" + ] + ] + ], + "timestamp": "2023-10-22T20:25:58.451364604" + }, + "test_bam_sort_stats_samtools_single_end_flagstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + ] + ] + ], + "timestamp": "2023-10-22T20:25:58.416859285" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_sort_stats_samtools/tests/tags.yml b/subworkflows/nf-core/bam_sort_stats_samtools/tests/tags.yml new file mode 100644 index 000000000..30b69d6a4 --- /dev/null +++ b/subworkflows/nf-core/bam_sort_stats_samtools/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/bam_sort_stats_samtools: + - subworkflows/nf-core/bam_sort_stats_samtools/** diff --git a/subworkflows/nf-core/bam_stats_samtools/meta.yml b/subworkflows/nf-core/bam_stats_samtools/meta.yml index 87863b11b..809bf736b 100644 --- a/subworkflows/nf-core/bam_stats_samtools/meta.yml +++ b/subworkflows/nf-core/bam_stats_samtools/meta.yml @@ -39,3 +39,5 @@ output: Structure: [ path(versions.yml) ] authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test new file mode 100644 index 000000000..972108905 --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test @@ -0,0 +1,102 @@ +nextflow_workflow { + + name "Test Workflow BAM_STATS_SAMTOOLS" + script "../main.nf" + workflow "BAM_STATS_SAMTOOLS" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "bam_stats_samtools" + tag "subworkflows/bam_stats_samtools" + tag "samtools" + tag "samtools/flagstat" + tag "samtools/idxstats" + tag "samtools/stats" + + test("test_bam_stats_samtools_single_end") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + 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") } + ) + } + } + + test("test_bam_stats_samtools_paired_end") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ [ id:'test', single_end:true ], // 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[1] = [ [ id:'genome' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + 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") } + ) + } + } + + test("test_bam_stats_samtools_paired_end_cram") { + + when { + params { + outdir = "$outputDir" + } + workflow { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + 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") } + ) + } + } + +} 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 new file mode 100644 index 000000000..d3af13769 --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap @@ -0,0 +1,128 @@ +{ + "test_bam_stats_samtools_paired_end_cram_flagstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,a53f3d26e2e9851f7d528442bbfe9781" + ] + ] + ], + "timestamp": "2023-11-06T09:31:26.194017574" + }, + "test_bam_stats_samtools_paired_end_stats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,49e2b43344ff92bc4c02463a58f7ba4a" + ] + ] + ], + "timestamp": "2023-12-04T11:07:13.965061942" + }, + "test_bam_stats_samtools_paired_end_flagstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ] + ], + "timestamp": "2023-11-06T09:31:11.668517251" + }, + "test_bam_stats_samtools_single_end_flagstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,2191911d72575a2358b08b1df64ccb53" + ] + ] + ], + "timestamp": "2023-11-06T09:26:10.340046381" + }, + "test_bam_stats_samtools_paired_end_cram_idxstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,e179601fa7b8ebce81ac3765206f6c15" + ] + ] + ], + "timestamp": "2023-11-06T09:31:26.207052003" + }, + "test_bam_stats_samtools_single_end_stats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,5a6667d97806e5002731e9cf23674fad" + ] + ] + ], + "timestamp": "2023-12-04T11:07:06.676820877" + }, + "test_bam_stats_samtools_paired_end_idxstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ] + ], + "timestamp": "2023-11-06T09:31:11.68246157" + }, + "test_bam_stats_samtools_single_end_idxstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,613e048487662c694aa4a2f73ca96a20" + ] + ] + ], + "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" + ] + ] + ], + "timestamp": "2023-12-04T11:07:22.30295557" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml b/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml new file mode 100644 index 000000000..ec2f2d68f --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/bam_stats_samtools: + - subworkflows/nf-core/bam_stats_samtools/** diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml index f76b40261..220e8db1c 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/meta.yml @@ -69,8 +69,10 @@ output: - reads: type: file description: > - Extracted FASTQ files. | - For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + + + For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. pattern: "*.{fastq.gz}" - fastqc_html: @@ -122,3 +124,5 @@ output: pattern: "versions.yml" authors: - "@robsyme" +maintainers: + - "@robsyme" diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test new file mode 100644 index 000000000..cdd73984c --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_workflow { + + name "Test Workflow FASTQ_FASTQC_UMITOOLS_FASTP" + script "../main.nf" + workflow "FASTQ_FASTQC_UMITOOLS_FASTP" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_fastqc_umitools_fastp" + tag "fastq_fastqc_umitools_fastp" + tag "fastqc" + tag "umitools/extract" + tag "fastp" + + + test("sarscov2 paired-end [fastq]") { + + when { + workflow { + """ + 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] = false // skip_fastqc + input[2] = false // with_umi + input[3] = false // skip_umi_extract + input[4] = 1 // umi_discard_read + input[5] = false // skip_trimming + input[6] = [] // adapter_fasta + input[7] = false // save_trimmed_fail + input[8] = false // save_merged + input[9] = 1 // min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out.reads).match("reads") }, + { assert snapshot(workflow.out.umi_log).match("umi_log") }, + { assert snapshot(workflow.out.trim_json).match("trim_json") }, + { assert snapshot(workflow.out.trim_reads_fail).match("trim_reads_fail") }, + { assert snapshot(workflow.out.trim_reads_merged).match("trim_reads_merged") }, + { assert snapshot(workflow.out.trim_read_count).match("trim_read_count") }, + { assert snapshot(workflow.out.versions).match("versions") }, + + { assert workflow.out.fastqc_raw_html }, + { assert workflow.out.fastqc_raw_zip }, + { assert workflow.out.trim_html }, + { assert workflow.out.trim_log }, + { assert workflow.out.fastqc_trim_html }, + { assert workflow.out.fastqc_trim_zip } + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap new file mode 100644 index 000000000..38a65aebe --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap @@ -0,0 +1,81 @@ +{ + "trim_reads_merged": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-26T02:28:26.26920982" + }, + "trim_reads_fail": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-26T02:28:26.25861515" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + ], + "timestamp": "2023-11-26T02:28:26.30891403" + }, + "trim_json": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,1e0f8e27e71728e2b63fc64086be95cd" + ] + ] + ], + "timestamp": "2023-11-26T02:28:26.24768259" + }, + "reads": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,67b2bbae47f073e05a97a9c2edce23c7", + "test_2.fastp.fastq.gz:md5,25cbdca08e2083dbd4f0502de6b62f39" + ] + ] + ] + ], + "timestamp": "2023-12-04T11:30:32.061644815" + }, + "umi_log": { + "content": [ + [ + + ] + ], + "timestamp": "2023-11-26T02:28:26.238536" + }, + "trim_read_count": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + 198 + ] + ] + ], + "timestamp": "2023-11-26T02:28:26.27984169" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml new file mode 100644 index 000000000..84a4b5676 --- /dev/null +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_fastqc_umitools_fastp: + - subworkflows/nf-core/fastq_fastqc_umitools_fastp/** diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/meta.yml b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/meta.yml index e32e90f43..a7df97f77 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/meta.yml +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/meta.yml @@ -47,13 +47,14 @@ input: type: integer description: | Inputs with fewer than this reads will be filtered out of the "reads" output channel - output: - reads: type: file description: > - Extracted FASTQ files. | - For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + + + For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. pattern: "*.{fastq.gz}" - fastqc_html: @@ -95,3 +96,6 @@ output: authors: - "@drpatelh" - "@KamilMaliszArdigen" +maintainers: + - "@drpatelh" + - "@KamilMaliszArdigen" From d6803dc14654fd4a4f2a62a6239712416f25f2e1 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 10:44:44 +0000 Subject: [PATCH 2/8] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36b2ad811..bfc45524f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes +- [PR #1103](https://github.com/nf-core/rnaseq/issues/1103) - Updates FASTQC and UMITOOLS modules and their dependencies which have had their version string extraction commands updated. + ### Software dependencies ### Modules / Subworkflows From 8e66ae35825db6929db6825bce667ce33c85102c Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 12:16:49 +0000 Subject: [PATCH 3/8] Update modules with stderr updated --- modules.json | 22 +-- modules/nf-core/fastp/main.nf | 6 +- modules/nf-core/rseqc/bamstat/environment.yml | 8 + modules/nf-core/rseqc/bamstat/main.nf | 2 +- modules/nf-core/rseqc/bamstat/meta.yml | 3 + .../nf-core/rseqc/bamstat/tests/main.nf.test | 38 ++++ .../rseqc/bamstat/tests/main.nf.test.snap | 31 ++++ .../rseqc/bamstat/tests/nextflow.config | 5 + modules/nf-core/rseqc/bamstat/tests/tags.yml | 2 + .../rseqc/inferexperiment/environment.yml | 8 + modules/nf-core/rseqc/inferexperiment/main.nf | 2 +- .../nf-core/rseqc/inferexperiment/meta.yml | 4 + .../rseqc/inferexperiment/tests/main.nf.test | 34 ++++ .../inferexperiment/tests/main.nf.test.snap | 31 ++++ .../inferexperiment/tests/nextflow.config | 5 + .../rseqc/inferexperiment/tests/tags.yml | 2 + .../rseqc/innerdistance/environment.yml | 8 + modules/nf-core/rseqc/innerdistance/main.nf | 2 +- modules/nf-core/rseqc/innerdistance/meta.yml | 4 + .../rseqc/innerdistance/tests/main.nf.test | 41 +++++ .../innerdistance/tests/main.nf.test.snap | 68 +++++++ .../rseqc/innerdistance/tests/nextflow.config | 5 + .../rseqc/innerdistance/tests/tags.yml | 2 + .../rseqc/junctionannotation/environment.yml | 8 + .../nf-core/rseqc/junctionannotation/main.nf | 4 +- .../nf-core/rseqc/junctionannotation/meta.yml | 3 + .../junctionannotation/tests/main.nf.test | 37 ++++ .../tests/main.nf.test.snap | 24 +++ .../rseqc/junctionannotation/tests/tags.yml | 2 + .../rseqc/junctionsaturation/environment.yml | 8 + .../nf-core/rseqc/junctionsaturation/main.nf | 2 +- .../nf-core/rseqc/junctionsaturation/meta.yml | 3 + .../junctionsaturation/tests/main.nf.test | 36 ++++ .../tests/main.nf.test.snap | 30 ++++ .../rseqc/junctionsaturation/tests/tags.yml | 2 + .../rseqc/readdistribution/environment.yml | 8 + .../nf-core/rseqc/readdistribution/main.nf | 2 +- .../nf-core/rseqc/readdistribution/meta.yml | 3 + .../rseqc/readdistribution/tests/main.nf.test | 33 ++++ .../readdistribution/tests/main.nf.test.snap | 33 ++++ .../rseqc/readdistribution/tests/tags.yml | 2 + .../rseqc/readduplication/environment.yml | 8 + modules/nf-core/rseqc/readduplication/main.nf | 2 +- .../nf-core/rseqc/readduplication/meta.yml | 5 + .../rseqc/readduplication/tests/main.nf.test | 36 ++++ .../readduplication/tests/main.nf.test.snap | 58 ++++++ .../rseqc/readduplication/tests/tags.yml | 2 + modules/nf-core/rseqc/tin/environment.yml | 8 + modules/nf-core/rseqc/tin/main.nf | 2 +- modules/nf-core/rseqc/tin/meta.yml | 2 + modules/nf-core/rseqc/tin/tests/main.nf.test | 35 ++++ .../nf-core/rseqc/tin/tests/main.nf.test.snap | 47 +++++ modules/nf-core/rseqc/tin/tests/tags.yml | 2 + subworkflows/nf-core/bam_rseqc/main.nf | 166 +++++++++--------- subworkflows/nf-core/bam_rseqc/meta.yml | 13 +- .../nf-core/bam_rseqc/tests/main.nf.test | 65 +++++++ .../nf-core/bam_rseqc/tests/main.nf.test.snap | 151 ++++++++++++++++ subworkflows/nf-core/bam_rseqc/tests/tags.yml | 2 + 58 files changed, 1074 insertions(+), 103 deletions(-) create mode 100644 modules/nf-core/rseqc/bamstat/environment.yml create mode 100644 modules/nf-core/rseqc/bamstat/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/bamstat/tests/nextflow.config create mode 100644 modules/nf-core/rseqc/bamstat/tests/tags.yml create mode 100644 modules/nf-core/rseqc/inferexperiment/environment.yml create mode 100644 modules/nf-core/rseqc/inferexperiment/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/inferexperiment/tests/nextflow.config create mode 100644 modules/nf-core/rseqc/inferexperiment/tests/tags.yml create mode 100644 modules/nf-core/rseqc/innerdistance/environment.yml create mode 100644 modules/nf-core/rseqc/innerdistance/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/innerdistance/tests/nextflow.config create mode 100644 modules/nf-core/rseqc/innerdistance/tests/tags.yml create mode 100644 modules/nf-core/rseqc/junctionannotation/environment.yml create mode 100644 modules/nf-core/rseqc/junctionannotation/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/junctionannotation/tests/tags.yml create mode 100644 modules/nf-core/rseqc/junctionsaturation/environment.yml create mode 100644 modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/junctionsaturation/tests/tags.yml create mode 100644 modules/nf-core/rseqc/readdistribution/environment.yml create mode 100644 modules/nf-core/rseqc/readdistribution/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/readdistribution/tests/tags.yml create mode 100644 modules/nf-core/rseqc/readduplication/environment.yml create mode 100644 modules/nf-core/rseqc/readduplication/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/readduplication/tests/tags.yml create mode 100644 modules/nf-core/rseqc/tin/environment.yml create mode 100644 modules/nf-core/rseqc/tin/tests/main.nf.test create mode 100644 modules/nf-core/rseqc/tin/tests/main.nf.test.snap create mode 100644 modules/nf-core/rseqc/tin/tests/tags.yml create mode 100644 subworkflows/nf-core/bam_rseqc/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_rseqc/tests/tags.yml diff --git a/modules.json b/modules.json index a469fc895..f24a07889 100644 --- a/modules.json +++ b/modules.json @@ -27,8 +27,8 @@ }, "fastp": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["fastq_fastqc_umitools_fastp", "modules"] + "git_sha": "3c77ca9aac783e76c3614a06db3bfe4fef619bde", + "installed_by": ["modules", "fastq_fastqc_umitools_fastp"] }, "fastqc": { "branch": "master", @@ -102,42 +102,42 @@ }, "rseqc/bamstat": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "65acf692457e8c466e104c6a3e5ac392e98fe688", "installed_by": ["bam_rseqc"] }, "rseqc/inferexperiment": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "f2a3328fde9a2b4185285057f8d3727f39dd2aef", "installed_by": ["bam_rseqc"] }, "rseqc/innerdistance": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3e839096a1be5da4f68d1de1066e4d0bc13f5d6d", "installed_by": ["bam_rseqc"] }, "rseqc/junctionannotation": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "3c77ca9aac783e76c3614a06db3bfe4fef619bde", "installed_by": ["bam_rseqc"] }, "rseqc/junctionsaturation": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "9dfed3180f80f599c91daf5112d73a5e59367c24", "installed_by": ["bam_rseqc"] }, "rseqc/readdistribution": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "7bb1b295a359bcbf0a0ea03d19d40a00916805ee", "installed_by": ["bam_rseqc"] }, "rseqc/readduplication": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "db02573fdd89210d09ce9e2ac06857902a7fffec", "installed_by": ["bam_rseqc"] }, "rseqc/tin": { "branch": "master", - "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", + "git_sha": "4acfdd20843d5b6d63f9181721a6856447cb7bec", "installed_by": ["bam_rseqc"] }, "salmon/index": { @@ -250,7 +250,7 @@ }, "bam_rseqc": { "branch": "master", - "git_sha": "a9784afdd5dcda23b84e64db75dc591065d64653", + "git_sha": "045c3b47040a8284766b78500801ec21e7678277", "installed_by": ["subworkflows"] }, "bam_sort_stats_samtools": { diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index c8e815aea..5fac3c1ad 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -45,7 +45,7 @@ process FASTP { $adapter_list \\ $fail_fastq \\ $args \\ - 2> ${prefix}.fastp.log \\ + 2> >(tee ${prefix}.fastp.log >&2) \\ | gzip -c > ${prefix}.fastp.fastq.gz cat <<-END_VERSIONS > versions.yml @@ -66,7 +66,7 @@ process FASTP { $adapter_list \\ $fail_fastq \\ $args \\ - 2> ${prefix}.fastp.log + 2> >(tee ${prefix}.fastp.log >&2) cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -91,7 +91,7 @@ process FASTP { --thread $task.cpus \\ --detect_adapter_for_pe \\ $args \\ - 2> ${prefix}.fastp.log + 2> >(tee ${prefix}.fastp.log >&2) cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/rseqc/bamstat/environment.yml b/modules/nf-core/rseqc/bamstat/environment.yml new file mode 100644 index 000000000..bf0bf0829 --- /dev/null +++ b/modules/nf-core/rseqc/bamstat/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_bamstat +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/bamstat/main.nf b/modules/nf-core/rseqc/bamstat/main.nf index 04c1eefd0..33e6959e7 100644 --- a/modules/nf-core/rseqc/bamstat/main.nf +++ b/modules/nf-core/rseqc/bamstat/main.nf @@ -2,7 +2,7 @@ process RSEQC_BAMSTAT { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/bamstat/meta.yml b/modules/nf-core/rseqc/bamstat/meta.yml index 2d7fa7996..72745310c 100644 --- a/modules/nf-core/rseqc/bamstat/meta.yml +++ b/modules/nf-core/rseqc/bamstat/meta.yml @@ -35,3 +35,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/bamstat/tests/main.nf.test b/modules/nf-core/rseqc/bamstat/tests/main.nf.test new file mode 100644 index 000000000..1facabea0 --- /dev/null +++ b/modules/nf-core/rseqc/bamstat/tests/main.nf.test @@ -0,0 +1,38 @@ +nextflow_process { + + name "Test Process RSEQC_BAMSTAT" + script "../main.nf" + process "RSEQC_BAMSTAT" + + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/bamstat" + + config "./nextflow.config" + + test("sarscov2 - [meta] - bam") { + + when { + params { + // define parameters here. Example: + // outdir = "tests/results" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} diff --git a/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap b/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap new file mode 100644 index 000000000..b3cc3f55f --- /dev/null +++ b/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap @@ -0,0 +1,31 @@ +{ + "sarscov2 - [meta] - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam_stat.txt:md5,2675857864c1d1139b2a19d25dc36b09" + ] + ], + "1": [ + "versions.yml:md5,300e8a9b6f8213d3621e53af09a9c728" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.bam_stat.txt:md5,2675857864c1d1139b2a19d25dc36b09" + ] + ], + "versions": [ + "versions.yml:md5,300e8a9b6f8213d3621e53af09a9c728" + ] + } + ], + "timestamp": "2023-11-23T11:26:51.281041171" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/bamstat/tests/nextflow.config b/modules/nf-core/rseqc/bamstat/tests/nextflow.config new file mode 100644 index 000000000..8730f1c4b --- /dev/null +++ b/modules/nf-core/rseqc/bamstat/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/modules/nf-core/rseqc/bamstat/tests/tags.yml b/modules/nf-core/rseqc/bamstat/tests/tags.yml new file mode 100644 index 000000000..ed9a41fa9 --- /dev/null +++ b/modules/nf-core/rseqc/bamstat/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/bamstat: + - modules/nf-core/rseqc/bamstat/** diff --git a/modules/nf-core/rseqc/inferexperiment/environment.yml b/modules/nf-core/rseqc/inferexperiment/environment.yml new file mode 100644 index 000000000..1d3936f4e --- /dev/null +++ b/modules/nf-core/rseqc/inferexperiment/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_inferexperiment +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/inferexperiment/main.nf b/modules/nf-core/rseqc/inferexperiment/main.nf index 5f9f4b111..db6163387 100644 --- a/modules/nf-core/rseqc/inferexperiment/main.nf +++ b/modules/nf-core/rseqc/inferexperiment/main.nf @@ -2,7 +2,7 @@ process RSEQC_INFEREXPERIMENT { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/inferexperiment/meta.yml b/modules/nf-core/rseqc/inferexperiment/meta.yml index b4162059d..d9b9ff63e 100644 --- a/modules/nf-core/rseqc/inferexperiment/meta.yml +++ b/modules/nf-core/rseqc/inferexperiment/meta.yml @@ -2,6 +2,7 @@ name: rseqc_inferexperiment description: Infer strandedness from sequencing reads keywords: - rnaseq + - strandedness - experiment tools: - rseqc: @@ -38,3 +39,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test new file mode 100644 index 000000000..97cd2cb9a --- /dev/null +++ b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process RSEQC_INFEREXPERIMENT" + script "../main.nf" + process "RSEQC_INFEREXPERIMENT" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/inferexperiment" + + test("sarscov2 - [[meta] - bam] - bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} diff --git a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap new file mode 100644 index 000000000..ca4faba2d --- /dev/null +++ b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap @@ -0,0 +1,31 @@ +{ + "sarscov2 - [[meta] - bam] - bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.infer_experiment.txt:md5,f9d0bfc239df637cd8aeda40ade3c59a" + ] + ], + "1": [ + "versions.yml:md5,c0d7ecdb2e1fbf7a2ba0c28dae49e428" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.infer_experiment.txt:md5,f9d0bfc239df637cd8aeda40ade3c59a" + ] + ], + "versions": [ + "versions.yml:md5,c0d7ecdb2e1fbf7a2ba0c28dae49e428" + ] + } + ], + "timestamp": "2023-11-23T16:21:55.713158354" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/inferexperiment/tests/nextflow.config b/modules/nf-core/rseqc/inferexperiment/tests/nextflow.config new file mode 100644 index 000000000..8730f1c4b --- /dev/null +++ b/modules/nf-core/rseqc/inferexperiment/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/modules/nf-core/rseqc/inferexperiment/tests/tags.yml b/modules/nf-core/rseqc/inferexperiment/tests/tags.yml new file mode 100644 index 000000000..f9ba7e26a --- /dev/null +++ b/modules/nf-core/rseqc/inferexperiment/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/inferexperiment: + - modules/nf-core/rseqc/inferexperiment/** diff --git a/modules/nf-core/rseqc/innerdistance/environment.yml b/modules/nf-core/rseqc/innerdistance/environment.yml new file mode 100644 index 000000000..bb61cce24 --- /dev/null +++ b/modules/nf-core/rseqc/innerdistance/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_innerdistance +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/innerdistance/main.nf b/modules/nf-core/rseqc/innerdistance/main.nf index a63a2bf03..a87399a98 100644 --- a/modules/nf-core/rseqc/innerdistance/main.nf +++ b/modules/nf-core/rseqc/innerdistance/main.nf @@ -2,7 +2,7 @@ process RSEQC_INNERDISTANCE { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/innerdistance/meta.yml b/modules/nf-core/rseqc/innerdistance/meta.yml index d10a4c445..d0a5bf181 100644 --- a/modules/nf-core/rseqc/innerdistance/meta.yml +++ b/modules/nf-core/rseqc/innerdistance/meta.yml @@ -1,6 +1,7 @@ name: rseqc_innerdistance description: Calculate inner distance between read pairs. keywords: + - read_pairs - fragment_size - inner_distance tools: @@ -54,3 +55,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test new file mode 100644 index 000000000..ee8901422 --- /dev/null +++ b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test @@ -0,0 +1,41 @@ +nextflow_process { + + name "Test Process RSEQC_INNERDISTANCE" + script "../main.nf" + process "RSEQC_INNERDISTANCE" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/innerdistance" + + test("sarscov2 - [[meta] - bam] - bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed12'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.distance).match("pe_distance") }, + { assert snapshot(process.out.freq).match("freq") }, + { assert snapshot(process.out.mean).match("mean") }, + { assert snapshot(process.out.freq).match("rscript") }, + { assert snapshot(process.out.versions).match("pe_versions") }, + { assert snapshot(file(process.out.pdf[0][1]).name).match("pdf") } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap new file mode 100644 index 000000000..9743d1bd6 --- /dev/null +++ b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "pe_distance": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.inner_distance.txt:md5,a1acc9def0f64a5500d4c4cb47cbe32b" + ] + ] + ], + "timestamp": "2023-11-23T16:59:21.812491711" + }, + "rscript": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.inner_distance_freq.txt:md5,3fc037501f5899b5da009c8ce02fc25e" + ] + ] + ], + "timestamp": "2023-11-23T16:59:21.847527889" + }, + "pdf": { + "content": [ + "test.inner_distance_plot.pdf" + ], + "timestamp": "2023-11-23T17:23:20.046679629" + }, + "mean": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.inner_distance_mean.txt:md5,58398b7d5a29a5e564f9e3c50b55996c" + ] + ] + ], + "timestamp": "2023-11-23T16:59:21.839422659" + }, + "freq": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.inner_distance_freq.txt:md5,3fc037501f5899b5da009c8ce02fc25e" + ] + ] + ], + "timestamp": "2023-11-23T16:59:21.83183025" + }, + "pe_versions": { + "content": [ + [ + "versions.yml:md5,c2a05298a9c55bd61cc6e07396815a27" + ] + ], + "timestamp": "2023-11-23T16:59:21.854738078" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/innerdistance/tests/nextflow.config b/modules/nf-core/rseqc/innerdistance/tests/nextflow.config new file mode 100644 index 000000000..8730f1c4b --- /dev/null +++ b/modules/nf-core/rseqc/innerdistance/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/modules/nf-core/rseqc/innerdistance/tests/tags.yml b/modules/nf-core/rseqc/innerdistance/tests/tags.yml new file mode 100644 index 000000000..4a9d0acf9 --- /dev/null +++ b/modules/nf-core/rseqc/innerdistance/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/innerdistance: + - modules/nf-core/rseqc/innerdistance/** diff --git a/modules/nf-core/rseqc/junctionannotation/environment.yml b/modules/nf-core/rseqc/junctionannotation/environment.yml new file mode 100644 index 000000000..105ea25ea --- /dev/null +++ b/modules/nf-core/rseqc/junctionannotation/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_junctionannotation +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/junctionannotation/main.nf b/modules/nf-core/rseqc/junctionannotation/main.nf index 4029ac765..58574a278 100644 --- a/modules/nf-core/rseqc/junctionannotation/main.nf +++ b/modules/nf-core/rseqc/junctionannotation/main.nf @@ -2,7 +2,7 @@ process RSEQC_JUNCTIONANNOTATION { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" @@ -33,7 +33,7 @@ process RSEQC_JUNCTIONANNOTATION { -r $bed \\ -o $prefix \\ $args \\ - 2> ${prefix}.junction_annotation.log + 2> >(tee ${prefix}.junction_annotation.log >&2) cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/rseqc/junctionannotation/meta.yml b/modules/nf-core/rseqc/junctionannotation/meta.yml index 48c43260e..a88aa2db3 100644 --- a/modules/nf-core/rseqc/junctionannotation/meta.yml +++ b/modules/nf-core/rseqc/junctionannotation/meta.yml @@ -63,3 +63,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test new file mode 100644 index 000000000..ed2c27558 --- /dev/null +++ b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test @@ -0,0 +1,37 @@ +nextflow_process { + + name "Test Process RSEQC_JUNCTIONANNOTATION" + script "../main.nf" + process "RSEQC_JUNCTIONANNOTATION" + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/junctionannotation" + + test("sarscov2 - paired end [bam]") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end: false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.log).match("log") }, + { assert snapshot(process.out.versions).match("versions") }, + { assert process.out.xls.get(0).get(1) ==~ ".*/test.junction.xls" }, + { assert process.out.rscript.get(0).get(1) ==~ ".*/test.junction_plot.r" } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap new file mode 100644 index 000000000..a9fc2cbb7 --- /dev/null +++ b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap @@ -0,0 +1,24 @@ +{ + "log": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction_annotation.log:md5,ef37d06d169a1adbeec23fddf82aee2b" + ] + ] + ], + "timestamp": "2023-11-23T21:11:28.772327081" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,78807fd7b5d9df98730e6c66641b48a0" + ] + ], + "timestamp": "2023-11-23T21:11:28.7811548" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/junctionannotation/tests/tags.yml b/modules/nf-core/rseqc/junctionannotation/tests/tags.yml new file mode 100644 index 000000000..5f719fb8d --- /dev/null +++ b/modules/nf-core/rseqc/junctionannotation/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/junctionannotation: + - modules/nf-core/rseqc/junctionannotation/** diff --git a/modules/nf-core/rseqc/junctionsaturation/environment.yml b/modules/nf-core/rseqc/junctionsaturation/environment.yml new file mode 100644 index 000000000..78ffd06ad --- /dev/null +++ b/modules/nf-core/rseqc/junctionsaturation/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_junctionsaturation +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/junctionsaturation/main.nf b/modules/nf-core/rseqc/junctionsaturation/main.nf index 93cc61b23..552865bbf 100644 --- a/modules/nf-core/rseqc/junctionsaturation/main.nf +++ b/modules/nf-core/rseqc/junctionsaturation/main.nf @@ -2,7 +2,7 @@ process RSEQC_JUNCTIONSATURATION { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/junctionsaturation/meta.yml b/modules/nf-core/rseqc/junctionsaturation/meta.yml index 340fec0d0..19ae3f52d 100644 --- a/modules/nf-core/rseqc/junctionsaturation/meta.yml +++ b/modules/nf-core/rseqc/junctionsaturation/meta.yml @@ -43,3 +43,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test new file mode 100644 index 000000000..347b5fccd --- /dev/null +++ b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process RSEQC_JUNCTIONSATURATION" + script "../main.nf" + process "RSEQC_JUNCTIONSATURATION" + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/junctionsaturation" + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end: false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rscript).match("rscript") }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.pdf[0][1]).name).match("pdf") } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap new file mode 100644 index 000000000..708782da6 --- /dev/null +++ b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap @@ -0,0 +1,30 @@ +{ + "rscript": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.junctionSaturation_plot.r:md5,caa6e63dcb477aabb169882b2f30dadd" + ] + ] + ], + "timestamp": "2023-11-24T00:15:43.655261555" + }, + "pdf": { + "content": [ + "test.junctionSaturation_plot.pdf" + ], + "timestamp": "2023-11-24T00:15:43.682673802" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,2a187a15edb3a5ba114ab3d9f003a8bc" + ] + ], + "timestamp": "2023-11-24T00:15:43.667463564" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/junctionsaturation/tests/tags.yml b/modules/nf-core/rseqc/junctionsaturation/tests/tags.yml new file mode 100644 index 000000000..7022b59ad --- /dev/null +++ b/modules/nf-core/rseqc/junctionsaturation/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/junctionsaturation: + - modules/nf-core/rseqc/junctionsaturation/** diff --git a/modules/nf-core/rseqc/readdistribution/environment.yml b/modules/nf-core/rseqc/readdistribution/environment.yml new file mode 100644 index 000000000..a20fef74e --- /dev/null +++ b/modules/nf-core/rseqc/readdistribution/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_readdistribution +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/readdistribution/main.nf b/modules/nf-core/rseqc/readdistribution/main.nf index f3e588d69..901b364c0 100644 --- a/modules/nf-core/rseqc/readdistribution/main.nf +++ b/modules/nf-core/rseqc/readdistribution/main.nf @@ -2,7 +2,7 @@ process RSEQC_READDISTRIBUTION { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/readdistribution/meta.yml b/modules/nf-core/rseqc/readdistribution/meta.yml index 94c647120..989792faa 100644 --- a/modules/nf-core/rseqc/readdistribution/meta.yml +++ b/modules/nf-core/rseqc/readdistribution/meta.yml @@ -39,3 +39,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test new file mode 100644 index 000000000..4da721ab6 --- /dev/null +++ b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test @@ -0,0 +1,33 @@ +nextflow_process { + + name "Test Process RSEQC_READDISTRIBUTION" + script "../main.nf" + process "RSEQC_READDISTRIBUTION" + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/readdistribution" + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end: false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed12'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap new file mode 100644 index 000000000..90cf8b029 --- /dev/null +++ b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap @@ -0,0 +1,33 @@ +{ + "sarscov2 paired-end [bam]": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.read_distribution.txt:md5,56893fdc0809d968629a363551a1655f" + ] + ], + "1": [ + "versions.yml:md5,15fd23aafd4d3aeabc4fede518d1b3a4" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.read_distribution.txt:md5,56893fdc0809d968629a363551a1655f" + ] + ], + "versions": [ + "versions.yml:md5,15fd23aafd4d3aeabc4fede518d1b3a4" + ] + } + ], + "timestamp": "2023-11-24T00:35:28.404023432" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/readdistribution/tests/tags.yml b/modules/nf-core/rseqc/readdistribution/tests/tags.yml new file mode 100644 index 000000000..c0c477b6d --- /dev/null +++ b/modules/nf-core/rseqc/readdistribution/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/readdistribution: + - modules/nf-core/rseqc/readdistribution/** diff --git a/modules/nf-core/rseqc/readduplication/environment.yml b/modules/nf-core/rseqc/readduplication/environment.yml new file mode 100644 index 000000000..bba52d8fa --- /dev/null +++ b/modules/nf-core/rseqc/readduplication/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_readduplication +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/readduplication/main.nf b/modules/nf-core/rseqc/readduplication/main.nf index 023118536..68c1296ea 100644 --- a/modules/nf-core/rseqc/readduplication/main.nf +++ b/modules/nf-core/rseqc/readduplication/main.nf @@ -2,7 +2,7 @@ process RSEQC_READDUPLICATION { tag "$meta.id" label 'process_medium' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/readduplication/meta.yml b/modules/nf-core/rseqc/readduplication/meta.yml index 5a8666435..4b24d3032 100644 --- a/modules/nf-core/rseqc/readduplication/meta.yml +++ b/modules/nf-core/rseqc/readduplication/meta.yml @@ -3,6 +3,8 @@ description: Calculate read duplication rate keywords: - rnaseq - duplication + - sequence-based + - mapping-based tools: - rseqc: description: | @@ -50,3 +52,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/modules/nf-core/rseqc/readduplication/tests/main.nf.test b/modules/nf-core/rseqc/readduplication/tests/main.nf.test new file mode 100644 index 000000000..93d0cccd6 --- /dev/null +++ b/modules/nf-core/rseqc/readduplication/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_process { + + name "Test Process RSEQC_READDUPLICATION" + script "../main.nf" + process "RSEQC_READDUPLICATION" + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/readduplication" + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end: false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.seq_xls).match("seq_xls") }, + { assert snapshot(process.out.pos_xls).match("pos_xls") }, + { assert snapshot(process.out.rscript).match("rscript") }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.pdf[0][1]).name).match("pdf") } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap b/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap new file mode 100644 index 000000000..e3e4ec3fd --- /dev/null +++ b/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap @@ -0,0 +1,58 @@ +{ + "pos_xls": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.pos.DupRate.xls:md5,a859bc2031d46bf1cc4336205847caa3" + ] + ] + ], + "timestamp": "2023-11-24T00:52:45.27809706" + }, + "rscript": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.DupRate_plot.r:md5,3c0325095cee4835b921e57d61c23dca" + ] + ] + ], + "timestamp": "2023-11-24T00:52:45.285457599" + }, + "pdf": { + "content": [ + "test.DupRate_plot.pdf" + ], + "timestamp": "2023-11-24T00:52:45.304152477" + }, + "seq_xls": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.seq.DupRate.xls:md5,ee8783399eec5a18522a6f08bece338b" + ] + ] + ], + "timestamp": "2023-11-24T00:52:45.262656562" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,06a70ece474de57fc1dc7585e7cfd5a0" + ] + ], + "timestamp": "2023-11-24T00:52:45.292599738" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/readduplication/tests/tags.yml b/modules/nf-core/rseqc/readduplication/tests/tags.yml new file mode 100644 index 000000000..fce3d35d4 --- /dev/null +++ b/modules/nf-core/rseqc/readduplication/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/readduplication: + - modules/nf-core/rseqc/readduplication/** diff --git a/modules/nf-core/rseqc/tin/environment.yml b/modules/nf-core/rseqc/tin/environment.yml new file mode 100644 index 000000000..48b7efa53 --- /dev/null +++ b/modules/nf-core/rseqc/tin/environment.yml @@ -0,0 +1,8 @@ +name: rseqc_tin +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::rseqc=3.0.1 + - conda-forge::r-base>=3.5 diff --git a/modules/nf-core/rseqc/tin/main.nf b/modules/nf-core/rseqc/tin/main.nf index 872938b62..718aabb89 100644 --- a/modules/nf-core/rseqc/tin/main.nf +++ b/modules/nf-core/rseqc/tin/main.nf @@ -2,7 +2,7 @@ process RSEQC_TIN { tag "$meta.id" label 'process_high' - conda "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : 'biocontainers/rseqc:3.0.1--py37h516909a_1' }" diff --git a/modules/nf-core/rseqc/tin/meta.yml b/modules/nf-core/rseqc/tin/meta.yml index 381edfde0..f760bb2f4 100644 --- a/modules/nf-core/rseqc/tin/meta.yml +++ b/modules/nf-core/rseqc/tin/meta.yml @@ -46,3 +46,5 @@ output: pattern: "versions.yml" authors: - "@drpatelh" +maintainers: + - "@drpatelh" diff --git a/modules/nf-core/rseqc/tin/tests/main.nf.test b/modules/nf-core/rseqc/tin/tests/main.nf.test new file mode 100644 index 000000000..c339d343a --- /dev/null +++ b/modules/nf-core/rseqc/tin/tests/main.nf.test @@ -0,0 +1,35 @@ +nextflow_process { + + name "Test Process RSEQC_TIN" + script "../main.nf" + process "RSEQC_TIN" + tag "modules" + tag "modules_nfcore" + tag "rseqc" + tag "rseqc/tin" + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/rseqc/tin/tests/main.nf.test.snap b/modules/nf-core/rseqc/tin/tests/main.nf.test.snap new file mode 100644 index 000000000..4bed8ac9b --- /dev/null +++ b/modules/nf-core/rseqc/tin/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "sarscov2 paired-end [bam]": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.summary.txt:md5,9d98447e178b89a89f6f5aba7a772fe6" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.tin.xls:md5,6b1b1b0dc1dc265342ba8c3f27fa60e6" + ] + ], + "2": [ + "versions.yml:md5,77a0664abb6e486d1a0dd2078d4916d2" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.summary.txt:md5,9d98447e178b89a89f6f5aba7a772fe6" + ] + ], + "versions": [ + "versions.yml:md5,77a0664abb6e486d1a0dd2078d4916d2" + ], + "xls": [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.tin.xls:md5,6b1b1b0dc1dc265342ba8c3f27fa60e6" + ] + ] + } + ], + "timestamp": "2023-11-24T02:30:03.446989864" + } +} \ No newline at end of file diff --git a/modules/nf-core/rseqc/tin/tests/tags.yml b/modules/nf-core/rseqc/tin/tests/tags.yml new file mode 100644 index 000000000..741bbd0c0 --- /dev/null +++ b/modules/nf-core/rseqc/tin/tests/tags.yml @@ -0,0 +1,2 @@ +rseqc/tin: + - modules/nf-core/rseqc/tin/** diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index a698b30ab..65fb18609 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -28,141 +28,149 @@ workflow BAM_RSEQC { // // Run RSeQC bam_stat.py // - bamstat_txt = Channel.empty() + ch_bamstat = Channel.empty() if ('bam_stat' in rseqc_modules) { RSEQC_BAMSTAT ( ch_bam ) - bamstat_txt = RSEQC_BAMSTAT.out.txt + ch_bamstat = RSEQC_BAMSTAT.out.txt ch_versions = ch_versions.mix(RSEQC_BAMSTAT.out.versions.first()) } // // Run RSeQC inner_distance.py // - innerdistance_distance = Channel.empty() - innerdistance_freq = Channel.empty() - innerdistance_mean = Channel.empty() - innerdistance_pdf = Channel.empty() - innerdistance_rscript = Channel.empty() + ch_innerdistance_distance = Channel.empty() + ch_innerdistance_freq = Channel.empty() + ch_innerdistance_mean = Channel.empty() + ch_innerdistance_pdf = Channel.empty() + ch_innerdistance_rscript = Channel.empty() if ('inner_distance' in rseqc_modules) { RSEQC_INNERDISTANCE ( ch_bam, ch_bed ) - innerdistance_distance = RSEQC_INNERDISTANCE.out.distance - innerdistance_freq = RSEQC_INNERDISTANCE.out.freq - innerdistance_mean = RSEQC_INNERDISTANCE.out.mean - innerdistance_pdf = RSEQC_INNERDISTANCE.out.pdf - innerdistance_rscript = RSEQC_INNERDISTANCE.out.rscript - ch_versions = ch_versions.mix(RSEQC_INNERDISTANCE.out.versions.first()) + ch_innerdistance_distance = RSEQC_INNERDISTANCE.out.distance + ch_innerdistance_freq = RSEQC_INNERDISTANCE.out.freq + ch_innerdistance_mean = RSEQC_INNERDISTANCE.out.mean + ch_innerdistance_pdf = RSEQC_INNERDISTANCE.out.pdf + ch_innerdistance_rscript = RSEQC_INNERDISTANCE.out.rscript + ch_inner_distance = ch_innerdistance_distance.mix(ch_innerdistance_freq, ch_innerdistance_mean, ch_innerdistance_pdf, ch_innerdistance_rscript) + ch_versions = ch_versions.mix(RSEQC_INNERDISTANCE.out.versions.first()) } // // Run RSeQC infer_experiment.py // - inferexperiment_txt = Channel.empty() + ch_inferexperiment = Channel.empty() if ('infer_experiment' in rseqc_modules) { RSEQC_INFEREXPERIMENT ( ch_bam, ch_bed ) - inferexperiment_txt = RSEQC_INFEREXPERIMENT.out.txt - ch_versions = ch_versions.mix(RSEQC_INFEREXPERIMENT.out.versions.first()) + ch_inferexperiment = RSEQC_INFEREXPERIMENT.out.txt + ch_versions = ch_versions.mix(RSEQC_INFEREXPERIMENT.out.versions.first()) } // // Run RSeQC junction_annotation.py // - junctionannotation_bed = Channel.empty() - junctionannotation_interact_bed = Channel.empty() - junctionannotation_xls = Channel.empty() - junctionannotation_pdf = Channel.empty() - junctionannotation_events_pdf = Channel.empty() - junctionannotation_rscript = Channel.empty() - junctionannotation_log = Channel.empty() + ch_junctionannotation_bed = Channel.empty() + ch_junctionannotation_interact_bed = Channel.empty() + ch_junctionannotation_xls = Channel.empty() + ch_junctionannotation_pdf = Channel.empty() + ch_junctionannotation_events_pdf = Channel.empty() + ch_junctionannotation_rscript = Channel.empty() + ch_junctionannotation_log = Channel.empty() if ('junction_annotation' in rseqc_modules) { RSEQC_JUNCTIONANNOTATION ( ch_bam, ch_bed ) - junctionannotation_bed = RSEQC_JUNCTIONANNOTATION.out.bed - junctionannotation_interact_bed = RSEQC_JUNCTIONANNOTATION.out.interact_bed - junctionannotation_xls = RSEQC_JUNCTIONANNOTATION.out.xls - junctionannotation_pdf = RSEQC_JUNCTIONANNOTATION.out.pdf - junctionannotation_events_pdf = RSEQC_JUNCTIONANNOTATION.out.events_pdf - junctionannotation_rscript = RSEQC_JUNCTIONANNOTATION.out.rscript - junctionannotation_log = RSEQC_JUNCTIONANNOTATION.out.log - ch_versions = ch_versions.mix(RSEQC_JUNCTIONANNOTATION.out.versions.first()) + ch_junctionannotation_bed = RSEQC_JUNCTIONANNOTATION.out.bed + ch_junctionannotation_interact_bed = RSEQC_JUNCTIONANNOTATION.out.interact_bed + ch_junctionannotation_xls = RSEQC_JUNCTIONANNOTATION.out.xls + ch_junctionannotation_pdf = RSEQC_JUNCTIONANNOTATION.out.pdf + ch_junctionannotation_events_pdf = RSEQC_JUNCTIONANNOTATION.out.events_pdf + ch_junctionannotation_rscript = RSEQC_JUNCTIONANNOTATION.out.rscript + ch_junctionannotation_log = RSEQC_JUNCTIONANNOTATION.out.log + ch_junction_annotation = ch_junctionannotation_bed.mix(ch_junctionannotation_interact_bed, ch_junctionannotation_xls, ch_junctionannotation_pdf, ch_junctionannotation_events_pdf, ch_junctionannotation_rscript, ch_junctionannotation_log) + ch_versions = ch_versions.mix(RSEQC_JUNCTIONANNOTATION.out.versions.first()) } // // Run RSeQC junction_saturation.py // - junctionsaturation_pdf = Channel.empty() - junctionsaturation_rscript = Channel.empty() + ch_junctionsaturation_pdf = Channel.empty() + ch_junctionsaturation_rscript = Channel.empty() if ('junction_saturation' in rseqc_modules) { RSEQC_JUNCTIONSATURATION ( ch_bam, ch_bed ) - junctionsaturation_pdf = RSEQC_JUNCTIONSATURATION.out.pdf - junctionsaturation_rscript = RSEQC_JUNCTIONSATURATION.out.rscript - ch_versions = ch_versions.mix(RSEQC_JUNCTIONSATURATION.out.versions.first()) + ch_junctionsaturation_pdf = RSEQC_JUNCTIONSATURATION.out.pdf + ch_junctionsaturation_rscript = RSEQC_JUNCTIONSATURATION.out.rscript + ch_junction_saturation = ch_junctionsaturation_pdf.mix(ch_junctionsaturation_rscript) + ch_versions = ch_versions.mix(RSEQC_JUNCTIONSATURATION.out.versions.first()) } // // Run RSeQC read_distribution.py // - readdistribution_txt = Channel.empty() + ch_readdistribution = Channel.empty() if ('read_distribution' in rseqc_modules) { RSEQC_READDISTRIBUTION ( ch_bam, ch_bed ) - readdistribution_txt = RSEQC_READDISTRIBUTION.out.txt - ch_versions = ch_versions.mix(RSEQC_READDISTRIBUTION.out.versions.first()) + ch_readdistribution = RSEQC_READDISTRIBUTION.out.txt + ch_versions = ch_versions.mix(RSEQC_READDISTRIBUTION.out.versions.first()) } // // Run RSeQC read_duplication.py // - readduplication_seq_xls = Channel.empty() - readduplication_pos_xls = Channel.empty() - readduplication_pdf = Channel.empty() - readduplication_rscript = Channel.empty() + ch_readduplication_seq_xls = Channel.empty() + ch_readduplication_pos_xls = Channel.empty() + ch_readduplication_pdf = Channel.empty() + ch_readduplication_rscript = Channel.empty() if ('read_duplication' in rseqc_modules) { RSEQC_READDUPLICATION ( ch_bam ) - readduplication_seq_xls = RSEQC_READDUPLICATION.out.seq_xls - readduplication_pos_xls = RSEQC_READDUPLICATION.out.pos_xls - readduplication_pdf = RSEQC_READDUPLICATION.out.pdf - readduplication_rscript = RSEQC_READDUPLICATION.out.rscript - ch_versions = ch_versions.mix(RSEQC_READDUPLICATION.out.versions.first()) + ch_readduplication_seq_xls = RSEQC_READDUPLICATION.out.seq_xls + ch_readduplication_pos_xls = RSEQC_READDUPLICATION.out.pos_xls + ch_readduplication_pdf = RSEQC_READDUPLICATION.out.pdf + ch_readduplication_rscript = RSEQC_READDUPLICATION.out.rscript + ch_read_duplication = ch_readduplication_seq_xls.mix(ch_readduplication_pos_xls, ch_readduplication_pdf, ch_readduplication_rscript) + ch_versions = ch_versions.mix(RSEQC_READDUPLICATION.out.versions.first()) } // // Run RSeQC tin.py // - tin_txt = Channel.empty() + ch_tin = Channel.empty() if ('tin' in rseqc_modules) { RSEQC_TIN ( ch_bam_bai, ch_bed ) - tin_txt = RSEQC_TIN.out.txt + ch_tin = RSEQC_TIN.out.txt ch_versions = ch_versions.mix(RSEQC_TIN.out.versions.first()) } emit: - bamstat_txt // channel: [ val(meta), txt ] - - innerdistance_distance // channel: [ val(meta), txt ] - innerdistance_freq // channel: [ val(meta), txt ] - innerdistance_mean // channel: [ val(meta), txt ] - innerdistance_pdf // channel: [ val(meta), pdf ] - innerdistance_rscript // channel: [ val(meta), r ] - - inferexperiment_txt // channel: [ val(meta), txt ] - - junctionannotation_bed // channel: [ val(meta), bed ] - junctionannotation_interact_bed // channel: [ val(meta), bed ] - junctionannotation_xls // channel: [ val(meta), xls ] - junctionannotation_pdf // channel: [ val(meta), pdf ] - junctionannotation_events_pdf // channel: [ val(meta), pdf ] - junctionannotation_rscript // channel: [ val(meta), r ] - junctionannotation_log // channel: [ val(meta), log ] - - junctionsaturation_pdf // channel: [ val(meta), pdf ] - junctionsaturation_rscript // channel: [ val(meta), r ] - - readdistribution_txt // channel: [ val(meta), txt ] - - readduplication_seq_xls // channel: [ val(meta), xls ] - readduplication_pos_xls // channel: [ val(meta), xls ] - readduplication_pdf // channel: [ val(meta), pdf ] - readduplication_rscript // channel: [ val(meta), r ] - - tin_txt // channel: [ val(meta), txt ] + ch_bamstat // channel: [ val(meta), txt ] + + ch_inner_distance + ch_innerdistance_distance // channel: [ val(meta), txt ] + ch_innerdistance_freq // channel: [ val(meta), txt ] + ch_innerdistance_mean // channel: [ val(meta), txt ] + ch_innerdistance_pdf // channel: [ val(meta), pdf ] + ch_innerdistance_rscript // channel: [ val(meta), r ] + + ch_inferexperiment // channel: [ val(meta), txt ] + + ch_junction_annotation + ch_junctionannotation_bed // channel: [ val(meta), bed ] + ch_junctionannotation_interact_bed // channel: [ val(meta), bed ] + ch_junctionannotation_xls // channel: [ val(meta), xls ] + ch_junctionannotation_pdf // channel: [ val(meta), pdf ] + ch_junctionannotation_events_pdf // channel: [ val(meta), pdf ] + ch_junctionannotation_rscript // channel: [ val(meta), r ] + ch_junctionannotation_log // channel: [ val(meta), log ] + + ch_junction_saturation + ch_junctionsaturation_pdf // channel: [ val(meta), pdf ] + ch_junctionsaturation_rscript // channel: [ val(meta), r ] + + ch_readdistribution // channel: [ val(meta), txt ] + + ch_read_duplication + ch_readduplication_seq_xls // channel: [ val(meta), xls ] + ch_readduplication_pos_xls // channel: [ val(meta), xls ] + ch_readduplication_pdf // channel: [ val(meta), pdf ] + ch_readduplication_rscript // channel: [ val(meta), r ] + + ch_tin // channel: [ val(meta), txt ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/bam_rseqc/meta.yml b/subworkflows/nf-core/bam_rseqc/meta.yml index 428b83e6d..781922de7 100644 --- a/subworkflows/nf-core/bam_rseqc/meta.yml +++ b/subworkflows/nf-core/bam_rseqc/meta.yml @@ -12,8 +12,16 @@ keywords: - readdistribution - readduplication - tin -modules: +components: - rseqc + - rseqc/tin + - rseqc/readduplication + - rseqc/readdistribution + - rseqc/junctionsaturation + - rseqc/junctionannotation + - rseqc/innerdistance + - rseqc/inferexperiment + - rseqc/bamstat input: - meta: type: map @@ -133,3 +141,6 @@ output: authors: - "@drpatelh" - "@kevinmenden" +maintainers: + - "@drpatelh" + - "@kevinmenden" diff --git a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test new file mode 100644 index 000000000..976fb67e8 --- /dev/null +++ b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test @@ -0,0 +1,65 @@ +nextflow_workflow { + + name "Test Workflow BAM_RSEQC" + script "../main.nf" + workflow "BAM_RSEQC" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_rseqc" + tag "bam_rseqc" + tag "rseqc" + tag "rseqc/bamstat" + tag "rseqc/inferexperiment" + tag "rseqc/innerdistance" + tag "rseqc/junctionannotation" + tag "rseqc/junctionsaturation" + tag "rseqc/readdistribution" + tag "rseqc/readduplication" + tag "rseqc/tin" + + test("sarscov2 paired-end [bam]") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ]) + input[1] = file(params.test_data['sarscov2']['genome']['test_bed12'], checkIfExists: true) + input[2] = ['bam_stat', 'inner_distance', 'infer_experiment', 'junction_annotation', 'junction_saturation', 'read_distribution', 'read_duplication', 'tin'] + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out.ch_bamstat).match("bamstat")}, + + { assert snapshot(workflow.out.ch_inner_distance.findAll { it[1].endsWith('.pdf') == false }).match("inner_distance")}, + { assert workflow.out.ch_inner_distance.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + + { assert snapshot(workflow.out.ch_inferexperiment).match("inferexperiment")}, + + { assert snapshot(workflow.out.ch_junction_annotation.findAll { + it[1].endsWith('.xls') == false && + it[1].endsWith('.r') == false }).match("junction_annotation")}, + + { assert snapshot(workflow.out.ch_junction_saturation.findAll { it[1].endsWith('.pdf') == false }).match("junction_saturation")}, + { assert workflow.out.ch_junction_saturation.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + + { assert snapshot(workflow.out.ch_readdistribution).match("readdistribution")}, + { assert snapshot(workflow.out.ch_read_duplication.findAll { it[1].endsWith('.pdf') == false }).match("read_duplication")}, + + { assert workflow.out.ch_read_duplication.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + + { assert snapshot(workflow.out.ch_tin).match("tin")}, + { assert snapshot(workflow.out.versions).match("versions")}, + ) + } + + } + +} diff --git a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap new file mode 100644 index 000000000..98b8b2eab --- /dev/null +++ b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap @@ -0,0 +1,151 @@ +{ + "inner_distance": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.inner_distance.txt:md5,a1acc9def0f64a5500d4c4cb47cbe32b" + ], + [ + { + "id": "test" + }, + "test.inner_distance_freq.txt:md5,3fc037501f5899b5da009c8ce02fc25e" + ], + [ + { + "id": "test" + }, + "test.inner_distance_mean.txt:md5,58398b7d5a29a5e564f9e3c50b55996c" + ], + [ + { + "id": "test" + }, + "test.inner_distance_plot.r:md5,5859fbd5b42046d47e8b9aa85077f4ea" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.884125559" + }, + "junction_saturation": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.junctionSaturation_plot.r:md5,caa6e63dcb477aabb169882b2f30dadd" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.919027887" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,07b3ad789260bd746d872e7ff18153b2", + "versions.yml:md5,59d1ee2d13b29d10549187562d8fe1e0", + "versions.yml:md5,5eb5515f8009effdbb601170bb90ba29", + "versions.yml:md5,71818a5705b87b9d5c2532403a436bd8", + "versions.yml:md5,a09f406b0da71ca4291fd935e49d377d", + "versions.yml:md5,c9124387d6090cb4c94aaa9bf0e1c321", + "versions.yml:md5,e1e69eaa546288ace5e97285313e1420", + "versions.yml:md5,fe3bf0ac57c99687880ee62b28a4d4df" + ] + ], + "timestamp": "2023-11-25T18:02:43.951402764" + }, + "tin": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.summary.txt:md5,9d98447e178b89a89f6f5aba7a772fe6" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.943409965" + }, + "bamstat": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.bam_stat.txt:md5,2675857864c1d1139b2a19d25dc36b09" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.862772491" + }, + "inferexperiment": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.infer_experiment.txt:md5,f9d0bfc239df637cd8aeda40ade3c59a" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.899686868" + }, + "read_duplication": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.DupRate_plot.r:md5,3c0325095cee4835b921e57d61c23dca" + ], + [ + { + "id": "test" + }, + "test.pos.DupRate.xls:md5,a859bc2031d46bf1cc4336205847caa3" + ], + [ + { + "id": "test" + }, + "test.seq.DupRate.xls:md5,ee8783399eec5a18522a6f08bece338b" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.934467786" + }, + "junction_annotation": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.junction_annotation.log:md5,d75e0f5d62fada8aa9449991b209554c" + ] + ] + ], + "timestamp": "2023-11-25T18:49:45.387109599" + }, + "readdistribution": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.read_distribution.txt:md5,56893fdc0809d968629a363551a1655f" + ] + ] + ], + "timestamp": "2023-11-25T18:02:43.926520106" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_rseqc/tests/tags.yml b/subworkflows/nf-core/bam_rseqc/tests/tags.yml new file mode 100644 index 000000000..c8dfce3a9 --- /dev/null +++ b/subworkflows/nf-core/bam_rseqc/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/bam_rseqc: + - subworkflows/nf-core/bam_rseqc/** From c9fd01c19815454b6efdcf350cc7c39939f91288 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 12:27:28 +0000 Subject: [PATCH 4/8] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81a5f41f3..6e89eb70b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PR #1135](https://github.com/nf-core/rnaseq/pull/1135) - Update [action-tower-launch](https://github.com/marketplace/actions/action-tower-launch) to v2 which supports more variable handling. - [PR #1138](https://github.com/nf-core/rnaseq/pull/1138) - Updates FASTQC and UMITOOLS modules and their dependencies which have had their version string extraction commands updated ([#1103](https://github.com/nf-core/rnaseq/issues/1103)) +- Picard module version updated 3.0.0 -> 3.1.1. +- Samtools module version updated 1.17 -> 1.18. +- Update Rseqc and Fastp modules to print STDERR to screen and file. + ### Software dependencies From 9e5cdc74980676f3ebd9593283b7c22884fb6920 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 12:30:42 +0000 Subject: [PATCH 5/8] Fix formatting --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e89eb70b..6de4afaa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Samtools module version updated 1.17 -> 1.18. - Update Rseqc and Fastp modules to print STDERR to screen and file. - ### Software dependencies ### Modules / Subworkflows From 75dde11d590c8eb252cfd455221a0d6f9f4367e4 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 13:01:19 +0000 Subject: [PATCH 6/8] Update channel names from bam_rseqc subworkflow update --- workflows/rnaseq.nf | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/workflows/rnaseq.nf b/workflows/rnaseq.nf index f8def2d10..5827b753a 100755 --- a/workflows/rnaseq.nf +++ b/workflows/rnaseq.nf @@ -40,15 +40,15 @@ if (!params.skip_alignment) { prepareToolIndices << params.aligner } if (!params.skip_pseudo_alignment && params.pseudo_aligner) { prepareToolIndices << params.pseudo_aligner } // Determine whether to filter the GTF or not -def filterGtf = +def filterGtf = (( // Condition 1: Alignment is required and aligner is set !params.skip_alignment && params.aligner - ) || + ) || ( // Condition 2: Pseudoalignment is required and pseudoaligner is set !params.skip_pseudo_alignment && params.pseudo_aligner - ) || + ) || ( // Condition 3: Transcript FASTA file is not provided !params.transcript_fasta @@ -774,14 +774,14 @@ workflow RNASEQ { PREPARE_GENOME.out.gene_bed, rseqc_modules ) - ch_bamstat_multiqc = BAM_RSEQC.out.bamstat_txt - ch_inferexperiment_multiqc = BAM_RSEQC.out.inferexperiment_txt - ch_innerdistance_multiqc = BAM_RSEQC.out.innerdistance_freq - ch_junctionannotation_multiqc = BAM_RSEQC.out.junctionannotation_log - ch_junctionsaturation_multiqc = BAM_RSEQC.out.junctionsaturation_rscript - ch_readdistribution_multiqc = BAM_RSEQC.out.readdistribution_txt - ch_readduplication_multiqc = BAM_RSEQC.out.readduplication_pos_xls - ch_tin_multiqc = BAM_RSEQC.out.tin_txt + ch_bamstat_multiqc = BAM_RSEQC.out.ch_bamstat + ch_inferexperiment_multiqc = BAM_RSEQC.out.ch_inferexperiment + ch_innerdistance_multiqc = BAM_RSEQC.out.ch_innerdistance_freq + ch_junctionannotation_multiqc = BAM_RSEQC.out.ch_junctionannotation_log + ch_junctionsaturation_multiqc = BAM_RSEQC.out.ch_junctionsaturation_rscript + ch_readdistribution_multiqc = BAM_RSEQC.out.ch_readdistribution + ch_readduplication_multiqc = BAM_RSEQC.out.ch_readduplication_pos_xls + ch_tin_multiqc = BAM_RSEQC.out.ch_tin ch_versions = ch_versions.mix(BAM_RSEQC.out.versions) ch_inferexperiment_multiqc @@ -816,7 +816,7 @@ workflow RNASEQ { // ch_pseudo_multiqc = Channel.empty() ch_pseudoaligner_pca_multiqc = Channel.empty() - ch_pseudoaligner_clustering_multiqc = Channel.empty() + ch_pseudoaligner_clustering_multiqc = Channel.empty() if (!params.skip_pseudo_alignment && params.pseudo_aligner) { if (params.pseudo_aligner == 'salmon') { @@ -851,7 +851,7 @@ workflow RNASEQ { ch_versions = ch_versions.mix(DESEQ2_QC_PSEUDO.out.versions) } } - + // // MODULE: Pipeline reporting // @@ -922,7 +922,7 @@ workflow.onComplete { if (params.email || params.email_on_fail) { NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report, pass_mapped_reads, pass_trimmed_reads, pass_strand_check) } - + NfcoreTemplate.dump_parameters(workflow, params) NfcoreTemplate.summary(workflow, params, log, pass_mapped_reads, pass_trimmed_reads, pass_strand_check) From a294bb5c3c43cd311737569189056c7ae2733460 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 15:25:32 +0000 Subject: [PATCH 7/8] Update bam_rseqc subworkflow again --- modules.json | 2 +- subworkflows/nf-core/bam_rseqc/main.nf | 30 ++++++---- subworkflows/nf-core/bam_rseqc/meta.yml | 60 ++++++++++++------- .../nf-core/bam_rseqc/tests/main.nf.test | 45 +++++++++++--- .../nf-core/bam_rseqc/tests/main.nf.test.snap | 18 +++--- 5 files changed, 103 insertions(+), 52 deletions(-) diff --git a/modules.json b/modules.json index f24a07889..31bd38cc9 100644 --- a/modules.json +++ b/modules.json @@ -250,7 +250,7 @@ }, "bam_rseqc": { "branch": "master", - "git_sha": "045c3b47040a8284766b78500801ec21e7678277", + "git_sha": "92793c143c93acd9129f15f35f25d3aab2b23c0e", "installed_by": ["subworkflows"] }, "bam_sort_stats_samtools": { diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index 65fb18609..bf530f09d 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -38,6 +38,7 @@ workflow BAM_RSEQC { // // Run RSeQC inner_distance.py // + ch_innerdistance = Channel.empty() ch_innerdistance_distance = Channel.empty() ch_innerdistance_freq = Channel.empty() ch_innerdistance_mean = Channel.empty() @@ -50,7 +51,7 @@ workflow BAM_RSEQC { ch_innerdistance_mean = RSEQC_INNERDISTANCE.out.mean ch_innerdistance_pdf = RSEQC_INNERDISTANCE.out.pdf ch_innerdistance_rscript = RSEQC_INNERDISTANCE.out.rscript - ch_inner_distance = ch_innerdistance_distance.mix(ch_innerdistance_freq, ch_innerdistance_mean, ch_innerdistance_pdf, ch_innerdistance_rscript) + ch_innerdistance = ch_innerdistance_distance.mix(ch_innerdistance_freq, ch_innerdistance_mean, ch_innerdistance_pdf, ch_innerdistance_rscript) ch_versions = ch_versions.mix(RSEQC_INNERDISTANCE.out.versions.first()) } @@ -67,6 +68,7 @@ workflow BAM_RSEQC { // // Run RSeQC junction_annotation.py // + ch_junctionannotation = Channel.empty() ch_junctionannotation_bed = Channel.empty() ch_junctionannotation_interact_bed = Channel.empty() ch_junctionannotation_xls = Channel.empty() @@ -83,20 +85,21 @@ workflow BAM_RSEQC { ch_junctionannotation_events_pdf = RSEQC_JUNCTIONANNOTATION.out.events_pdf ch_junctionannotation_rscript = RSEQC_JUNCTIONANNOTATION.out.rscript ch_junctionannotation_log = RSEQC_JUNCTIONANNOTATION.out.log - ch_junction_annotation = ch_junctionannotation_bed.mix(ch_junctionannotation_interact_bed, ch_junctionannotation_xls, ch_junctionannotation_pdf, ch_junctionannotation_events_pdf, ch_junctionannotation_rscript, ch_junctionannotation_log) + ch_junctionannotation = ch_junctionannotation_bed.mix(ch_junctionannotation_interact_bed, ch_junctionannotation_xls, ch_junctionannotation_pdf, ch_junctionannotation_events_pdf, ch_junctionannotation_rscript, ch_junctionannotation_log) ch_versions = ch_versions.mix(RSEQC_JUNCTIONANNOTATION.out.versions.first()) } // // Run RSeQC junction_saturation.py // + ch_junctionsaturation = Channel.empty() ch_junctionsaturation_pdf = Channel.empty() ch_junctionsaturation_rscript = Channel.empty() if ('junction_saturation' in rseqc_modules) { RSEQC_JUNCTIONSATURATION ( ch_bam, ch_bed ) ch_junctionsaturation_pdf = RSEQC_JUNCTIONSATURATION.out.pdf ch_junctionsaturation_rscript = RSEQC_JUNCTIONSATURATION.out.rscript - ch_junction_saturation = ch_junctionsaturation_pdf.mix(ch_junctionsaturation_rscript) + ch_junctionsaturation = ch_junctionsaturation_pdf.mix(ch_junctionsaturation_rscript) ch_versions = ch_versions.mix(RSEQC_JUNCTIONSATURATION.out.versions.first()) } @@ -113,6 +116,7 @@ workflow BAM_RSEQC { // // Run RSeQC read_duplication.py // + ch_readduplication = Channel.empty() ch_readduplication_seq_xls = Channel.empty() ch_readduplication_pos_xls = Channel.empty() ch_readduplication_pdf = Channel.empty() @@ -123,7 +127,7 @@ workflow BAM_RSEQC { ch_readduplication_pos_xls = RSEQC_READDUPLICATION.out.pos_xls ch_readduplication_pdf = RSEQC_READDUPLICATION.out.pdf ch_readduplication_rscript = RSEQC_READDUPLICATION.out.rscript - ch_read_duplication = ch_readduplication_seq_xls.mix(ch_readduplication_pos_xls, ch_readduplication_pdf, ch_readduplication_rscript) + ch_readduplication = ch_readduplication_seq_xls.mix(ch_readduplication_pos_xls, ch_readduplication_pdf, ch_readduplication_rscript) ch_versions = ch_versions.mix(RSEQC_READDUPLICATION.out.versions.first()) } @@ -138,18 +142,18 @@ workflow BAM_RSEQC { } emit: - ch_bamstat // channel: [ val(meta), txt ] + ch_bamstat // channel: [ val(meta), txt ] - ch_inner_distance + ch_innerdistance ch_innerdistance_distance // channel: [ val(meta), txt ] ch_innerdistance_freq // channel: [ val(meta), txt ] ch_innerdistance_mean // channel: [ val(meta), txt ] ch_innerdistance_pdf // channel: [ val(meta), pdf ] ch_innerdistance_rscript // channel: [ val(meta), r ] - ch_inferexperiment // channel: [ val(meta), txt ] + ch_inferexperiment // channel: [ val(meta), txt ] - ch_junction_annotation + ch_junctionannotation ch_junctionannotation_bed // channel: [ val(meta), bed ] ch_junctionannotation_interact_bed // channel: [ val(meta), bed ] ch_junctionannotation_xls // channel: [ val(meta), xls ] @@ -158,19 +162,19 @@ workflow BAM_RSEQC { ch_junctionannotation_rscript // channel: [ val(meta), r ] ch_junctionannotation_log // channel: [ val(meta), log ] - ch_junction_saturation + ch_junctionsaturation ch_junctionsaturation_pdf // channel: [ val(meta), pdf ] ch_junctionsaturation_rscript // channel: [ val(meta), r ] - ch_readdistribution // channel: [ val(meta), txt ] + ch_readdistribution // channel: [ val(meta), txt ] - ch_read_duplication + ch_readduplication ch_readduplication_seq_xls // channel: [ val(meta), xls ] ch_readduplication_pos_xls // channel: [ val(meta), xls ] ch_readduplication_pdf // channel: [ val(meta), pdf ] ch_readduplication_rscript // channel: [ val(meta), r ] - ch_tin // channel: [ val(meta), txt ] + ch_tin // channel: [ val(meta), txt ] - versions = ch_versions // channel: [ versions.yml ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/bam_rseqc/meta.yml b/subworkflows/nf-core/bam_rseqc/meta.yml index 781922de7..2fef88737 100644 --- a/subworkflows/nf-core/bam_rseqc/meta.yml +++ b/subworkflows/nf-core/bam_rseqc/meta.yml @@ -46,91 +46,107 @@ input: List of rseqc modules to run e.g. [ 'bam_stat', 'infer_experiment' ] output: - - bamstat_txt: + - ch_bamstat: type: file description: bam statistics report pattern: "*.bam_stat.txt" - - innerdistance_distance: + - ch_innerdistance: + type: file + description: All the output files from RSEQC_INNERDISTANCE + pattern: "*.{txt,pdf,R}" + - ch_innerdistance_distance: type: file description: the inner distances pattern: "*.inner_distance.txt" - - innerdistance_freq: + - ch_innerdistance_freq: type: file description: frequencies of different insert sizes pattern: "*.inner_distance_freq.txt" - - innerdistance_mean: + - ch_innerdistance_mean: type: file description: mean/median values of inner distances pattern: "*.inner_distance_mean.txt" - - innerdistance_pdf: + - ch_innerdistance_pdf: type: file description: distribution plot of inner distances pattern: "*.inner_distance_plot.pdf" - - innerdistance_rscript: + - ch_innerdistance_rscript: type: file description: script to reproduce the plot pattern: "*.inner_distance_plot.R" - - inferexperiment_txt: + - ch_inferexperiment: type: file description: infer_experiment results report pattern: "*.infer_experiment.txt" - - junctionannotation_bed: + - ch_junctionannotation: + type: file + description: All the output files from RSEQC_JUNCTIONANNOTATION + pattern: "*.{bed,xls,pdf,R,log}" + - ch_junctionannotation_bed: type: file description: bed file of annotated junctions pattern: "*.junction.bed" - - junctionannotation_interact_bed: + - ch_junctionannotation_interact_bed: type: file description: Interact bed file pattern: "*.Interact.bed" - - junctionannotation_xls: + - ch_junctionannotation_xls: type: file description: xls file with junction information pattern: "*.xls" - - junctionannotation_pdf: + - ch_junctionannotation_pdf: type: file description: junction plot pattern: "*.junction.pdf" - - junctionannotation_events_pdf: + - ch_junctionannotation_events_pdf: type: file description: events plot pattern: "*.events.pdf" - - junctionannotation_rscript: + - ch_junctionannotation_rscript: type: file description: Rscript to reproduce the plots pattern: "*.r" - - junctionannotation_log: + - ch_junctionannotation_log: type: file description: Log file generated by tool pattern: "*.log" - - junctionsaturation_pdf: + - ch_junctionsaturation: + type: file + description: All the output files from RSEQC_JUNCTIONSATURATION + pattern: "*.{pdf,R}" + - ch_junctionsaturation_pdf: type: file description: Junction saturation report pattern: "*.pdf" - - junctionsaturation_rscript: + - ch_junctionsaturation_rscript: type: file description: Junction saturation R-script pattern: "*.r" - - readdistribution_txt: + - ch_readdistribution: type: file description: the read distribution report pattern: "*.read_distribution.txt" - - readduplication_seq_xls: + - ch_readduplication: + type: file + description: All the output files from RSEQC_READDUPLICATION + pattern: "*.{xls,pdf,R}" + - ch_readduplication_seq_xls: type: file description: Read duplication rate determined from mapping position of read pattern: "*seq.DupRate.xls" - - readduplication_pos_xls: + - ch_readduplication_pos_xls: type: file description: Read duplication rate determined from sequence of read pattern: "*pos.DupRate.xls" - - readduplication_pdf: + - ch_readduplication_pdf: type: file description: plot of duplication rate pattern: "*.pdf" - - readduplication_rscript: + - ch_readduplication_rscript: type: file description: script to reproduce the plot pattern: "*.R" - - tin_txt: + - ch_tin: type: file description: TXT file containing tin.py results summary pattern: "*.txt" diff --git a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test index 976fb67e8..171476a91 100644 --- a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test +++ b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test @@ -38,28 +38,59 @@ nextflow_workflow { { assert workflow.success}, { assert snapshot(workflow.out.ch_bamstat).match("bamstat")}, - { assert snapshot(workflow.out.ch_inner_distance.findAll { it[1].endsWith('.pdf') == false }).match("inner_distance")}, - { assert workflow.out.ch_inner_distance.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + { assert snapshot(workflow.out.ch_innerdistance.findAll { it[1].endsWith('.pdf') == false }).match("inner_distance")}, + { assert workflow.out.ch_innerdistance.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, { assert snapshot(workflow.out.ch_inferexperiment).match("inferexperiment")}, - { assert snapshot(workflow.out.ch_junction_annotation.findAll { + { assert snapshot(workflow.out.ch_junctionannotation.findAll { it[1].endsWith('.xls') == false && it[1].endsWith('.r') == false }).match("junction_annotation")}, - { assert snapshot(workflow.out.ch_junction_saturation.findAll { it[1].endsWith('.pdf') == false }).match("junction_saturation")}, - { assert workflow.out.ch_junction_saturation.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + { assert snapshot(workflow.out.ch_junctionsaturation.findAll { it[1].endsWith('.pdf') == false }).match("junction_saturation")}, + { assert workflow.out.ch_junctionsaturation.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, { assert snapshot(workflow.out.ch_readdistribution).match("readdistribution")}, - { assert snapshot(workflow.out.ch_read_duplication.findAll { it[1].endsWith('.pdf') == false }).match("read_duplication")}, - { assert workflow.out.ch_read_duplication.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, + { assert snapshot(workflow.out.ch_readduplication.findAll { it[1].endsWith('.pdf') == false }).match("read_duplication")}, + { assert workflow.out.ch_readduplication.any { it[1].endsWith('.pdf') && file(it[1]).exists() } }, { assert snapshot(workflow.out.ch_tin).match("tin")}, { assert snapshot(workflow.out.versions).match("versions")}, ) } + } + + test("sarscov2 paired-end [bam] no modules") { + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ]) + input[1] = file(params.test_data['sarscov2']['genome']['test_bed12'], checkIfExists: true) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.ch_bamstat.size() == 0 }, + { assert workflow.out.ch_innerdistance.size() == 0 }, + { assert workflow.out.ch_inferexperiment.size() == 0 }, + { assert workflow.out.ch_junctionannotation.size() == 0 }, + { assert workflow.out.ch_junctionsaturation.size() == 0 }, + { assert workflow.out.ch_readdistribution.size() == 0 }, + { assert workflow.out.ch_readduplication.size() == 0 }, + { assert workflow.out.ch_tin.size() == 0 }, + { assert workflow.out.versions.size() == 0 }, + ) + } } } diff --git a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap index 98b8b2eab..13285ef06 100644 --- a/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_rseqc/tests/main.nf.test.snap @@ -28,7 +28,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.884125559" + "timestamp": "2023-12-08T14:37:45.734509133" }, "junction_saturation": { "content": [ @@ -41,7 +41,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.919027887" + "timestamp": "2023-12-08T14:37:45.825157699" }, "versions": { "content": [ @@ -56,7 +56,7 @@ "versions.yml:md5,fe3bf0ac57c99687880ee62b28a4d4df" ] ], - "timestamp": "2023-11-25T18:02:43.951402764" + "timestamp": "2023-12-08T14:37:45.942304603" }, "tin": { "content": [ @@ -69,7 +69,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.943409965" + "timestamp": "2023-12-08T14:37:45.935155313" }, "bamstat": { "content": [ @@ -82,7 +82,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.862772491" + "timestamp": "2023-12-08T14:37:45.671792186" }, "inferexperiment": { "content": [ @@ -95,7 +95,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.899686868" + "timestamp": "2023-12-08T14:37:45.747507043" }, "read_duplication": { "content": [ @@ -120,7 +120,7 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.934467786" + "timestamp": "2023-12-08T14:37:45.927253593" }, "junction_annotation": { "content": [ @@ -133,7 +133,7 @@ ] ] ], - "timestamp": "2023-11-25T18:49:45.387109599" + "timestamp": "2023-12-08T14:37:45.757733033" }, "readdistribution": { "content": [ @@ -146,6 +146,6 @@ ] ] ], - "timestamp": "2023-11-25T18:02:43.926520106" + "timestamp": "2023-12-08T14:37:45.841855468" } } \ No newline at end of file From ed2b8aaaaa7797a1632e6d024ba98602651b76dc Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 8 Dec 2023 15:41:09 +0000 Subject: [PATCH 8/8] Update CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de4afaa6..ba6701c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,14 +11,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PR #1135](https://github.com/nf-core/rnaseq/pull/1135) - Update [action-tower-launch](https://github.com/marketplace/actions/action-tower-launch) to v2 which supports more variable handling. - [PR #1138](https://github.com/nf-core/rnaseq/pull/1138) - Updates FASTQC and UMITOOLS modules and their dependencies which have had their version string extraction commands updated ([#1103](https://github.com/nf-core/rnaseq/issues/1103)) -- Picard module version updated 3.0.0 -> 3.1.1. -- Samtools module version updated 1.17 -> 1.18. - Update Rseqc and Fastp modules to print STDERR to screen and file. ### Software dependencies +| Dependency | Old version | New version | +| ---------- | ----------- | ----------- | +| `picard` | 3.0.0 | 3.1.1 | +| `samtools` | 1.17 | 1.18 | + +> **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. +> +> **NB:** Dependency has been **removed** if new version information isn't present. + ### Modules / Subworkflows +- BAM_RSEQC subworkflow updated with new channel names. + ## [[3.13.2](https://github.com/nf-core/rnaseq/releases/tag/3.13.2)] - 2023-11-21 ### Credits