From b2945467c57ec4c494d60c9f19ae2b22313534e0 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:38:24 +0000 Subject: [PATCH 1/7] nf-test for FASTQ_ALIGN_HISAT2 --- .../fastq_align_hisat2/tests/main.nf.test | 84 +++++++++ .../tests/main.nf.test.snap | 167 ++++++++++++++++++ .../fastq_align_hisat2/tests/nextflow.config | 5 + .../nf-core/fastq_align_hisat2/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - .../nf-core/fastq_align_hisat2/main.nf | 52 ------ .../fastq_align_hisat2/nextflow.config | 8 - .../nf-core/fastq_align_hisat2/test.yml | 55 ------ 8 files changed, 258 insertions(+), 118 deletions(-) create mode 100644 subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test create mode 100644 subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/fastq_align_hisat2/tests/nextflow.config create mode 100644 subworkflows/nf-core/fastq_align_hisat2/tests/tags.yml delete mode 100644 tests/subworkflows/nf-core/fastq_align_hisat2/main.nf delete mode 100644 tests/subworkflows/nf-core/fastq_align_hisat2/nextflow.config delete mode 100644 tests/subworkflows/nf-core/fastq_align_hisat2/test.yml diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test new file mode 100644 index 00000000000..f5468ee0712 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test @@ -0,0 +1,84 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core subworkflows test fastq_align_hisat2 +nextflow_workflow { + + name "Test Subworkflow FASTQ_ALIGN_HISAT2" + script "../main.nf" + workflow "FASTQ_ALIGN_HISAT2" + config "./nextflow.config" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/fastq_align_hisat2" + + tag "hisat2/align" + tag "hisat2/build" + tag "hisat2/extractsplicesites" + + tag "samtools/flagstat" + tag "samtools/idxstats" + tag "samtools/index" + tag "samtools/sort" + tag "samtools/stats" + + + setup { + run("HISAT2_EXTRACTSPLICESITES") { + script "../../../../modules/nf-core/hisat2/extractsplicesites/main.nf" + process { + """ + input[0] = Channel.of([ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ]) + """ + } + } + run("HISAT2_BUILD") { + script "../../../../modules/nf-core/hisat2/build/main.nf" + process { + """ + input[0] = Channel.of([ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + ]) + input[1] = Channel.of([ + [id: 'test'], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ]) + input[2] = HISAT2_EXTRACTSPLICESITES.out.txt + """ + } + } + } + + test("sarscov2 - bam - single_end") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + [ + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true) + ] + ]) + input[1] = HISAT2_BUILD.out.index + input[2] = HISAT2_EXTRACTSPLICESITES.out.txt + input[3] = Channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match()} + ) + } + } +} diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap new file mode 100644 index 00000000000..20cd66ef599 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -0,0 +1,167 @@ +{ + "sarscov2 - bam - single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,4764debd32afed6ba0b28a47c28d0360" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hisat2.summary.log:md5,9839b31db795958cc4b70711a3414e9c" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,244ee47f9def6e98af10ba0eeea77d7c" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.bai:md5,23a20e49369142c5431fa1b17aafc624" + ] + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,12496c1f90fa6e9800fac62792acb8ff" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,2fa0d90162a1b655863796c2a6bd8f45" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" + ] + ], + "9": [ + "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", + "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", + "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", + "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", + "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam.bai:md5,23a20e49369142c5431fa1b17aafc624" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sorted.bam:md5,244ee47f9def6e98af10ba0eeea77d7c" + ] + ], + "csi": [ + + ], + "fastq": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,2fa0d90162a1b655863796c2a6bd8f45" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" + ] + ], + "orig_bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,4764debd32afed6ba0b28a47c28d0360" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,12496c1f90fa6e9800fac62792acb8ff" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hisat2.summary.log:md5,9839b31db795958cc4b70711a3414e9c" + ] + ], + "versions": [ + "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", + "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", + "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", + "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", + "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-08T17:36:59.841917" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/nextflow.config b/subworkflows/nf-core/fastq_align_hisat2/tests/nextflow.config new file mode 100644 index 00000000000..d2a119b55e3 --- /dev/null +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } +} diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/tags.yml b/subworkflows/nf-core/fastq_align_hisat2/tests/tags.yml new file mode 100644 index 00000000000..8993cde0c6e --- /dev/null +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/fastq_align_hisat2: + - subworkflows/nf-core/fastq_align_hisat2/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index f43ae7d9559..21a6e44818d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2329,9 +2329,6 @@ subworkflows/fastq_align_chromap: subworkflows/fastq_align_dna: - subworkflows/nf-core/fastq_align_dna/** - tests/subworkflows/nf-core/fastq_align_dna/** -subworkflows/fastq_align_hisat2: - - subworkflows/nf-core/fastq_align_hisat2/** - - tests/subworkflows/nf-core/fastq_align_hisat2/** subworkflows/fastq_align_star: - subworkflows/nf-core/fastq_align_star/** - tests/subworkflows/nf-core/fastq_align_star/** diff --git a/tests/subworkflows/nf-core/fastq_align_hisat2/main.nf b/tests/subworkflows/nf-core/fastq_align_hisat2/main.nf deleted file mode 100644 index 1ed964b6b51..00000000000 --- a/tests/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/nf-core/hisat2/extractsplicesites/main.nf' -include { HISAT2_BUILD } from '../../../../modules/nf-core/hisat2/build/main.nf' -include { FASTQ_ALIGN_HISAT2 } from '../../../../subworkflows/nf-core/fastq_align_hisat2/main.nf' - -workflow test_fastq_align_hisat2_single_end { - input = [ - [ id:'test', single_end:true ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - ] - fasta = [ - [ id:'test' ], - [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - ] - gtf = [ [id:'test'], - file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - ] - - HISAT2_EXTRACTSPLICESITES ( gtf ) - HISAT2_BUILD ( fasta, gtf, HISAT2_EXTRACTSPLICESITES.out.txt ) - FASTQ_ALIGN_HISAT2 ( input, HISAT2_BUILD.out.index, HISAT2_EXTRACTSPLICESITES.out.txt, fasta ) -} - -workflow test_fastq_align_hisat2_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) - ] - ] - fasta = [ - [ id:'test' ], - [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - ] - gtf = [ [id:'test'], - file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - ] - - HISAT2_EXTRACTSPLICESITES ( gtf ) - HISAT2_BUILD ( fasta, gtf, HISAT2_EXTRACTSPLICESITES.out.txt ) - FASTQ_ALIGN_HISAT2 ( input, HISAT2_BUILD.out.index, HISAT2_EXTRACTSPLICESITES.out.txt, fasta ) -} diff --git a/tests/subworkflows/nf-core/fastq_align_hisat2/nextflow.config b/tests/subworkflows/nf-core/fastq_align_hisat2/nextflow.config deleted file mode 100644 index f5db4b4caf7..00000000000 --- a/tests/subworkflows/nf-core/fastq_align_hisat2/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: SAMTOOLS_SORT { - ext.prefix = { "${meta.id}.sorted" } - } -} diff --git a/tests/subworkflows/nf-core/fastq_align_hisat2/test.yml b/tests/subworkflows/nf-core/fastq_align_hisat2/test.yml deleted file mode 100644 index c363e85101a..00000000000 --- a/tests/subworkflows/nf-core/fastq_align_hisat2/test.yml +++ /dev/null @@ -1,55 +0,0 @@ -- name: fastq_align_hisat2 test_fastq_align_hisat2_single_end - command: nextflow run ./tests/subworkflows/nf-core/fastq_align_hisat2 -entry test_fastq_align_hisat2_single_end -c ./tests/config/nextflow.config - tags: - - hisat2 - - hisat2/align - - samtools - - samtools/stats - - samtools/sort - - samtools/index - - samtools/idxstats - - samtools/flagstat - - subworkflows - - subworkflows/bam_sort_stats_samtools - - subworkflows/fastq_align_hisat2 - - subworkflows/bam_stats_samtools - files: - - path: output/hisat2/test.bam - - path: output/hisat2/test.hisat2.summary.log - md5sum: 7b8a9e61b7646da1089b041333c41a87 - - path: output/samtools/test.flagstat - md5sum: 6de3bfde9582ad2532033832091f5c46 - - path: output/samtools/test.idxstats - md5sum: 2a5df85e0d90e55bb2b359f6e05d5fbb - - path: output/samtools/test.sorted.bam - - path: output/samtools/test.sorted.bam.bai - - path: output/samtools/test.stats - md5sum: de59b04575abceeb5f91d4088653baa9 - -- name: fastq_align_hisat2 test_fastq_align_hisat2_paired_end - command: nextflow run ./tests/subworkflows/nf-core/fastq_align_hisat2 -entry test_fastq_align_hisat2_paired_end -c ./tests/config/nextflow.config - tags: - - hisat2 - - hisat2/align - - samtools - - samtools/stats - - samtools/sort - - samtools/index - - samtools/idxstats - - samtools/flagstat - - subworkflows - - subworkflows/bam_sort_stats_samtools - - subworkflows/fastq_align_hisat2 - - subworkflows/bam_stats_samtools - files: - - path: output/hisat2/test.bam - - path: output/hisat2/test.hisat2.summary.log - md5sum: 9839b31db795958cc4b70711a3414e9c - - path: output/samtools/test.flagstat - md5sum: 2fa0d90162a1b655863796c2a6bd8f45 - - path: output/samtools/test.idxstats - md5sum: 1adb27b52d4d64b826f48b59d61dcd4d - - path: output/samtools/test.sorted.bam - - path: output/samtools/test.sorted.bam.bai - - path: output/samtools/test.stats - md5sum: 0f64403e4f929933095d1c9c3c5ca2a3 From 82ccefc8a55b39f219d9a3c0a778acebdd4fcf0f Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:43:00 +0000 Subject: [PATCH 2/7] nf-test for FASTQ_ALIGN_HISAT2 single-end --- .../fastq_align_hisat2/tests/main.nf.test | 29 +++ .../tests/main.nf.test.snap | 179 +++++++++++++++++- 2 files changed, 201 insertions(+), 7 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test index f5468ee0712..f40e0df170e 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test @@ -54,6 +54,35 @@ nextflow_workflow { test("sarscov2 - bam - single_end") { + when { + workflow { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], + [ + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) + ] + ]) + input[1] = HISAT2_BUILD.out.index + input[2] = HISAT2_EXTRACTSPLICESITES.out.txt + input[3] = Channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success}, + { assert snapshot(workflow.out).match()} + ) + } + } + + test("sarscov2 - bam - paired_end") { + when { workflow { """ diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap index 20cd66ef599..2ad7219e6b8 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -1,5 +1,170 @@ { "sarscov2 - bam - single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,7e9d86bc07785088be61d40ec2eefa1d" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hisat2.summary.log:md5,7b8a9e61b7646da1089b041333c41a87" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam:md5,1f5e166b2e07170c4e73ace30a7129bd" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.bai:md5,af2f8016a65f96ba633f1d88ced0d919" + ] + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,dd225299645dc960d49017cca45211f6" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,6de3bfde9582ad2532033832091f5c46" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" + ] + ], + "9": [ + "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", + "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", + "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", + "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", + "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + ], + "bai": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam.bai:md5,af2f8016a65f96ba633f1d88ced0d919" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sorted.bam:md5,1f5e166b2e07170c4e73ace30a7129bd" + ] + ], + "csi": [ + + ], + "fastq": [ + + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,6de3bfde9582ad2532033832091f5c46" + ] + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" + ] + ], + "orig_bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,7e9d86bc07785088be61d40ec2eefa1d" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,dd225299645dc960d49017cca45211f6" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hisat2.summary.log:md5,7b8a9e61b7646da1089b041333c41a87" + ] + ], + "versions": [ + "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", + "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", + "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", + "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", + "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-08T17:41:57.477299" + }, + "sarscov2 - bam - paired_end": { "content": [ { "0": [ @@ -8,7 +173,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,4764debd32afed6ba0b28a47c28d0360" + "test.bam:md5,bf97d3c0a400aada6f1fc4934712389d" ] ], "1": [ @@ -29,7 +194,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,244ee47f9def6e98af10ba0eeea77d7c" + "test.sorted.bam:md5,6fe3fc030fdf277288b5ca74dcd0aa6a" ] ], "4": [ @@ -38,7 +203,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam.bai:md5,23a20e49369142c5431fa1b17aafc624" + "test.sorted.bam.bai:md5,c30c7c429972ff6d75d5f56d443dcbbf" ] ], "5": [ @@ -85,7 +250,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam.bai:md5,23a20e49369142c5431fa1b17aafc624" + "test.sorted.bam.bai:md5,c30c7c429972ff6d75d5f56d443dcbbf" ] ], "bam": [ @@ -94,7 +259,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,244ee47f9def6e98af10ba0eeea77d7c" + "test.sorted.bam:md5,6fe3fc030fdf277288b5ca74dcd0aa6a" ] ], "csi": [ @@ -127,7 +292,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,4764debd32afed6ba0b28a47c28d0360" + "test.bam:md5,bf97d3c0a400aada6f1fc4934712389d" ] ], "stats": [ @@ -162,6 +327,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-02-08T17:36:59.841917" + "timestamp": "2024-02-08T17:42:17.127243" } } \ No newline at end of file From 909fd1a9545315a279f938fb3d13acaf7695ba34 Mon Sep 17 00:00:00 2001 From: Maxime U Garcia Date: Mon, 12 Feb 2024 12:10:24 +0100 Subject: [PATCH 3/7] Apply suggestions from code review --- subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test index f40e0df170e..7960247c7e9 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core subworkflows test fastq_align_hisat2 nextflow_workflow { name "Test Subworkflow FASTQ_ALIGN_HISAT2" @@ -20,7 +18,7 @@ nextflow_workflow { tag "samtools/index" tag "samtools/sort" tag "samtools/stats" - + tag "subworkflows/bam_sort_stats_samtools" setup { run("HISAT2_EXTRACTSPLICESITES") { From 15a513b6e1b2e8fc2261d1965db66994bb7901cf Mon Sep 17 00:00:00 2001 From: maxulysse Date: Mon, 26 Feb 2024 13:23:04 +0100 Subject: [PATCH 4/7] update snapshots --- .../tests/main.nf.test.snap | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap index 2ad7219e6b8..974824e6e4d 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test.bam:md5,7e9d86bc07785088be61d40ec2eefa1d" + "test.bam:md5,800d0f095c3433648fd6070fc5b0739c" ] ], "1": [ @@ -29,7 +29,7 @@ "id": "test", "single_end": true }, - "test.sorted.bam:md5,1f5e166b2e07170c4e73ace30a7129bd" + "test.sorted.bam:md5,3d699402ac55e56324aa030fea501a35" ] ], "4": [ @@ -38,7 +38,7 @@ "id": "test", "single_end": true }, - "test.sorted.bam.bai:md5,af2f8016a65f96ba633f1d88ced0d919" + "test.sorted.bam.bai:md5,8c2d13dac5ec2485845adb8a45bc81a2" ] ], "5": [ @@ -50,7 +50,7 @@ "id": "test", "single_end": true }, - "test.stats:md5,dd225299645dc960d49017cca45211f6" + "test.stats:md5,f712acf6108a70c3fb06ac51e5e76f15" ] ], "7": [ @@ -72,12 +72,12 @@ ] ], "9": [ - "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", - "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", - "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", - "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", - "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" ], "bai": [ [ @@ -85,7 +85,7 @@ "id": "test", "single_end": true }, - "test.sorted.bam.bai:md5,af2f8016a65f96ba633f1d88ced0d919" + "test.sorted.bam.bai:md5,8c2d13dac5ec2485845adb8a45bc81a2" ] ], "bam": [ @@ -94,7 +94,7 @@ "id": "test", "single_end": true }, - "test.sorted.bam:md5,1f5e166b2e07170c4e73ace30a7129bd" + "test.sorted.bam:md5,3d699402ac55e56324aa030fea501a35" ] ], "csi": [ @@ -127,7 +127,7 @@ "id": "test", "single_end": true }, - "test.bam:md5,7e9d86bc07785088be61d40ec2eefa1d" + "test.bam:md5,800d0f095c3433648fd6070fc5b0739c" ] ], "stats": [ @@ -136,7 +136,7 @@ "id": "test", "single_end": true }, - "test.stats:md5,dd225299645dc960d49017cca45211f6" + "test.stats:md5,f712acf6108a70c3fb06ac51e5e76f15" ] ], "summary": [ @@ -149,20 +149,20 @@ ] ], "versions": [ - "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", - "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", - "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", - "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", - "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.01.0" }, - "timestamp": "2024-02-08T17:41:57.477299" + "timestamp": "2024-02-26T13:21:47.248531" }, "sarscov2 - bam - paired_end": { "content": [ @@ -173,7 +173,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,bf97d3c0a400aada6f1fc4934712389d" + "test.bam:md5,b462c105aeecc6fccaf2714309c27704" ] ], "1": [ @@ -194,7 +194,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,6fe3fc030fdf277288b5ca74dcd0aa6a" + "test.sorted.bam:md5,e071250ca2f593daf9177b776d597162" ] ], "4": [ @@ -203,7 +203,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam.bai:md5,c30c7c429972ff6d75d5f56d443dcbbf" + "test.sorted.bam.bai:md5,ab51aa55d2da99b8be8e3ea13d112ecb" ] ], "5": [ @@ -215,7 +215,7 @@ "id": "test", "single_end": false }, - "test.stats:md5,12496c1f90fa6e9800fac62792acb8ff" + "test.stats:md5,ed4e2ba437f4819b7ab93a6df8dd5348" ] ], "7": [ @@ -237,12 +237,12 @@ ] ], "9": [ - "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", - "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", - "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", - "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", - "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" ], "bai": [ [ @@ -250,7 +250,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam.bai:md5,c30c7c429972ff6d75d5f56d443dcbbf" + "test.sorted.bam.bai:md5,ab51aa55d2da99b8be8e3ea13d112ecb" ] ], "bam": [ @@ -259,7 +259,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,6fe3fc030fdf277288b5ca74dcd0aa6a" + "test.sorted.bam:md5,e071250ca2f593daf9177b776d597162" ] ], "csi": [ @@ -292,7 +292,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,bf97d3c0a400aada6f1fc4934712389d" + "test.bam:md5,b462c105aeecc6fccaf2714309c27704" ] ], "stats": [ @@ -301,7 +301,7 @@ "id": "test", "single_end": false }, - "test.stats:md5,12496c1f90fa6e9800fac62792acb8ff" + "test.stats:md5,ed4e2ba437f4819b7ab93a6df8dd5348" ] ], "summary": [ @@ -314,19 +314,19 @@ ] ], "versions": [ - "versions.yml:md5,98d0a110d0ccc586c9cd6bce63d34783", - "versions.yml:md5,a7eddb4699ba2f51b60aeb568ae06fc7", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1", - "versions.yml:md5,d5428992e76af0b9e76bc888c65a6084", - "versions.yml:md5,db79edaf7a3a724b55535f013ce7d00f", - "versions.yml:md5,eba7e6ff8ea5b8c5a8c1160906cac3c0" + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.01.0" }, - "timestamp": "2024-02-08T17:42:17.127243" + "timestamp": "2024-02-26T13:22:02.734645" } } \ No newline at end of file From ae87664558ae6d980f5131160c8ec25997a3ddc9 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Mon, 26 Feb 2024 13:50:34 +0100 Subject: [PATCH 5/7] update snapshot --- .../tests/main.nf.test.snap | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap index 974824e6e4d..e6feeacca2a 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test.bam:md5,800d0f095c3433648fd6070fc5b0739c" + "test.bam:md5,04d926b218641dcc6286b8af31b0c000" ] ], "1": [ @@ -21,7 +21,7 @@ ] ], "2": [ - + ], "3": [ [ @@ -29,7 +29,7 @@ "id": "test", "single_end": true }, - "test.sorted.bam:md5,3d699402ac55e56324aa030fea501a35" + "test.sorted.bam:md5,de6ee3bfb8c5b69d4f8917783d547036" ] ], "4": [ @@ -42,7 +42,7 @@ ] ], "5": [ - + ], "6": [ [ @@ -94,14 +94,14 @@ "id": "test", "single_end": true }, - "test.sorted.bam:md5,3d699402ac55e56324aa030fea501a35" + "test.sorted.bam:md5,de6ee3bfb8c5b69d4f8917783d547036" ] ], "csi": [ - + ], "fastq": [ - + ], "flagstat": [ [ @@ -127,7 +127,7 @@ "id": "test", "single_end": true }, - "test.bam:md5,800d0f095c3433648fd6070fc5b0739c" + "test.bam:md5,04d926b218641dcc6286b8af31b0c000" ] ], "stats": [ @@ -173,7 +173,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,b462c105aeecc6fccaf2714309c27704" + "test.bam:md5,e14c90ac70d8b8c904e2db7c843d8cd3" ] ], "1": [ @@ -186,7 +186,7 @@ ] ], "2": [ - + ], "3": [ [ @@ -194,7 +194,7 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,e071250ca2f593daf9177b776d597162" + "test.sorted.bam:md5,83e1747deffe07e7389ddf3c7e1eaa2f" ] ], "4": [ @@ -207,7 +207,7 @@ ] ], "5": [ - + ], "6": [ [ @@ -259,14 +259,14 @@ "id": "test", "single_end": false }, - "test.sorted.bam:md5,e071250ca2f593daf9177b776d597162" + "test.sorted.bam:md5,83e1747deffe07e7389ddf3c7e1eaa2f" ] ], "csi": [ - + ], "fastq": [ - + ], "flagstat": [ [ @@ -292,7 +292,7 @@ "id": "test", "single_end": false }, - "test.bam:md5,b462c105aeecc6fccaf2714309c27704" + "test.bam:md5,e14c90ac70d8b8c904e2db7c843d8cd3" ] ], "stats": [ @@ -329,4 +329,4 @@ }, "timestamp": "2024-02-26T13:22:02.734645" } -} \ No newline at end of file +} From 8d7f132faf2712c05eff7162e9aa9f617fe94886 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 29 Feb 2024 13:19:52 +0100 Subject: [PATCH 6/7] do not snapshot bam --- .../fastq_align_hisat2/tests/main.nf.test | 25 +- .../tests/main.nf.test.snap | 602 +++++++++--------- 2 files changed, 308 insertions(+), 319 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test index 7960247c7e9..1999207a5c1 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test @@ -20,7 +20,7 @@ nextflow_workflow { tag "samtools/stats" tag "subworkflows/bam_sort_stats_samtools" - setup { + setup { run("HISAT2_EXTRACTSPLICESITES") { script "../../../../modules/nf-core/hisat2/extractsplicesites/main.nf" process { @@ -74,11 +74,19 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out).match()} + { assert snapshot(file(workflow.out.bam[0][1]).name).match("se - bam")}, + { assert snapshot(file(workflow.out.bai[0][1]).name).match("se - bai")}, + { assert snapshot(workflow.out.csi).match("se - csi")}, + { assert snapshot(workflow.out.orig_bam).match("se - orig_bam")}, + { assert snapshot(workflow.out.summary).match("se - summary")}, + { assert snapshot(workflow.out.fastq).match("se - fastq")}, + { assert snapshot(workflow.out.stats).match("se - stats")}, + { assert snapshot(workflow.out.flagstat).match("se - flagstat")}, + { assert snapshot(workflow.out.idxstats).match("se - idxstats")}, + { assert snapshot(workflow.out.versions).match("se - versions")} ) } } - test("sarscov2 - bam - paired_end") { when { @@ -104,7 +112,16 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out).match()} + { assert snapshot(file(workflow.out.bam[0][1]).name).match("pe - bam")}, + { assert snapshot(file(workflow.out.bai[0][1]).name).match("pe - bai")}, + { assert snapshot(workflow.out.csi).match("pe - csi")}, + { assert snapshot(workflow.out.orig_bam).match("pe - orig_bam")}, + { assert snapshot(workflow.out.summary).match("pe - summary")}, + { assert snapshot(workflow.out.fastq).match("pe - fastq")}, + { assert snapshot(workflow.out.stats).match("pe - stats")}, + { assert snapshot(workflow.out.flagstat).match("pe - flagstat")}, + { assert snapshot(workflow.out.idxstats).match("pe - idxstats")}, + { assert snapshot(workflow.out.versions).match("pe - versions")} ) } } diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap index e6feeacca2a..ab2c5ac1a73 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -1,332 +1,304 @@ { - "sarscov2 - bam - single_end": { + "pe - stats": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,04d926b218641dcc6286b8af31b0c000" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": true - }, - "test.hisat2.summary.log:md5,7b8a9e61b7646da1089b041333c41a87" - ] - ], - "2": [ - - ], - "3": [ - [ - { - "id": "test", - "single_end": true - }, - "test.sorted.bam:md5,de6ee3bfb8c5b69d4f8917783d547036" - ] - ], - "4": [ - [ - { - "id": "test", - "single_end": true - }, - "test.sorted.bam.bai:md5,8c2d13dac5ec2485845adb8a45bc81a2" - ] - ], - "5": [ - - ], - "6": [ - [ - { - "id": "test", - "single_end": true - }, - "test.stats:md5,f712acf6108a70c3fb06ac51e5e76f15" - ] - ], - "7": [ - [ - { - "id": "test", - "single_end": true - }, - "test.flagstat:md5,6de3bfde9582ad2532033832091f5c46" - ] - ], - "8": [ - [ - { - "id": "test", - "single_end": true - }, - "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" - ] - ], - "9": [ - "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", - "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", - "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", - "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", - "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" - ], - "bai": [ - [ - { - "id": "test", - "single_end": true - }, - "test.sorted.bam.bai:md5,8c2d13dac5ec2485845adb8a45bc81a2" - ] - ], - "bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.sorted.bam:md5,de6ee3bfb8c5b69d4f8917783d547036" - ] - ], - "csi": [ - - ], - "fastq": [ - - ], - "flagstat": [ - [ - { - "id": "test", - "single_end": true - }, - "test.flagstat:md5,6de3bfde9582ad2532033832091f5c46" - ] - ], - "idxstats": [ - [ - { - "id": "test", - "single_end": true - }, - "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" - ] - ], - "orig_bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,04d926b218641dcc6286b8af31b0c000" - ] - ], - "stats": [ - [ - { - "id": "test", - "single_end": true - }, - "test.stats:md5,f712acf6108a70c3fb06ac51e5e76f15" - ] - ], - "summary": [ - [ - { - "id": "test", - "single_end": true - }, - "test.hisat2.summary.log:md5,7b8a9e61b7646da1089b041333c41a87" - ] - ], - "versions": [ - "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", - "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", - "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", - "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", - "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" + [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,ed4e2ba437f4819b7ab93a6df8dd5348" ] - } + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-26T13:21:47.248531" + "timestamp": "2024-02-29T13:19:34.455959" }, - "sarscov2 - bam - paired_end": { + "pe - csi": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,e14c90ac70d8b8c904e2db7c843d8cd3" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test.hisat2.summary.log:md5,9839b31db795958cc4b70711a3414e9c" - ] - ], - "2": [ - - ], - "3": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,83e1747deffe07e7389ddf3c7e1eaa2f" - ] - ], - "4": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.bai:md5,ab51aa55d2da99b8be8e3ea13d112ecb" - ] - ], - "5": [ - - ], - "6": [ - [ - { - "id": "test", - "single_end": false - }, - "test.stats:md5,ed4e2ba437f4819b7ab93a6df8dd5348" - ] - ], - "7": [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,2fa0d90162a1b655863796c2a6bd8f45" - ] - ], - "8": [ - [ - { - "id": "test", - "single_end": false - }, - "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" - ] - ], - "9": [ - "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", - "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", - "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", - "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", - "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" - ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.bai:md5,ab51aa55d2da99b8be8e3ea13d112ecb" - ] - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,83e1747deffe07e7389ddf3c7e1eaa2f" - ] - ], - "csi": [ - - ], - "fastq": [ - - ], - "flagstat": [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,2fa0d90162a1b655863796c2a6bd8f45" - ] - ], - "idxstats": [ - [ - { - "id": "test", - "single_end": false - }, - "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" - ] - ], - "orig_bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,e14c90ac70d8b8c904e2db7c843d8cd3" - ] - ], - "stats": [ - [ - { - "id": "test", - "single_end": false - }, - "test.stats:md5,ed4e2ba437f4819b7ab93a6df8dd5348" - ] - ], - "summary": [ - [ - { - "id": "test", - "single_end": false - }, - "test.hisat2.summary.log:md5,9839b31db795958cc4b70711a3414e9c" - ] - ], - "versions": [ - "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", - "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", - "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", - "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", - "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", - "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.433808" + }, + "se - bai": { + "content": [ + "test.sorted.bam.bai" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.096113" + }, + "pe - flagstat": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,2fa0d90162a1b655863796c2a6bd8f45" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.462817" + }, + "pe - orig_bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,8622e56445f7307f74f46ac84c00f836" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.436708" + }, + "se - bam": { + "content": [ + "test.sorted.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.083446" + }, + "se - summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.hisat2.summary.log:md5,7b8a9e61b7646da1089b041333c41a87" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.106767" + }, + "pe - bam": { + "content": [ + "test.sorted.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.429083" + }, + "se - versions": { + "content": [ + [ + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.152614" + }, + "pe - idxstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.467231" + }, + "pe - bai": { + "content": [ + "test.sorted.bam.bai" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.431586" + }, + "pe - fastq": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.45247" + }, + "se - fastq": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.112921" + }, + "se - idxstats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.144299" + }, + "se - csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:19.164082" + }, + "se - orig_bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,37b713442dca7cc28b1291f5b1ccde30" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:19.212009" + }, + "pe - summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.hisat2.summary.log:md5,9839b31db795958cc4b70711a3414e9c" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.440223" + }, + "pe - versions": { + "content": [ + [ + "versions.yml:md5,34be144fb97a11f1c581b39301f6f0d1", + "versions.yml:md5,4392ca9e255d9137e74a73a8d1e1559d", + "versions.yml:md5,651e735a2754f3be76b516f5fbf099b5", + "versions.yml:md5,912e1daa1e432f6b5ca601ab2294e37f", + "versions.yml:md5,9b7dd7f9a173fbf92f5e476451c840c1", + "versions.yml:md5,b4ccce0351e5718d36600858452dd4b1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:19:34.471413" + }, + "se - flagstat": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.flagstat:md5,6de3bfde9582ad2532033832091f5c46" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:17:55.136555" + }, + "se - stats": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats:md5,f712acf6108a70c3fb06ac51e5e76f15" ] - } + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-26T13:22:02.734645" + "timestamp": "2024-02-29T13:17:55.119968" } -} +} \ No newline at end of file From a4a15e5f1d18d27de5d18f28a19a50ad7b33538c Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 29 Feb 2024 13:29:36 +0100 Subject: [PATCH 7/7] do not snapshot bam --- .../fastq_align_hisat2/tests/main.nf.test | 16 ++-- .../tests/main.nf.test.snap | 80 ++++++++----------- 2 files changed, 40 insertions(+), 56 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test index 1999207a5c1..b0c0ca512a7 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test @@ -74,15 +74,15 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(file(workflow.out.bam[0][1]).name).match("se - bam")}, { assert snapshot(file(workflow.out.bai[0][1]).name).match("se - bai")}, + { assert snapshot(file(workflow.out.bam[0][1]).name).match("se - bam")}, + { assert snapshot(file(workflow.out.orig_bam[0][1]).name).match("se - orig_bam")}, { assert snapshot(workflow.out.csi).match("se - csi")}, - { assert snapshot(workflow.out.orig_bam).match("se - orig_bam")}, - { assert snapshot(workflow.out.summary).match("se - summary")}, { assert snapshot(workflow.out.fastq).match("se - fastq")}, - { assert snapshot(workflow.out.stats).match("se - stats")}, { assert snapshot(workflow.out.flagstat).match("se - flagstat")}, { assert snapshot(workflow.out.idxstats).match("se - idxstats")}, + { assert snapshot(workflow.out.stats).match("se - stats")}, + { assert snapshot(workflow.out.summary).match("se - summary")}, { assert snapshot(workflow.out.versions).match("se - versions")} ) } @@ -112,15 +112,15 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(file(workflow.out.bam[0][1]).name).match("pe - bam")}, { assert snapshot(file(workflow.out.bai[0][1]).name).match("pe - bai")}, + { assert snapshot(file(workflow.out.bam[0][1]).name).match("pe - bam")}, + { assert snapshot(file(workflow.out.orig_bam[0][1]).name).match("pe - orig_bam")}, { assert snapshot(workflow.out.csi).match("pe - csi")}, - { assert snapshot(workflow.out.orig_bam).match("pe - orig_bam")}, - { assert snapshot(workflow.out.summary).match("pe - summary")}, { assert snapshot(workflow.out.fastq).match("pe - fastq")}, - { assert snapshot(workflow.out.stats).match("pe - stats")}, { assert snapshot(workflow.out.flagstat).match("pe - flagstat")}, { assert snapshot(workflow.out.idxstats).match("pe - idxstats")}, + { assert snapshot(workflow.out.stats).match("pe - stats")}, + { assert snapshot(workflow.out.summary).match("pe - summary")}, { assert snapshot(workflow.out.versions).match("pe - versions")} ) } diff --git a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap index ab2c5ac1a73..d3f6692752b 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test.snap @@ -15,7 +15,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.455959" + "timestamp": "2024-02-29T13:28:06.091982" }, "pe - csi": { "content": [ @@ -27,7 +27,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.433808" + "timestamp": "2024-02-29T13:28:06.081055" }, "se - bai": { "content": [ @@ -37,7 +37,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.096113" + "timestamp": "2024-02-29T13:27:50.763127" }, "pe - flagstat": { "content": [ @@ -55,25 +55,17 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.462817" + "timestamp": "2024-02-29T13:28:06.08653" }, "pe - orig_bam": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,8622e56445f7307f74f46ac84c00f836" - ] - ] + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.436708" + "timestamp": "2024-02-29T13:28:06.077797" }, "se - bam": { "content": [ @@ -83,7 +75,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.083446" + "timestamp": "2024-02-29T13:27:50.773767" }, "se - summary": { "content": [ @@ -101,7 +93,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.106767" + "timestamp": "2024-02-29T13:27:50.818659" }, "pe - bam": { "content": [ @@ -111,7 +103,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.429083" + "timestamp": "2024-02-29T13:28:06.074968" }, "se - versions": { "content": [ @@ -128,7 +120,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.152614" + "timestamp": "2024-02-29T13:27:50.826601" }, "pe - idxstats": { "content": [ @@ -146,7 +138,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.467231" + "timestamp": "2024-02-29T13:28:06.089411" }, "pe - bai": { "content": [ @@ -156,7 +148,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.431586" + "timestamp": "2024-02-29T13:28:06.071767" }, "pe - fastq": { "content": [ @@ -168,7 +160,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.45247" + "timestamp": "2024-02-29T13:28:06.083598" }, "se - fastq": { "content": [ @@ -180,25 +172,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.112921" - }, - "se - idxstats": { - "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" - ] - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" - }, - "timestamp": "2024-02-29T13:17:55.144299" + "timestamp": "2024-02-29T13:27:50.782981" }, "se - csi": { "content": [ @@ -210,9 +184,9 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:19.164082" + "timestamp": "2024-02-29T13:27:50.77962" }, - "se - orig_bam": { + "se - idxstats": { "content": [ [ [ @@ -220,7 +194,7 @@ "id": "test", "single_end": true }, - "test.bam:md5,37b713442dca7cc28b1291f5b1ccde30" + "test.idxstats:md5,2a5df85e0d90e55bb2b359f6e05d5fbb" ] ] ], @@ -228,7 +202,17 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:19.212009" + "timestamp": "2024-02-29T13:27:50.798637" + }, + "se - orig_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-29T13:27:50.776773" }, "pe - summary": { "content": [ @@ -246,7 +230,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.440223" + "timestamp": "2024-02-29T13:28:06.095265" }, "pe - versions": { "content": [ @@ -263,7 +247,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:19:34.471413" + "timestamp": "2024-02-29T13:28:06.098801" }, "se - flagstat": { "content": [ @@ -281,7 +265,7 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.136555" + "timestamp": "2024-02-29T13:27:50.786813" }, "se - stats": { "content": [ @@ -299,6 +283,6 @@ "nf-test": "0.8.4", "nextflow": "24.01.0" }, - "timestamp": "2024-02-29T13:17:55.119968" + "timestamp": "2024-02-29T13:27:50.804219" } } \ No newline at end of file