From daf9e8d3f1e9e9b680574e2a30693ef12b760e2f Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 15:45:52 +0100 Subject: [PATCH 1/9] Add sylph/profile module and remove unnecessary pattern from sylph/sketch --- modules/nf-core/sylph/profile/environment.yml | 7 ++ modules/nf-core/sylph/profile/main.nf | 52 +++++++++ modules/nf-core/sylph/profile/meta.yml | 53 +++++++++ .../nf-core/sylph/profile/tests/main.nf.test | 74 ++++++++++++ .../sylph/profile/tests/main.nf.test.snap | 107 ++++++++++++++++++ modules/nf-core/sylph/sketch/meta.yml | 1 - 6 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/sylph/profile/environment.yml create mode 100644 modules/nf-core/sylph/profile/main.nf create mode 100644 modules/nf-core/sylph/profile/meta.yml create mode 100644 modules/nf-core/sylph/profile/tests/main.nf.test create mode 100644 modules/nf-core/sylph/profile/tests/main.nf.test.snap diff --git a/modules/nf-core/sylph/profile/environment.yml b/modules/nf-core/sylph/profile/environment.yml new file mode 100644 index 00000000000..fd9d6bf1294 --- /dev/null +++ b/modules/nf-core/sylph/profile/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::sylph=0.7.0" diff --git a/modules/nf-core/sylph/profile/main.nf b/modules/nf-core/sylph/profile/main.nf new file mode 100644 index 00000000000..2bd20e60fc6 --- /dev/null +++ b/modules/nf-core/sylph/profile/main.nf @@ -0,0 +1,52 @@ +process SYLPH_PROFILE { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sylph:0.7.0--h919a2d8_0' : + 'biocontainers/sylph:0.7.0--h919a2d8_0' }" + + input: + tuple val(meta), path(reads) + path(pre_sketched_files) + + output: + tuple val(meta), path('*.tsv'), emit: profile_out + path "versions.yml" , emit: versions + + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + sylph profile \\ + $args \\ + $reads \\ + $pre_sketched_files\\ + -o ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sylph: \$(sylph -V|awk '{print \$2}') + END_VERSIONS + + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sylph: \$(sylph -V|awk '{print \$2}') + END_VERSIONS + """ + +} diff --git a/modules/nf-core/sylph/profile/meta.yml b/modules/nf-core/sylph/profile/meta.yml new file mode 100644 index 00000000000..8be27407ca1 --- /dev/null +++ b/modules/nf-core/sylph/profile/meta.yml @@ -0,0 +1,53 @@ +name: "sylph_profile" +description: Sylph profile command for taxonoming profiling +keywords: + - profile + - metagenomics + - sylph + - classification +tools: + - sylph: + description: Sylph quickly enables querying of genomes against even low-coverage + shotgun metagenomes to find nearest neighbour ANI. + homepage: https://github.com/bluenote-1577/sylph + documentation: https://github.com/bluenote-1577/sylph + tool_dev_url: https://github.com/bluenote-1577/sylph + doi: 10.1038/s41587-024-02412-y + licence: ["MIT"] + identifier: biotools:sylph +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - reads: + type: file + description:description: | + List of input FastQ/FASTA files of size 1 and 2 for single-end and paired-end data, + respectively. They are automatically sketched to .sylsp/.syldb + - - pre_sketched_files: + type: file + description: Pre-sketched *.syldb/*.sylsp files + pattern: "*.{syldb,sylsp}" +output: + - profile_out: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*tsv": + type: file + description: Output file from sylph/profile command + pattern: "*tsv" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@jiahang1234" + - "@sofstam" +maintainers: + - "@sofstam" diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test b/modules/nf-core/sylph/profile/tests/main.nf.test new file mode 100644 index 00000000000..64e9a64efe0 --- /dev/null +++ b/modules/nf-core/sylph/profile/tests/main.nf.test @@ -0,0 +1,74 @@ +nextflow_process { + + script "../main.nf" + process "SYLPH_PROFILE" + tag "modules" + tag "modules_nfcore" + tag "sylph" + tag "sylph/profile" + + test("sarscov2 illumina single-end [fastq_gz]") { + when { + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 illumina paired-end [fastq_gz]") { + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 illumina paired-end [fastq_gz]-stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap new file mode 100644 index 00000000000..faab1382137 --- /dev/null +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -0,0 +1,107 @@ +{ + "sarscov2 illumina paired-end [fastq_gz]": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + ] + ], + "1": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "profile_out": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + ] + ], + "versions": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-28T15:38:02.578998" + }, + "sarscov2 illumina single-end [fastq_gz]": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.tsv:md5,26f426e1c89323756bfea2818a582448" + ] + ], + "1": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "profile_out": [ + [ + { + "id": "test", + "single_end": true + }, + "test.tsv:md5,26f426e1c89323756bfea2818a582448" + ] + ], + "versions": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-28T15:36:54.294945" + }, + "sarscov2 illumina paired-end [fastq_gz]-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "profile_out": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-28T15:38:10.588075" + } +} \ No newline at end of file diff --git a/modules/nf-core/sylph/sketch/meta.yml b/modules/nf-core/sylph/sketch/meta.yml index 7a9abdf85b1..9d3645c959a 100644 --- a/modules/nf-core/sylph/sketch/meta.yml +++ b/modules/nf-core/sylph/sketch/meta.yml @@ -35,7 +35,6 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - pattern: "my_sketches/*.sylsp" - my_sketches/*.sylsp: type: map description: | From dfdd3fca323ebb20b25a9fe653e68a1560d9cdf7 Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 15:54:42 +0100 Subject: [PATCH 2/9] Remove description --- modules/nf-core/sylph/profile/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/sylph/profile/meta.yml b/modules/nf-core/sylph/profile/meta.yml index 8be27407ca1..7885c792375 100644 --- a/modules/nf-core/sylph/profile/meta.yml +++ b/modules/nf-core/sylph/profile/meta.yml @@ -23,7 +23,7 @@ input: e.g. `[ id:'test', single_end:false ]` - reads: type: file - description:description: | + description: | List of input FastQ/FASTA files of size 1 and 2 for single-end and paired-end data, respectively. They are automatically sketched to .sylsp/.syldb - - pre_sketched_files: From a2f134422381de8f6192246e0a92c58b6a38e069 Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 15:58:51 +0100 Subject: [PATCH 3/9] Update snap --- modules/nf-core/sylph/profile/tests/main.nf.test.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index faab1382137..87a9f9964ee 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" ] ], "1": [ @@ -20,7 +20,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" ] ], "versions": [ @@ -32,7 +32,7 @@ "nf-test": "0.8.4", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T15:38:02.578998" + "timestamp": "2024-11-28T15:58:17.063453" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ From 8544ee966c52253d19c2b43a98e1ec931b9fe6ee Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 16:07:08 +0100 Subject: [PATCH 4/9] Try again with linting --- modules/nf-core/sylph/profile/tests/main.nf.test.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index 87a9f9964ee..bebb3491ec6 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" + "test.tsv:md5,4778852001d6d37824647dbc7303aabd" ] ], "1": [ @@ -20,7 +20,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" + "test.tsv:md5,4778852001d6d37824647dbc7303aabd" ] ], "versions": [ @@ -29,10 +29,10 @@ } ], "meta": { - "nf-test": "0.8.4", + "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T15:58:17.063453" + "timestamp": "2024-11-28T16:06:27.130348" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ From fa0e2c1780c8b53db5b035e3634895452061e071 Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 16:50:44 +0100 Subject: [PATCH 5/9] Update snap --- modules/nf-core/sylph/profile/tests/main.nf.test.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index bebb3491ec6..0022cb20a83 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" ] ], "1": [ @@ -20,7 +20,7 @@ "id": "test", "single_end": false }, - "test.tsv:md5,4778852001d6d37824647dbc7303aabd" + "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" ] ], "versions": [ @@ -32,7 +32,7 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T16:06:27.130348" + "timestamp": "2024-11-28T16:45:00.123564" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ From e45886d6a99a324935edf4ab521505fadb6fe51e Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 17:02:17 +0100 Subject: [PATCH 6/9] Fix linting for meta.yaml --- modules/nf-core/sylph/profile/meta.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/sylph/profile/meta.yml b/modules/nf-core/sylph/profile/meta.yml index 7885c792375..88eda04c0a3 100644 --- a/modules/nf-core/sylph/profile/meta.yml +++ b/modules/nf-core/sylph/profile/meta.yml @@ -37,9 +37,12 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*tsv": - type: file - description: Output file from sylph/profile command + pattern: "*tsv" + - "*.tsv": + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] pattern: "*tsv" - versions: - versions.yml: From 2451fcd095e88ed8a3c832e56f4be1f7f9569b1a Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 28 Nov 2024 17:30:46 +0100 Subject: [PATCH 7/9] Update tests --- .../nf-core/sylph/profile/tests/main.nf.test | 18 ++- .../sylph/profile/tests/main.nf.test.snap | 110 +++++------------- 2 files changed, 45 insertions(+), 83 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test b/modules/nf-core/sylph/profile/tests/main.nf.test index 64e9a64efe0..af9ce7d7ee4 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test +++ b/modules/nf-core/sylph/profile/tests/main.nf.test @@ -22,7 +22,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.report, + process.out.versions, + ).match() + } ) } } @@ -43,7 +47,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.profile_out, + process.out.versions, + ).match() + } ) } } @@ -67,7 +75,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.profile_out, + process.out.versions, + ).match() + } ) } } diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index 0022cb20a83..623c6bf7918 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -1,107 +1,57 @@ { "sarscov2 illumina paired-end [fastq_gz]": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" - ] - ], - "1": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ], - "profile_out": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" - ] - ], - "versions": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" ] - } + ], + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] ], "meta": { - "nf-test": "0.9.2", + "nf-test": "0.8.4", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T16:45:00.123564" + "timestamp": "2024-11-28T17:29:55.064467" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.tsv:md5,26f426e1c89323756bfea2818a582448" - ] - ], - "1": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ], - "profile_out": [ - [ - { - "id": "test", - "single_end": true - }, - "test.tsv:md5,26f426e1c89323756bfea2818a582448" - ] - ], - "versions": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ] - } + null, + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T15:36:54.294945" + "timestamp": "2024-11-28T17:27:29.922818" }, "sarscov2 illumina paired-end [fastq_gz]-stub": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ], - "profile_out": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] - } + ], + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T15:38:10.588075" + "timestamp": "2024-11-28T17:30:02.138682" } } \ No newline at end of file From c06f4fb98539a6109d860f5c468a108349053089 Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 5 Dec 2024 09:59:07 +0100 Subject: [PATCH 8/9] Add contains in nf-test --- .../nf-core/sylph/profile/tests/main.nf.test | 6 ++-- .../sylph/profile/tests/main.nf.test.snap | 32 +++++-------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test b/modules/nf-core/sylph/profile/tests/main.nf.test index af9ce7d7ee4..671bbb501aa 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test +++ b/modules/nf-core/sylph/profile/tests/main.nf.test @@ -23,8 +23,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.report, process.out.versions, + process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, ).match() } ) @@ -48,8 +48,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.profile_out, process.out.versions, + process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, ).match() } ) @@ -76,8 +76,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.profile_out, process.out.versions, + process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, ).match() } ) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index 623c6bf7918..d381f4a3fe8 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -1,24 +1,16 @@ { "sarscov2 illumina paired-end [fastq_gz]": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,c1a6fcabeaa1070385f1430d370ba02f" - ] - ], [ "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ] + ], + false ], "meta": { - "nf-test": "0.8.4", + "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T17:29:55.064467" + "timestamp": "2024-12-05T09:57:57.900344" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ @@ -35,23 +27,15 @@ }, "sarscov2 illumina paired-end [fastq_gz]-stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], [ "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" - ] + ], + false ], "meta": { - "nf-test": "0.8.4", + "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T17:30:02.138682" + "timestamp": "2024-12-05T09:58:05.124595" } } \ No newline at end of file From c95a10028f126e6f609d7ca8c005754ed4c97ace Mon Sep 17 00:00:00 2001 From: sofstam Date: Thu, 5 Dec 2024 10:33:02 +0100 Subject: [PATCH 9/9] Add contains --- .../nf-core/sylph/profile/tests/main.nf.test | 6 ++-- .../sylph/profile/tests/main.nf.test.snap | 32 +++++++++++++++---- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test b/modules/nf-core/sylph/profile/tests/main.nf.test index 671bbb501aa..de0f0e35ba1 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test +++ b/modules/nf-core/sylph/profile/tests/main.nf.test @@ -24,7 +24,7 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions, - process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, + process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") }, ).match() } ) @@ -49,7 +49,7 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions, - process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, + process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") }, ).match() } ) @@ -77,7 +77,7 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions, - process.out.profile_out.get(0).get(1).readLines().any { it.contains("Adjusted_ANI") }, + process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") }, ).match() } ) diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap index d381f4a3fe8..da7a092b33a 100644 --- a/modules/nf-core/sylph/profile/tests/main.nf.test.snap +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -1,41 +1,59 @@ { + "versions": { + "content": [ + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-05T10:06:07.353254" + }, "sarscov2 illumina paired-end [fastq_gz]": { "content": [ [ "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" ], - false + [ + false + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-12-05T09:57:57.900344" + "timestamp": "2024-12-05T10:31:09.774052" }, "sarscov2 illumina single-end [fastq_gz]": { "content": [ - null, [ "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + [ + false ] ], "meta": { - "nf-test": "0.8.4", + "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-28T17:27:29.922818" + "timestamp": "2024-12-05T10:29:46.733197" }, "sarscov2 illumina paired-end [fastq_gz]-stub": { "content": [ [ "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" ], - false + [ + false + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-12-05T09:58:05.124595" + "timestamp": "2024-12-05T10:31:16.953204" } } \ No newline at end of file