From 5e5350a08ce4d4a09dedf034559c678239579cc1 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:11:47 +0000 Subject: [PATCH 1/4] Swap umitools/group to nf-test --- modules/nf-core/umitools/group/main.nf | 7 +- .../nf-core/umitools/group/tests/main.nf.test | 164 +++++++++++++ .../umitools/group/tests/main.nf.test.snap | 226 ++++++++++++++++++ .../umitools/group/tests/nextflow.config | 5 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/umitools/group/main.nf | 96 -------- .../nf-core/umitools/group/nextflow.config | 27 --- tests/modules/nf-core/umitools/group/test.yml | 59 ----- 8 files changed, 399 insertions(+), 188 deletions(-) create mode 100644 modules/nf-core/umitools/group/tests/main.nf.test create mode 100644 modules/nf-core/umitools/group/tests/main.nf.test.snap create mode 100644 modules/nf-core/umitools/group/tests/nextflow.config delete mode 100644 tests/modules/nf-core/umitools/group/main.nf delete mode 100644 tests/modules/nf-core/umitools/group/nextflow.config delete mode 100644 tests/modules/nf-core/umitools/group/test.yml diff --git a/modules/nf-core/umitools/group/main.nf b/modules/nf-core/umitools/group/main.nf index 6fc8194d9aa..10314f69f98 100644 --- a/modules/nf-core/umitools/group/main.nf +++ b/modules/nf-core/umitools/group/main.nf @@ -23,7 +23,7 @@ process UMITOOLS_GROUP { script: def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}_grouped" def paired = meta.single_end ? "" : "--paired" output_bam = create_bam ? "--output-bam -S ${prefix}.bam" : "" group_info = get_group_info ? "--group-out ${prefix}.tsv" : "" @@ -48,11 +48,12 @@ process UMITOOLS_GROUP { """ stub: - prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}_grouped" + output_bam = create_bam ? "touch ${prefix}.bam" : "" """ - touch ${prefix}.bam touch ${prefix}.log touch ${prefix}.tsv + $output_bam cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/umitools/group/tests/main.nf.test b/modules/nf-core/umitools/group/tests/main.nf.test new file mode 100644 index 00000000000..62791724e02 --- /dev/null +++ b/modules/nf-core/umitools/group/tests/main.nf.test @@ -0,0 +1,164 @@ +nextflow_process { + + name "Test Process UMITOOLS_GROUP" + script "../main.nf" + process "UMITOOLS_GROUP" + + tag "modules" + tag "modules_nfcore" + tag "umitools" + tag "umitools/group" + + setup { + run("UMITOOLS_EXTRACT") { + script "../../extract/main.nf" + config "./nextflow.config" + 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) + ] + ] + """ + } + } + + run("BWA_INDEX") { + script "../../../bwa/index/main.nf" + process { + """ + input[0] = [ + [ id:'sarscov2'], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + run("BWA_MEM") { + script "../../../bwa/mem/main.nf" + process { + """ + input[0] = UMITOOLS_EXTRACT.out.reads + input[1] = BWA_INDEX.out.index + input[2] = [ [], [] ] + input[3] = true + """ + } + } + + run("SAMTOOLS_INDEX") { + script "../../../samtools/index/main.nf" + process { + """ + input[0] = BWA_MEM.out.bam + """ + } + } + + } + + test("no_umi") { + + when { + process { + """ + input[0] = [[ id:'test'], // meta map + file(params.test_data_base + '/data/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.test_data_base + '/data/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + input[1] = true + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.tsv, + file(process.out.log[0][1]).readLines()[0..1], + process.out.versions + ).match() } + ) + } + + } + + test("with_umi - bam") { + + when { + process { + """ + input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[1] = true + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bam, + file(process.out.log[0][1]).readLines()[0..1], + process.out.versions + ).match() } + ) + } + + } + + test("with_umi - tsv") { + + when { + process { + """ + input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[1] = true + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.tsv, + file(process.out.log[0][1]).readLines()[0..1], + process.out.versions + ).match() } + ) + } + + } + + test("with_umi - stub") { + options "-stub" + when { + process { + """ + input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[1] = true + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/umitools/group/tests/main.nf.test.snap b/modules/nf-core/umitools/group/tests/main.nf.test.snap new file mode 100644 index 00000000000..20b2cae91d0 --- /dev/null +++ b/modules/nf-core/umitools/group/tests/main.nf.test.snap @@ -0,0 +1,226 @@ +{ + "with_umi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T19:52:11.292296043" + }, + "with_umi - tsv": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" + ] + ], + [ + "# UMI-tools version: 1.1.5", + "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" + ], + [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T20:01:27.19796961" + }, + "with_umi": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.log:md5,1758ea02d8ed0fcc81dd379456f180b2" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" + ] + ], + "3": [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.log:md5,1758ea02d8ed0fcc81dd379456f180b2" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" + ] + ], + "versions": [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T19:57:23.817618505" + }, + "with_umi - bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" + ] + ], + [ + "# UMI-tools version: 1.1.5", + "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --paired --random-seed=100" + ], + [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T20:01:05.763105045" + }, + "no_umi": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_grouped.bam:md5,fb90b49a90c2b3e8ddfedd9c95361625" + ] + ], + [ + [ + { + "id": "test" + }, + "test_grouped.tsv:md5,1a3ccdc00df59fa89c79ad482980a003" + ] + ], + [ + "# UMI-tools version: 1.1.5", + "# output generated by group -I test.paired_end.sorted.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" + ], + [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T20:02:22.66987719" + } +} \ No newline at end of file diff --git a/modules/nf-core/umitools/group/tests/nextflow.config b/modules/nf-core/umitools/group/tests/nextflow.config new file mode 100644 index 00000000000..06a7d07a746 --- /dev/null +++ b/modules/nf-core/umitools/group/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: UMITOOLS_EXTRACT { + ext.args = '--bc-pattern="NNNN"' + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 83f3c37d11f..c4ae5e5d5a3 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -798,9 +798,6 @@ ultra/pipeline: ultraplex: - modules/nf-core/ultraplex/** - tests/modules/nf-core/ultraplex/** -umitools/group: - - modules/nf-core/umitools/group/** - - tests/modules/nf-core/umitools/group/** universc: - modules/nf-core/universc/** - tests/modules/nf-core/universc/** diff --git a/tests/modules/nf-core/umitools/group/main.nf b/tests/modules/nf-core/umitools/group/main.nf deleted file mode 100644 index 0540b906187..00000000000 --- a/tests/modules/nf-core/umitools/group/main.nf +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { UMITOOLS_EXTRACT } from '../../../../../modules/nf-core/umitools/extract/main.nf' -include { BWA_INDEX } from '../../../../../modules/nf-core/bwa/index/main.nf' -include { BWA_MEM } from '../../../../../modules/nf-core/bwa/mem/main.nf' -include { SAMTOOLS_INDEX } from '../../../../../modules/nf-core/samtools/index/main.nf' -include { UMITOOLS_GROUP } from '../../../../../modules/nf-core/umitools/group/main.nf' - -// -// Test with no UMI -// -workflow test_umitools_group_no_umi { - input = [ - [ 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) - ] - create_bam = true - get_group_info = true - - UMITOOLS_GROUP ( input, create_bam, get_group_info ) -} - -// -// Test with single-end data with BAM false and group info true -// -workflow test_umitools_group_single_end_info { - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - fasta = [ - [ id:'sarscov2'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - create_bam = false - get_group_info = true - - UMITOOLS_EXTRACT ( input ) - BWA_INDEX ( fasta ) - BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) - SAMTOOLS_INDEX ( BWA_MEM.out.bam ) - UMITOOLS_GROUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), create_bam, get_group_info ) -} - -// -// Test with paired-end data with BAM true and group info false -// -workflow test_umitools_group_paired_end_bam { - 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:'sarscov2'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - create_bam = true - get_group_info = false - - UMITOOLS_EXTRACT ( input ) - BWA_INDEX ( fasta ) - BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) - SAMTOOLS_INDEX ( BWA_MEM.out.bam ) - UMITOOLS_GROUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), create_bam, get_group_info ) -} - -// -// Test with paired-end data BAM true and group info true -// -workflow test_umitools_group_paired_bam_info { - 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:'sarscov2'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - create_bam = true - get_group_info = true - - UMITOOLS_EXTRACT ( input ) - BWA_INDEX ( fasta ) - BWA_MEM ( UMITOOLS_EXTRACT.out.reads, BWA_INDEX.out.index, true ) - SAMTOOLS_INDEX ( BWA_MEM.out.bam ) - UMITOOLS_GROUP ( BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), create_bam, get_group_info ) -} diff --git a/tests/modules/nf-core/umitools/group/nextflow.config b/tests/modules/nf-core/umitools/group/nextflow.config deleted file mode 100644 index 93d50ad5d6a..00000000000 --- a/tests/modules/nf-core/umitools/group/nextflow.config +++ /dev/null @@ -1,27 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - - withName: BWA_INDEX { - publishDir = [enabled : false ] - } - - withName: BWA_MEM { - publishDir = [enabled : false ] - } - - withName: SAMTOOLS_INDEX { - publishDir = [enabled : false ] - } - - withName: UMITOOLS_EXTRACT { - ext.args = '--bc-pattern="NNNN"' - publishDir = [ enabled : false ] - } - - withName: UMITOOLS_GROUP { - ext.prefix = { "${meta.id}.group" } - } - -} diff --git a/tests/modules/nf-core/umitools/group/test.yml b/tests/modules/nf-core/umitools/group/test.yml deleted file mode 100644 index 31f6054e0f4..00000000000 --- a/tests/modules/nf-core/umitools/group/test.yml +++ /dev/null @@ -1,59 +0,0 @@ -- name: umitools group test_umitools_group_no_umi - command: nextflow run ./tests/modules/nf-core/umitools/group -entry test_umitools_group_no_umi -c ./tests/config/nextflow.config - tags: - - umitools/group - - umitools - files: - - path: output/umitools/test.group.bam - md5sum: fb90b49a90c2b3e8ddfedd9c95361625 - - path: output/umitools/test.group.log - contains: - - "# UMI-tools version:" - - "job finished" - - path: output/umitools/test.group.tsv - md5sum: 1a3ccdc00df59fa89c79ad482980a003 - - path: output/umitools/versions.yml - -- name: umitools group test_umitools_group_single_end_info - command: nextflow run ./tests/modules/nf-core/umitools/group -entry test_umitools_group_single_end_info -c ./tests/config/nextflow.config - tags: - - umitools/group - - umitools - files: - - path: output/umitools/test.group.log - contains: - - "# UMI-tools version:" - - "job finished" - - path: output/umitools/test.group.tsv - md5sum: e7d46166eb3d8f42d73032e44f313b71 - - path: output/umitools/versions.yml - -- name: umitools group test_umitools_group_paired_end_bam - command: nextflow run ./tests/modules/nf-core/umitools/group -entry test_umitools_group_paired_end_bam -c ./tests/config/nextflow.config - tags: - - umitools/group - - umitools - files: - - path: output/umitools/test.group.bam - md5sum: 939c7ab9c5c7f78c2664b152b76fead4 - - path: output/umitools/test.group.log - contains: - - "# UMI-tools version:" - - "job finished" - - path: output/umitools/versions.yml - -- name: umitools group test_umitools_group_paired_bam_info - command: nextflow run ./tests/modules/nf-core/umitools/group -entry test_umitools_group_paired_bam_info -c ./tests/config/nextflow.config - tags: - - umitools/group - - umitools - files: - - path: output/umitools/test.group.bam - md5sum: 939c7ab9c5c7f78c2664b152b76fead4 - - path: output/umitools/test.group.log - contains: - - "# UMI-tools version:" - - "job finished" - - path: output/umitools/test.group.tsv - md5sum: d652eb6570057e9e709e8cac5f43d00c - - path: output/umitools/versions.yml From 34831531a879fb074f46179863154b2b2667a1ef Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Tue, 17 Sep 2024 08:05:53 +0000 Subject: [PATCH 2/4] Update tests and meta --- modules/nf-core/umitools/group/meta.yml | 4 + .../nf-core/umitools/group/tests/main.nf.test | 8 +- .../umitools/group/tests/main.nf.test.snap | 94 +------------------ 3 files changed, 14 insertions(+), 92 deletions(-) diff --git a/modules/nf-core/umitools/group/meta.yml b/modules/nf-core/umitools/group/meta.yml index c989836f7fa..09bdf70a6dd 100644 --- a/modules/nf-core/umitools/group/meta.yml +++ b/modules/nf-core/umitools/group/meta.yml @@ -55,6 +55,10 @@ output: type: file description: Flatfile describing the read groups, see docs for complete info of all columns pattern: "*.{tsv}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@Joon-Klaps" maintainers: diff --git a/modules/nf-core/umitools/group/tests/main.nf.test b/modules/nf-core/umitools/group/tests/main.nf.test index 62791724e02..a69805dcca4 100644 --- a/modules/nf-core/umitools/group/tests/main.nf.test +++ b/modules/nf-core/umitools/group/tests/main.nf.test @@ -7,7 +7,11 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "umitools" + tag "umitools/extract" tag "umitools/group" + tag "bwa/index" + tag "bwa/mem" + tag "samtools/index" setup { run("UMITOOLS_EXTRACT") { @@ -80,7 +84,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getReadsMD5(), process.out.tsv, file(process.out.log[0][1]).readLines()[0..1], process.out.versions @@ -106,7 +110,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getReadsMD5(), file(process.out.log[0][1]).readLines()[0..1], process.out.versions ).match() } diff --git a/modules/nf-core/umitools/group/tests/main.nf.test.snap b/modules/nf-core/umitools/group/tests/main.nf.test.snap index 20b2cae91d0..1a5c435652e 100644 --- a/modules/nf-core/umitools/group/tests/main.nf.test.snap +++ b/modules/nf-core/umitools/group/tests/main.nf.test.snap @@ -95,88 +95,9 @@ }, "timestamp": "2024-09-16T20:01:27.19796961" }, - "with_umi": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.log:md5,1758ea02d8ed0fcc81dd379456f180b2" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" - ] - ], - "3": [ - "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" - ] - ], - "log": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.log:md5,1758ea02d8ed0fcc81dd379456f180b2" - ] - ], - "tsv": [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" - ] - ], - "versions": [ - "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T19:57:23.817618505" - }, "with_umi - bam": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_grouped.bam:md5,f576b264fd3e8457f5e3716b09fcca58" - ] - ], + "72da540b9a840cf39e3567cc35045143", [ "# UMI-tools version: 1.1.5", "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --paired --random-seed=100" @@ -189,18 +110,11 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-16T20:01:05.763105045" + "timestamp": "2024-09-17T07:22:56.250821809" }, "no_umi": { "content": [ - [ - [ - { - "id": "test" - }, - "test_grouped.bam:md5,fb90b49a90c2b3e8ddfedd9c95361625" - ] - ], + "b01829d27fad55e707745f86311b443e", [ [ { @@ -221,6 +135,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-16T20:02:22.66987719" + "timestamp": "2024-09-17T07:22:24.041871851" } } \ No newline at end of file From a72b3ff4fadc62a120f872197553c6ce762879ee Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:53:42 +0000 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Joon Klaps --- modules/nf-core/umitools/group/tests/main.nf.test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/umitools/group/tests/main.nf.test b/modules/nf-core/umitools/group/tests/main.nf.test index a69805dcca4..9ba95f871ea 100644 --- a/modules/nf-core/umitools/group/tests/main.nf.test +++ b/modules/nf-core/umitools/group/tests/main.nf.test @@ -94,7 +94,7 @@ nextflow_process { } - test("with_umi - bam") { + test("with_umi - create only bam") { when { process { @@ -119,7 +119,7 @@ nextflow_process { } - test("with_umi - tsv") { + test("with_umi - create bam and tsv") { when { process { @@ -136,6 +136,7 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.tsv, + bam(process.out.bam[0][1]).getReadsMD5(), file(process.out.log[0][1]).readLines()[0..1], process.out.versions ).match() } From cce72a89352add820e6f90de9f32483d1b8cac3b Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:06:07 +0000 Subject: [PATCH 4/4] Update snapshot --- .../umitools/group/tests/main.nf.test.snap | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/modules/nf-core/umitools/group/tests/main.nf.test.snap b/modules/nf-core/umitools/group/tests/main.nf.test.snap index 1a5c435652e..b7941149526 100644 --- a/modules/nf-core/umitools/group/tests/main.nf.test.snap +++ b/modules/nf-core/umitools/group/tests/main.nf.test.snap @@ -1,4 +1,21 @@ { + "with_umi - create only bam": { + "content": [ + "72da540b9a840cf39e3567cc35045143", + [ + "# UMI-tools version: 1.1.5", + "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --paired --random-seed=100" + ], + [ + "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-20T13:51:08.650455694" + }, "with_umi - stub": { "content": [ { @@ -70,37 +87,20 @@ }, "timestamp": "2024-09-16T19:52:11.292296043" }, - "with_umi - tsv": { + "no_umi": { "content": [ + "b01829d27fad55e707745f86311b443e", [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" + "test_grouped.tsv:md5,1a3ccdc00df59fa89c79ad482980a003" ] ], [ "# UMI-tools version: 1.1.5", - "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" - ], - [ - "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T20:01:27.19796961" - }, - "with_umi - bam": { - "content": [ - "72da540b9a840cf39e3567cc35045143", - [ - "# UMI-tools version: 1.1.5", - "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --paired --random-seed=100" + "# output generated by group -I test.paired_end.sorted.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" ], [ "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" @@ -110,31 +110,32 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-17T07:22:56.250821809" + "timestamp": "2024-09-17T07:22:24.041871851" }, - "no_umi": { + "with_umi - create bam and tsv": { "content": [ - "b01829d27fad55e707745f86311b443e", [ [ { - "id": "test" + "id": "test", + "single_end": false }, - "test_grouped.tsv:md5,1a3ccdc00df59fa89c79ad482980a003" + "test_grouped.tsv:md5,d652eb6570057e9e709e8cac5f43d00c" ] ], + "72da540b9a840cf39e3567cc35045143", [ "# UMI-tools version: 1.1.5", - "# output generated by group -I test.paired_end.sorted.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" + "# output generated by group -I test.bam --output-bam -S test_grouped.bam -L test_grouped.log --group-out test_grouped.tsv --paired --random-seed=100" ], [ "versions.yml:md5,1f4cec69f12f1759748ed167701b321c" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-09-17T07:22:24.041871851" + "timestamp": "2024-11-20T13:51:34.459633546" } } \ No newline at end of file