From 30d3ca4346ae38f0de821c57a9c517b8b0b135d6 Mon Sep 17 00:00:00 2001 From: awgymer <24782660+awgymer@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:52:22 +0000 Subject: [PATCH] Make `mosdepth` stub use `gzip` for `.gz` files (#5410) Switch to using proper gzip command to generate empty gz files. Update snapshot and tests --- modules/nf-core/mosdepth/main.nf | 8 +- modules/nf-core/mosdepth/tests/main.nf.test | 16 +- .../nf-core/mosdepth/tests/main.nf.test.snap | 339 +++++++++++++++--- 3 files changed, 295 insertions(+), 68 deletions(-) diff --git a/modules/nf-core/mosdepth/main.nf b/modules/nf-core/mosdepth/main.nf index c7e243038f9..0190a09d801 100644 --- a/modules/nf-core/mosdepth/main.nf +++ b/modules/nf-core/mosdepth/main.nf @@ -63,13 +63,13 @@ process MOSDEPTH { touch ${prefix}.region.dist.txt touch ${prefix}.summary.txt touch ${prefix}.per-base.d4 - touch ${prefix}.per-base.bed.gz + echo "" | gzip > ${prefix}.per-base.bed.gz touch ${prefix}.per-base.bed.gz.csi - touch ${prefix}.regions.bed.gz + echo "" | gzip > ${prefix}.regions.bed.gz touch ${prefix}.regions.bed.gz.csi - touch ${prefix}.quantized.bed.gz + echo "" | gzip > ${prefix}.quantized.bed.gz touch ${prefix}.quantized.bed.gz.csi - touch ${prefix}.thresholds.bed.gz + echo "" | gzip > ${prefix}.thresholds.bed.gz touch ${prefix}.thresholds.bed.gz.csi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/mosdepth/tests/main.nf.test b/modules/nf-core/mosdepth/tests/main.nf.test index d991f819ab3..21eebc1fa5e 100644 --- a/modules/nf-core/mosdepth/tests/main.nf.test +++ b/modules/nf-core/mosdepth/tests/main.nf.test @@ -237,21 +237,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.global_txt[0][1]).name, - file(process.out.summary_txt[0][1]).name, - file(process.out.regions_txt[0][1]).name, - file(process.out.per_base_d4[0][1]).name, - file(process.out.per_base_bed[0][1]).name, - file(process.out.per_base_csi[0][1]).name, - file(process.out.regions_bed[0][1]).name, - file(process.out.regions_csi[0][1]).name, - file(process.out.quantized_bed[0][1]).name, - file(process.out.quantized_csi[0][1]).name, - file(process.out.thresholds_bed[0][1]).name, - file(process.out.thresholds_csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/mosdepth/tests/main.nf.test.snap b/modules/nf-core/mosdepth/tests/main.nf.test.snap index dc4d9508568..00f4cd974b9 100644 --- a/modules/nf-core/mosdepth/tests/main.nf.test.snap +++ b/modules/nf-core/mosdepth/tests/main.nf.test.snap @@ -1,23 +1,236 @@ { "homo_sapiens - bam, bai, [] - stub": { "content": [ - "test.global.dist.txt", - "test.summary.txt", - "test.region.dist.txt", - "test.per-base.d4", - "test.per-base.bed.gz", - "test.per-base.bed.gz.csi", - "test.regions.bed.gz", - "test.regions.bed.gz.csi", - "test.quantized.bed.gz", - "test.quantized.bed.gz.csi", - "test.thresholds.bed.gz", - "test.thresholds.bed.gz.csi", - [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_d4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "quantized_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "quantized_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "thresholds_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "thresholds_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } ], - "timestamp": "2023-11-27T15:14:34.897155161" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:29:04.084192" }, "homo_sapiens - cram, crai, bed": { "content": [ @@ -67,7 +280,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -85,7 +298,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -118,7 +331,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -145,7 +358,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -186,7 +399,11 @@ ] } ], - "timestamp": "2023-11-27T14:47:18.171150781" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:16.664319" }, "homo_sapiens - bam, bai, [] - quantized": { "content": [ @@ -230,7 +447,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -254,7 +471,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz:md5,3e434a8bafcf59a67841ae3d4d752838" + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" ] ], "9": [ @@ -281,7 +498,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -302,7 +519,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz:md5,3e434a8bafcf59a67841ae3d4d752838" + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" ] ], "quantized_csi": [ @@ -343,7 +560,11 @@ ] } ], - "timestamp": "2023-11-27T14:47:29.228103864" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:35.978752" }, "homo_sapiens - bam, bai, bed": { "content": [ @@ -393,7 +614,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -411,7 +632,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -444,7 +665,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -471,7 +692,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -512,7 +733,11 @@ ] } ], - "timestamp": "2023-11-27T14:47:04.537716314" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:27:55.598384" }, "homo_sapiens - bam, bai, [] - window": { "content": [ @@ -562,7 +787,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -580,7 +805,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,f02e2cb49cc050e13d76942d6960827a" + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" ] ], "7": [ @@ -613,7 +838,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -640,7 +865,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,f02e2cb49cc050e13d76942d6960827a" + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" ] ], "regions_csi": [ @@ -681,7 +906,11 @@ ] } ], - "timestamp": "2023-11-27T14:47:23.708536171" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:26.37386" }, "homo_sapiens - bam, bai, []": { "content": [ @@ -725,7 +954,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -764,7 +993,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -814,7 +1043,11 @@ ] } ], - "timestamp": "2023-11-27T14:46:56.975710077" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:27:44.658599" }, "homo_sapiens - cram, crai, []": { "content": [ @@ -858,7 +1091,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -897,7 +1130,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -947,7 +1180,11 @@ ] } ], - "timestamp": "2023-11-27T14:47:12.09259995" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:06.482838" }, "homo_sapiens - bam, bai, bed - thresholds": { "content": [ @@ -976,7 +1213,7 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz:md5,13101e326eea3cbfa1d569b69f494f4c" + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" ] ], "11": [ @@ -1009,7 +1246,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -1027,7 +1264,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -1060,7 +1297,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -1087,7 +1324,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -1123,7 +1360,7 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz:md5,13101e326eea3cbfa1d569b69f494f4c" + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" ] ], "thresholds_csi": [ @@ -1140,6 +1377,10 @@ ] } ], - "timestamp": "2023-11-27T14:49:44.311847326" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:45.918241" } } \ No newline at end of file