From 3873c15fef28a44bcf10e7dbdfa7d7a5ce3b1277 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 15:51:31 +0100 Subject: [PATCH 01/25] Update bcftools annotate --- modules.json | 2 +- .../bcftools/annotate/bcftools-annotate.diff | 21 ++- .../nf-core/bcftools/annotate/environment.yml | 2 - modules/nf-core/bcftools/annotate/main.nf | 10 +- modules/nf-core/bcftools/annotate/meta.yml | 91 ++++++---- .../bcftools/annotate/tests/main.nf.test | 170 +++++++++--------- .../bcftools/annotate/tests/main.nf.test.snap | 160 ++++++++--------- 7 files changed, 244 insertions(+), 212 deletions(-) diff --git a/modules.json b/modules.json index cf2407ab..39ca219b 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "bcftools/annotate": { "branch": "master", - "git_sha": "c1a7fa1c038061b344f2a41be71942061ec40d2e", + "git_sha": "cb08035150685b11d890d90c9534d4f16869eaec", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff" }, diff --git a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff index bc6cd88e..c9614e6c 100644 --- a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff +++ b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff @@ -1,19 +1,19 @@ Changes in module 'nf-core/bcftools/annotate' +'modules/nf-core/bcftools/annotate/environment.yml' is unchanged +Changes in 'bcftools/annotate/main.nf': --- modules/nf-core/bcftools/annotate/main.nf +++ modules/nf-core/bcftools/annotate/main.nf -@@ -8,10 +8,7 @@ +@@ -8,8 +8,7 @@ 'biocontainers/bcftools:1.20--h8b25389_0' }" input: -- tuple val(meta), path(input), path(index) -- path(annotations) -- path(annotations_index) +- tuple val(meta), path(input), path(index), path(annotations), path(annotations_index) - path(header_lines) + tuple val(meta), path(input), path(index), path(annotations), path(annotations_index), path(header_lines), path(rename_chr) output: tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf -@@ -27,6 +24,7 @@ +@@ -25,6 +24,7 @@ def prefix = task.ext.prefix ?: "${meta.id}" def header_file = header_lines ? "--header-lines ${header_lines}" : '' def annotations_file = annotations ? "--annotations ${annotations}" : '' @@ -21,7 +21,7 @@ Changes in module 'nf-core/bcftools/annotate' def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : -@@ -43,6 +41,7 @@ +@@ -41,6 +41,7 @@ $args \\ $annotations_file \\ $header_file \\ @@ -30,4 +30,13 @@ Changes in module 'nf-core/bcftools/annotate' --threads $task.cpus \\ $input +'modules/nf-core/bcftools/annotate/meta.yml' is unchanged +'modules/nf-core/bcftools/annotate/tests/bcf.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/main.nf.test' is unchanged +'modules/nf-core/bcftools/annotate/tests/main.nf.test.snap' is unchanged +'modules/nf-core/bcftools/annotate/tests/tags.yml' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config' is unchanged ************************************************************ diff --git a/modules/nf-core/bcftools/annotate/environment.yml b/modules/nf-core/bcftools/annotate/environment.yml index 3d4e3379..5c00b116 100644 --- a/modules/nf-core/bcftools/annotate/environment.yml +++ b/modules/nf-core/bcftools/annotate/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_annotate channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/annotate/main.nf b/modules/nf-core/bcftools/annotate/main.nf index 1d440ac9..b6850bba 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -60,12 +60,12 @@ process BCFTOOLS_ANNOTATE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" - def index = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" : - args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" : - args.contains("--write-index") || args.contains("-W") ? "csi" : - "" + def index_extension = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" : + args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" : + args.contains("--write-index") || args.contains("-W") ? "csi" : + "" def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" - def create_index = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index}" : "" + def create_index = extension.endsWith(".gz") && index_extension.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index_extension}" : "" """ ${create_cmd} ${prefix}.${extension} diff --git a/modules/nf-core/bcftools/annotate/meta.yml b/modules/nf-core/bcftools/annotate/meta.yml index 248eee0c..5bfccd2b 100644 --- a/modules/nf-core/bcftools/annotate/meta.yml +++ b/modules/nf-core/bcftools/annotate/meta.yml @@ -13,49 +13,64 @@ tools: documentation: https://samtools.github.io/bcftools/bcftools.html#annotate doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: Query VCF or BCF file, can be either uncompressed or compressed - - index: - type: file - description: Index of the query VCF or BCF file - - annotations: - type: file - description: Bgzip-compressed file with annotations - - annotations_index: - type: file - description: Index of the annotations file - - header_lines: - type: file - description: Contains lines to append to the output VCF header + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: Query VCF or BCF file, can be either uncompressed or compressed + - index: + type: file + description: Index of the query VCF or BCF file + - annotations: + type: file + description: Bgzip-compressed file with annotations + - annotations_index: + type: file + description: Index of the annotations file + - - header_lines: + type: file + description: Contains lines to append to the output VCF header output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: Compressed annotated VCF file - pattern: "*{vcf,vcf.gz,bcf,bcf.gz}" - - csi: - type: file - description: Default VCF file index - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,vcf.gz,bcf,bcf.gz}": + type: file + description: Compressed annotated VCF file + pattern: "*{vcf,vcf.gz,bcf,bcf.gz}" - tbi: - type: file - description: Alternative VCF file index - pattern: "*.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: Alternative VCF file index + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: Default VCF file index + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@projectoriented" - "@ramprasadn" diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test b/modules/nf-core/bcftools/annotate/tests/main.nf.test index 8cd87abc..3a5c4933 100644 --- a/modules/nf-core/bcftools/annotate/tests/main.nf.test +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test @@ -9,20 +9,21 @@ nextflow_process { tag "bcftools" tag "bcftools/annotate" - test("sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_output") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_output") { config "./vcf.config" when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -39,20 +40,21 @@ nextflow_process { } - test("sarscov2 - [vcf, []] annotation, annotation_tbi, [] - vcf_output") { + test("sarscov2 - [vcf, [], annotation, annotation_tbi], [] - vcf_output") { config "./vcf.config" when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - []] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -68,20 +70,21 @@ nextflow_process { } } - test("sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index") { config "./vcf_gz_index.config" when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -101,20 +104,21 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index_csi") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi") { config "./vcf_gz_index_csi.config" when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -134,20 +138,21 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index_tbi") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi") { config "./vcf_gz_index_tbi.config" when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -166,20 +171,21 @@ nextflow_process { } } - test("sarscov2 - [vcf, []], annotation, annotation_tbi, header - bcf_output") { + test("sarscov2 - [vcf, [], annotation, annotation_tbi], header - bcf_output") { config "./bcf.config" when { process { """ - input[0] = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - []]) - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = Channel.of( + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = Channel.of( '##INFO=', '##INFO=' ).collectFile(name:"headers.vcf", newLine:true) @@ -199,7 +205,7 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - stub") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - stub") { config "./vcf.config" options "-stub" @@ -207,13 +213,14 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -227,7 +234,7 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index - stub") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index - stub") { config "./vcf_gz_index.config" options "-stub" @@ -235,13 +242,14 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -256,7 +264,7 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index_csi - stub") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi - stub") { config "./vcf_gz_index_csi.config" options "-stub" @@ -264,13 +272,14 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } @@ -285,7 +294,7 @@ nextflow_process { } - test("sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index_tbi - stub") { + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi - stub") { config "./vcf_gz_index_tbi.config" options "-stub" @@ -293,13 +302,14 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] - - input[1] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true) - input[3] = [] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] """ } } diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap index 8fd8d11d..bac2224a 100644 --- a/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap @@ -1,38 +1,5 @@ { - "sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index_tbi": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_vcf.vcf.gz" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test_vcf.vcf.gz.tbi" - ] - ], - [ - - ], - [ - "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-06-12T16:39:23.802873" - }, - "sarscov2 - [vcf, []] annotation, annotation_tbi, [] - vcf_output": { + "bcf": { "content": [ [ [ @@ -40,7 +7,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.bcf" ] ], [ @@ -51,9 +18,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:38:57.039285" + "timestamp": "2024-06-12T16:39:33.331888" }, - "sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index_csi": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index": { "content": [ [ [ @@ -84,9 +51,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:39:15.152697" + "timestamp": "2024-08-15T10:07:59.658031137" }, - "sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - stub": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi - stub": { "content": [ { "0": [ @@ -102,13 +69,25 @@ ], "2": [ - + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "3": [ "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" ], "csi": [ - + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "tbi": [ @@ -131,9 +110,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:39:41.994785" + "timestamp": "2024-08-15T10:09:05.096883418" }, - "bcf": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi": { "content": [ [ [ @@ -141,7 +120,19 @@ "id": "test", "single_end": false }, - "test_ann.bcf" + "test_vcf.vcf.gz" + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi" ] ], [ @@ -152,9 +143,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:39:33.331888" + "timestamp": "2024-08-15T10:08:10.581301219" }, - "sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index_tbi - stub": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - stub": { "content": [ { "0": [ @@ -167,13 +158,7 @@ ] ], "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + ], "2": [ @@ -185,13 +170,7 @@ ], "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + ], "vcf": [ [ @@ -211,9 +190,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:40:13.835994" + "timestamp": "2024-08-15T10:08:43.975017625" }, - "sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_output": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi": { "content": [ [ [ @@ -223,6 +202,18 @@ }, "test_vcf.vcf.gz" ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi" + ] + ], + [ + ], [ "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" @@ -232,9 +223,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:38:48.368629" + "timestamp": "2024-08-15T10:08:21.354059092" }, - "sarscov2 - [vcf, tbi], annotation, annotation_tbi, [] - vcf_gz_index": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_output": { "content": [ [ [ @@ -246,15 +237,24 @@ ] ], [ - - ], + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:07:37.788393317" + }, + "sarscov2 - [vcf, [], annotation, annotation_tbi], [] - vcf_output": { + "content": [ [ [ { "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_vcf.vcf.gz" ] ], [ @@ -265,9 +265,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:39:05.608108" + "timestamp": "2024-08-15T10:07:48.500746325" }, - "sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index - stub": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi - stub": { "content": [ { "0": [ @@ -280,31 +280,31 @@ ] ], "1": [ - - ], - "2": [ [ { "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "2": [ + ], "3": [ "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" ], "csi": [ + + ], + "tbi": [ [ { "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "tbi": [ - ], "vcf": [ [ @@ -324,9 +324,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:39:54.842082" + "timestamp": "2024-08-15T10:09:16.094918834" }, - "sarscov2 - [vcf, tbi] annotation, annotation_tbi, [] - vcf_gz_index_csi - stub": { + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index - stub": { "content": [ { "0": [ @@ -383,6 +383,6 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-06-12T16:40:04.074052" + "timestamp": "2024-08-15T10:08:54.366358502" } } \ No newline at end of file From 8320188a1b67a08d2e362c8271d3ac7c896e4aa3 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 15:54:07 +0100 Subject: [PATCH 02/25] Update bcftools concat --- modules.json | 2 +- .../nf-core/bcftools/concat/environment.yml | 2 - modules/nf-core/bcftools/concat/main.nf | 15 +- modules/nf-core/bcftools/concat/meta.yml | 90 ++++++---- .../bcftools/concat/tests/main.nf.test | 86 +++++----- .../bcftools/concat/tests/main.nf.test.snap | 158 +++++++++--------- 6 files changed, 189 insertions(+), 164 deletions(-) diff --git a/modules.json b/modules.json index 39ca219b..0a1f1be3 100644 --- a/modules.json +++ b/modules.json @@ -13,7 +13,7 @@ }, "bcftools/concat": { "branch": "master", - "git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988", + "git_sha": "d1e0ec7670fa77905a378627232566ce54c3c26d", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/concat/bcftools-concat.diff" }, diff --git a/modules/nf-core/bcftools/concat/environment.yml b/modules/nf-core/bcftools/concat/environment.yml index 6544e949..5c00b116 100644 --- a/modules/nf-core/bcftools/concat/environment.yml +++ b/modules/nf-core/bcftools/concat/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_concat channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/concat/main.nf b/modules/nf-core/bcftools/concat/main.nf index 1f4d754f..17e3cf4a 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -11,18 +11,21 @@ process BCFTOOLS_CONCAT { tuple val(meta), path(vcfs), path(tbi) output: - tuple val(meta), path("*.gz") , emit: vcf - tuple val(meta), path("*.tbi"), emit: tbi, optional: true - tuple val(meta), path("*.csi"), emit: csi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf + tuple val(meta), path("${prefix}.vcf.gz.tbi"), emit: tbi, optional: true + tuple val(meta), path("${prefix}.vcf.gz.csi"), emit: csi, optional: true + 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}" + prefix = task.ext.prefix ?: "${meta.id}" + def tbi_names = tbi.findAll { file -> !(file instanceof List) }.collect { file -> file.name } + def create_input_index = vcfs.collect { vcf -> tbi_names.contains(vcf.name + ".tbi") ? "" : "tabix ${vcf}" }.join("\n ") """ + ${create_input_index} ls -1v ${vcfs} > order_files.txt bcftools concat \\ --output ${prefix}.vcf.gz \\ @@ -38,7 +41,7 @@ process BCFTOOLS_CONCAT { stub: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" def index = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" : args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" : args.contains("--write-index") || args.contains("-W") ? "csi" : diff --git a/modules/nf-core/bcftools/concat/meta.yml b/modules/nf-core/bcftools/concat/meta.yml index eeeb2071..d2565b28 100644 --- a/modules/nf-core/bcftools/concat/meta.yml +++ b/modules/nf-core/bcftools/concat/meta.yml @@ -13,44 +13,68 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcfs: - type: list - description: | - List containing 2 or more vcf files - e.g. [ 'file1.vcf', 'file2.vcf' ] - - tbi: - type: list - description: | - List containing 2 or more index files (optional) - e.g. [ 'file1.tbi', 'file2.tbi' ] + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcfs: + type: list + description: | + List containing 2 or more vcf files + e.g. [ 'file1.vcf', 'file2.vcf' ] + - tbi: + type: list + description: | + List containing 2 or more index files (optional) + e.g. [ 'file1.tbi', 'file2.tbi' ] output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: VCF concatenated output file - pattern: "*.{vcf.gz}" - - csi: - type: file - description: Default VCF file index - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.{vcf.gz}" + - ${prefix}.vcf.gz: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.{vcf.gz}" - tbi: - type: file - description: Alternative VCF file index - pattern: "*.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.tbi" + - ${prefix}.vcf.gz.tbi: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.csi" + - ${prefix}.vcf.gz.csi: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" - "@nvnieuwk" diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test index b42d065e..cb4642b2 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { tag "bcftools/concat" - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]]") { config "./nextflow.config" @@ -20,12 +20,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -41,7 +41,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index") { config "./vcf_gz_index.config" @@ -51,12 +51,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -78,7 +78,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi") { config "./vcf_gz_index_csi.config" @@ -88,12 +88,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -115,7 +115,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi") { config "./vcf_gz_index_tbi.config" @@ -125,12 +125,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -153,7 +153,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], []]") { + test("homo_sapiens - [[vcf1, vcf2], []]") { config "./nextflow.config" @@ -163,8 +163,8 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [] ] @@ -181,7 +181,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - stub") { config "./nextflow.config" options "-stub" @@ -192,12 +192,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -213,7 +213,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub") { config "./vcf_gz_index.config" options "-stub" @@ -224,12 +224,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -246,7 +246,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub") { config "./vcf_gz_index_csi.config" options "-stub" @@ -257,12 +257,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -279,7 +279,7 @@ nextflow_process { } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub") { + test("homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub") { config "./vcf_gz_index_tbi.config" options "-stub" @@ -290,12 +290,12 @@ nextflow_process { input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap index 1182854f..09e87cd3 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub": { "content": [ { "0": [ @@ -49,12 +49,12 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-05T08:09:13.734103412" + "timestamp": "2024-09-26T11:04:11.178539482" }, - "sarscov2 - [[vcf1, vcf2], []]": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]]": { "content": [ { "0": [ @@ -94,12 +94,12 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-04T15:19:09.213249578" + "timestamp": "2024-09-26T11:03:08.765639958" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index": { "content": [ [ [ @@ -125,12 +125,12 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-05T08:08:23.981388325" + "timestamp": "2024-09-26T11:03:21.607274757" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub": { "content": [ { "0": [ @@ -142,29 +142,29 @@ ] ], "1": [ - - ], - "2": [ [ { "id": "test3" }, - "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "2": [ + ], "3": [ "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ], "csi": [ + + ], + "tbi": [ [ { "id": "test3" }, - "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "tbi": [ - ], "vcf": [ [ @@ -180,12 +180,43 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-26T11:04:27.332133878" + }, + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-05T14:01:24.419027693" + "timestamp": "2024-09-26T11:03:36.575719606" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { + "homo_sapiens - [[vcf1, vcf2], []]": { "content": [ { "0": [ @@ -225,43 +256,12 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-04T15:19:03.597061078" + "timestamp": "2024-09-26T11:03:54.069826178" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi": { - "content": [ - [ - [ - { - "id": "test3" - }, - "test3_vcf.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" - ] - ], - [ - [ - { - "id": "test3" - }, - "test3_vcf.vcf.gz.csi" - ] - ], - [ - - ], - [ - "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-06-05T14:00:10.868487669" - }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { "content": [ { "0": [ @@ -301,12 +301,12 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-04T15:19:14.836256897" + "timestamp": "2024-09-26T11:04:02.45346063" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi": { "content": [ [ [ @@ -332,12 +332,12 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-05T14:00:31.061411617" + "timestamp": "2024-09-26T11:03:44.618596639" }, - "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub": { + "homo_sapiens - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub": { "content": [ { "0": [ @@ -349,29 +349,29 @@ ] ], "1": [ + + ], + "2": [ [ { "id": "test3" }, - "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "2": [ - ], "3": [ "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ], "csi": [ - - ], - "tbi": [ [ { "id": "test3" }, - "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "tbi": [ + ], "vcf": [ [ @@ -387,9 +387,9 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-05T14:01:35.209746508" + "timestamp": "2024-09-26T11:04:19.745768656" } } \ No newline at end of file From d4eef21ca83fd7f6c39d92e774951292f093bf69 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:09:07 +0100 Subject: [PATCH 03/25] Update bcftools convert --- modules.json | 2 +- .../nf-core/bcftools/convert/environment.yml | 2 - modules/nf-core/bcftools/convert/meta.yml | 174 +++++++++++------- 3 files changed, 111 insertions(+), 67 deletions(-) diff --git a/modules.json b/modules.json index 0a1f1be3..4a4aa82f 100644 --- a/modules.json +++ b/modules.json @@ -19,7 +19,7 @@ }, "bcftools/convert": { "branch": "master", - "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "bcftools/index": { diff --git a/modules/nf-core/bcftools/convert/environment.yml b/modules/nf-core/bcftools/convert/environment.yml index 3d85cb2c..5c00b116 100644 --- a/modules/nf-core/bcftools/convert/environment.yml +++ b/modules/nf-core/bcftools/convert/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_convert channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/convert/meta.yml b/modules/nf-core/bcftools/convert/meta.yml index 2c89112f..4f2a9f3f 100644 --- a/modules/nf-core/bcftools/convert/meta.yml +++ b/modules/nf-core/bcftools/convert/meta.yml @@ -7,83 +7,129 @@ keywords: - gvcf tools: - "bcftools": - description: "BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations." + description: "BCFtools is a set of utilities that manipulate variant calls in + the Variant Call Format (VCF) and its binary counterpart BCF. All commands work + transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed.\ + \ Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically + even when streaming from a pipe. Indexed VCF and BCF will work in all situations. + Un-indexed VCF and BCF and streams will work in most, but not all situations." homepage: "https://samtools.github.io/bcftools/bcftools.html" documentation: "https://samtools.github.io/bcftools/bcftools.html#convert" tool_dev_url: "https://github.com/samtools/bcftools" doi: "10.1093/gigascience/giab008" licence: ["GPL"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: | - The input format. Each format needs a seperate parameter to be specified in the `args`: - - GEN/SAMPLE file: `--gensample2vcf` - - gVCF file: `--gvcf2vcf` - - HAP/SAMPLE file: `--hapsample2vcf` - - HAP/LEGEND/SAMPLE file: `--haplegendsample2vcf` - - TSV file: `--tsv2vcf` - pattern: "*.{gen,sample,g.vcf,hap,legend}{.gz,}" - - input_index: - type: file - description: (Optional) The index for the input files, if needed - pattern: "*.bed" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: (Optional) The reference fasta, only needed for gVCF conversion - pattern: "*.{fa,fasta}" - - bed: - type: file - description: (Optional) The BED file containing the regions for the VCF file - pattern: "*.bed" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: | + The input format. Each format needs a seperate parameter to be specified in the `args`: + - GEN/SAMPLE file: `--gensample2vcf` + - gVCF file: `--gvcf2vcf` + - HAP/SAMPLE file: `--hapsample2vcf` + - HAP/LEGEND/SAMPLE file: `--haplegendsample2vcf` + - TSV file: `--tsv2vcf` + pattern: "*.{gen,sample,g.vcf,hap,legend}{.gz,}" + - input_index: + type: file + description: (Optional) The index for the input files, if needed + pattern: "*.bed" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: (Optional) The reference fasta, only needed for gVCF conversion + pattern: "*.{fa,fasta}" + - - bed: + type: file + description: (Optional) The BED file containing the regions for the VCF file + pattern: "*.bed" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - vcf_gz: - type: file - description: VCF merged output file (bgzipped) => when `--output-type z` is used - pattern: "*.vcf.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz": + type: file + description: VCF merged output file (bgzipped) => when `--output-type z` is + used + pattern: "*.vcf.gz" - vcf: - type: file - description: VCF merged output file => when `--output-type v` is used - pattern: "*.vcf" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf": + type: file + description: VCF merged output file => when `--output-type v` is used + pattern: "*.vcf" - bcf_gz: - type: file - description: BCF merged output file (bgzipped) => when `--output-type b` is used - pattern: "*.bcf.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bcf.gz": + type: file + description: BCF merged output file (bgzipped) => when `--output-type b` is + used + pattern: "*.bcf.gz" - bcf: - type: file - description: BCF merged output file => when `--output-type u` is used - pattern: "*.bcf" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bcf": + type: file + description: BCF merged output file => when `--output-type u` is used + pattern: "*.bcf" - hap: - type: file - description: hap format used by IMPUTE2 and SHAPEIT - pattern: "*.hap.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.hap.gz": + type: file + description: hap format used by IMPUTE2 and SHAPEIT + pattern: "*.hap.gz" - legend: - type: file - description: legend format used by IMPUTE2 and SHAPEIT - pattern: "*.legend.gz" - - sample: - type: file - description: sample format used by IMPUTE2 and SHAPEIT - pattern: "*.samples" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.legend.gz": + type: file + description: legend format used by IMPUTE2 and SHAPEIT + pattern: "*.legend.gz" + - samples: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.samples": + type: file + description: samples format used by IMPUTE2 and SHAPEIT + pattern: "*.samples" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@nvnieuwk" - "@ramprasadn" From 8591d9825fdfd30f4db3c512e2c6de30dddcc0f9 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:11:20 +0100 Subject: [PATCH 04/25] Update bcftools index --- modules.json | 2 +- .../nf-core/bcftools/index/environment.yml | 2 - modules/nf-core/bcftools/index/meta.yml | 65 ++++++++++++------- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/modules.json b/modules.json index 4a4aa82f..357a0b96 100644 --- a/modules.json +++ b/modules.json @@ -24,7 +24,7 @@ }, "bcftools/index": { "branch": "master", - "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["bam_impute_glimpse", "vcf_phase_shapeit5"] }, "bcftools/merge": { diff --git a/modules/nf-core/bcftools/index/environment.yml b/modules/nf-core/bcftools/index/environment.yml index ea752646..5c00b116 100644 --- a/modules/nf-core/bcftools/index/environment.yml +++ b/modules/nf-core/bcftools/index/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_index channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/index/meta.yml b/modules/nf-core/bcftools/index/meta.yml index 0207d057..6897d1bd 100644 --- a/modules/nf-core/bcftools/index/meta.yml +++ b/modules/nf-core/bcftools/index/meta.yml @@ -8,40 +8,55 @@ keywords: - tbi tools: - bcftools: - description: BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations. + description: BCFtools is a set of utilities that manipulate variant calls in the + Variant Call Format (VCF) and its binary counterpart BCF. All commands work + transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most + commands accept VCF, bgzipped VCF and BCF with filetype detected automatically + even when streaming from a pipe. Indexed VCF and BCF will work in all situations. + Un-indexed VCF and BCF and streams will work in most, but not all situations. homepage: https://samtools.github.io/bcftools/ documentation: https://samtools.github.io/bcftools/howtos/index.html tool_dev_url: https://github.com/samtools/bcftools doi: "10.1093/gigascience/giab008" licence: ["MIT", "GPL-3.0-or-later"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: VCF file (optionally GZIPPED) - pattern: "*.{vcf,vcf.gz}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file (optionally GZIPPED) + pattern: "*.{vcf,vcf.gz}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software version - pattern: "versions.yml" - csi: - type: file - description: Default VCF file index file - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: Default VCF file index file + pattern: "*.csi" - tbi: - type: file - description: Alternative VCF file index file for larger files (activated with -t parameter) - pattern: "*.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: Alternative VCF file index file for larger files (activated with + -t parameter) + pattern: "*.tbi" + - versions: + - versions.yml: + type: file + description: File containing software version + pattern: "versions.yml" authors: - "@jfy133" maintainers: From 89a4c9285aea010e6b991dad4e77899e51b00619 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:18:42 +0100 Subject: [PATCH 05/25] Update bcftools merge --- modules.json | 2 +- .../bcftools/merge/bcftools-merge.diff | 24 +- .../nf-core/bcftools/merge/environment.yml | 2 - modules/nf-core/bcftools/merge/main.nf | 19 +- modules/nf-core/bcftools/merge/meta.yml | 128 +-- .../nf-core/bcftools/merge/tests/bcf.config | 3 + .../bcftools/merge/tests/bcf_gz.config | 3 + .../nf-core/bcftools/merge/tests/main.nf.test | 853 ++++++++++++++++++ .../bcftools/merge/tests/main.nf.test.snap | 607 +++++++++++++ .../bcftools/merge/tests/nextflow.config | 5 + .../bcftools/merge/tests/nextflow.gvcf.config | 5 + modules/nf-core/bcftools/merge/tests/tags.yml | 2 + .../nf-core/bcftools/merge/tests/vcf.config | 3 + .../bcftools/merge/tests/vcf_gz.config | 3 + .../bcftools/merge/tests/vcf_gz_index.config | 3 + .../merge/tests/vcf_gz_index_csi.config | 3 + .../merge/tests/vcf_gz_index_tbi.config | 3 + subworkflows/local/bam_gl_bcftools/main.nf | 2 +- .../vcf_split_bcftools/tests/main.nf.test | 2 +- 19 files changed, 1598 insertions(+), 74 deletions(-) create mode 100644 modules/nf-core/bcftools/merge/tests/bcf.config create mode 100644 modules/nf-core/bcftools/merge/tests/bcf_gz.config create mode 100644 modules/nf-core/bcftools/merge/tests/main.nf.test create mode 100644 modules/nf-core/bcftools/merge/tests/main.nf.test.snap create mode 100644 modules/nf-core/bcftools/merge/tests/nextflow.config create mode 100644 modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config create mode 100644 modules/nf-core/bcftools/merge/tests/tags.yml create mode 100644 modules/nf-core/bcftools/merge/tests/vcf.config create mode 100644 modules/nf-core/bcftools/merge/tests/vcf_gz.config create mode 100644 modules/nf-core/bcftools/merge/tests/vcf_gz_index.config create mode 100644 modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config create mode 100644 modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config diff --git a/modules.json b/modules.json index 357a0b96..63a64f0f 100644 --- a/modules.json +++ b/modules.json @@ -29,7 +29,7 @@ }, "bcftools/merge": { "branch": "master", - "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/merge/bcftools-merge.diff" }, diff --git a/modules/nf-core/bcftools/merge/bcftools-merge.diff b/modules/nf-core/bcftools/merge/bcftools-merge.diff index 50899ac5..8da3841c 100644 --- a/modules/nf-core/bcftools/merge/bcftools-merge.diff +++ b/modules/nf-core/bcftools/merge/bcftools-merge.diff @@ -1,25 +1,28 @@ Changes in module 'nf-core/bcftools/merge' +'modules/nf-core/bcftools/merge/environment.yml' is unchanged +Changes in 'bcftools/merge/main.nf': --- modules/nf-core/bcftools/merge/main.nf +++ modules/nf-core/bcftools/merge/main.nf -@@ -8,13 +8,13 @@ +@@ -8,14 +8,13 @@ 'biocontainers/bcftools:1.20--h8b25389_0' }" input: - tuple val(meta), path(vcfs), path(tbis) - tuple val(meta2), path(fasta) - tuple val(meta3), path(fai) -- path(bed) +- tuple val(meta4), path(bed) + tuple val(meta), path(vcfs), path(tbis), path(bed) + tuple val(meta2), path(fasta), path(fai) output: - tuple val(meta), path("*.{bcf,vcf}{,.gz}"), emit: merged_variants + tuple val(meta), path("*.{bcf,vcf}{,.gz}"), emit: vcf +- tuple val(meta), path("*.{csi,tbi}") , emit: index, optional: true + tuple val(meta), path("*.tbi") , emit: tbi, optional: true + tuple val(meta), path("*.csi") , emit: csi, optional: true path "versions.yml" , emit: versions when: -@@ -29,7 +29,7 @@ +@@ -31,7 +30,7 @@ args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : @@ -29,4 +32,17 @@ Changes in module 'nf-core/bcftools/merge' """ bcftools merge \\ +'modules/nf-core/bcftools/merge/meta.yml' is unchanged +'modules/nf-core/bcftools/merge/tests/bcf.config' is unchanged +'modules/nf-core/bcftools/merge/tests/bcf_gz.config' is unchanged +'modules/nf-core/bcftools/merge/tests/main.nf.test' is unchanged +'modules/nf-core/bcftools/merge/tests/main.nf.test.snap' is unchanged +'modules/nf-core/bcftools/merge/tests/nextflow.config' is unchanged +'modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config' is unchanged +'modules/nf-core/bcftools/merge/tests/tags.yml' is unchanged +'modules/nf-core/bcftools/merge/tests/vcf.config' is unchanged +'modules/nf-core/bcftools/merge/tests/vcf_gz.config' is unchanged +'modules/nf-core/bcftools/merge/tests/vcf_gz_index.config' is unchanged +'modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config' is unchanged +'modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config' is unchanged ************************************************************ diff --git a/modules/nf-core/bcftools/merge/environment.yml b/modules/nf-core/bcftools/merge/environment.yml index 51f1fb75..5c00b116 100644 --- a/modules/nf-core/bcftools/merge/environment.yml +++ b/modules/nf-core/bcftools/merge/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_merge channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/merge/main.nf b/modules/nf-core/bcftools/merge/main.nf index a16b38ab..c922b9ca 100644 --- a/modules/nf-core/bcftools/merge/main.nf +++ b/modules/nf-core/bcftools/merge/main.nf @@ -12,7 +12,7 @@ process BCFTOOLS_MERGE { tuple val(meta2), path(fasta), path(fai) output: - tuple val(meta), path("*.{bcf,vcf}{,.gz}"), emit: merged_variants + tuple val(meta), path("*.{bcf,vcf}{,.gz}"), emit: vcf tuple val(meta), path("*.tbi") , emit: tbi, optional: true tuple val(meta), path("*.csi") , emit: csi, optional: true path "versions.yml" , emit: versions @@ -21,9 +21,10 @@ process BCFTOOLS_MERGE { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input = (vcfs.collect().size() > 1) ? vcfs.sort{ it.name } : vcfs def regions = bed ? "--regions-file $bed" : "" def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : @@ -37,7 +38,7 @@ process BCFTOOLS_MERGE { $regions \\ --threads $task.cpus \\ --output ${prefix}.${extension} \\ - $vcfs + $input cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -53,8 +54,16 @@ process BCFTOOLS_MERGE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + def index = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" : + args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" : + args.contains("--write-index") || args.contains("-W") ? "csi" : + "" + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" + def create_index = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index}" : "" + """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} + ${create_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/merge/meta.yml b/modules/nf-core/bcftools/merge/meta.yml index 87707140..2cf09a1d 100644 --- a/modules/nf-core/bcftools/merge/meta.yml +++ b/modules/nf-core/bcftools/merge/meta.yml @@ -12,70 +12,78 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcfs: - type: file - description: | - List containing 2 or more vcf files - e.g. [ 'file1.vcf', 'file2.vcf' ] - - tbis: - type: file - description: | - List containing the tbi index files corresponding to the vcfs input files - e.g. [ 'file1.vcf.tbi', 'file2.vcf.tbi' ] - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: "(Optional) The fasta reference file (only necessary for the `--gvcf FILE` parameter)" - pattern: "*.{fasta,fa}" - - meta3: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fai: - type: file - description: "(Optional) The fasta reference file index (only necessary for the `--gvcf FILE` parameter)" - pattern: "*.fai" - - bed: - type: file - description: "(Optional) The bed regions to merge on" - pattern: "*.bed" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcfs: + type: file + description: | + List containing 2 or more vcf files + e.g. [ 'file1.vcf', 'file2.vcf' ] + - tbis: + type: file + description: | + List containing the tbi index files corresponding to the vcfs input files + e.g. [ 'file1.vcf.tbi', 'file2.vcf.tbi' ] + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: "(Optional) The fasta reference file (only necessary for the `--gvcf + FILE` parameter)" + pattern: "*.{fasta,fa}" + - - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fai: + type: file + description: "(Optional) The fasta reference file index (only necessary for + the `--gvcf FILE` parameter)" + pattern: "*.fai" + - - meta4: + type: map + description: | + Groovy Map containing bed information + e.g. [ id:'genome' ] + - bed: + type: file + description: "(Optional) The bed regions to merge on" + pattern: "*.bed" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf_gz: - type: file - description: VCF merged output file (bgzipped) => when `--output-type z` is used - pattern: "*.vcf.gz" - vcf: - type: file - description: VCF merged output file => when `--output-type v` is used - pattern: "*.vcf" - - bcf_gz: - type: file - description: BCF merged output file (bgzipped) => when `--output-type b` is used - pattern: "*.bcf.gz" - - bcf: - type: file - description: BCF merged output file => when `--output-type u` is used - pattern: "*.bcf" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{bcf,vcf}{,.gz}": + type: file + description: merged output file + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - index: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{csi,tbi}": + type: file + description: index of merged output + pattern: "*.{csi,tbi}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bcftools/merge/tests/bcf.config b/modules/nf-core/bcftools/merge/tests/bcf.config new file mode 100644 index 00000000..4467d07d --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/bcf.config @@ -0,0 +1,3 @@ +process { + ext.args = '--output-type u --no-version' +} diff --git a/modules/nf-core/bcftools/merge/tests/bcf_gz.config b/modules/nf-core/bcftools/merge/tests/bcf_gz.config new file mode 100644 index 00000000..280de8db --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/bcf_gz.config @@ -0,0 +1,3 @@ +process { + ext.args = '--output-type b --no-version' +} diff --git a/modules/nf-core/bcftools/merge/tests/main.nf.test b/modules/nf-core/bcftools/merge/tests/main.nf.test new file mode 100644 index 00000000..3995fc1a --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/main.nf.test @@ -0,0 +1,853 @@ +nextflow_process { + + name "Test Process BCFTOOLS_MERGE" + script "../main.nf" + process "BCFTOOLS_MERGE" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/merge" + + test("sarscov2 - [vcf, tbi], [], [], []") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf output") { + + config "./vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).md5, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output") { + + config "./vcf_gz.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - bcf output") { + + config "./bcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("bcf") }, + { assert snapshot( + file(process.out.vcf.get(0).get(1)).name, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output") { + + config "./bcf_gz.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("bcf.gz") }, + { assert snapshot( + file(process.out.vcf.get(0).get(1)).name, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("csi") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + file(process.out.index.get(0).get(1)).name, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index") { + + config "./vcf_gz_index_csi.config" + + when { + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("csi") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + file(process.out.index.get(0).get(1)).name, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index") { + + config "./vcf_gz_index_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("tbi") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + file(process.out.index.get(0).get(1)).name, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], bed") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).md5, + process.out.versions, + ).match() } + ) + } + + } + + test("homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output") { + + config "./nextflow.gvcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + ] + input[2] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + ] + input[3] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - one sample") { + + config "./nextflow.config" + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot( + path(process.out.vcf.get(0).get(1)).md5, + process.out.versions, + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf output - stub") { + + options "-stub" + config "./vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - stub") { + + options "-stub" + config "./vcf_gz.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - bcf output - stub") { + + options "-stub" + config "./bcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("bcf") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output - stub") { + + options "-stub" + config "./bcf_gz.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("bcf.gz") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index - stub") { + + options "-stub" + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("csi") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index - stub") { + + options "-stub" + config "./vcf_gz_index_csi.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("csi") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index - stub") { + + options "-stub" + config "./vcf_gz_index_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert process.out.index.get(0).get(1).endsWith("tbi") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], bed - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output - stub") { + + options "-stub" + config "./nextflow.gvcf.config" + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi', checkIfExists: true), + ] + ] + input[1] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + ] + input[2] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + ] + input[3] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - one sample - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert snapshot(process.out).match() } + ) + } + + } +} diff --git a/modules/nf-core/bcftools/merge/tests/main.nf.test.snap b/modules/nf-core/bcftools/merge/tests/main.nf.test.snap new file mode 100644 index 00000000..b3b62556 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/main.nf.test.snap @@ -0,0 +1,607 @@ +{ + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index": { + "content": [ + "e0de448dc8e712956a03ce68d79a0b3a", + "test.vcf.gz.tbi", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T12:34:16.977726522" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:17:34.532910365" + }, + "sarscov2 - [vcf, tbi], [], [], bed": { + "content": [ + "febdcfb851dcfc83d8248520830aef10", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:29:48.630057872" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:17:59.983157569" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf output": { + "content": [ + "57bb84274f336465d0a0946b532093b0", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:29:05.528412678" + }, + "sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.bcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:58:46.619657457" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:18:12.848227353" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:23:15.794389239" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index": { + "content": [ + "e0de448dc8e712956a03ce68d79a0b3a", + "test.vcf.gz.csi", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:57:16.850641473" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output": { + "content": [ + "e0de448dc8e712956a03ce68d79a0b3a", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:56:27.949031071" + }, + "sarscov2 - [vcf, tbi], [], [], bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:18:19.273064822" + }, + "sarscov2 - [vcf, tbi], [], [], [] - bcf output": { + "content": [ + "test.bcf", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:56:38.567500859" + }, + "sarscov2 - [vcf, tbi], [], [], [] - bcf output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:17:47.356328326" + }, + "sarscov2 - [vcf, tbi], [], [], [] - one sample - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T15:13:18.708495878" + }, + "homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:56:45.706125286" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index": { + "content": [ + "e0de448dc8e712956a03ce68d79a0b3a", + "test.vcf.gz.csi", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T12:33:43.639646108" + }, + "homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output": { + "content": [ + "645b7f7f9131bfe350a9ec3cf82c17fe", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:55:44.299812124" + }, + "sarscov2 - [vcf, tbi], [], [], [] - one sample": { + "content": [ + "2a374cf02f0c32cf607646167e7f153b", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T15:37:38.491844702" + }, + "sarscov2 - [vcf, tbi], [], [], [] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:17:28.188178904" + }, + "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T13:18:06.430943593" + }, + "sarscov2 - [vcf, tbi], [], [], []": { + "content": [ + "e0de448dc8e712956a03ce68d79a0b3a", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T12:31:03.893007442" + }, + "sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output": { + "content": [ + "test.bcf.gz", + [ + "versions.yml:md5,d2c0a30d9a4cc6df89a464ae82e0c38a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-05T11:56:56.416361069" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/merge/tests/nextflow.config b/modules/nf-core/bcftools/merge/tests/nextflow.config new file mode 100644 index 00000000..c3f0b715 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: BCFTOOLS_MERGE { + ext.args = '--force-samples --force-single --no-version' + } +} diff --git a/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config b/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config new file mode 100644 index 00000000..8c457b71 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config @@ -0,0 +1,5 @@ +process { + withName: BCFTOOLS_MERGE { + ext.args = { "--force-samples --no-version --output-type z --gvcf $fasta" } + } +} diff --git a/modules/nf-core/bcftools/merge/tests/tags.yml b/modules/nf-core/bcftools/merge/tests/tags.yml new file mode 100644 index 00000000..1464d0c1 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/merge: + - "modules/nf-core/bcftools/merge/**" diff --git a/modules/nf-core/bcftools/merge/tests/vcf.config b/modules/nf-core/bcftools/merge/tests/vcf.config new file mode 100644 index 00000000..759222e5 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/vcf.config @@ -0,0 +1,3 @@ +process { + ext.args = '--output-type v --no-version' +} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz.config b/modules/nf-core/bcftools/merge/tests/vcf_gz.config new file mode 100644 index 00000000..8b6ad8b4 --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/vcf_gz.config @@ -0,0 +1,3 @@ +process { + ext.args = '--output-type z --no-version' +} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config new file mode 100644 index 00000000..9f1e9b1d --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-type z --write-index --no-version" +} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..8308ee1a --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-type z --write-index=csi --no-version" +} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..9be4075b --- /dev/null +++ b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-type z --write-index=tbi --no-version" +} diff --git a/subworkflows/local/bam_gl_bcftools/main.nf b/subworkflows/local/bam_gl_bcftools/main.nf index 3527996f..4fd140bb 100644 --- a/subworkflows/local/bam_gl_bcftools/main.nf +++ b/subworkflows/local/bam_gl_bcftools/main.nf @@ -65,7 +65,7 @@ workflow BAM_GL_BCFTOOLS { ch_to_annotate = ch_all_vcf.one .map{ [it[0]["metas"][0], it[1][0], it[2][0]] } .mix( - BCFTOOLS_MERGE.out.merged_variants + BCFTOOLS_MERGE.out.vcf .join(BCFTOOLS_MERGE.out.tbi) ) diff --git a/subworkflows/local/vcf_split_bcftools/tests/main.nf.test b/subworkflows/local/vcf_split_bcftools/tests/main.nf.test index ab4e43b6..bcb0a9ed 100644 --- a/subworkflows/local/vcf_split_bcftools/tests/main.nf.test +++ b/subworkflows/local/vcf_split_bcftools/tests/main.nf.test @@ -49,7 +49,7 @@ nextflow_workflow { } workflow { """ - input[0] = BCFTOOLS_MERGE.out.merged_variants.join(BCFTOOLS_MERGE.out.tbi) + input[0] = BCFTOOLS_MERGE.out.vcf.join(BCFTOOLS_MERGE.out.tbi) """ } } From 5872546648844b7ba3a9173d0786d6bf930f0078 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:22:14 +0100 Subject: [PATCH 06/25] Update bcftools mpileup --- modules.json | 2 +- .../bcftools/mpileup/bcftools-mpileup.diff | 23 ---- .../nf-core/bcftools/mpileup/environment.yml | 2 - modules/nf-core/bcftools/mpileup/meta.yml | 109 +++++++++++------- .../bcftools/mpileup/tests/main.nf.test | 28 ++--- 5 files changed, 81 insertions(+), 83 deletions(-) delete mode 100644 modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff diff --git a/modules.json b/modules.json index 63a64f0f..a8c5d5d8 100644 --- a/modules.json +++ b/modules.json @@ -35,7 +35,7 @@ }, "bcftools/mpileup": { "branch": "master", - "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff" }, diff --git a/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff b/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff deleted file mode 100644 index ca922756..00000000 --- a/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff +++ /dev/null @@ -1,23 +0,0 @@ -Changes in module 'nf-core/bcftools/mpileup' ---- modules/nf-core/bcftools/mpileup/main.nf -+++ modules/nf-core/bcftools/mpileup/main.nf -@@ -9,7 +9,7 @@ - - input: - tuple val(meta), path(bam), path(intervals) -- tuple val(meta2), path(fasta) -+ tuple val(meta2), path(fasta), path(fai) - val save_mpileup - - output: -@@ -40,7 +40,7 @@ - $bam \\ - $intervals \\ - $mpileup \\ -- | bcftools call --output-type v $args2 \\ -+ | bcftools call --output-type v $args2 $intervals \\ - | bcftools reheader --samples sample_name.list \\ - | bcftools view --output-file ${prefix}.vcf.gz --output-type z $args3 - - -************************************************************ diff --git a/modules/nf-core/bcftools/mpileup/environment.yml b/modules/nf-core/bcftools/mpileup/environment.yml index 7e479383..5c00b116 100644 --- a/modules/nf-core/bcftools/mpileup/environment.yml +++ b/modules/nf-core/bcftools/mpileup/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_mpileup channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/mpileup/meta.yml b/modules/nf-core/bcftools/mpileup/meta.yml index 65410ddd..febcb33f 100644 --- a/modules/nf-core/bcftools/mpileup/meta.yml +++ b/modules/nf-core/bcftools/mpileup/meta.yml @@ -12,56 +12,79 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: Input BAM file - pattern: "*.{bam}" - - intervals: - type: file - description: Input intervals file. A file (commonly '.bed') containing regions to subset - - meta: - type: map - description: | - Groovy Map containing information about the genome fasta, e.g. [ id: 'sarscov2' ] - - fasta: - type: file - description: FASTA reference file - pattern: "*.{fasta,fa}" - - save_mpileup: - type: boolean - description: Save mpileup file generated by bcftools mpileup + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Input BAM file + pattern: "*.{bam}" + - intervals: + type: file + description: Input intervals file. A file (commonly '.bed') containing regions + to subset + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" + - - save_mpileup: + type: boolean + description: Save mpileup file generated by bcftools mpileup output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: VCF gzipped output file - pattern: "*.{vcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*vcf.gz": + type: file + description: VCF gzipped output file + pattern: "*.{vcf.gz}" - tbi: - type: file - description: tabix index file - pattern: "*.{vcf.gz.tbi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*vcf.gz.tbi": + type: file + description: tabix index file + pattern: "*.{vcf.gz.tbi}" - stats: - type: file - description: Text output file containing stats - pattern: "*{stats.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*stats.txt": + type: file + description: Text output file containing stats + pattern: "*{stats.txt}" - mpileup: - type: file - description: mpileup gzipped output for all positions - pattern: "{*.mpileup.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.mpileup.gz": + type: file + description: mpileup gzipped output for all positions + pattern: "{*.mpileup.gz}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test b/modules/nf-core/bcftools/mpileup/tests/main.nf.test index dc35c542..665a349f 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test @@ -18,12 +18,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = false """ @@ -51,12 +51,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = false """ @@ -82,12 +82,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = true """ @@ -116,12 +116,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = true """ @@ -148,12 +148,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = false """ @@ -181,12 +181,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = false """ From 3aa60e93935a2507d1650286138d8b473f5014db Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:24:52 +0100 Subject: [PATCH 07/25] Update bcftools norm --- modules.json | 2 +- modules/nf-core/bcftools/norm/environment.yml | 2 - modules/nf-core/bcftools/norm/main.nf | 2 +- modules/nf-core/bcftools/norm/meta.yml | 102 ++++++++++-------- 4 files changed, 61 insertions(+), 47 deletions(-) diff --git a/modules.json b/modules.json index a8c5d5d8..4e7c02c3 100644 --- a/modules.json +++ b/modules.json @@ -41,7 +41,7 @@ }, "bcftools/norm": { "branch": "master", - "git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "bcftools/pluginsplit": { diff --git a/modules/nf-core/bcftools/norm/environment.yml b/modules/nf-core/bcftools/norm/environment.yml index 0c7dfa8f..5c00b116 100644 --- a/modules/nf-core/bcftools/norm/environment.yml +++ b/modules/nf-core/bcftools/norm/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_norm channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/norm/main.nf b/modules/nf-core/bcftools/norm/main.nf index 97658267..bd7a2501 100644 --- a/modules/nf-core/bcftools/norm/main.nf +++ b/modules/nf-core/bcftools/norm/main.nf @@ -32,7 +32,7 @@ process BCFTOOLS_NORM { """ bcftools norm \\ --fasta-ref ${fasta} \\ - --output ${prefix}.${extension}\\ + --output ${prefix}.${extension} \\ $args \\ --threads $task.cpus \\ ${vcf} diff --git a/modules/nf-core/bcftools/norm/meta.yml b/modules/nf-core/bcftools/norm/meta.yml index a0cdeaf1..b6edeb4a 100644 --- a/modules/nf-core/bcftools/norm/meta.yml +++ b/modules/nf-core/bcftools/norm/meta.yml @@ -13,54 +13,70 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: | - The vcf file to be normalized - e.g. 'file1.vcf' - pattern: "*.{vcf,vcf.gz}" - - tbi: - type: file - description: | - An optional index of the VCF file (for when the VCF is compressed) - pattern: "*.vcf.gz.tbi" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: FASTA reference file - pattern: "*.{fasta,fa}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be normalized + e.g. 'file1.vcf' + pattern: "*.{vcf,vcf.gz}" + - tbi: + type: file + description: | + An optional index of the VCF file (for when the VCF is compressed) + pattern: "*.vcf.gz.tbi" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: One of uncompressed VCF (.vcf), compressed VCF (.vcf.gz), compressed BCF (.bcf.gz) or uncompressed BCF (.bcf) normalized output file - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - - csi: - type: file - description: Default VCF file index - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,vcf.gz,bcf,bcf.gz}": + type: file + description: One of uncompressed VCF (.vcf), compressed VCF (.vcf.gz), compressed + BCF (.bcf.gz) or uncompressed BCF (.bcf) normalized output file + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - tbi: - type: file - description: Alternative VCF file index - pattern: "*.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: Alternative VCF file index + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: Default VCF file index + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" - "@ramprasadn" From a89513d24fe71bdc527423f45e281c7fe28817d7 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:29:14 +0100 Subject: [PATCH 08/25] Update bcftools pluginsplit --- modules.json | 2 +- .../pluginsplit/bcftools-pluginsplit.diff | 32 ----- .../bcftools/pluginsplit/environment.yml | 2 - modules/nf-core/bcftools/pluginsplit/main.nf | 19 +-- modules/nf-core/bcftools/pluginsplit/meta.yml | 124 +++++++++++------- .../bcftools/pluginsplit/tests/main.nf.test | 6 +- .../pluginsplit/tests/main.nf.test.snap | 22 ---- .../pluginsplit/tests/nextflow.config | 1 - 8 files changed, 83 insertions(+), 125 deletions(-) delete mode 100644 modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff diff --git a/modules.json b/modules.json index 4e7c02c3..e898864b 100644 --- a/modules.json +++ b/modules.json @@ -46,7 +46,7 @@ }, "bcftools/pluginsplit": { "branch": "master", - "git_sha": "c5abf7acbb2943bf09f4025cacbbcc2bc2292637", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff" }, diff --git a/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff b/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff deleted file mode 100644 index 7e9a57e2..00000000 --- a/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff +++ /dev/null @@ -1,32 +0,0 @@ -Changes in module 'nf-core/bcftools/pluginsplit' ---- modules/nf-core/bcftools/pluginsplit/main.nf -+++ modules/nf-core/bcftools/pluginsplit/main.nf -@@ -26,11 +26,17 @@ - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" -+ def suffix = task.ext.suffix ?: "" - - def samples_arg = samples ? "--samples-file ${samples}" : "" - def groups_arg = groups ? "--groups-file ${groups}" : "" - def regions_arg = regions ? "--regions-file ${regions}" : "" - def targets_arg = targets ? "--targets-file ${targets}" : "" -+ def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : -+ args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : -+ args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : -+ args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : -+ "vcf" - - """ - bcftools plugin split \\ -@@ -42,7 +48,7 @@ - ${targets_arg} \\ - --output ${prefix} - -- mv ${prefix}/* . -+ for i in ${prefix}/*; do cp "\$i" "./\$(basename "\$i" .${extension})${suffix}.${extension}"; done - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - -************************************************************ diff --git a/modules/nf-core/bcftools/pluginsplit/environment.yml b/modules/nf-core/bcftools/pluginsplit/environment.yml index 1f7bb1ff..5c00b116 100644 --- a/modules/nf-core/bcftools/pluginsplit/environment.yml +++ b/modules/nf-core/bcftools/pluginsplit/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_pluginsplit channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 87b55a65..70ee882a 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -32,6 +32,11 @@ process BCFTOOLS_PLUGINSPLIT { def groups_arg = groups ? "--groups-file ${groups}" : "" def regions_arg = regions ? "--regions-file ${regions}" : "" def targets_arg = targets ? "--targets-file ${targets}" : "" + def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : + args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : + args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : + args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : + "vcf" """ bcftools plugin split \\ @@ -43,19 +48,7 @@ process BCFTOOLS_PLUGINSPLIT { ${targets_arg} \\ --output ${prefix} - for file in ${prefix}/*; do - # Extract the basename - base_name=\$(basename "\$file") - # Extract the part of the basename before the first dot - name_before_dot="\${base_name%%.*}" - - # Extract the extension - extension="\${base_name#\${name_before_dot}}" - - # Construct the new name - new_name="\${name_before_dot}${suffix}\${extension}" - mv "\$file" "./\$new_name" - done + for i in ${prefix}/*; do cp "\$i" "./\$(basename "\$i" .${extension})${suffix}.${extension}"; done cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/pluginsplit/meta.yml b/modules/nf-core/bcftools/pluginsplit/meta.yml index 64bfce0a..41f76658 100644 --- a/modules/nf-core/bcftools/pluginsplit/meta.yml +++ b/modules/nf-core/bcftools/pluginsplit/meta.yml @@ -1,4 +1,3 @@ ---- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json name: "bcftools_pluginsplit" description: Split VCF by sample, creating single- or multi-sample VCFs. @@ -14,60 +13,83 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: The VCF file to split + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - tbi: + type: file + description: OPTIONAL - The index of the input VCF/BCF + pattern: "*.tbi" + - - samples: + type: file + description: | + A tab-separated file determining which samples should be in which output file + column 1: The sample name(s) in the input file + column 2: The sample name(s) to use in the output file (use `-` to keep the original name) + column 3: The name of the output file + Either this or a groups file should be given + pattern: "*" + - - groups: + type: file + description: | + A tab-separated file determining which samples should be in which output file(s) + column 1: The sample name(s) in the input file + column 2: The sample name(s) to use in the output file (use `-` to keep the original name) + column 3: The name of the output file(s) + Either this or a samples file should be given + pattern: "*" + - - regions: + type: file + description: A BED file containing regions to use + pattern: "*.bed" + - - targets: + type: file + description: A BED file containing regions to use (but streams rather than index-jumps) + pattern: "*.bed" +output: - vcf: - type: file - description: The VCF file to split - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,vcf.gz,bcf,bcf.gz}": + type: file + description: The resulting VCF files from the split + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - tbi: - type: file - description: OPTIONAL - The index of the input VCF/BCF - pattern: "*.tbi" - - samples: - type: file - description: | - A tab-separated file determining which samples should be in which output file - column 1: The sample name(s) in the input file - column 2: The sample name(s) to use in the output file (use `-` to keep the original name) - column 3: The name of the output file - Either this or a groups file should be given - pattern: "*" - - groups: - type: file - description: | - A tab-separated file determining which samples should be in which output file(s) - column 1: The sample name(s) in the input file - column 2: The sample name(s) to use in the output file (use `-` to keep the original name) - column 3: The name of the output file(s) - Either this or a samples file should be given - pattern: "*" - - regions: - type: file - description: A BED file containing regions to use - pattern: "*.bed" - - targets: - type: file - description: A BED file containing regions to use (but streams rather than index-jumps) - pattern: "*.bed" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: TBI file + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: CSI file + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - vcf: - type: file - description: The resulting VCF files from the split - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@nvnieuwk" maintainers: diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 2c29ea8c..e3160851 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -92,13 +92,13 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.vcf, - process.out.tbi.get(0).get(1).find { file(it).name.matches("normal_split.vcf.gz.tbi|tumor_split.vcf.gz.tbi") }, - ).match() } + process.out.tbi.get(0).get(1).find { file(it).name.matches("normal.vcf.gz.tbi|tumor.vcf.gz.tbi") }, + ) } ) } } - + test("homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub") { options "-stub" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 85f9558c..66c3c1dd 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -52,28 +52,6 @@ }, "timestamp": "2024-07-09T15:56:42.307673651" }, - "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal_split.vcf.gz:md5,78e962c3a724790b27041f28a4180600", - "tumour_split.vcf.gz:md5,3008a0a06a2f319897fa04ea0018fcdd" - ] - ] - ], - "normal_split.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-07-11T10:28:16.262880408" - }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets": { "content": null, "meta": { diff --git a/modules/nf-core/bcftools/pluginsplit/tests/nextflow.config b/modules/nf-core/bcftools/pluginsplit/tests/nextflow.config index aeff1f03..9b9a4783 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/nextflow.config +++ b/modules/nf-core/bcftools/pluginsplit/tests/nextflow.config @@ -1,6 +1,5 @@ process { withName: 'BCFTOOLS_PLUGINSPLIT' { ext.args = '--write-index=tbi --output-type z' - ext.suffix = '_split' } } From a772cac7890f24395669d56a06d134bf5e64a3b0 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:32:41 +0100 Subject: [PATCH 09/25] Update bcftools stats --- .../nf-core/bcftools/stats/environment.yml | 2 - modules/nf-core/bcftools/stats/meta.yml | 124 +++++++++++------- 2 files changed, 76 insertions(+), 50 deletions(-) diff --git a/modules/nf-core/bcftools/stats/environment.yml b/modules/nf-core/bcftools/stats/environment.yml index 128fe204..93357b41 100644 --- a/modules/nf-core/bcftools/stats/environment.yml +++ b/modules/nf-core/bcftools/stats/environment.yml @@ -1,8 +1,6 @@ -name: bcftools_stats channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 - bioconda::htslib=1.20 diff --git a/modules/nf-core/bcftools/stats/meta.yml b/modules/nf-core/bcftools/stats/meta.yml index 7ea2103e..655a61c5 100644 --- a/modules/nf-core/bcftools/stats/meta.yml +++ b/modules/nf-core/bcftools/stats/meta.yml @@ -13,58 +13,86 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: VCF input file - pattern: "*.{vcf}" - - tbi: - type: file - description: | - The tab index for the VCF file to be inspected. Optional: only required when parameter regions is chosen. - pattern: "*.tbi" - - regions: - type: file - description: | - Optionally, restrict the operation to regions listed in this file. (VCF, BED or tab-delimited) - - targets: - type: file - description: | - Optionally, restrict the operation to regions listed in this file (doesn't rely upon tbi index files) - - samples: - type: file - description: | - Optional, file of sample names to be included or excluded. - e.g. 'file.tsv' - - exons: - type: file - description: | - Tab-delimited file with exons for indel frameshifts (chr,beg,end; 1-based, inclusive, optionally bgzip compressed). - e.g. 'exons.tsv.gz' - - fasta: - type: file - description: | - Faidx indexed reference sequence file to determine INDEL context. - e.g. 'reference.fa' + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF input file + pattern: "*.{vcf}" + - tbi: + type: file + description: | + The tab index for the VCF file to be inspected. Optional: only required when parameter regions is chosen. + pattern: "*.tbi" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. (VCF, BED or tab-delimited) + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon tbi index files) + - - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' + - - meta5: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - exons: + type: file + description: | + Tab-delimited file with exons for indel frameshifts (chr,beg,end; 1-based, inclusive, optionally bgzip compressed). + e.g. 'exons.tsv.gz' + - - meta6: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: | + Faidx indexed reference sequence file to determine INDEL context. + e.g. 'reference.fa' output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - stats: - type: file - description: Text output file containing stats - pattern: "*_{stats.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*stats.txt": + type: file + description: Text output file containing stats + pattern: "*_{stats.txt}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" From 5d2a2d098afad98a06223cb52d245c24abe6bd47 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:34:37 +0100 Subject: [PATCH 10/25] Update bcftools view --- modules/nf-core/bcftools/view/environment.yml | 2 - modules/nf-core/bcftools/view/meta.yml | 114 ++++++++++-------- .../nf-core/bcftools/view/tests/main.nf.test | 40 +++--- 3 files changed, 85 insertions(+), 71 deletions(-) diff --git a/modules/nf-core/bcftools/view/environment.yml b/modules/nf-core/bcftools/view/environment.yml index 4b2a21df..5c00b116 100644 --- a/modules/nf-core/bcftools/view/environment.yml +++ b/modules/nf-core/bcftools/view/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_view channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/view/meta.yml b/modules/nf-core/bcftools/view/meta.yml index 5eb1b196..aa7785f1 100644 --- a/modules/nf-core/bcftools/view/meta.yml +++ b/modules/nf-core/bcftools/view/meta.yml @@ -1,5 +1,6 @@ name: bcftools_view -description: View, subset and filter VCF or BCF files by position and filtering expression. Convert between VCF and BCF +description: View, subset and filter VCF or BCF files by position and filtering expression. + Convert between VCF and BCF keywords: - variant calling - view @@ -13,59 +14,74 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: | - The vcf file to be inspected. - e.g. 'file.vcf' - - index: - type: file - description: | - The tab index for the VCF file to be inspected. - e.g. 'file.tbi' - - regions: - type: file - description: | - Optionally, restrict the operation to regions listed in this file. - e.g. 'file.vcf' - - targets: - type: file - description: | - Optionally, restrict the operation to regions listed in this file (doesn't rely upon index files) - e.g. 'file.vcf' - - samples: - type: file - description: | - Optional, file of sample names to be included or excluded. - e.g. 'file.tsv' + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be inspected. + e.g. 'file.vcf' + - index: + type: file + description: | + The tab index for the VCF file to be inspected. + e.g. 'file.tbi' + - - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. + e.g. 'file.vcf' + - - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon index files) + e.g. 'file.vcf' + - - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: VCF normalized output file - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - - csi: - type: file - description: Default VCF file index - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,vcf.gz,bcf,bcf.gz}": + type: file + description: VCF normalized output file + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - tbi: - type: file - description: Alternative VCF file index - pattern: "*.tbi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: Alternative VCF file index + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: Default VCF file index + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" maintainers: diff --git a/modules/nf-core/bcftools/view/tests/main.nf.test b/modules/nf-core/bcftools/view/tests/main.nf.test index 14a7283d..1e60c50d 100644 --- a/modules/nf-core/bcftools/view/tests/main.nf.test +++ b/modules/nf-core/bcftools/view/tests/main.nf.test @@ -18,8 +18,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -49,8 +49,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -83,8 +83,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -117,8 +117,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -151,11 +151,11 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] - input[1] = file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_targets_tsv_gz'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.targets.tsv.gz', checkIfExists: true) input[3] = [] """ } @@ -183,8 +183,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -215,8 +215,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -245,8 +245,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] @@ -275,8 +275,8 @@ nextflow_process { """ input[0] = [ [ id:'out', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) ] input[1] = [] input[2] = [] From 6cc74a87bcb29287386f54a9e7948a4987224a3e Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:37:28 +0100 Subject: [PATCH 11/25] Update bedtools makewindows --- .../bedtools/makewindows/environment.yml | 2 - modules/nf-core/bedtools/makewindows/meta.yml | 48 +++++++------ .../bedtools/makewindows/tests/main.nf.test | 58 ++++++++++++++++ .../makewindows/tests/main.nf.test.snap | 68 +++++++++++++++++++ .../makewindows/tests/nextflow.config | 5 ++ 5 files changed, 157 insertions(+), 24 deletions(-) create mode 100644 modules/nf-core/bedtools/makewindows/tests/main.nf.test create mode 100644 modules/nf-core/bedtools/makewindows/tests/main.nf.test.snap create mode 100644 modules/nf-core/bedtools/makewindows/tests/nextflow.config diff --git a/modules/nf-core/bedtools/makewindows/environment.yml b/modules/nf-core/bedtools/makewindows/environment.yml index 0de3c15d..5683bc05 100644 --- a/modules/nf-core/bedtools/makewindows/environment.yml +++ b/modules/nf-core/bedtools/makewindows/environment.yml @@ -1,7 +1,5 @@ -name: bedtools_makewindows channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bedtools=2.31.1 diff --git a/modules/nf-core/bedtools/makewindows/meta.yml b/modules/nf-core/bedtools/makewindows/meta.yml index f89d7175..df047f66 100644 --- a/modules/nf-core/bedtools/makewindows/meta.yml +++ b/modules/nf-core/bedtools/makewindows/meta.yml @@ -7,35 +7,39 @@ keywords: - chunking tools: - bedtools: - description: A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. + description: A set of tools for genomic analysis tasks, specifically enabling + genome arithmetic (merge, count, complement) on various file types. homepage: https://bedtools.readthedocs.io documentation: https://bedtools.readthedocs.io/en/latest/content/tools/makewindows.html doi: "10.1093/bioinformatics/btq033" licence: ["MIT"] + identifier: biotools:bedtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - regions: - type: file - description: BED file OR Genome details file () - pattern: "*.{bed,tab,fai}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - regions: + type: file + description: BED file OR Genome details file () + pattern: "*.{bed,tab,fai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - bed: - type: file - description: BED file containing the windows - pattern: "*.bed" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bed": + type: file + description: BED file containing the windows + pattern: "*.bed" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@kevbrick" - "@nvnieuwk" diff --git a/modules/nf-core/bedtools/makewindows/tests/main.nf.test b/modules/nf-core/bedtools/makewindows/tests/main.nf.test new file mode 100644 index 00000000..b27e59b6 --- /dev/null +++ b/modules/nf-core/bedtools/makewindows/tests/main.nf.test @@ -0,0 +1,58 @@ + +nextflow_process { + + name "Test Process BEDTOOLS_MAKEWINDOWS" + script "../main.nf" + process "BEDTOOLS_MAKEWINDOWS" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "bedtools" + tag "bedtools/makewindows" + + test("test-bedtools-makewindows-bed") { + + when { + process { + """ + input[0] = [ + [ id:'test2'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-bedtools-makewindows-fai") { + + when { + process { + """ + input[0] = [ + [ id:'test2'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/bedtools/makewindows/tests/main.nf.test.snap b/modules/nf-core/bedtools/makewindows/tests/main.nf.test.snap new file mode 100644 index 00000000..22cfbc17 --- /dev/null +++ b/modules/nf-core/bedtools/makewindows/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "test-bedtools-makewindows-fai": { + "content": [ + { + "0": [ + [ + { + "id": "test2" + }, + "test2.bed:md5,622d1f62786fe4239b76c53168f21c54" + ] + ], + "1": [ + "versions.yml:md5,f797078cc8b8bac7e6906685d4867be5" + ], + "bed": [ + [ + { + "id": "test2" + }, + "test2.bed:md5,622d1f62786fe4239b76c53168f21c54" + ] + ], + "versions": [ + "versions.yml:md5,f797078cc8b8bac7e6906685d4867be5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T14:03:31.430455" + }, + "test-bedtools-makewindows-bed": { + "content": [ + { + "0": [ + [ + { + "id": "test2" + }, + "test2.bed:md5,0cf6ed2b6f470cd44a247da74ca4fe4e" + ] + ], + "1": [ + "versions.yml:md5,f797078cc8b8bac7e6906685d4867be5" + ], + "bed": [ + [ + { + "id": "test2" + }, + "test2.bed:md5,0cf6ed2b6f470cd44a247da74ca4fe4e" + ] + ], + "versions": [ + "versions.yml:md5,f797078cc8b8bac7e6906685d4867be5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T14:03:27.118372" + } +} \ No newline at end of file diff --git a/modules/nf-core/bedtools/makewindows/tests/nextflow.config b/modules/nf-core/bedtools/makewindows/tests/nextflow.config new file mode 100644 index 00000000..fa16733f --- /dev/null +++ b/modules/nf-core/bedtools/makewindows/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: BEDTOOLS_MAKEWINDOWS { + ext.args = '-w 50 ' + } +} From 0c8b876b52ec09573c79ce5951b581a12326d843 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:47:05 +0100 Subject: [PATCH 12/25] Remove dumpsoftware --- .../dumpsoftwareversions/environment.yml | 7 -- .../custom/dumpsoftwareversions/main.nf | 24 ----- .../custom/dumpsoftwareversions/meta.yml | 37 ------- .../templates/dumpsoftwareversions.py | 100 ------------------ .../dumpsoftwareversions/tests/main.nf.test | 43 -------- .../tests/main.nf.test.snap | 33 ------ .../dumpsoftwareversions/tests/tags.yml | 2 - 7 files changed, 246 deletions(-) delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/environment.yml delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/main.nf delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/meta.yml delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap delete mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml diff --git a/modules/nf-core/custom/dumpsoftwareversions/environment.yml b/modules/nf-core/custom/dumpsoftwareversions/environment.yml deleted file mode 100644 index b48ced26..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: custom_dumpsoftwareversions -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::multiqc=1.20 diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf deleted file mode 100644 index 105f9265..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/main.nf +++ /dev/null @@ -1,24 +0,0 @@ -process CUSTOM_DUMPSOFTWAREVERSIONS { - label 'process_single' - - // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.20--pyhdfd78af_0' : - 'biocontainers/multiqc:1.20--pyhdfd78af_0' }" - - input: - path versions - - output: - path "software_versions.yml" , emit: yml - path "software_versions_mqc.yml", emit: mqc_yml - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - template 'dumpsoftwareversions.py' -} diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml deleted file mode 100644 index 5f15a5fd..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/meta.yml +++ /dev/null @@ -1,37 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: custom_dumpsoftwareversions -description: Custom module used to dump software versions within the nf-core pipeline template -keywords: - - custom - - dump - - version -tools: - - custom: - description: Custom module used to dump software versions within the nf-core pipeline template - homepage: https://github.com/nf-core/tools - documentation: https://github.com/nf-core/tools - licence: ["MIT"] -input: - - versions: - type: file - description: YML file containing software versions - pattern: "*.yml" -output: - - yml: - type: file - description: Standard YML file containing software versions - pattern: "software_versions.yml" - - mqc_yml: - type: file - description: MultiQC custom content YML file containing software versions - pattern: "software_versions_mqc.yml" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@drpatelh" - - "@grst" -maintainers: - - "@drpatelh" - - "@grst" diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py deleted file mode 100644 index 9a493ace..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python - - -"""Provide functions to merge multiple versions.yml files.""" - -import yaml -import platform -from textwrap import dedent - - -def _make_versions_html(versions): - """Generate a tabular HTML output of all versions for MultiQC.""" - html = [ - dedent( - """\\ - - - - - - - - - - """ - ) - ] - for process, tmp_versions in sorted(versions.items()): - html.append("") - for i, (tool, version) in enumerate(sorted(tmp_versions.items())): - html.append( - dedent( - f"""\\ - - - - - - """ - ) - ) - html.append("") - html.append("
Process Name Software Version
{process if (i == 0) else ''}{tool}{version}
") - return "\\n".join(html) - - -def main(): - """Load all version files and generate merged output.""" - versions_this_module = {} - versions_this_module["${task.process}"] = { - "python": platform.python_version(), - "yaml": yaml.__version__, - } - - with open("$versions") as f: - versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module - - # aggregate versions by the module name (derived from fully-qualified process name) - versions_by_module = {} - for process, process_versions in versions_by_process.items(): - module = process.split(":")[-1] - try: - if versions_by_module[module] != process_versions: - raise AssertionError( - "We assume that software versions are the same between all modules. " - "If you see this error-message it means you discovered an edge-case " - "and should open an issue in nf-core/tools. " - ) - except KeyError: - versions_by_module[module] = process_versions - - versions_by_module["Workflow"] = { - "Nextflow": "$workflow.nextflow.version", - "$workflow.manifest.name": "$workflow.manifest.version", - } - - versions_mqc = { - "id": "software_versions", - "section_name": "${workflow.manifest.name} Software Versions", - "section_href": "https://github.com/${workflow.manifest.name}", - "plot_type": "html", - "description": "are collected at run time from the software output.", - "data": _make_versions_html(versions_by_module), - } - - with open("software_versions.yml", "w") as f: - yaml.dump(versions_by_module, f, default_flow_style=False) - with open("software_versions_mqc.yml", "w") as f: - yaml.dump(versions_mqc, f, default_flow_style=False) - - with open("versions.yml", "w") as f: - yaml.dump(versions_this_module, f, default_flow_style=False) - - -if __name__ == "__main__": - main() diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test deleted file mode 100644 index b1e1630b..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test +++ /dev/null @@ -1,43 +0,0 @@ -nextflow_process { - - name "Test Process CUSTOM_DUMPSOFTWAREVERSIONS" - script "../main.nf" - process "CUSTOM_DUMPSOFTWAREVERSIONS" - tag "modules" - tag "modules_nfcore" - tag "custom" - tag "dumpsoftwareversions" - tag "custom/dumpsoftwareversions" - - test("Should run without failures") { - when { - process { - """ - def tool1_version = ''' - TOOL1: - tool1: 0.11.9 - '''.stripIndent() - - def tool2_version = ''' - TOOL2: - tool2: 1.9 - '''.stripIndent() - - input[0] = Channel.of(tool1_version, tool2_version).collectFile() - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - process.out.versions, - file(process.out.mqc_yml[0]).readLines()[0..10], - file(process.out.yml[0]).readLines()[0..7] - ).match() - } - ) - } - } -} diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap deleted file mode 100644 index 5f59a936..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Should run without failures": { - "content": [ - [ - "versions.yml:md5,76d454d92244589d32455833f7c1ba6d" - ], - [ - "data: \"\\n\\n \\n \\n \\n \\n \\n \\n \\n\\", - " \\n\\n\\n \\n \\n\\", - " \\ \\n\\n\\n\\n \\n \\", - " \\ \\n \\n\\n\\n\\n\\", - " \\n\\n \\n \\n\\", - " \\ \\n\\n\\n\\n\\n\\n \\n\\", - " \\ \\n \\n\\n\\n\\n\\", - " \\n\\n \\n \\n\\" - ], - [ - "CUSTOM_DUMPSOFTWAREVERSIONS:", - " python: 3.11.7", - " yaml: 5.4.1", - "TOOL1:", - " tool1: 0.11.9", - "TOOL2:", - " tool2: '1.9'", - "Workflow:" - ] - ], - "timestamp": "2024-01-09T23:01:18.710682" - } -} \ No newline at end of file diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml deleted file mode 100644 index 405aa24a..00000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/dumpsoftwareversions: - - modules/nf-core/custom/dumpsoftwareversions/** From ca221296be75e997c0b04faae222797688a28765 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:48:05 +0100 Subject: [PATCH 13/25] Update gawk --- modules.json | 13 +--- modules/nf-core/gawk/environment.yml | 1 - modules/nf-core/gawk/gawk.diff | 37 --------- modules/nf-core/gawk/meta.yml | 57 ++++++++------ modules/nf-core/gawk/tests/main.nf.test | 52 ++++++++++++- modules/nf-core/gawk/tests/main.nf.test.snap | 80 ++++++++++++++++++-- 6 files changed, 159 insertions(+), 81 deletions(-) delete mode 100644 modules/nf-core/gawk/gawk.diff diff --git a/modules.json b/modules.json index e898864b..ad5f5ad4 100644 --- a/modules.json +++ b/modules.json @@ -52,27 +52,22 @@ }, "bcftools/stats": { "branch": "master", - "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "bcftools/view": { "branch": "master", - "git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "bedtools/makewindows": { "branch": "master", - "git_sha": "3b248b84694d1939ac4bb33df84bf6233a34d668", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["vcf_phase_shapeit5"] }, - "custom/dumpsoftwareversions": { - "branch": "master", - "git_sha": "82024cf6325d2ee194e7f056d841ecad2f6856e9", - "installed_by": ["modules"] - }, "gawk": { "branch": "master", - "git_sha": "cf3ed075695639b0a0924eb0901146df1996dc08", + "git_sha": "97321eded31a12598837a476d3615300af413bb7", "installed_by": ["modules"], "patch": "modules/nf-core/gawk/gawk.diff" }, diff --git a/modules/nf-core/gawk/environment.yml b/modules/nf-core/gawk/environment.yml index 1ae70e59..315f6dc6 100644 --- a/modules/nf-core/gawk/environment.yml +++ b/modules/nf-core/gawk/environment.yml @@ -1,4 +1,3 @@ -name: gawk channels: - conda-forge - bioconda diff --git a/modules/nf-core/gawk/gawk.diff b/modules/nf-core/gawk/gawk.diff deleted file mode 100644 index 6f873490..00000000 --- a/modules/nf-core/gawk/gawk.diff +++ /dev/null @@ -1,37 +0,0 @@ -Changes in module 'nf-core/gawk' ---- modules/nf-core/gawk/main.nf -+++ modules/nf-core/gawk/main.nf -@@ -8,7 +8,7 @@ - 'biocontainers/gawk:5.3.0' }" - - input: -- tuple val(meta), path(input) -+ tuple val(meta), path(input, arity: '0..*') - path(program_file) - - output: -@@ -22,15 +22,19 @@ - def args = task.ext.args ?: '' // args is used for the main arguments of the tool - def args2 = task.ext.args2 ?: '' // args2 is used to specify a program when no program file has been given - prefix = task.ext.prefix ?: "${meta.id}" -- suffix = task.ext.suffix ?: "${input.getExtension()}" -+ suffix = task.ext.suffix ?: "${input.collect{ it.getExtension()}.get(0)}" // use the first extension of the input files - -- program = program_file ? "-f ${program_file}" : "${args2}" -+ program = program_file ? "-f ${program_file}" : "${args2}" -+ lst_gz = input.collect{ it.getExtension().endsWith("gz") } -+ unzip = lst_gz.contains(false) ? "" : "find ${input} -exec zcat {} \\; | \\" -+ input_cmd = unzip ? "" : "${input}" - - """ -+ ${unzip} - awk \\ - ${args} \\ - ${program} \\ -- ${input} \\ -+ ${input_cmd} \\ - > ${prefix}.${suffix} - - cat <<-END_VERSIONS > versions.yml - -************************************************************ diff --git a/modules/nf-core/gawk/meta.yml b/modules/nf-core/gawk/meta.yml index 2b6033b0..2da41405 100644 --- a/modules/nf-core/gawk/meta.yml +++ b/modules/nf-core/gawk/meta.yml @@ -16,34 +16,41 @@ tools: documentation: "https://www.gnu.org/software/gawk/manual/" tool_dev_url: "https://www.gnu.org/prep/ftp.html" licence: ["GPL v3"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: The input file - Specify the logic that needs to be executed on this file on the `ext.args2` or in the program file - pattern: "*" - - program_file: - type: file - description: Optional file containing logic for awk to execute. If you don't wish to use a file, you can use `ext.args2` to specify the logic. - pattern: "*" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: The input file - Specify the logic that needs to be executed on + this file on the `ext.args2` or in the program file. + If the files have a `.gz` extension, they will be unzipped using `zcat`. + pattern: "*" + - - program_file: + type: file + description: Optional file containing logic for awk to execute. If you don't + wish to use a file, you can use `ext.args2` to specify the logic. + pattern: "*" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - output: - type: file - description: The output file - specify the name of this file using `ext.prefix` and the extension using `ext.suffix` - pattern: "*" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${suffix}: + type: file + description: The output file - specify the name of this file using `ext.prefix` + and the extension using `ext.suffix` + pattern: "*" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@nvnieuwk" maintainers: diff --git a/modules/nf-core/gawk/tests/main.nf.test b/modules/nf-core/gawk/tests/main.nf.test index fce82ca9..5952e9a2 100644 --- a/modules/nf-core/gawk/tests/main.nf.test +++ b/modules/nf-core/gawk/tests/main.nf.test @@ -8,7 +8,7 @@ nextflow_process { tag "modules_nfcore" tag "gawk" - test("convert fasta to bed") { + test("Convert fasta to bed") { config "./nextflow.config" when { @@ -31,7 +31,7 @@ nextflow_process { } } - test("convert fasta to bed with program file") { + test("Convert fasta to bed with program file") { config "./nextflow_with_program_file.config" when { @@ -53,4 +53,52 @@ nextflow_process { ) } } + + test("Extract first column from multiple files") { + config "./nextflow_with_program_file.config" + tag "test" + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [file(params.modules_testdata_base_path + 'generic/txt/hello.txt', checkIfExists: true), + file(params.modules_testdata_base_path + 'generic/txt/species_names.txt', checkIfExists: true)] + ] + input[1] = Channel.of('BEGIN {FS=" "}; {print \$1}').collectFile(name:"program.txt") + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("Unzip files before processing") { + config "./nextflow_with_program_file.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA12878_chrM.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz', checkIfExists: true)] + ] + input[1] = Channel.of('/^#CHROM/ { print \$1, \$10 }').collectFile(name:"column_header.txt") + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } \ No newline at end of file diff --git a/modules/nf-core/gawk/tests/main.nf.test.snap b/modules/nf-core/gawk/tests/main.nf.test.snap index 4f3a759c..d396f738 100644 --- a/modules/nf-core/gawk/tests/main.nf.test.snap +++ b/modules/nf-core/gawk/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "convert fasta to bed with program file": { + "Convert fasta to bed": { "content": [ { "0": [ @@ -28,11 +28,11 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "24.04.4" }, - "timestamp": "2024-05-17T15:20:02.495430346" + "timestamp": "2024-10-19T13:14:02.347809811" }, - "convert fasta to bed": { + "Convert fasta to bed with program file": { "content": [ { "0": [ @@ -61,8 +61,74 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "24.04.4" }, - "timestamp": "2024-05-17T15:19:53.291809648" + "timestamp": "2024-10-19T13:14:11.894616209" + }, + "Extract first column from multiple files": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,566c51674bd643227bb2d83e0963376d" + ] + ], + "1": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,566c51674bd643227bb2d83e0963376d" + ] + ], + "versions": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T22:04:47.729300129" + }, + "Unzip files before processing": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,1e31ebd4a060aab5433bbbd9ab24e403" + ] + ], + "1": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,1e31ebd4a060aab5433bbbd9ab24e403" + ] + ], + "versions": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T22:08:19.533527657" } -} \ No newline at end of file +} From ca5f50e40385a8f21b8831fbe04f90686f46599f Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 16:54:52 +0100 Subject: [PATCH 14/25] Update glimpse --- modules.json | 6 +- modules/nf-core/glimpse/chunk/environment.yml | 2 - modules/nf-core/glimpse/chunk/meta.yml | 65 +++++----- .../nf-core/glimpse/ligate/environment.yml | 2 - modules/nf-core/glimpse/ligate/meta.yml | 63 ++++----- modules/nf-core/glimpse/phase/environment.yml | 2 - modules/nf-core/glimpse/phase/meta.yml | 122 +++++++++--------- 7 files changed, 137 insertions(+), 125 deletions(-) diff --git a/modules.json b/modules.json index ad5f5ad4..3315dc4d 100644 --- a/modules.json +++ b/modules.json @@ -73,17 +73,17 @@ }, "glimpse/chunk": { "branch": "master", - "git_sha": "7e56daae390ff896b292ddc70823447683a79936", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["bam_impute_glimpse"] }, "glimpse/ligate": { "branch": "master", - "git_sha": "7e56daae390ff896b292ddc70823447683a79936", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["bam_impute_glimpse"] }, "glimpse/phase": { "branch": "master", - "git_sha": "7e56daae390ff896b292ddc70823447683a79936", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["bam_impute_glimpse"] }, "glimpse2/chunk": { diff --git a/modules/nf-core/glimpse/chunk/environment.yml b/modules/nf-core/glimpse/chunk/environment.yml index 8d71aa91..6247794b 100644 --- a/modules/nf-core/glimpse/chunk/environment.yml +++ b/modules/nf-core/glimpse/chunk/environment.yml @@ -1,7 +1,5 @@ -name: glimpse_chunk channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=1.1.1 diff --git a/modules/nf-core/glimpse/chunk/meta.yml b/modules/nf-core/glimpse/chunk/meta.yml index e500d9e9..e8ff4019 100644 --- a/modules/nf-core/glimpse/chunk/meta.yml +++ b/modules/nf-core/glimpse/chunk/meta.yml @@ -6,43 +6,50 @@ keywords: - low coverage tools: - "glimpse": - description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: | - Target dataset in VCF/BCF format defined at all variable positions. - The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - region: - type: string - description: | - Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). - For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: | + Target dataset in VCF/BCF format defined at all variable positions. + The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file for the input VCF/BCF file. + - region: + type: string + description: | + Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). + For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + - chunk_chr: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Tab delimited output txt file containing buffer and imputation regions. + pattern: "*.txt" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - txt: - type: file - description: Tab delimited output txt file containing buffer and imputation regions. - pattern: "*.{txt}" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/glimpse/ligate/environment.yml b/modules/nf-core/glimpse/ligate/environment.yml index 0f9e9a33..6247794b 100644 --- a/modules/nf-core/glimpse/ligate/environment.yml +++ b/modules/nf-core/glimpse/ligate/environment.yml @@ -1,7 +1,5 @@ -name: glimpse_ligate channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=1.1.1 diff --git a/modules/nf-core/glimpse/ligate/meta.yml b/modules/nf-core/glimpse/ligate/meta.yml index c3b1485c..c1ed67ee 100644 --- a/modules/nf-core/glimpse/ligate/meta.yml +++ b/modules/nf-core/glimpse/ligate/meta.yml @@ -1,5 +1,6 @@ name: "glimpse_ligate" -description: Concatenates imputation chunks in a single VCF/BCF file ligating phased information. +description: Concatenates imputation chunks in a single VCF/BCF file ligating phased + information. keywords: - ligate - low-coverage @@ -7,42 +8,46 @@ keywords: - imputation tools: - "glimpse": - description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input_list: - type: file - description: VCF/BCF file containing genotype probabilities (GP field). - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - input_index: - type: file - description: Index file of the input VCF/BCF file containing genotype likelihoods. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_list: + type: file + description: VCF/BCF file containing genotype probabilities (GP field). + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file of the input VCF/BCF file containing genotype likelihoods. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - merged_variants: - type: file - description: | - Output VCF/BCF file for the merged regions. - Phased information (HS field) is updated accordingly for the full region. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: | + Output VCF/BCF file for the merged regions. + Phased information (HS field) is updated accordingly for the full region. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/glimpse/phase/environment.yml b/modules/nf-core/glimpse/phase/environment.yml index fc79765a..6247794b 100644 --- a/modules/nf-core/glimpse/phase/environment.yml +++ b/modules/nf-core/glimpse/phase/environment.yml @@ -1,7 +1,5 @@ -name: glimpse_phase channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=1.1.1 diff --git a/modules/nf-core/glimpse/phase/meta.yml b/modules/nf-core/glimpse/phase/meta.yml index 862033b7..e905b758 100644 --- a/modules/nf-core/glimpse/phase/meta.yml +++ b/modules/nf-core/glimpse/phase/meta.yml @@ -1,5 +1,6 @@ name: "glimpse_phase" -description: main GLIMPSE algorithm, performs phasing and imputation refining genotype likelihoods +description: main GLIMPSE algorithm, performs phasing and imputation refining genotype + likelihoods keywords: - phase - imputation @@ -7,71 +8,76 @@ keywords: - glimpse tools: - "glimpse": - description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: Input VCF/BCF file containing genotype likelihoods. - pattern: "*.{vcf.gz,bcf.gz}" - - input_index: - type: file - description: Index file of the input VCF/BCF file containing genotype likelihoods. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - samples_file: - type: file - description: | - File with sample names and ploidy information. - One sample per line with a mandatory second column indicating ploidy (1 or 2). - Sample names that are not present are assumed to have ploidy 2 (diploids). - GLIMPSE does NOT handle the use of sex (M/F) instead of ploidy. - pattern: "*.{txt,tsv}" - - input_region: - type: string - description: Target region used for imputation, including left and right buffers (e.g. chr20:1000000-2000000). - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - output_region: - type: string - description: Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - reference: - type: file - description: Reference panel of haplotypes in VCF/BCF format. - pattern: "*.{vcf.gz,bcf.gz}" - - reference_index: - type: file - description: Index file of the Reference panel file. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - map: - type: file - description: File containing the genetic map. - pattern: "*.gmap" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: Input VCF/BCF file containing genotype likelihoods. + pattern: "*.{vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file of the input VCF/BCF file containing genotype likelihoods. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - samples_file: + type: file + description: | + File with sample names and ploidy information. + One sample per line with a mandatory second column indicating ploidy (1 or 2). + Sample names that are not present are assumed to have ploidy 2 (diploids). + GLIMPSE does NOT handle the use of sex (M/F) instead of ploidy. + pattern: "*.{txt,tsv}" + - input_region: + type: string + description: Target region used for imputation, including left and right buffers + (e.g. chr20:1000000-2000000). + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - output_region: + type: string + description: Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - reference: + type: file + description: Reference panel of haplotypes in VCF/BCF format. + pattern: "*.{vcf.gz,bcf.gz}" + - reference_index: + type: file + description: Index file of the Reference panel file. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - map: + type: file + description: File containing the genetic map. + pattern: "*.gmap" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - phased_variants: - type: file - description: | - Output VCF/BCF file containing genotype probabilities (GP field), - imputed dosages (DS field), best guess genotypes (GT field), - sampled haplotypes in the last (max 16) main iterations (HS field) and info-score. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: | + Output VCF/BCF file containing genotype probabilities (GP field), + imputed dosages (DS field), best guess genotypes (GT field), + sampled haplotypes in the last (max 16) main iterations (HS field) and info-score. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: From e321e4f6d1de1015d86df0c8a1dc146928a2eaaa Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:00:21 +0100 Subject: [PATCH 15/25] Update glimpse2 --- .../nf-core/glimpse2/chunk/environment.yml | 2 - .../glimpse2/chunk/glimpse2-chunk.diff | 15 -- modules/nf-core/glimpse2/chunk/main.nf | 2 +- modules/nf-core/glimpse2/chunk/meta.yml | 100 ++++---- .../nf-core/glimpse2/chunk/tests/main.nf.test | 23 +- .../glimpse2/concordance/environment.yml | 2 - modules/nf-core/glimpse2/concordance/meta.yml | 230 +++++++++++------- .../glimpse2/concordance/tests/main.nf.test | 199 +++++++++++++++ .../concordance/tests/main.nf.test.snap | 86 +++++++ .../concordance/tests/nextflow.config | 6 + .../concordance/tests/nextflow_R2.config | 7 + .../glimpse2/concordance/tests/tags.yml | 2 + .../nf-core/glimpse2/ligate/environment.yml | 2 - modules/nf-core/glimpse2/ligate/meta.yml | 56 +++-- .../glimpse2/ligate/tests/main.nf.test | 2 +- .../nf-core/glimpse2/phase/environment.yml | 2 - .../glimpse2/phase/glimpse2-phase.diff | 158 ------------ modules/nf-core/glimpse2/phase/meta.yml | 183 +++++++------- .../nf-core/glimpse2/phase/tests/main.nf.test | 95 ++++---- .../glimpse2/phase/tests/main.nf.test.snap | 40 ++- .../glimpse2/phase/tests/nextflow.config | 5 + .../glimpse2/splitreference/environment.yml | 2 - .../nf-core/glimpse2/splitreference/meta.yml | 91 +++---- 23 files changed, 767 insertions(+), 543 deletions(-) delete mode 100644 modules/nf-core/glimpse2/chunk/glimpse2-chunk.diff create mode 100644 modules/nf-core/glimpse2/concordance/tests/main.nf.test create mode 100644 modules/nf-core/glimpse2/concordance/tests/main.nf.test.snap create mode 100644 modules/nf-core/glimpse2/concordance/tests/nextflow.config create mode 100644 modules/nf-core/glimpse2/concordance/tests/nextflow_R2.config create mode 100644 modules/nf-core/glimpse2/concordance/tests/tags.yml delete mode 100644 modules/nf-core/glimpse2/phase/glimpse2-phase.diff create mode 100644 modules/nf-core/glimpse2/phase/tests/nextflow.config diff --git a/modules/nf-core/glimpse2/chunk/environment.yml b/modules/nf-core/glimpse2/chunk/environment.yml index 54e5a111..75b86239 100644 --- a/modules/nf-core/glimpse2/chunk/environment.yml +++ b/modules/nf-core/glimpse2/chunk/environment.yml @@ -1,7 +1,5 @@ -name: glimpse2_chunk channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/chunk/glimpse2-chunk.diff b/modules/nf-core/glimpse2/chunk/glimpse2-chunk.diff deleted file mode 100644 index 51be4337..00000000 --- a/modules/nf-core/glimpse2/chunk/glimpse2-chunk.diff +++ /dev/null @@ -1,15 +0,0 @@ -Changes in module 'nf-core/glimpse2/chunk' ---- modules/nf-core/glimpse2/chunk/main.nf -+++ modules/nf-core/glimpse2/chunk/main.nf -@@ -17,8 +17,7 @@ - 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" - - input: -- tuple val(meta) , path(input), path(input_index), val(region) -- tuple val(meta2), path(map) -+ tuple val(meta) , path(input), path(input_index), val(region), path(map) - val(model) - - output: - -************************************************************ diff --git a/modules/nf-core/glimpse2/chunk/main.nf b/modules/nf-core/glimpse2/chunk/main.nf index 78f27032..4c72990d 100644 --- a/modules/nf-core/glimpse2/chunk/main.nf +++ b/modules/nf-core/glimpse2/chunk/main.nf @@ -17,7 +17,7 @@ process GLIMPSE2_CHUNK { 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: - tuple val(meta) , path(input), path(input_index), val(region), path(map) + tuple val(meta), path(input), path(input_index), val(region), path(map) val(model) output: diff --git a/modules/nf-core/glimpse2/chunk/meta.yml b/modules/nf-core/glimpse2/chunk/meta.yml index 759ee024..bcb089d5 100644 --- a/modules/nf-core/glimpse2/chunk/meta.yml +++ b/modules/nf-core/glimpse2/chunk/meta.yml @@ -7,66 +7,66 @@ keywords: - glimpse tools: - "glimpse2": - description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: biotools:glimpse2 requirements: - AVX2 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: | - Target dataset in VCF/BCF format defined at all variable positions. - The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - input_index: - type: file - description: Index file of the input VCF/BCF file containing genotype likelihoods. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - region: - type: string - description: | - Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). - For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. - - meta2: - type: map - description: | - Groovy Map containing genomic map information - e.g. [ map:'GRCh38' ] - - map: - type: file - description: File containing the genetic map. - pattern: "*.gmap" - - model: - type: string - description: | - Algorithm model to use: - "recursive": Recursive algorithm - "sequential": Sequential algorithm (Recommended) - "uniform-number-variants": Experimental. Uniform the number of variants in the sequential algorithm - pattern: "{recursive,sequential,uniform-number-variants}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: | + Target dataset in VCF/BCF format defined at all variable positions. + The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file of the input VCF/BCF file containing genotype likelihoods. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - region: + type: string + description: | + Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). + For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. + - map: + type: file + description: File containing the genetic map. + pattern: "*.gmap" + - - model: + type: string + description: | + Algorithm model to use: + "recursive": Recursive algorithm + "sequential": Sequential algorithm (Recommended) + "uniform-number-variants": Experimental. Uniform the number of variants in the sequential algorithm + pattern: "{recursive,sequential,uniform-number-variants}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - chunk_chr: - type: file - description: Tab delimited output txt file containing buffer and imputation regions. - pattern: "*.{txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Tab delimited output txt file containing buffer and imputation + regions. + pattern: "*.{txt}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/glimpse2/chunk/tests/main.nf.test b/modules/nf-core/glimpse2/chunk/tests/main.nf.test index 0f9e8850..406aa7b8 100644 --- a/modules/nf-core/glimpse2/chunk/tests/main.nf.test +++ b/modules/nf-core/glimpse2/chunk/tests/main.nf.test @@ -9,19 +9,18 @@ nextflow_process { tag "modules" test("Should run without map") { - config "modules/nf-core/glimpse2/chunk/tests/nextflow.config" + config "./nextflow.config" when { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), - file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true), - "chr21" + file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true), + "chr21", [] ] - input[1]= [[ id:'map'],[]] - input[2]= "recursive" + input[1]= "recursive" """ } } @@ -36,19 +35,19 @@ nextflow_process { } test("Should run with map") { - config "modules/nf-core/glimpse2/chunk/tests/nextflow.config" + config "./nextflow.config" when { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), - file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true), - "chr21" + file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true), + "chr21", + file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true) ] - input[1]= [[ id:'map'],file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true)] - input[2]= "recursive" + input[1]= "recursive" """ } } diff --git a/modules/nf-core/glimpse2/concordance/environment.yml b/modules/nf-core/glimpse2/concordance/environment.yml index f40e8317..75b86239 100644 --- a/modules/nf-core/glimpse2/concordance/environment.yml +++ b/modules/nf-core/glimpse2/concordance/environment.yml @@ -1,7 +1,5 @@ -name: glimpse2_concordance channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/concordance/meta.yml b/modules/nf-core/glimpse2/concordance/meta.yml index 7c82c350..f286f6e9 100644 --- a/modules/nf-core/glimpse2/concordance/meta.yml +++ b/modules/nf-core/glimpse2/concordance/meta.yml @@ -1,5 +1,6 @@ name: "glimpse2_concordance" -description: Program to compute the genotyping error rate at the sample or marker level. +description: Program to compute the genotyping error rate at the sample or marker + level. keywords: - concordance - low-coverage @@ -7,103 +8,160 @@ keywords: - imputation tools: - "glimpse2": - description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" - licence: "['MIT']" + licence: ["MIT"] + identifier: biotools:glimpse2 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - region: - type: string - description: Target region used for imputation, including left and right buffers (e.g. chr20:1000000-2000000). Can also be a list of such regions. - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - freq: - type: file - description: File containing allele frequencies at each site. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - truth: - type: file - description: Validation dataset called at the same positions as the imputed file. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - estimate: - type: file - description: Imputed dataset file obtain after phasing. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - samples: - type: file - description: List of samples to process, one sample ID per line. - pattern: "*.{txt,tsv}" - - groups: - type: file - description: Alternative to frequency bins, group bins are user defined, provided in a file. - pattern: "*.{txt,tsv}" - - bins: - type: string - description: | - Allele frequency bins used for rsquared computations. - By default they should as MAF bins [0-0.5], while - they should take the full range [0-1] if --use-ref-alt is used. - pattern: "0 0.01 0.05 ... 0.5" - - ac_bins: - type: string - description: User-defined allele count bins used for rsquared computations. - pattern: "1 2 5 10 20 ... 100000" - - allele_counts: - type: string - description: | - Default allele count bins used for rsquared computations. - AN field must be defined in the frequency file. - - min_val_gl: - type: float - description: | - Minimum genotype likelihood probability P(G|R) in validation data. - Set to zero to have no filter of if using –gt-validation - - min_val_dp: - type: integer - description: | - Minimum coverage in validation data. - If FORMAT/DP is missing and –min_val_dp > 0, the program exits with an error. - Set to zero to have no filter of if using –gt-validation + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - estimate: + type: file + description: Imputed dataset file obtain after phasing. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - estimate_index: + type: file + description: Index file for the imputed dataset file. + - truth: + type: file + description: Validation dataset called at the same positions as the imputed + file. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - truth_index: + type: file + description: Index file for the truth file. + - freq: + type: file + description: File containing allele frequencies at each site. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - freq_index: + type: file + description: Index file for the allele frequencies file. + - samples: + type: file + description: List of samples to process, one sample ID per line. + pattern: "*.{txt,tsv}" + - region: + type: string + description: Target region used for imputation, including left and right buffers + (e.g. chr20:1000000-2000000). Can also be a list of such regions. + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - groups: + type: file + description: Alternative to frequency bins, group bins are user defined, provided + in a file. + pattern: "*.{txt,tsv}" + - bins: + type: string + description: | + Allele frequency bins used for rsquared computations. + By default they should as MAF bins [0-0.5], while + they should take the full range [0-1] if --use-ref-alt is used. + pattern: "0 0.01 0.05 ... 0.5" + - ac_bins: + type: string + description: User-defined allele count bins used for rsquared computations. + pattern: "1 2 5 10 20 ... 100000" + - allele_counts: + type: string + description: | + Default allele count bins used for rsquared computations. + AN field must be defined in the frequency file. + - - min_val_gl: + type: float + description: | + Minimum genotype likelihood probability P(G|R) in validation data. + Set to zero to have no filter of if using –gt-validation + - - min_val_dp: + type: integer + description: | + Minimum coverage in validation data. + If FORMAT/DP is missing and –min_val_dp > 0, the program exits with an error. + Set to zero to have no filter of if using –gt-validation output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions. - pattern: "versions.yml" - errors_cal: - type: file - description: Calibration correlation errors between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "*.errors.cal.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.error.cal.txt.gz": + type: file + description: Calibration correlation errors between imputed dosages (in MAF + bins) and highly-confident genotype. + pattern: "*.errors.cal.txt.gz" - errors_grp: - type: file - description: Groups correlation errors between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "*.errors.grp.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.error.grp.txt.gz": + type: file + description: Groups correlation errors between imputed dosages (in MAF bins) + and highly-confident genotype. + pattern: "*.errors.grp.txt.gz" - errors_spl: - type: file - description: Samples correlation errors between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "*.errors.spl.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.error.spl.txt.gz": + type: file + description: Samples correlation errors between imputed dosages (in MAF bins) + and highly-confident genotype. + pattern: "*.errors.spl.txt.gz" - rsquare_grp: - type: file - description: Groups r-squared correlation between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "*.rsquare.grp.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.rsquare.grp.txt.gz": + type: file + description: Groups r-squared correlation between imputed dosages (in MAF bins) + and highly-confident genotype. + pattern: "*.rsquare.grp.txt.gz" - rsquare_spl: - type: file - description: Samples r-squared correlation between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "*.rsquare.spl.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.rsquare.spl.txt.gz": + type: file + description: Samples r-squared correlation between imputed dosages (in MAF bins) + and highly-confident genotype. + pattern: "*.rsquare.spl.txt.gz" - rsquare_per_site: - type: file - description: Variant r-squared correlation between imputed dosages (in MAF bins) and highly-confident genotype. - pattern: "_r2_sites.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*_r2_sites.txt.gz": + type: file + description: Variant r-squared correlation between imputed dosages (in MAF bins) + and highly-confident genotype. + pattern: "_r2_sites.txt.gz" + - versions: + - versions.yml: + type: file + description: File containing software versions. + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/glimpse2/concordance/tests/main.nf.test b/modules/nf-core/glimpse2/concordance/tests/main.nf.test new file mode 100644 index 00000000..9c562520 --- /dev/null +++ b/modules/nf-core/glimpse2/concordance/tests/main.nf.test @@ -0,0 +1,199 @@ +nextflow_process { + + name "Test Process GLIMPSE2_CONCORDANCE" + script "../main.nf" + process "GLIMPSE2_CONCORDANCE" + tag "glimpse2" + tag "glimpse2/concordance" + tag "glimpse2/phase" + tag "bcftools/index" + tag "modules_nfcore" + tag "modules" + + setup { + run("GLIMPSE2_PHASE") { + script "../../phase/main.nf" + process { + """ + input_vcf = Channel.of([ + [ id:'input'], // meta map + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true), + [] + ]) + + samples_infos = Channel.of('NA12878 2').collectFile(name: 'sampleinfos.txt') + region = Channel.of(["chr21:16600000-16800000","chr21:16650000-16750000"]) + + ch_ref_panel = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) + ]) + + ch_map = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true), + ]) + + // [meta, vcf, index, sample_infos, regionin, regionout, regionindex, ref, ref_index, map] + input[0] = input_vcf + .combine(samples_infos) + .combine(region) + .combine( ch_ref_panel ) + .combine( ch_map ) + input[1]= Channel.of([[],[],[]]) + """ + } + } + + run("BCFTOOLS_INDEX") { + script "../../../bcftools/index/main.nf" + process { + """ + input[0] = GLIMPSE2_PHASE.output.phased_variants + """ + } + } + } + + + test("test_glimpse2_concordance") { + config "./nextflow.config" + + when { + process { + """ + allele_freq = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) + ]) + + truth = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) + ]) + list_inputs = GLIMPSE2_PHASE.output.phased_variants + .join( BCFTOOLS_INDEX.out.csi ) + .combine( truth ) + .combine( allele_freq ) + .combine( Channel.of([[]]) ) + .combine( Channel.of(["chr21"]) ) + + input[0] = list_inputs + input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) + input[2] = 0.9999 + input[3] = 8 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.errors_cal.collect{ file(it[1]).name }, + process.out.errors_grp.collect{ file(it[1]).name }, + process.out.errors_spl.collect{ file(it[1]).name }, + process.out.rsquare_grp.collect{ file(it[1]).name }, + process.out.rsquare_spl.collect{ file(it[1]).name }, + process.out.versions + ).match() } + ) + } + + } + + test("test_list_region") { + config "./nextflow.config" + + when { + process { + """ + allele_freq = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) + ]) + + truth = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) + ]) + list_inputs = GLIMPSE2_PHASE.output.phased_variants + .join( BCFTOOLS_INDEX.out.csi ) + .combine( truth ) + .combine( allele_freq ) + .combine( Channel.of([[]]) ) + .combine( Channel.of(["chr21", "chr21"]) ) + + input[0] = list_inputs + input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) + input[2] = 0.9999 + input[3] = 8 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.errors_cal.collect{ file(it[1]).name }, + process.out.errors_grp.collect{ file(it[1]).name }, + process.out.errors_spl.collect{ file(it[1]).name }, + process.out.rsquare_grp.collect{ file(it[1]).name }, + process.out.rsquare_spl.collect{ file(it[1]).name }, + process.out.versions + ).match() + } + ) + } + + } + + test("test_r2_per_site") { + config "./nextflow_R2.config" + + when { + process { + """ + allele_freq = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) + ]) + + truth = Channel.of([ + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), + file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) + ]) + list_inputs = GLIMPSE2_PHASE.output.phased_variants + .join( BCFTOOLS_INDEX.out.csi ) + .combine( truth ) + .combine( allele_freq ) + .combine( Channel.of([[]]) ) + .combine( Channel.of(["chr21"]) ) + input[0] = list_inputs + input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) + input[2] = 0.9999 + input[3] = 8 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.errors_cal.collect{ file(it[1]).name }, + process.out.errors_grp.collect{ file(it[1]).name }, + process.out.errors_spl.collect{ file(it[1]).name }, + process.out.rsquare_grp.collect{ file(it[1]).name }, + process.out.rsquare_spl.collect{ file(it[1]).name }, + process.out.rsquare_per_site.collect{ file(it[1]).name }, + process.out.versions + ).match() + } + ) + } + + } + +} diff --git a/modules/nf-core/glimpse2/concordance/tests/main.nf.test.snap b/modules/nf-core/glimpse2/concordance/tests/main.nf.test.snap new file mode 100644 index 00000000..12bded93 --- /dev/null +++ b/modules/nf-core/glimpse2/concordance/tests/main.nf.test.snap @@ -0,0 +1,86 @@ +{ + "test_r2_per_site": { + "content": [ + [ + "input.error.cal.txt.gz" + ], + [ + "input.error.grp.txt.gz" + ], + [ + "input.error.spl.txt.gz" + ], + [ + "input.rsquare.grp.txt.gz" + ], + [ + "input.rsquare.spl.txt.gz" + ], + [ + "input_r2_sites.txt.gz" + ], + [ + "versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T16:23:00.623182365" + }, + "test_glimpse2_concordance": { + "content": [ + [ + "input.error.cal.txt.gz" + ], + [ + "input.error.grp.txt.gz" + ], + [ + "input.error.spl.txt.gz" + ], + [ + "input.rsquare.grp.txt.gz" + ], + [ + "input.rsquare.spl.txt.gz" + ], + [ + "versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T16:22:26.823581573" + }, + "test_list_region": { + "content": [ + [ + "input.error.cal.txt.gz" + ], + [ + "input.error.grp.txt.gz" + ], + [ + "input.error.spl.txt.gz" + ], + [ + "input.rsquare.grp.txt.gz" + ], + [ + "input.rsquare.spl.txt.gz" + ], + [ + "versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T16:22:43.352729014" + } +} \ No newline at end of file diff --git a/modules/nf-core/glimpse2/concordance/tests/nextflow.config b/modules/nf-core/glimpse2/concordance/tests/nextflow.config new file mode 100644 index 00000000..e5721995 --- /dev/null +++ b/modules/nf-core/glimpse2/concordance/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: GLIMPSE2_CHUNK { + ext.prefix = { "${meta.id}" } + } + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } +} \ No newline at end of file diff --git a/modules/nf-core/glimpse2/concordance/tests/nextflow_R2.config b/modules/nf-core/glimpse2/concordance/tests/nextflow_R2.config new file mode 100644 index 00000000..0ceee00d --- /dev/null +++ b/modules/nf-core/glimpse2/concordance/tests/nextflow_R2.config @@ -0,0 +1,7 @@ +process { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:GLIMPSE2_CONCORDANCE { + ext.args = "--out-r2-per-site" + } +} diff --git a/modules/nf-core/glimpse2/concordance/tests/tags.yml b/modules/nf-core/glimpse2/concordance/tests/tags.yml new file mode 100644 index 00000000..76ef847a --- /dev/null +++ b/modules/nf-core/glimpse2/concordance/tests/tags.yml @@ -0,0 +1,2 @@ +glimpse2/concordance: + - modules/nf-core/glimpse2/concordance/** diff --git a/modules/nf-core/glimpse2/ligate/environment.yml b/modules/nf-core/glimpse2/ligate/environment.yml index 1e531600..75b86239 100644 --- a/modules/nf-core/glimpse2/ligate/environment.yml +++ b/modules/nf-core/glimpse2/ligate/environment.yml @@ -1,7 +1,5 @@ -name: glimpse2_ligate channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/ligate/meta.yml b/modules/nf-core/glimpse2/ligate/meta.yml index 7c07973f..14fc8dac 100644 --- a/modules/nf-core/glimpse2/ligate/meta.yml +++ b/modules/nf-core/glimpse2/ligate/meta.yml @@ -9,40 +9,44 @@ keywords: - imputation tools: - "glimpse2": - description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: biotools:glimpse2 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input_list: - type: file - description: VCF/BCF file containing genotype probabilities (GP field). - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - input_index: - type: file - description: Index file of the input VCF/BCF file containing genotype likelihoods. - pattern: "*.{csi,tbi}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_list: + type: file + description: VCF/BCF file containing genotype probabilities (GP field). + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file of the input VCF/BCF file containing genotype likelihoods. + pattern: "*.{csi,tbi}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - merged_variants: - type: file - description: Output ligated (phased) file in VCF/BCF format. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: Output ligated (phased) file in VCF/BCF format. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/glimpse2/ligate/tests/main.nf.test b/modules/nf-core/glimpse2/ligate/tests/main.nf.test index d45c448b..6706d586 100644 --- a/modules/nf-core/glimpse2/ligate/tests/main.nf.test +++ b/modules/nf-core/glimpse2/ligate/tests/main.nf.test @@ -22,7 +22,7 @@ nextflow_process { [ id:'input' ], // meta map file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true), - [], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000" ]) diff --git a/modules/nf-core/glimpse2/phase/environment.yml b/modules/nf-core/glimpse2/phase/environment.yml index 0e3938c7..75b86239 100644 --- a/modules/nf-core/glimpse2/phase/environment.yml +++ b/modules/nf-core/glimpse2/phase/environment.yml @@ -1,7 +1,5 @@ -name: glimpse2_phase channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/phase/glimpse2-phase.diff b/modules/nf-core/glimpse2/phase/glimpse2-phase.diff deleted file mode 100644 index ec5160aa..00000000 --- a/modules/nf-core/glimpse2/phase/glimpse2-phase.diff +++ /dev/null @@ -1,158 +0,0 @@ -Changes in module 'nf-core/glimpse2/phase' -'modules/nf-core/glimpse2/phase/environment.yml' is unchanged -Changes in 'glimpse2/phase/main.nf': ---- modules/nf-core/glimpse2/phase/main.nf -+++ modules/nf-core/glimpse2/phase/main.nf -@@ -18,13 +18,13 @@ - 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" - - input: -- tuple val(meta) , path(input, arity: '1..*'), path(input_index), path(samples_file), val(input_region), val(output_region), path(reference), path(reference_index), path(map) -+ tuple val(meta) , path(input, arity: '1..*'), path(input_index), path(bamlist), path(samples_file), val(input_region), val(output_region), path(reference), path(reference_index), path(map) - tuple val(meta2), path(fasta_reference), path(fasta_reference_index) - - output: - tuple val(meta), path("*.{vcf,vcf.gz,bcf,bgen}"), emit: phased_variants -- tuple val(meta), path("*.txt.gz") , emit: stats_coverage, optional: true -- path "versions.yml" , emit: versions -+ tuple val(meta), path("*.txt.gz") , emit: stats_coverage, optional: true -+ path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when -@@ -45,7 +45,7 @@ - it.toString().endsWithAny("cram", "bam") ? "bam" : - it.toString().endsWithAny("vcf", "bcf", "vcf.gz") ? "gl" : - it.getExtension() -- }.unique() -+ }.unique() - - if (input_type.size() > 1 | !(input_type.contains("gl") | input_type.contains("bam"))) { - error "Input files must be of the same type and either .bam/.cram or .vcf/.vcf.gz/.bcf format. Found: ${input_type}" -@@ -58,7 +58,10 @@ - def input_list = input.size() > 1 - - """ -- if $input_list ; -+ if [ -n "$bamlist" ] ; -+ then -+ input_command="--bam-list $bamlist" -+ elif $input_list ; - then - ls -1 | grep '\\.cram\$\\|\\.bam\$' > all_bam.txt - input_command="--bam-list all_bam.txt" - -'modules/nf-core/glimpse2/phase/meta.yml' is unchanged -Changes in 'glimpse2/phase/tests/main.nf.test': ---- modules/nf-core/glimpse2/phase/tests/main.nf.test -+++ modules/nf-core/glimpse2/phase/tests/main.nf.test -@@ -20,6 +20,7 @@ - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true), - [], -+ [], - "chr21:16600000-16800000", - "chr21:16650000-16750000" - ]) -@@ -63,6 +64,7 @@ - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.bam", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.bam.bai", checkIfExists: true), - [], -+ [], - "chr21:16600000-16800000", - "chr21:16650000-16750000", - ]) -@@ -105,6 +107,7 @@ - [id:'input'], - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.cram", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.cram.crai", checkIfExists: true), -+ [], - [], - "chr21:16600000-16800000", - "chr21:16650000-16750000", -@@ -153,9 +156,62 @@ - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)], - [], -- "chr21:16600000-16800000", -- "chr21:16650000-16750000", -- ]) -+ [], -+ "chr21:16600000-16800000", -+ "chr21:16650000-16750000", -+ ]) -+ ref_panel = Channel.of([ -+ file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), -+ file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) -+ ]) -+ -+ map_file = Channel.of([ -+ file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true) -+ ]) -+ reference_genome = Channel.of([ -+ [id:'refHG38_chr21'], -+ file(params.modules_testdata_base_path + "delete_me/glimpse/hs38DH.chr21.fa.gz", checkIfExists: true), -+ file(params.modules_testdata_base_path + "delete_me/glimpse/hs38DH.chr21.fa.gz.fai", checkIfExists: true) -+ ]) -+ // [meta, vcf, index, sample_infos, regionin, regionout,ref, index, map] [meta, fasta, fai] -+ input[0] = input_bam -+ .combine(ref_panel) -+ .combine(map_file) -+ input[1] = reference_genome -+ """ -+ } -+ } -+ -+ then { -+ assertAll( -+ { assert process.success }, -+ // File has a timestamp in it and is in binary format, so we can only check the name -+ { assert file(process.out.phased_variants[0][1]).name == "input_chr21_16650000-16750000.bcf" }, -+ { assert snapshot(process.out.stats_coverage).match("List_coverage")}, -+ { assert snapshot(process.out.versions).match("List_versions")} -+ ) -+ } -+ } -+ -+ test("Should run with list of bam files with renaming file list") { -+ -+ when { -+ process { -+ """ -+ ch_bamlist = Channel.of(["NA12878.s.bam\tIndividual1", "NA19401.s.bam\tIndividual2"]).collectFile(name:"bamlist.txt", newline:true) -+ -+ input_bam = Channel.of([ -+ [id:'input'], -+ [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), -+ file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam", checkIfExists: true)], -+ [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), -+ file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)] -+ ]) -+ input_bam = input -+ .combine(ch_bamlist) -+ .map{ meta, bam, bai, bamlist -> [ -+ meta, bam, bai, bamlist, [], "chr21:16600000-16800000", "chr21:16650000-16750000" -+ ] } - ref_panel = Channel.of([ - file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) -@@ -201,6 +257,7 @@ - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)], - [], -+ [], - "chr21:16600000-16800000", - "chr21:16650000-16750000", - ]) -@@ -245,6 +302,7 @@ - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.1x.bcf.csi", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)], - [], -+ [], - "chr21:16600000-16800000", - "chr21:16650000-16750000", - ]) - -'modules/nf-core/glimpse2/phase/tests/main.nf.test.snap' is unchanged -'modules/nf-core/glimpse2/phase/tests/tags.yml' is unchanged -************************************************************ diff --git a/modules/nf-core/glimpse2/phase/meta.yml b/modules/nf-core/glimpse2/phase/meta.yml index 700b6204..dd720fd4 100644 --- a/modules/nf-core/glimpse2/phase/meta.yml +++ b/modules/nf-core/glimpse2/phase/meta.yml @@ -7,98 +7,115 @@ keywords: - glimpse tools: - "glimpse2": - description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: biotools:glimpse2 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test', single_end:false ]` - - input: - type: file - description: | - Either one or multiple BAM/CRAM files in an array containing low-coverage sequencing reads or one VCF/BCF file containing the genotype likelihoods. - When using BAM/CRAM the name of the file is used as samples name. - pattern: "*.{bam,cram,vcf,vcf.gz,bcf,bcf.gz}" - - input_index: - type: file - description: Index file of the input BAM/CRAM/VCF/BCF file. - pattern: "*.{bam.bai,cram.crai,vcf.gz.csi,bcf.gz.csi}" - - samples_file: - type: file - description: | - File with sample names and ploidy information. - One sample per line with a mandatory second column indicating ploidy (1 or 2). - Sample names that are not present are assumed to have ploidy 2 (diploids). - GLIMPSE does NOT handle the use of sex (M/F) instead of ploidy. - pattern: "*.{txt,tsv}" - - input_region: - type: string - description: | - Target region used for imputation, including left and right buffers (e.g. chr20:1000000-2000000). - Optional if reference panel is in bin format. - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - output_region: - type: string - description: | - Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). - Optional if reference panel is in bin format. - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - meta2: - type: map - description: | - Groovy Map containing genomic map information - e.g. `[ map:'GRCh38' ]` - - reference: - type: file - description: Reference panel of haplotypes in VCF/BCF format. - pattern: "*.{vcf.gz,bcf.gz}" - - reference_index: - type: file - description: Index file of the Reference panel file. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - map: - type: file - description: | - File containing the genetic map. - Optional if reference panel is in bin format. - pattern: "*.gmap" - - fasta_reference: - type: file - description: | - Faidx-indexed reference sequence file in the appropriate genome build. - Necessary for CRAM files. - pattern: "*.fasta" - - fasta_reference_index: - type: file - description: | - Faidx index of the reference sequence file in the appropriate genome build. - Necessary for CRAM files. - pattern: "*.fai" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - input: + type: file + description: | + Either one or multiple BAM/CRAM files in an array containing low-coverage sequencing reads or one VCF/BCF file containing the genotype likelihoods. + When using BAM/CRAM the name of the file is used as samples name. + pattern: "*.{bam,cram,vcf,vcf.gz,bcf,bcf.gz}" + - input_index: + type: file + description: Index file of the input BAM/CRAM/VCF/BCF file. + pattern: "*.{bam.bai,cram.crai,vcf.gz.csi,bcf.gz.csi}" + - bamlist: + type: file + description: | + File containing the list of BAM/CRAM files to be phased. + One file per line and a second column can be added to indicate the sample name. + pattern: "*.{txt,tsv}" + - samples_file: + type: file + description: | + File with sample names and ploidy information. + One sample per line with a mandatory second column indicating ploidy (1 or 2). + Sample names that are not present are assumed to have ploidy 2 (diploids). + GLIMPSE does NOT handle the use of sex (M/F) instead of ploidy. + pattern: "*.{txt,tsv}" + - input_region: + type: string + description: | + Target region used for imputation, including left and right buffers (e.g. chr20:1000000-2000000). + Optional if reference panel is in bin format. + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - output_region: + type: string + description: | + Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). + Optional if reference panel is in bin format. + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - reference: + type: file + description: Reference panel of haplotypes in VCF/BCF format. + pattern: "*.{vcf.gz,bcf.gz}" + - reference_index: + type: file + description: Index file of the Reference panel file. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - map: + type: file + description: | + File containing the genetic map. + Optional if reference panel is in bin format. + pattern: "*.gmap" + - - meta2: + type: map + description: | + Groovy Map containing genomic map information + e.g. `[ map:'GRCh38' ]` + - fasta_reference: + type: file + description: | + Faidx-indexed reference sequence file in the appropriate genome build. + Necessary for CRAM files. + pattern: "*.fasta" + - fasta_reference_index: + type: file + description: | + Faidx index of the reference sequence file in the appropriate genome build. + Necessary for CRAM files. + pattern: "*.fai" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test', single_end:false ]` - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - phased_variants: - type: file - description: | - Output VCF/BCF file containing genotype probabilities (GP field), imputed dosages (DS field), best guess genotypes (GT field), sampled haplotypes in the last (max 16) main iterations (HS field) and info-score. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.{vcf,vcf.gz,bcf,bgen}": + type: file + description: | + Output VCF/BCF file containing genotype probabilities (GP field), imputed dosages (DS field), best guess genotypes (GT field), sampled haplotypes in the last (max 16) main iterations (HS field) and info-score. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - stats_coverage: - type: file - description: Optional coverage statistic file created when BAM/CRAM files are used as inputs. - pattern: "*.txt.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.txt.gz": + type: file + description: Optional coverage statistic file created when BAM/CRAM files are + used as inputs. + pattern: "*.txt.gz" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@LouisLeNezet" maintainers: diff --git a/modules/nf-core/glimpse2/phase/tests/main.nf.test b/modules/nf-core/glimpse2/phase/tests/main.nf.test index 08892f54..04b89f2a 100644 --- a/modules/nf-core/glimpse2/phase/tests/main.nf.test +++ b/modules/nf-core/glimpse2/phase/tests/main.nf.test @@ -19,8 +19,7 @@ nextflow_process { [ id:'input' ], // meta map file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true), - [], - [], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000" ]) @@ -63,8 +62,7 @@ nextflow_process { [id:'input'], file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.bam", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.bam.bai", checkIfExists: true), - [], - [], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000", ]) @@ -107,8 +105,7 @@ nextflow_process { [id:'input'], file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.cram", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.cram.crai", checkIfExists: true), - [], - [], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000", ]) @@ -144,6 +141,7 @@ nextflow_process { ) } } + test("Should run with list of bam files and reference genome") { when { @@ -151,12 +149,11 @@ nextflow_process { """ input_bam = Channel.of([ [id:'input'], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam", checkIfExists: true)], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)], - [], - [], + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA19401/NA19401.s.bam", checkIfExists: true)], + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000", ]) @@ -193,25 +190,21 @@ nextflow_process { } } - test("Should run with list of bam files with renaming file list") { + test("Should run into error file type inconsistent") { when { process { """ - ch_bamlist = Channel.of(["NA12878.s.bam\tIndividual1", "NA19401.s.bam\tIndividual2"]).collectFile(name:"bamlist.txt", newline:true) - input_bam = Channel.of([ [id:'input'], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam", checkIfExists: true)], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), - file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)] + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true)], + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)], + [], [], + "chr21:16600000-16800000", + "chr21:16650000-16750000", ]) - input_bam = input - .combine(ch_bamlist) - .map{ meta, bam, bai, bamlist -> [ - meta, bam, bai, bamlist, [], "chr21:16600000-16800000", "chr21:16650000-16750000" - ] } ref_panel = Channel.of([ file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) @@ -236,28 +229,24 @@ nextflow_process { then { assertAll( - { assert process.success }, - // File has a timestamp in it and is in binary format, so we can only check the name - { assert file(process.out.phased_variants[0][1]).name == "input_chr21_16650000-16750000.bcf" }, - { assert snapshot(process.out.stats_coverage).match("List_coverage")}, - { assert snapshot(process.out.versions).match("List_versions")} + { assert process.failed }, + { assert process.errorReport.contains("Input files must be of the same type and either .bam/.cram or .vcf/.vcf.gz/.bcf format. Found: [bam, gl]") } ) } } - test("Should run into error file type inconsistent") { + test("Should run into error only one vcf allowed") { when { process { """ input_bam = Channel.of([ [id:'input'], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.1x.bcf", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true)], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.1x.bcf.csi", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)], - [], - [], + [], [], "chr21:16600000-16800000", "chr21:16650000-16750000", ]) @@ -286,26 +275,34 @@ nextflow_process { then { assertAll( { assert process.failed }, - { assert process.errorReport.contains("Input files must be of the same type and either .bam/.cram or .vcf/.vcf.gz/.bcf format. Found: [bam, gl]") } + { assert process.errorReport.contains("Only one input .vcf/.vcf.gz/.bcf file can be provided") } ) } } - test("Should run into error only one vcf allowed") { + test("Should run with a bamlist to rename samples") { + config "./nextflow.config" + when { process { """ + bamlist = Channel.of( + "NA12878.s.bam\tNA12878", + "NA19401.s.bam\tNA19401" + ).collectFile(name: 'bamlist.txt', newLine: true) + input_bam = Channel.of([ [id:'input'], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.1x.bcf", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true)], - [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/individuals/NA12878/NA12878.s.1x.bcf.csi", checkIfExists: true), - file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)], - [], - [], - "chr21:16600000-16800000", - "chr21:16650000-16750000", - ]) + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA19401/NA19401.s.bam", checkIfExists: true)], + [file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA12878/NA12878.s.bam.bai", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/hum_data/individuals/NA19401/NA19401.s.bam.bai", checkIfExists: true)], + ]).combine(bamlist).map{ map, bam, bai, bamlist -> [ + map, bam, bai, bamlist, [], + "chr21:16600000-16800000", + "chr21:16650000-16750000", + ] + } ref_panel = Channel.of([ file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) @@ -330,8 +327,12 @@ nextflow_process { then { assertAll( - { assert process.failed }, - { assert process.errorReport.contains("Only one input .vcf/.vcf.gz/.bcf file can be provided") } + { assert process.success }, + // File has a timestamp in it and is in binary format, so we can only check the name + { assert snapshot( + process.out.phased_variants.collect{ path(it[1]).vcf.header.getGenotypeSamples().sort() }, + process.out.phased_variants.collect{ path(it[1]).vcf.summary.replaceAll(", phasedAutodetect=(false|true)", "") } + ).match()}, ) } } diff --git a/modules/nf-core/glimpse2/phase/tests/main.nf.test.snap b/modules/nf-core/glimpse2/phase/tests/main.nf.test.snap index d32e27c3..180af8cc 100644 --- a/modules/nf-core/glimpse2/phase/tests/main.nf.test.snap +++ b/modules/nf-core/glimpse2/phase/tests/main.nf.test.snap @@ -11,7 +11,7 @@ }, "timestamp": "2024-03-13T16:58:34.365910006" }, - "VCF": { + "List_versions": { "content": [ [ "versions.yml:md5,c68de03046a6503cdbcf3a1495fc512f" @@ -21,26 +21,27 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-13T16:58:05.013609832" + "timestamp": "2024-07-09T20:35:30.97466287" }, - "List_coverage": { + "Should run with a bamlist to rename samples": { "content": [ [ [ - { - "id": "input" - }, - "input_chr21_16650000-16750000_stats_coverage.txt.gz:md5,ac61370fc14738b103e160b7298727b9" + "NA12878", + "NA19401" ] + ], + [ + "VcfFile [chromosomes=[chr21], sampleCount=2, variantCount=4719, phased=true]" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-07-09T20:35:30.943277837" + "timestamp": "2024-10-22T15:23:37.368119579" }, - "List_versions": { + "VCF": { "content": [ [ "versions.yml:md5,c68de03046a6503cdbcf3a1495fc512f" @@ -50,7 +51,24 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-07-09T20:35:30.97466287" + "timestamp": "2024-03-13T16:58:05.013609832" + }, + "List_coverage": { + "content": [ + [ + [ + { + "id": "input" + }, + "input_chr21_16650000-16750000_stats_coverage.txt.gz:md5,ac61370fc14738b103e160b7298727b9" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-07-09T20:35:30.943277837" }, "BAM_coverage": { "content": [ diff --git a/modules/nf-core/glimpse2/phase/tests/nextflow.config b/modules/nf-core/glimpse2/phase/tests/nextflow.config new file mode 100644 index 00000000..c5d9c9be --- /dev/null +++ b/modules/nf-core/glimpse2/phase/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GLIMPSE2_PHASE { + ext.suffix = { "vcf" } + } +} \ No newline at end of file diff --git a/modules/nf-core/glimpse2/splitreference/environment.yml b/modules/nf-core/glimpse2/splitreference/environment.yml index b283e835..75b86239 100644 --- a/modules/nf-core/glimpse2/splitreference/environment.yml +++ b/modules/nf-core/glimpse2/splitreference/environment.yml @@ -1,7 +1,5 @@ -name: glimpse2_splitreference channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/splitreference/meta.yml b/modules/nf-core/glimpse2/splitreference/meta.yml index c70ec024..192e6d65 100644 --- a/modules/nf-core/glimpse2/splitreference/meta.yml +++ b/modules/nf-core/glimpse2/splitreference/meta.yml @@ -7,59 +7,64 @@ keywords: - imputation tools: - "glimpse2": - description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies." + description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage + sequencing studies." homepage: "https://odelaneau.github.io/GLIMPSE" documentation: "https://odelaneau.github.io/GLIMPSE/commands.html" tool_dev_url: "https://github.com/odelaneau/GLIMPSE" doi: "10.1038/s41588-020-00756-0" licence: ["MIT"] + identifier: biotools:glimpse2 requirements: - AVX2 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reference: - type: file - description: Reference panel of haplotypes in VCF/BCF format. - pattern: "*.{vcf.gz,bcf.gz}" - - reference_index: - type: file - description: Index file of the Reference panel file. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - input_region: - type: string - description: Target region used for imputation, including left and right buffers (e.g. chr20:1000000-2000000). - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - output_region: - type: string - description: Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - meta2: - type: map - description: | - Groovy Map containing genomic map information - e.g. `[ map:'GRCh38' ]` - - map: - type: file - description: File containing the genetic map. - pattern: "*.gmap" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reference: + type: file + description: Reference panel of haplotypes in VCF/BCF format. + pattern: "*.{vcf.gz,bcf.gz}" + - reference_index: + type: file + description: Index file of the Reference panel file. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - input_region: + type: string + description: Target region used for imputation, including left and right buffers + (e.g. chr20:1000000-2000000). + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - output_region: + type: string + description: Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000). + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - - meta2: + type: map + description: | + Groovy Map containing genomic map information + e.g. `[ map:'GRCh38' ]` + - map: + type: file + description: File containing the genetic map. + pattern: "*.gmap" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - bin_ref: - type: file - description: binary reference panel - pattern: "*.bin" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bin": + type: file + description: binary reference panel + pattern: "*.bin" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@LouisLeNezet" maintainers: From 0f125bc0ccd7c29ed889eba4d837b18a0f242094 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:01:15 +0100 Subject: [PATCH 16/25] Update gunzip --- modules/nf-core/gunzip/environment.yml | 2 -- modules/nf-core/gunzip/meta.yml | 37 +++++++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/gunzip/environment.yml b/modules/nf-core/gunzip/environment.yml index dfc02a7b..c7794856 100644 --- a/modules/nf-core/gunzip/environment.yml +++ b/modules/nf-core/gunzip/environment.yml @@ -1,8 +1,6 @@ -name: gunzip channels: - conda-forge - bioconda - - defaults dependencies: - conda-forge::grep=3.11 - conda-forge::sed=4.8 diff --git a/modules/nf-core/gunzip/meta.yml b/modules/nf-core/gunzip/meta.yml index f32973a0..9066c035 100644 --- a/modules/nf-core/gunzip/meta.yml +++ b/modules/nf-core/gunzip/meta.yml @@ -10,25 +10,32 @@ tools: gzip is a file format and a software application used for file compression and decompression. documentation: https://www.gnu.org/software/gzip/manual/gzip.html licence: ["GPL-3.0-or-later"] + identifier: "" input: - - meta: - type: map - description: | - Optional groovy Map containing meta information - e.g. [ id:'test', single_end:false ] - - archive: - type: file - description: File to be compressed/uncompressed - pattern: "*.*" + - - meta: + type: map + description: | + Optional groovy Map containing meta information + e.g. [ id:'test', single_end:false ] + - archive: + type: file + description: File to be compressed/uncompressed + pattern: "*.*" output: - gunzip: - type: file - description: Compressed/uncompressed file - pattern: "*.*" + - meta: + type: file + description: Compressed/uncompressed file + pattern: "*.*" + - $gunzip: + type: file + description: Compressed/uncompressed file + pattern: "*.*" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" From 1071bd68a53725f6a8661a0457a4e017ad0b6880 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:03:17 +0100 Subject: [PATCH 17/25] Update quilt --- modules/nf-core/quilt/quilt/environment.yml | 2 - modules/nf-core/quilt/quilt/main.nf | 10 +- modules/nf-core/quilt/quilt/meta.yml | 216 +++++++++++------- modules/nf-core/quilt/quilt/quilt-quilt.diff | 35 --- .../nf-core/quilt/quilt/tests/main.nf.test | 42 +++- .../quilt/quilt/tests/main.nf.test.snap | 81 +++++++ 6 files changed, 264 insertions(+), 122 deletions(-) delete mode 100644 modules/nf-core/quilt/quilt/quilt-quilt.diff diff --git a/modules/nf-core/quilt/quilt/environment.yml b/modules/nf-core/quilt/quilt/environment.yml index a2161a65..967b84ba 100644 --- a/modules/nf-core/quilt/quilt/environment.yml +++ b/modules/nf-core/quilt/quilt/environment.yml @@ -1,8 +1,6 @@ -name: quilt_quilt channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::r-quilt=1.0.5=r43h06b5641_0 - r-base=4.3.1 diff --git a/modules/nf-core/quilt/quilt/main.nf b/modules/nf-core/quilt/quilt/main.nf index 901f2021..fd3a67a6 100644 --- a/modules/nf-core/quilt/quilt/main.nf +++ b/modules/nf-core/quilt/quilt/main.nf @@ -35,8 +35,16 @@ process QUILT_QUILT { if (!(args ==~ /.*--seed.*/)) {args += " --seed=1"} """ + if [ -n "$bamlist" ] ; + then + BAM_LIST="$bamlist" + else + printf "%s\\n" $bams | tr -d '[],' > all_files.txt + BAM_LIST="all_files.txt" + fi + QUILT.R \\ - ${list_command}${bamlist} \\ + ${list_command}\$BAM_LIST \\ $genetic_map_file_command \\ $posfile_command \\ $phasefile_command \\ diff --git a/modules/nf-core/quilt/quilt/meta.yml b/modules/nf-core/quilt/quilt/meta.yml index e4653983..958d39cb 100644 --- a/modules/nf-core/quilt/quilt/meta.yml +++ b/modules/nf-core/quilt/quilt/meta.yml @@ -1,5 +1,6 @@ name: "quilt_quilt" -description: QUILT is an R and C++ program for rapid genotype imputation from low-coverage sequence using a large reference panel. +description: QUILT is an R and C++ program for rapid genotype imputation from low-coverage + sequence using a large reference panel. keywords: - imputation - low-coverage @@ -8,99 +9,148 @@ keywords: - vcf tools: - "quilt": - description: "Read aware low coverage whole genome sequence imputation from a reference panel" + description: "Read aware low coverage whole genome sequence imputation from a + reference panel" homepage: "https://github.com/rwdavies/quilt" documentation: "https://github.com/rwdavies/quilt" tool_dev_url: "https://github.com/rwdavies/quilt" doi: "10.1038/s41588-021-00877-0" licence: ["GPL v3"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bams: - type: file - description: (Mandatory) BAM/CRAM files - pattern: "*.{bam,cram,sam}" - - bais: - type: file - description: (Mandatory) BAM/CRAM index files - pattern: "*.{bai}" - - reference_haplotype_file: - type: file - description: (Mandatory) Reference haplotype file in IMPUTE format (file with no header and no rownames, one row per SNP, one column per reference haplotype, space separated, values must be 0 or 1) - pattern: "*.{hap.gz}" - - reference_legend_file: - type: file - description: (Mandatory) Reference haplotype legend file in IMPUTE format (file with one row per SNP, and a header including position for the physical position in 1 based coordinates, a0 for the reference allele, and a1 for the alternate allele). - pattern: "*.{legend.gz}" - - chr: - type: string - description: (Mandatory) What chromosome to run. Should match BAM headers. - - regions_start: - type: integer - description: (Mandatory) When running imputation, where to start from. The 1-based position x is kept if regionStart <= x <= regionEnd. - - regions_end: - type: integer - description: (Mandatory) When running imputation, where to stop. - - buffer: - type: integer - description: Buffer of region to perform imputation over. So imputation is run form regionStart-buffer to regionEnd+buffer, and reported for regionStart to regionEnd, including the bases of regionStart and regionEnd. - - ngen: - type: integer - description: Number of generations since founding or mixing. Note that the algorithm is relatively robust to this. Use nGen = 4 * Ne / K if unsure. - - genetic_map_file: - type: file - description: (Optional) File with genetic map information, a file with 3 white-space delimited entries giving position (1-based), genetic rate map in cM/Mbp, and genetic map in cM. If no file included, rate is based on physical distance and expected rate (expRate). - pattern: "*.{txt.gz}" - - meta2: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - posfile: - type: file - description: (Optional) File with positions of where to impute, lining up one-to-one with genfile. File is tab seperated with no header, one row per SNP, with col 1 = chromosome, col 2 = physical position (sorted from smallest to largest), col 3 = reference base, col 4 = alternate base. Bases are capitalized. - pattern: "*.{txt}" - - phasefile: - type: file - description: (Optional) File with truth phasing results. Supersedes genfile if both options given. File has a header row with a name for each sample, matching what is found in the bam file. Each subject is then a tab seperated column, with 0 = ref and 1 = alt, separated by a vertical bar |, e.g. 0|0 or 0|1. Note therefore this file has one more row than posfile which has no header. - pattern: "*.{txt}" - - meta3: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: (Optional) File with reference genome. - pattern: "*.{txt.gz}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bams: + type: file + description: (Mandatory) BAM/CRAM files + pattern: "*.{bam,cram,sam}" + - bais: + type: file + description: (Mandatory) BAM/CRAM index files + pattern: "*.{bai}" + - bamlist: + type: file + description: (Optional) File with list of BAM/CRAM files to impute. One file + per line. + pattern: "*.{txt}" + - reference_haplotype_file: + type: file + description: (Mandatory) Reference haplotype file in IMPUTE format (file with + no header and no rownames, one row per SNP, one column per reference haplotype, + space separated, values must be 0 or 1) + pattern: "*.{hap.gz}" + - reference_legend_file: + type: file + description: (Mandatory) Reference haplotype legend file in IMPUTE format (file + with one row per SNP, and a header including position for the physical position + in 1 based coordinates, a0 for the reference allele, and a1 for the alternate + allele). + pattern: "*.{legend.gz}" + - chr: + type: string + description: (Mandatory) What chromosome to run. Should match BAM headers. + - regions_start: + type: integer + description: (Mandatory) When running imputation, where to start from. The 1-based + position x is kept if regionStart <= x <= regionEnd. + - regions_end: + type: integer + description: (Mandatory) When running imputation, where to stop. + - ngen: + type: integer + description: Number of generations since founding or mixing. Note that the algorithm + is relatively robust to this. Use nGen = 4 * Ne / K if unsure. + - buffer: + type: integer + description: Buffer of region to perform imputation over. So imputation is run + form regionStart-buffer to regionEnd+buffer, and reported for regionStart + to regionEnd, including the bases of regionStart and regionEnd. + - genetic_map_file: + type: file + description: (Optional) File with genetic map information, a file with 3 white-space + delimited entries giving position (1-based), genetic rate map in cM/Mbp, and + genetic map in cM. If no file included, rate is based on physical distance + and expected rate (expRate). + pattern: "*.{txt.gz}" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - posfile: + type: file + description: (Optional) File with positions of where to impute, lining up one-to-one + with genfile. File is tab seperated with no header, one row per SNP, with + col 1 = chromosome, col 2 = physical position (sorted from smallest to largest), + col 3 = reference base, col 4 = alternate base. Bases are capitalized. + pattern: "*.{txt}" + - phasefile: + type: file + description: (Optional) File with truth phasing results. Supersedes genfile + if both options given. File has a header row with a name for each sample, + matching what is found in the bam file. Each subject is then a tab seperated + column, with 0 = ref and 1 = alt, separated by a vertical bar |, e.g. 0|0 + or 0|1. Note therefore this file has one more row than posfile which has no + header. + pattern: "*.{txt}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: (Optional) File with reference genome. + pattern: "*.{txt.gz}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - vcf: - type: file - description: VCF file with both SNP annotation information and per-sample genotype information. - pattern: "*.{vcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz": + type: file + description: VCF file with both SNP annotation information and per-sample genotype + information. + pattern: "*.{vcf.gz}" - tbi: - type: file - description: TBI file of the VCF. - pattern: "*.{vcf.gz.tbi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz.tbi": + type: file + description: TBI file of the VCF. + pattern: "*.{vcf.gz.tbi}" - rdata: - type: directory - description: Optional directory path to prepared RData file with reference objects (useful with --save_prepared_reference=TRUE). + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - 'RData", type: "dir': + type: directory + description: Optional directory path to prepared RData file with reference objects + (useful with --save_prepared_reference=TRUE). - plots: - type: directory - description: Optional directory path to save plots. + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - 'plots", type: "dir': + type: directory + description: Optional directory path to save plots. + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@atrigila" maintainers: diff --git a/modules/nf-core/quilt/quilt/quilt-quilt.diff b/modules/nf-core/quilt/quilt/quilt-quilt.diff deleted file mode 100644 index f72a7646..00000000 --- a/modules/nf-core/quilt/quilt/quilt-quilt.diff +++ /dev/null @@ -1,35 +0,0 @@ -Changes in module 'nf-core/quilt/quilt' -'modules/nf-core/quilt/quilt/environment.yml' is unchanged -Changes in 'quilt/quilt/main.nf': ---- modules/nf-core/quilt/quilt/main.nf -+++ modules/nf-core/quilt/quilt/main.nf -@@ -8,7 +8,7 @@ - 'biocontainers/r-quilt:1.0.5--r43h06b5641_0' }" - - input: -- tuple val(meta), path(bams), path(bais), path(reference_haplotype_file), path(reference_legend_file), val(chr), val(regions_start), val(regions_end), val(ngen), val(buffer), path(genetic_map_file) -+ tuple val(meta), path(bams), path(bais), path(bamlist), path(reference_haplotype_file), path(reference_legend_file), val(chr), val(regions_start), val(regions_end), val(ngen), val(buffer), path(genetic_map_file) - tuple val(meta2), path(posfile), path(phasefile) - tuple val(meta3), path(fasta) - -@@ -35,10 +35,8 @@ - if (!(args ==~ /.*--seed.*/)) {args += " --seed=1"} - - """ -- printf "%s\\n" $bams | tr -d '[],' > all_files.txt -- - QUILT.R \\ -- ${list_command}all_files.txt \\ -+ ${list_command}${bamlist} \\ - $genetic_map_file_command \\ - $posfile_command \\ - $phasefile_command \\ - -'modules/nf-core/quilt/quilt/meta.yml' is unchanged -'modules/nf-core/quilt/quilt/tests/main.nf.test' is unchanged -'modules/nf-core/quilt/quilt/tests/main.nf.test.snap' is unchanged -'modules/nf-core/quilt/quilt/tests/quilt_default.config' is unchanged -'modules/nf-core/quilt/quilt/tests/quilt_noseed.config' is unchanged -'modules/nf-core/quilt/quilt/tests/quilt_optional.config' is unchanged -'modules/nf-core/quilt/quilt/tests/tags.yml' is unchanged -************************************************************ diff --git a/modules/nf-core/quilt/quilt/tests/main.nf.test b/modules/nf-core/quilt/quilt/tests/main.nf.test index 2d80516d..d2963026 100644 --- a/modules/nf-core/quilt/quilt/tests/main.nf.test +++ b/modules/nf-core/quilt/quilt/tests/main.nf.test @@ -23,7 +23,7 @@ def posfile_phasefile = "[[ id:'test', chr:'chr20' ], [$posfile], [$phasefile]]" def fasta = "[[id:'test'], []]" // Input channel quilt -def ch_input = "[ id:'test', chr:'chr20' ], $bam, $bai, [$reference_haplotype_file], [$reference_legend_file], $chr, $regions_start, $regions_end, $ngen, $buffer" +def ch_input = "[ id:'test', chr:'chr20' ], $bam, $bai, [], [$reference_haplotype_file], [$reference_legend_file], $chr, $regions_start, $regions_end, $ngen, $buffer" def ch_input_gmap = "[$ch_input, [$genetic_map_file]]" def ch_input_nogmap = "[$ch_input, []]" @@ -129,4 +129,44 @@ nextflow_process { } + test("QUILT with bamlist") { + config ("./quilt_default.config") + tag "test" + when { + process { + """ + bamlist = Channel.of( + "NA12878.illumina.1.0.bam", + "NA12878.ont.1.0.bam", + "NA12878.haplotagged.1.0.bam" + ).collectFile(name : 'bamlist.txt', newLine : true) + + ch_input = Channel.of([ + [ id:'test', chr:'chr20' ], + $bam, $bai + ]) + .combine(bamlist) + .map { map, bam, bai, bamlist -> [ + map, bam, bai, bamlist, + [$reference_haplotype_file], [$reference_legend_file], + $chr, $regions_start, $regions_end, $ngen, $buffer, + [$genetic_map_file] + ]} + + input[0] = ch_input + input[1] = $posfile_phasefile + input[2] = $fasta + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + } \ No newline at end of file diff --git a/modules/nf-core/quilt/quilt/tests/main.nf.test.snap b/modules/nf-core/quilt/quilt/tests/main.nf.test.snap index 191b519a..1a07b067 100644 --- a/modules/nf-core/quilt/quilt/tests/main.nf.test.snap +++ b/modules/nf-core/quilt/quilt/tests/main.nf.test.snap @@ -372,5 +372,86 @@ "nextflow": "23.10.1" }, "timestamp": "2024-04-23T17:28:59.999377862" + }, + "QUILT with bamlist": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,9d1da27200354997d7f159d36c4d8166" + ] + ], + "1": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,7d573c34c4e133549623f9b44b27e486" + ] + ], + "2": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ], + "plots": [ + + ], + "rdata": [ + [ + { + "id": "test", + "chr": "chr20" + }, + [ + + ] + ] + ], + "tbi": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz.tbi:md5,7d573c34c4e133549623f9b44b27e486" + ] + ], + "vcf": [ + [ + { + "id": "test", + "chr": "chr20" + }, + "quilt.chr20.2000001.2100000.vcf.gz:md5,9d1da27200354997d7f159d36c4d8166" + ] + ], + "versions": [ + "versions.yml:md5,6d07cd60389ff6981a44004872bd16b7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T17:05:26.881048883" } } \ No newline at end of file From 2c30110b555d6ed5b5fd4e2acb0a4cad901d20a5 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:17:54 +0100 Subject: [PATCH 18/25] Update samtools --- .../nf-core/samtools/coverage/environment.yml | 8 +- modules/nf-core/samtools/coverage/main.nf | 4 +- modules/nf-core/samtools/coverage/meta.yml | 85 +++--- .../samtools/coverage/samtools-coverage.diff | 6 + .../samtools/coverage/tests/main.nf.test.snap | 30 +- .../nf-core/samtools/depth/environment.yml | 8 +- modules/nf-core/samtools/depth/main.nf | 4 +- modules/nf-core/samtools/depth/meta.yml | 68 +++-- .../samtools/depth/samtools-depth.diff | 7 +- .../nf-core/samtools/depth/tests/main.nf.test | 62 ++++ .../samtools/depth/tests/main.nf.test.snap | 72 +++++ .../nf-core/samtools/faidx/environment.yml | 10 +- modules/nf-core/samtools/faidx/main.nf | 4 +- modules/nf-core/samtools/faidx/meta.yml | 85 +++--- .../samtools/faidx/tests/main.nf.test.snap | 50 ++-- .../nf-core/samtools/index/environment.yml | 8 +- modules/nf-core/samtools/index/main.nf | 11 +- modules/nf-core/samtools/index/meta.yml | 68 +++-- .../nf-core/samtools/index/tests/main.nf.test | 87 ++++-- .../samtools/index/tests/main.nf.test.snap | 264 +++++++++++++++--- .../nf-core/samtools/merge/environment.yml | 8 +- modules/nf-core/samtools/merge/main.nf | 4 +- modules/nf-core/samtools/merge/meta.yml | 117 ++++---- .../samtools/merge/samtools-merge.diff | 9 +- .../samtools/merge/tests/main.nf.test.snap | 32 +-- .../nf-core/samtools/reheader/environment.yml | 8 +- modules/nf-core/samtools/reheader/main.nf | 6 +- modules/nf-core/samtools/reheader/meta.yml | 46 +-- .../samtools/reheader/samtools-reheader.diff | 9 +- .../samtools/reheader/tests/chrdel.config | 6 + .../samtools/reheader/tests/main.nf.test | 80 ++++++ .../samtools/reheader/tests/main.nf.test.snap | 107 +++++++ .../samtools/reheader/tests/rgdel.config | 6 + modules/nf-core/samtools/view/environment.yml | 8 +- modules/nf-core/samtools/view/main.nf | 6 +- modules/nf-core/samtools/view/meta.yml | 163 +++++++---- .../nf-core/samtools/view/samtools-view.diff | 16 +- .../samtools/view/tests/main.nf.test.snap | 66 +++-- .../local/bam_downsample_samtools/main.nf | 2 +- 39 files changed, 1183 insertions(+), 457 deletions(-) create mode 100644 modules/nf-core/samtools/depth/tests/main.nf.test create mode 100644 modules/nf-core/samtools/depth/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/reheader/tests/chrdel.config create mode 100644 modules/nf-core/samtools/reheader/tests/main.nf.test create mode 100644 modules/nf-core/samtools/reheader/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/reheader/tests/rgdel.config diff --git a/modules/nf-core/samtools/coverage/environment.yml b/modules/nf-core/samtools/coverage/environment.yml index 74461be7..62054fc9 100644 --- a/modules/nf-core/samtools/coverage/environment.yml +++ b/modules/nf-core/samtools/coverage/environment.yml @@ -1,8 +1,8 @@ -name: samtools_coverage +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/coverage/main.nf b/modules/nf-core/samtools/coverage/main.nf index b0303610..060c9298 100644 --- a/modules/nf-core/samtools/coverage/main.nf +++ b/modules/nf-core/samtools/coverage/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_COVERAGE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/samtools/coverage/meta.yml b/modules/nf-core/samtools/coverage/meta.yml index e74082d9..fb9ba6f3 100644 --- a/modules/nf-core/samtools/coverage/meta.yml +++ b/modules/nf-core/samtools/coverage/meta.yml @@ -14,47 +14,56 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - input_index: - type: file - description: BAM/CRAM index file - pattern: "*.{bai,crai}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference genome file - pattern: "*.{fa,fasta}" - - fai: - type: file - description: Reference genome index file - pattern: "*.fai" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference genome file + pattern: "*.{fa,fasta}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fai: + type: file + description: Reference genome index file + pattern: "*.fai" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - coverage: - type: file - description: Tabulated text containing the coverage at each position or region or an ASCII-art histogram (with --histogram). - pattern: "*.txt" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Tabulated text containing the coverage at each position or region + or an ASCII-art histogram (with --histogram). + pattern: "*.txt" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@LouisLeNezet" maintainers: diff --git a/modules/nf-core/samtools/coverage/samtools-coverage.diff b/modules/nf-core/samtools/coverage/samtools-coverage.diff index a400266c..14c9be18 100644 --- a/modules/nf-core/samtools/coverage/samtools-coverage.diff +++ b/modules/nf-core/samtools/coverage/samtools-coverage.diff @@ -1,4 +1,6 @@ Changes in module 'nf-core/samtools/coverage' +'modules/nf-core/samtools/coverage/environment.yml' is unchanged +Changes in 'samtools/coverage/main.nf': --- modules/nf-core/samtools/coverage/main.nf +++ modules/nf-core/samtools/coverage/main.nf @@ -9,8 +9,7 @@ @@ -20,4 +22,8 @@ Changes in module 'nf-core/samtools/coverage' cat <<-END_VERSIONS > versions.yml "${task.process}": +'modules/nf-core/samtools/coverage/meta.yml' is unchanged +'modules/nf-core/samtools/coverage/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/coverage/tests/main.nf.test.snap' is unchanged +'modules/nf-core/samtools/coverage/tests/tags.yml' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/coverage/tests/main.nf.test.snap b/modules/nf-core/samtools/coverage/tests/main.nf.test.snap index 63e26051..b9ddb18d 100644 --- a/modules/nf-core/samtools/coverage/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/coverage/tests/main.nf.test.snap @@ -12,7 +12,7 @@ ] ], "1": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -24,15 +24,15 @@ ] ], "versions": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:41:47.4359515" + "timestamp": "2024-09-16T07:53:42.773351407" }, "test_samtools_coverage_bam": { "content": [ @@ -47,7 +47,7 @@ ] ], "1": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -59,15 +59,15 @@ ] ], "versions": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:41:36.39684853" + "timestamp": "2024-09-16T07:53:22.798338025" }, "test_samtools_coverage_cram": { "content": [ @@ -82,7 +82,7 @@ ] ], "1": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -94,14 +94,14 @@ ] ], "versions": [ - "versions.yml:md5,16dec2ad2e9aa7cc174e86b03ec99984" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:41:42.036690983" + "timestamp": "2024-09-16T07:53:32.409876082" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/depth/environment.yml b/modules/nf-core/samtools/depth/environment.yml index 70975f2a..62054fc9 100644 --- a/modules/nf-core/samtools/depth/environment.yml +++ b/modules/nf-core/samtools/depth/environment.yml @@ -1,8 +1,8 @@ -name: samtools_depth +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/depth/main.nf b/modules/nf-core/samtools/depth/main.nf index e8810398..bb11306b 100644 --- a/modules/nf-core/samtools/depth/main.nf +++ b/modules/nf-core/samtools/depth/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_DEPTH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta1), path(bam), path(bai) diff --git a/modules/nf-core/samtools/depth/meta.yml b/modules/nf-core/samtools/depth/meta.yml index bc51f264..2acd645d 100644 --- a/modules/nf-core/samtools/depth/meta.yml +++ b/modules/nf-core/samtools/depth/meta.yml @@ -7,45 +7,51 @@ keywords: - coverage tools: - samtools: - description: Tools for dealing with SAM, BAM and CRAM files; samtools depth – computes the read depth at each position or region + description: Tools for dealing with SAM, BAM and CRAM files; samtools depth – + computes the read depth at each position or region homepage: http://www.htslib.org documentation: http://www.htslib.org/doc/samtools-depth.html tool_dev_url: https://github.com/samtools/samtools doi: "10.1093/bioinformatics/btp352" licence: ["MIT"] + identifier: biotools:samtools input: - - meta1: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - meta2: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test' ] - - intervals: - type: file - description: list of positions or regions in specified bed file - pattern: "*.{bed}" + - - meta1: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - intervals: + type: file + description: list of positions or regions in specified bed file + pattern: "*.{bed}" output: - - meta1: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - tsv: - type: file - description: The output of samtools depth has three columns - the name of the contig or chromosome, the position and the number of reads aligned at that position - pattern: "*.{tsv}" + - meta1: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tsv": + type: file + description: The output of samtools depth has three columns - the name of the + contig or chromosome, the position and the number of reads aligned at that + position + pattern: "*.{tsv}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louperelo" - "@nevinwu" diff --git a/modules/nf-core/samtools/depth/samtools-depth.diff b/modules/nf-core/samtools/depth/samtools-depth.diff index 523a63e0..389b7650 100644 --- a/modules/nf-core/samtools/depth/samtools-depth.diff +++ b/modules/nf-core/samtools/depth/samtools-depth.diff @@ -1,8 +1,10 @@ Changes in module 'nf-core/samtools/depth' +'modules/nf-core/samtools/depth/environment.yml' is unchanged +Changes in 'samtools/depth/main.nf': --- modules/nf-core/samtools/depth/main.nf +++ modules/nf-core/samtools/depth/main.nf @@ -8,7 +8,7 @@ - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: - tuple val(meta1), path(bam) @@ -11,4 +13,7 @@ Changes in module 'nf-core/samtools/depth' output: +'modules/nf-core/samtools/depth/meta.yml' is unchanged +'modules/nf-core/samtools/depth/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/depth/tests/main.nf.test.snap' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/depth/tests/main.nf.test b/modules/nf-core/samtools/depth/tests/main.nf.test new file mode 100644 index 00000000..ddacb540 --- /dev/null +++ b/modules/nf-core/samtools/depth/tests/main.nf.test @@ -0,0 +1,62 @@ + +nextflow_process { + + name "Test Process SAMTOOLS_DEPTH" + script "../main.nf" + process "SAMTOOLS_DEPTH" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/depth" + + test("test-samtools-depth") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + input[1] = [[],[]] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-samtools-depth-intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'bed' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/samtools/depth/tests/main.nf.test.snap b/modules/nf-core/samtools/depth/tests/main.nf.test.snap new file mode 100644 index 00000000..f5523cbf --- /dev/null +++ b/modules/nf-core/samtools/depth/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "test-samtools-depth-intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,a89e2f8e1b66356c7500599fcadb8784" + ] + ], + "1": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,a89e2f8e1b66356c7500599fcadb8784" + ] + ], + "versions": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T07:55:28.207892316" + }, + "test-samtools-depth": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,722d2c060944d6b96ae5ae00d8074657" + ] + ], + "1": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,722d2c060944d6b96ae5ae00d8074657" + ] + ], + "versions": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T07:55:17.233534429" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml index f8450fa5..62054fc9 100644 --- a/modules/nf-core/samtools/faidx/environment.yml +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -1,10 +1,8 @@ -name: samtools_faidx - +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults - dependencies: - - bioconda::htslib=1.20 - - bioconda::samtools=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index bdcdbc95..28c0a81c 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FAIDX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml index f3c25de2..6721b2cb 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -14,47 +14,62 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fasta: - type: file - description: FASTA file - pattern: "*.{fa,fasta}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" + - - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fasta: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - fa: - type: file - description: FASTA file - pattern: "*.{fa}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{fa,fasta}": + type: file + description: FASTA file + pattern: "*.{fa}" - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fai": + type: file + description: FASTA index file + pattern: "*.{fai}" - gzi: - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.gzi": + type: file + description: Optional gzip index file for compressed inputs + pattern: "*.gzi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap index 3223b72b..1bbb3ec2 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -18,7 +18,7 @@ ], "3": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -36,15 +36,15 @@ ], "versions": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:14.779784761" + "timestamp": "2024-09-16T07:57:47.450887871" }, "test_samtools_faidx_bgzip": { "content": [ @@ -71,7 +71,7 @@ ] ], "3": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -95,15 +95,15 @@ ] ], "versions": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:20.256633877" + "timestamp": "2024-09-16T07:58:04.804905659" }, "test_samtools_faidx_fasta": { "content": [ @@ -124,7 +124,7 @@ ], "3": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ [ @@ -142,15 +142,15 @@ ], "versions": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:25.632577273" + "timestamp": "2024-09-16T07:58:23.831268154" }, "test_samtools_faidx_stub_fasta": { "content": [ @@ -171,7 +171,7 @@ ], "3": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ [ @@ -189,15 +189,15 @@ ], "versions": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:31.058424849" + "timestamp": "2024-09-16T07:58:35.600243706" }, "test_samtools_faidx_stub_fai": { "content": [ @@ -218,7 +218,7 @@ ], "3": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -236,14 +236,14 @@ ], "versions": [ - "versions.yml:md5,2db78952923a61e05d50b95518b21856" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:36.479929617" + "timestamp": "2024-09-16T07:58:54.705460167" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index 260d516b..62054fc9 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -1,8 +1,8 @@ -name: samtools_index +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index b523c21b..31175610 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input) @@ -35,10 +35,11 @@ process SAMTOOLS_INDEX { """ stub: + def args = task.ext.args ?: '' + def extension = file(input).getExtension() == 'cram' ? + "crai" : args.contains("-c") ? "csi" : "bai" """ - touch ${input}.bai - touch ${input}.crai - touch ${input}.csi + touch ${input}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index 01a4ee03..db8df0d5 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -15,38 +15,52 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: input file output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" - - crai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" - csi: - type: file - description: CSI index file - pattern: "*.{csi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: CSI index file + pattern: "*.{csi}" + - crai: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.crai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test index bb7756d1..ca34fb5c 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -9,11 +9,7 @@ nextflow_process { tag "samtools/index" test("bai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -27,18 +23,13 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.bai).match("bai") }, - { assert snapshot(process.out.versions).match("bai_versions") } + { assert snapshot(process.out).match() } ) } } test("crai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -52,20 +43,83 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.crai).match("crai") }, - { assert snapshot(process.out.versions).match("crai_versions") } + { assert snapshot(process.out).match() } ) } } test("csi") { - config "./csi.nextflow.config" when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.csi[0][1]).name, + process.out.versions + ).match() } + ) + } + } + + test("bai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("crai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("csi - stub") { + options "-stub" + config "./csi.nextflow.config" + + when { process { """ input[0] = Channel.of([ @@ -79,8 +133,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert path(process.out.csi.get(0).get(1)).exists() }, - { assert snapshot(process.out.versions).match("csi_versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap index 52756e85..72d65e81 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -1,74 +1,250 @@ { - "crai_versions": { + "csi - stub": { "content": [ - [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:04.203740976" + "timestamp": "2024-09-16T08:21:25.261127166" }, - "csi_versions": { + "crai - stub": { "content": [ - [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:09.57475878" + "timestamp": "2024-09-16T08:21:12.653194876" }, - "crai": { + "bai - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:41:38.446424" + "timestamp": "2024-09-16T08:21:01.854932651" }, - "bai": { + "csi": { "content": [ + "test.paired_end.sorted.bam.csi", [ - [ - { - "id": "test", - "single_end": false - }, - "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" - ] + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:40:46.579747" + "timestamp": "2024-09-16T08:20:51.485364222" }, - "bai_versions": { + "crai": { "content": [ - [ - "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" - ] + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T08:20:40.518873972" + }, + "bai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:41:57.929287369" + "timestamp": "2024-09-16T08:20:21.184050361" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/merge/environment.yml b/modules/nf-core/samtools/merge/environment.yml index cd366d6d..62054fc9 100644 --- a/modules/nf-core/samtools/merge/environment.yml +++ b/modules/nf-core/samtools/merge/environment.yml @@ -1,8 +1,8 @@ -name: samtools_merge +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/merge/main.nf b/modules/nf-core/samtools/merge/main.nf index 800bc633..d01d5e3f 100644 --- a/modules/nf-core/samtools/merge/main.nf +++ b/modules/nf-core/samtools/merge/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_MERGE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input_files, stageAs: "?/*"), path(index, stageAs: "?/*") diff --git a/modules/nf-core/samtools/merge/meta.yml b/modules/nf-core/samtools/merge/meta.yml index 2e8f3dbb..235aa219 100644 --- a/modules/nf-core/samtools/merge/meta.yml +++ b/modules/nf-core/samtools/merge/meta.yml @@ -15,60 +15,81 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input_files: - type: file - description: BAM/CRAM file - pattern: "*.{bam,cram,sam}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference file the CRAM was created with (optional) - pattern: "*.{fasta,fa}" - - meta3: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fai: - type: file - description: Index of the reference file the CRAM was created with (optional) - pattern: "*.fai" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_files: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram,sam}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference file the CRAM was created with (optional) + pattern: "*.{fasta,fa}" + - - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fai: + type: file + description: Index of the reference file the CRAM was created with (optional) + pattern: "*.fai" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bam: - type: file - description: BAM file - pattern: "*.{bam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.bam: + type: file + description: BAM file + pattern: "*.{bam}" - cram: - type: file - description: CRAM file - pattern: "*.{cram}" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.cram: + type: file + description: CRAM file + pattern: "*.{cram}" - csi: - type: file - description: BAM index file (optional) - pattern: "*.csi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: BAM index file (optional) + pattern: "*.csi" - crai: - type: file - description: CRAM index file (optional) - pattern: "*.crai" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.crai": + type: file + description: CRAM index file (optional) + pattern: "*.crai" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@yuukiiwa " diff --git a/modules/nf-core/samtools/merge/samtools-merge.diff b/modules/nf-core/samtools/merge/samtools-merge.diff index 4cb87e1c..c53a01b8 100644 --- a/modules/nf-core/samtools/merge/samtools-merge.diff +++ b/modules/nf-core/samtools/merge/samtools-merge.diff @@ -1,8 +1,10 @@ Changes in module 'nf-core/samtools/merge' +'modules/nf-core/samtools/merge/environment.yml' is unchanged +Changes in 'samtools/merge/main.nf': --- modules/nf-core/samtools/merge/main.nf +++ modules/nf-core/samtools/merge/main.nf @@ -8,9 +8,8 @@ - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: - tuple val(meta), path(input_files, stageAs: "?/*") @@ -14,4 +16,9 @@ Changes in module 'nf-core/samtools/merge' output: tuple val(meta), path("${prefix}.bam") , optional:true, emit: bam +'modules/nf-core/samtools/merge/meta.yml' is unchanged +'modules/nf-core/samtools/merge/tests/index.config' is unchanged +'modules/nf-core/samtools/merge/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/merge/tests/main.nf.test.snap' is unchanged +'modules/nf-core/samtools/merge/tests/tags.yml' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/merge/tests/main.nf.test.snap b/modules/nf-core/samtools/merge/tests/main.nf.test.snap index 17bc846f..0a41e01a 100644 --- a/modules/nf-core/samtools/merge/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/merge/tests/main.nf.test.snap @@ -80,14 +80,14 @@ "bam_versions": { "content": [ [ - "versions.yml:md5,84dab54b9812780df48f5cecef690c34" + "versions.yml:md5,d51d18a97513e370e43f0c891c51dfc4" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:46:35.851936597" + "timestamp": "2024-09-16T09:16:30.476887194" }, "bams_csi": { "content": [ @@ -124,14 +124,14 @@ "bams_stub_versions": { "content": [ [ - "versions.yml:md5,84dab54b9812780df48f5cecef690c34" + "versions.yml:md5,d51d18a97513e370e43f0c891c51dfc4" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:46:41.405707643" + "timestamp": "2024-09-16T09:16:52.203823961" }, "bam_cram": { "content": [ @@ -158,14 +158,14 @@ "bams_versions": { "content": [ [ - "versions.yml:md5,84dab54b9812780df48f5cecef690c34" + "versions.yml:md5,d51d18a97513e370e43f0c891c51dfc4" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:45:51.695689923" + "timestamp": "2024-09-16T08:29:57.524363148" }, "crams_bam": { "content": [ @@ -182,14 +182,14 @@ "crams_versions": { "content": [ [ - "versions.yml:md5,84dab54b9812780df48f5cecef690c34" + "versions.yml:md5,d51d18a97513e370e43f0c891c51dfc4" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:46:30.185392319" + "timestamp": "2024-09-16T09:16:06.977096207" }, "bam_csi": { "content": [ diff --git a/modules/nf-core/samtools/reheader/environment.yml b/modules/nf-core/samtools/reheader/environment.yml index aa9c798d..62054fc9 100644 --- a/modules/nf-core/samtools/reheader/environment.yml +++ b/modules/nf-core/samtools/reheader/environment.yml @@ -1,8 +1,8 @@ -name: samtools_reheader +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/reheader/main.nf b/modules/nf-core/samtools/reheader/main.nf index 0baa833d..b4ba902f 100644 --- a/modules/nf-core/samtools/reheader/main.nf +++ b/modules/nf-core/samtools/reheader/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_REHEADER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0': - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0': + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai), val(cmd) @@ -43,7 +43,7 @@ process SAMTOOLS_REHEADER { """ touch ${prefix}.bam - ccat <<-END_VERSIONS > versions.yml + cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS diff --git a/modules/nf-core/samtools/reheader/meta.yml b/modules/nf-core/samtools/reheader/meta.yml index a5e15914..e9699f56 100644 --- a/modules/nf-core/samtools/reheader/meta.yml +++ b/modules/nf-core/samtools/reheader/meta.yml @@ -1,4 +1,3 @@ ---- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json name: "samtools_reheader" @@ -20,30 +19,33 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test', single_end:false ]` - - bam: - type: file - description: BAM/CRAM file to be reheaded - pattern: "*.{bam,cram}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - bam: + type: file + description: BAM/CRAM file to be reheaded + pattern: "*.{bam,cram}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test', single_end:false ]` - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - bam: - type: file - description: Reheaded BAM/CRAM file - pattern: "*.{bam,cram}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.bam": + type: file + description: Reheaded BAM/CRAM file + pattern: "*.{bam,cram}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: diff --git a/modules/nf-core/samtools/reheader/samtools-reheader.diff b/modules/nf-core/samtools/reheader/samtools-reheader.diff index 7a04de7f..1c080b8d 100644 --- a/modules/nf-core/samtools/reheader/samtools-reheader.diff +++ b/modules/nf-core/samtools/reheader/samtools-reheader.diff @@ -1,8 +1,10 @@ Changes in module 'nf-core/samtools/reheader' +'modules/nf-core/samtools/reheader/environment.yml' is unchanged +Changes in 'samtools/reheader/main.nf': --- modules/nf-core/samtools/reheader/main.nf +++ modules/nf-core/samtools/reheader/main.nf @@ -8,7 +8,7 @@ - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: - tuple val(meta), path(bam) @@ -25,4 +27,9 @@ Changes in module 'nf-core/samtools/reheader' $bam \\ > ${prefix}.bam +'modules/nf-core/samtools/reheader/meta.yml' is unchanged +'modules/nf-core/samtools/reheader/tests/chrdel.config' is unchanged +'modules/nf-core/samtools/reheader/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/reheader/tests/main.nf.test.snap' is unchanged +'modules/nf-core/samtools/reheader/tests/rgdel.config' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/reheader/tests/chrdel.config b/modules/nf-core/samtools/reheader/tests/chrdel.config new file mode 100644 index 00000000..7b5da49a --- /dev/null +++ b/modules/nf-core/samtools/reheader/tests/chrdel.config @@ -0,0 +1,6 @@ +process { + withName: SAMTOOLS_REHEADER { + ext.args = "--command 'sed -E \"s/^(@SQ.*)(\\tSN:)chr/\\1\\2/\"'" + ext.prefix = { "${meta.id}_chrDel" } + } +} diff --git a/modules/nf-core/samtools/reheader/tests/main.nf.test b/modules/nf-core/samtools/reheader/tests/main.nf.test new file mode 100644 index 00000000..53142525 --- /dev/null +++ b/modules/nf-core/samtools/reheader/tests/main.nf.test @@ -0,0 +1,80 @@ +nextflow_process { + + name "Test Process SAMTOOLS_REHEADER" + script "../main.nf" + process "SAMTOOLS_REHEADER" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/reheader" + + test("homo_sapiens - chrdel") { + config "./chrdel.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - rgdel") { + config "./rgdel.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/samtools/reheader/tests/main.nf.test.snap b/modules/nf-core/samtools/reheader/tests/main.nf.test.snap new file mode 100644 index 00000000..885ee350 --- /dev/null +++ b/modules/nf-core/samtools/reheader/tests/main.nf.test.snap @@ -0,0 +1,107 @@ +{ + "homo_sapiens - chrdel": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_chrDel.bam:md5,957d2d542fb9bbd6511df9c0b5069ce4" + ] + ], + "1": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test_chrDel.bam:md5,957d2d542fb9bbd6511df9c0b5069ce4" + ] + ], + "versions": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-17T08:28:17.577422205" + }, + "homo_sapiens - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-17T08:26:34.99215454" + }, + "homo_sapiens - rgdel": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_rgDel.bam:md5,02e7512a76fd9df1905ee90558365b0c" + ] + ], + "1": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test_rgDel.bam:md5,02e7512a76fd9df1905ee90558365b0c" + ] + ], + "versions": [ + "versions.yml:md5,3ffd4092d9f7ad731794ab8691ea79af" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-17T08:23:30.403448169" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/reheader/tests/rgdel.config b/modules/nf-core/samtools/reheader/tests/rgdel.config new file mode 100644 index 00000000..03a2dc85 --- /dev/null +++ b/modules/nf-core/samtools/reheader/tests/rgdel.config @@ -0,0 +1,6 @@ +process { + withName: SAMTOOLS_REHEADER { + ext.args = "--command 'grep -v ^@RG'" + ext.prefix = { "${meta.id}_rgDel" } + } +} diff --git a/modules/nf-core/samtools/view/environment.yml b/modules/nf-core/samtools/view/environment.yml index 150c3777..62054fc9 100644 --- a/modules/nf-core/samtools/view/environment.yml +++ b/modules/nf-core/samtools/view/environment.yml @@ -1,8 +1,8 @@ -name: samtools_view +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.20 - - bioconda::htslib=1.20 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index 209ba6d5..5260dde8 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -4,12 +4,12 @@ process SAMTOOLS_VIEW { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : - 'biocontainers/samtools:1.20--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input), path(index), val(region), val(subsample) - tuple val(meta2), path(fasta) + tuple val(meta2), path(fasta), path(fai) path qname output: diff --git a/modules/nf-core/samtools/view/meta.yml b/modules/nf-core/samtools/view/meta.yml index 27be60d0..caa7b015 100644 --- a/modules/nf-core/samtools/view/meta.yml +++ b/modules/nf-core/samtools/view/meta.yml @@ -15,77 +15,120 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - index: - type: file - description: BAM.BAI/BAM.CSI/CRAM.CRAI file (optional) - pattern: "*.{.bai,.csi,.crai}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fasta: - type: file - description: Reference file the CRAM was created with (optional) - pattern: "*.{fasta,fa}" - - qname: - type: file - description: Optional file with read names to output only select alignments - pattern: "*.{txt,list}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - index: + type: file + description: BAM.BAI/BAM.CSI/CRAM.CRAI file (optional) + pattern: "*.{.bai,.csi,.crai}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fasta: + type: file + description: Reference file the CRAM was created with (optional) + pattern: "*.{fasta,fa}" + - - qname: + type: file + description: Optional file with read names to output only select alignments + pattern: "*.{txt,list}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bam: - type: file - description: optional filtered/converted BAM file - pattern: "*.{bam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.bam: + type: file + description: optional filtered/converted BAM file + pattern: "*.{bam}" - cram: - type: file - description: optional filtered/converted CRAM file - pattern: "*.{cram}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.cram: + type: file + description: optional filtered/converted CRAM file + pattern: "*.{cram}" - sam: - type: file - description: optional filtered/converted SAM file - pattern: "*.{sam}" - # bai, csi, and crai are created with `--write-index` + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.sam: + type: file + description: optional filtered/converted SAM file + pattern: "*.{sam}" - bai: - type: file - description: optional BAM file index - pattern: "*.{bai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${file_type}.bai: + type: file + description: optional BAM file index + pattern: "*.{bai}" - csi: - type: file - description: optional tabix BAM file index - pattern: "*.{csi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${file_type}.csi: + type: file + description: optional tabix BAM file index + pattern: "*.{csi}" - crai: - type: file - description: optional CRAM file index - pattern: "*.{crai}" - # unselected and unselected_index are created when passing a qname + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${file_type}.crai: + type: file + description: optional CRAM file index + pattern: "*.{crai}" - unselected: - type: file - description: optional file with unselected alignments - pattern: "*.unselected.{bam,cram,sam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.unselected.${file_type}: + type: file + description: optional file with unselected alignments + pattern: "*.unselected.{bam,cram,sam}" - unselected_index: - type: file - description: index for the "unselected" file - pattern: "*.unselected.{bai,csi,crai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.unselected.${file_type}.{bai,csi,crsi}: + type: file + description: index for the "unselected" file + pattern: "*.unselected.{bai,csi,crai}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@joseespinosa" diff --git a/modules/nf-core/samtools/view/samtools-view.diff b/modules/nf-core/samtools/view/samtools-view.diff index 05d59648..d6c86ad3 100644 --- a/modules/nf-core/samtools/view/samtools-view.diff +++ b/modules/nf-core/samtools/view/samtools-view.diff @@ -1,15 +1,19 @@ Changes in module 'nf-core/samtools/view' +'modules/nf-core/samtools/view/environment.yml' is unchanged +Changes in 'samtools/view/main.nf': --- modules/nf-core/samtools/view/main.nf +++ modules/nf-core/samtools/view/main.nf -@@ -8,7 +8,7 @@ - 'biocontainers/samtools:1.20--h50ea8bc_0' }" +@@ -8,8 +8,8 @@ + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: - tuple val(meta), path(input), path(index) +- tuple val(meta2), path(fasta) + tuple val(meta), path(input), path(index), val(region), val(subsample) - tuple val(meta2), path(fasta) ++ tuple val(meta2), path(fasta), path(fai) path qname + output: @@ -31,6 +31,8 @@ def args2 = task.ext.args2 ?: '' prefix = task.ext.prefix ?: "${meta.id}" @@ -33,4 +37,10 @@ Changes in module 'nf-core/samtools/view' cat <<-END_VERSIONS > versions.yml "${task.process}": +'modules/nf-core/samtools/view/meta.yml' is unchanged +'modules/nf-core/samtools/view/tests/bam.config' is unchanged +'modules/nf-core/samtools/view/tests/bam_index.config' is unchanged +'modules/nf-core/samtools/view/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/view/tests/main.nf.test.snap' is unchanged +'modules/nf-core/samtools/view/tests/tags.yml' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/view/tests/main.nf.test.snap b/modules/nf-core/samtools/view/tests/main.nf.test.snap index 6bcce9fe..63849b03 100644 --- a/modules/nf-core/samtools/view/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/view/tests/main.nf.test.snap @@ -56,14 +56,14 @@ "bam_stub_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:43:20.390692583" + "timestamp": "2024-09-16T09:26:24.461775464" }, "cram_to_bam_index_cram": { "content": [ @@ -169,6 +169,16 @@ }, "timestamp": "2024-02-12T19:37:56.490286" }, + "cram_to_bam_index_qname_unselected_csi": { + "content": [ + "test.unselected.bam.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.328458" + }, "bam_csi": { "content": [ [ @@ -208,14 +218,14 @@ "cram_to_bam_index_qname_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:43:15.007493874" + "timestamp": "2024-09-16T09:25:51.953436682" }, "cram_to_bam_bam": { "content": [ @@ -240,14 +250,14 @@ "cram_to_bam_index_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:43:09.472376824" + "timestamp": "2024-09-16T09:25:14.475388399" }, "cram_to_bam_bai": { "content": [ @@ -264,14 +274,14 @@ "cram_to_bam_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:43:04.080050906" + "timestamp": "2024-09-16T09:24:49.673441798" }, "cram_bam": { "content": [ @@ -378,14 +388,14 @@ "bam_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-05-28T15:42:52.978954857" + "timestamp": "2024-09-16T09:23:27.151650338" }, "cram_to_bam_index_qname_cram": { "content": [ @@ -450,14 +460,24 @@ "cram_versions": { "content": [ [ - "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T09:24:12.95416913" + }, + "cram_to_bam_index_qname_unselected": { + "content": [ + "test.unselected.bam" + ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "23.04.3" }, - "timestamp": "2024-05-28T15:42:58.400776109" + "timestamp": "2024-02-12T19:38:23.322874" }, "bam_sam": { "content": [ diff --git a/subworkflows/local/bam_downsample_samtools/main.nf b/subworkflows/local/bam_downsample_samtools/main.nf index d2501569..9aaa0f65 100644 --- a/subworkflows/local/bam_downsample_samtools/main.nf +++ b/subworkflows/local/bam_downsample_samtools/main.nf @@ -42,7 +42,7 @@ workflow BAM_DOWNSAMPLE_SAMTOOLS { // Downsample SAMTOOLS_VIEW( ch_input_downsample, - ch_fasta.map{ metaG, fasta, fai -> [metaG, fasta] }, + ch_fasta, [] ) ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions.first()) From 49d8960f1e4de5d06f5a59c167c85d5f5de1b452 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:19:14 +0100 Subject: [PATCH 19/25] Update shapeit5 --- modules.json | 30 ++++----- .../nf-core/shapeit5/ligate/environment.yml | 2 - modules/nf-core/shapeit5/ligate/meta.yml | 61 ++++++++++--------- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/modules.json b/modules.json index 3315dc4d..a5f29005 100644 --- a/modules.json +++ b/modules.json @@ -88,34 +88,34 @@ }, "glimpse2/chunk": { "branch": "master", - "git_sha": "d735292b38270792799d18d3b4948ea4f815b5a7", + "git_sha": "cc64e71652f67ce627064af51008fe0a00850987", "installed_by": ["modules"], "patch": "modules/nf-core/glimpse2/chunk/glimpse2-chunk.diff" }, "glimpse2/concordance": { "branch": "master", - "git_sha": "d735292b38270792799d18d3b4948ea4f815b5a7", + "git_sha": "cc64e71652f67ce627064af51008fe0a00850987", "installed_by": ["modules"] }, "glimpse2/ligate": { "branch": "master", - "git_sha": "d735292b38270792799d18d3b4948ea4f815b5a7", + "git_sha": "cc64e71652f67ce627064af51008fe0a00850987", "installed_by": ["modules"] }, "glimpse2/phase": { "branch": "master", - "git_sha": "6a5a6e1dedc88826744e8117c1974dcca4829d8f", + "git_sha": "cc64e71652f67ce627064af51008fe0a00850987", "installed_by": ["modules"], "patch": "modules/nf-core/glimpse2/phase/glimpse2-phase.diff" }, "glimpse2/splitreference": { "branch": "master", - "git_sha": "d735292b38270792799d18d3b4948ea4f815b5a7", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "gunzip": { "branch": "master", - "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "multiqc": { @@ -125,53 +125,53 @@ }, "quilt/quilt": { "branch": "master", - "git_sha": "46265545d61e7f482adf40de941cc9a94e479bbe", + "git_sha": "82dcdacf8aa932e6683e15a8992ed1cd6fcb174f", "installed_by": ["modules"], "patch": "modules/nf-core/quilt/quilt/quilt-quilt.diff" }, "samtools/coverage": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"], "patch": "modules/nf-core/samtools/coverage/samtools-coverage.diff" }, "samtools/depth": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"], "patch": "modules/nf-core/samtools/depth/samtools-depth.diff" }, "samtools/faidx": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", - "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"], "patch": "modules/nf-core/samtools/merge/samtools-merge.diff" }, "samtools/reheader": { "branch": "master", - "git_sha": "d5622b05dd40dd3a4c9739151606d473266f5313", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"], "patch": "modules/nf-core/samtools/reheader/samtools-reheader.diff" }, "samtools/view": { "branch": "master", - "git_sha": "6c2309aaec566c0d44a6cf14d4b2d0c51afe2e91", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"], "patch": "modules/nf-core/samtools/view/samtools-view.diff" }, "shapeit5/ligate": { "branch": "master", - "git_sha": "dcf17cc0ed8fd5ea57e61a13e0147cddb5c1ee30", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["vcf_phase_shapeit5"] }, "shapeit5/phasecommon": { diff --git a/modules/nf-core/shapeit5/ligate/environment.yml b/modules/nf-core/shapeit5/ligate/environment.yml index d4c71302..7b8e63bb 100644 --- a/modules/nf-core/shapeit5/ligate/environment.yml +++ b/modules/nf-core/shapeit5/ligate/environment.yml @@ -1,7 +1,5 @@ -name: shapeit5_ligate channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::shapeit5=1.0.0 diff --git a/modules/nf-core/shapeit5/ligate/meta.yml b/modules/nf-core/shapeit5/ligate/meta.yml index ed1e5e9e..a8d6db14 100644 --- a/modules/nf-core/shapeit5/ligate/meta.yml +++ b/modules/nf-core/shapeit5/ligate/meta.yml @@ -14,38 +14,41 @@ tools: tool_dev_url: "https://github.com/odelaneau/shapeit5" doi: "10.1101/2022.10.19.512867" licence: ["MIT"] + identifier: biotools:shapeit5 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input_list: - type: file - description: | - VCF/BCF files containing genotype probabilities (GP field). - The files should be ordered by genomic position. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - input_list_index: - type: file - description: VCF/BCF files index. - pattern: "*.csi" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_list: + type: file + description: | + VCF/BCF files containing genotype probabilities (GP field). + The files should be ordered by genomic position. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_list_index: + type: file + description: VCF/BCF files index. + pattern: "*.csi" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - merged_variants: - type: file - description: | - Output VCF/BCF file for the merged regions. - Phased information (HS field) is updated accordingly for the full region. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: | + Output VCF/BCF file for the merged regions. + Phased information (HS field) is updated accordingly for the full region. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louislenezet" maintainers: From 039f4855ed5f228eec737670f0f8b86f0a74d136 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:22:05 +0100 Subject: [PATCH 20/25] Update shapeit5 --- .../shapeit5/phasecommon/environment.yml | 2 - modules/nf-core/shapeit5/phasecommon/meta.yml | 139 ++++++++++-------- .../phasecommon/shapeit5-phasecommon.diff | 3 + 3 files changed, 82 insertions(+), 62 deletions(-) diff --git a/modules/nf-core/shapeit5/phasecommon/environment.yml b/modules/nf-core/shapeit5/phasecommon/environment.yml index 8bc91822..7b8e63bb 100644 --- a/modules/nf-core/shapeit5/phasecommon/environment.yml +++ b/modules/nf-core/shapeit5/phasecommon/environment.yml @@ -1,7 +1,5 @@ -name: shapeit5_phasecommon channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::shapeit5=1.0.0 diff --git a/modules/nf-core/shapeit5/phasecommon/meta.yml b/modules/nf-core/shapeit5/phasecommon/meta.yml index 5d1381fb..5aa05232 100644 --- a/modules/nf-core/shapeit5/phasecommon/meta.yml +++ b/modules/nf-core/shapeit5/phasecommon/meta.yml @@ -1,5 +1,6 @@ name: "shapeit5_phasecommon" -description: Tool to phase common sites, typically SNP array data, or the first step of WES/WGS data. +description: Tool to phase common sites, typically SNP array data, or the first step + of WES/WGS data. keywords: - phasing - haplotype @@ -11,68 +12,86 @@ tools: documentation: "https://odelaneau.github.io/shapeit5/docs/documentation" tool_dev_url: "https://github.com/odelaneau/shapeit5" doi: "10.1101/2022.10.19.512867 " - licence: "['MIT']" + licence: ["MIT"] + identifier: biotools:shapeit5 input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: | - Target dataset in VCF/BCF format defined at all variable positions. - The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - - input_index: - type: file - description: Index file of the input VCF/BCF file containing genotype likelihoods. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - pedigree: - type: file - description: | - Pedigree information in the following format: offspring father mother. - pattern: "*.{txt, tsv}" - - region: - type: string - description: | - Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). - For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. - pattern: "chrXX:leftBufferPosition-rightBufferPosition" - - reference: - type: file - description: Reference panel of haplotypes in VCF/BCF format. - pattern: "*.{vcf.gz,bcf.gz}" - - reference_index: - type: file - description: Index file of the Reference panel file. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - scaffold: - type: file - description: Scaffold of haplotypes in VCF/BCF format. - pattern: "*.{vcf.gz,bcf.gz}" - - scaffold_index: - type: file - description: Index file of the scaffold file. - pattern: "*.{vcf.gz.csi,bcf.gz.csi}" - - map: - type: file - description: File containing the genetic map. - pattern: "*.gmap" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: | + Target dataset in VCF/BCF format defined at all variable positions. + The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended). + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - input_index: + type: file + description: Index file of the input VCF/BCF file containing genotype likelihoods. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - pedigree: + type: file + description: | + Pedigree information in the following format: offspring father mother. + pattern: "*.{txt, tsv}" + - region: + type: string + description: | + Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20). + For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy. + pattern: "chrXX:leftBufferPosition-rightBufferPosition" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reference: + type: file + description: Reference panel of haplotypes in VCF/BCF format. + pattern: "*.{vcf.gz,bcf.gz}" + - reference_index: + type: file + description: Index file of the Reference panel file. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - scaffold: + type: file + description: Scaffold of haplotypes in VCF/BCF format. + pattern: "*.{vcf.gz,bcf.gz}" + - scaffold_index: + type: file + description: Index file of the scaffold file. + pattern: "*.{vcf.gz.csi,bcf.gz.csi}" + - - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - map: + type: file + description: File containing the genetic map. + pattern: "*.gmap" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - phased_variants: - type: file - description: Phased haplotypes in VCF/BCF format. - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - phased_variant: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: Phased variant dataset in VCF/BCF format. + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@LouisLeNezet" maintainers: diff --git a/modules/nf-core/shapeit5/phasecommon/shapeit5-phasecommon.diff b/modules/nf-core/shapeit5/phasecommon/shapeit5-phasecommon.diff index ca7df800..7afc3136 100644 --- a/modules/nf-core/shapeit5/phasecommon/shapeit5-phasecommon.diff +++ b/modules/nf-core/shapeit5/phasecommon/shapeit5-phasecommon.diff @@ -1,4 +1,6 @@ Changes in module 'nf-core/shapeit5/phasecommon' +'modules/nf-core/shapeit5/phasecommon/meta.yml' is unchanged +Changes in 'shapeit5/phasecommon/main.nf': --- modules/nf-core/shapeit5/phasecommon/main.nf +++ modules/nf-core/shapeit5/phasecommon/main.nf @@ -8,10 +8,9 @@ @@ -14,4 +16,5 @@ Changes in module 'nf-core/shapeit5/phasecommon' output: tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: phased_variant +'modules/nf-core/shapeit5/phasecommon/environment.yml' is unchanged ************************************************************ From c8b00dffe639666809110841a1293ae66f34d7b4 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:28:00 +0100 Subject: [PATCH 21/25] Update stitch --- modules/nf-core/stitch/environment.yml | 5 +- modules/nf-core/stitch/main.nf | 2 +- modules/nf-core/stitch/meta.yml | 218 ++++++++++-------- modules/nf-core/stitch/stitch.diff | 24 +- modules/nf-core/stitch/tests/main.nf.test | 178 ++++++++++++++ .../nf-core/stitch/tests/main.nf.test.snap | 170 ++++++++++++++ .../stitch/tests/stitch_generate_input.config | 6 + .../stitch/tests/stitch_impute_only.config | 5 + 8 files changed, 501 insertions(+), 107 deletions(-) create mode 100644 modules/nf-core/stitch/tests/main.nf.test create mode 100644 modules/nf-core/stitch/tests/main.nf.test.snap create mode 100644 modules/nf-core/stitch/tests/stitch_generate_input.config create mode 100644 modules/nf-core/stitch/tests/stitch_impute_only.config diff --git a/modules/nf-core/stitch/environment.yml b/modules/nf-core/stitch/environment.yml index 3facc1bc..4978bec2 100644 --- a/modules/nf-core/stitch/environment.yml +++ b/modules/nf-core/stitch/environment.yml @@ -1,7 +1,8 @@ -name: stitch channels: - conda-forge - bioconda - - defaults dependencies: + - conda-forge::r-base=4.3.1 + - conda-forge::rsync=3.2.7 - bioconda::r-stitch=1.6.10 + - bioconda::htslib=1.18 diff --git a/modules/nf-core/stitch/main.nf b/modules/nf-core/stitch/main.nf index 9b3d2c7d..83a62741 100644 --- a/modules/nf-core/stitch/main.nf +++ b/modules/nf-core/stitch/main.nf @@ -9,7 +9,7 @@ process STITCH { input: tuple val(meta), path(collected_crams), path(collected_crais), path(cramlist), path(posfile), path(input, stageAs: "input"), path(rdata, stageAs: "RData_in"), val(chromosome_name), val(K), val(nGen) - tuple val(meta2), path(fasta), path(fasta_fai) + tuple val(meta3), path(fasta), path(fasta_fai) val seed output: diff --git a/modules/nf-core/stitch/meta.yml b/modules/nf-core/stitch/meta.yml index a36d61cd..0035d346 100644 --- a/modules/nf-core/stitch/meta.yml +++ b/modules/nf-core/stitch/meta.yml @@ -1,7 +1,9 @@ ---- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json name: "stitch" -description: "STITCH is an R program for reference panel free, read aware, low coverage sequencing genotype imputation. STITCH runs on a set of samples with sequencing reads in BAM format, as well as a list of positions to genotype, and outputs imputed genotypes in VCF format." +description: "STITCH is an R program for reference panel free, read aware, low coverage + sequencing genotype imputation. STITCH runs on a set of samples with sequencing + reads in BAM format, as well as a list of positions to genotype, and outputs imputed + genotypes in VCF format." keywords: - imputation - genomics @@ -17,103 +19,137 @@ tools: documentation: "https://github.com/rwdavies/stitch" tool_dev_url: "https://github.com/rwdavies/stitch" doi: "10.1038/ng.3594" - licence: "['GPL v3']" + licence: ["GPL v3"] + identifier: biotools:stitch-snijderlab input: - - meta: - type: map - description: | - Groovy Map containing information about the set of positions to run the imputation over - e.g. `[ id:'test' ]` - - posfile: - type: file - description: | - Tab-separated file describing the variable positions to be used for imputation. Refer to the documentation for the `--posfile` argument of STITCH for more information. - pattern: "*.tsv" - - input: - type: directory - description: | - Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. - pattern: "input" - - rdata: - type: directory - description: | - Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. - pattern: "RData" - - chromosome_name: - type: string - description: Name of the chromosome to impute. Should match a chromosome name in the reference genome. - - K: - type: integer - description: Number of ancestral haplotypes to use for imputation. Refer to the documentation for the `--K` argument of STITCH for more information. - - nGen: - type: integer - description: Number of generations since founding of the population to use for imputation. Refer to the documentation for the `--nGen` argument of STITCH for more information. - - meta2: - type: map - description: | - Groovy Map containing information about the set of samples - e.g. `[ id:'test' ]` - - collected_crams: - type: file - description: List of sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - collected_crais: - type: file - description: List of BAM/CRAM/SAM index files - pattern: "*.{bai,crai,sai}" - - cramlist: - type: file - description: | - Text file with the path to the cram files to use in imputation, one per line. Since the cram files are staged to the working directory for the process, this file should just contain the file names without any pre-pending path. - pattern: "*.txt" - - meta3: - type: map - description: | - Groovy Map containing information about the reference genome used - e.g. `[ id:'test' ]` - - fasta: - type: file - description: FASTA reference genome file - pattern: "*.{fa,fasta}" - - fasta_fai: - type: file - description: FASTA index file - pattern: "*.{fai}" + - - meta: + type: map + description: | + Groovy Map containing information about the set of samples + e.g. `[ id:'test' ]` + - collected_crams: + type: file + description: List of sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - collected_crais: + type: file + description: List of BAM/CRAM/SAM index files + pattern: "*.{bai,crai,sai}" + - cramlist: + type: file + description: | + Text file with the path to the cram files to use in imputation, one per line. Since the cram files are staged to the working directory for the process, this file should just contain the file names without any pre-pending path. + pattern: "*.txt" + - - meta2: + type: map + description: | + Groovy Map containing information about the set of positions to run the imputation over + e.g. `[ id:'test' ]` + - posfile: + type: file + description: | + Tab-separated file describing the variable positions to be used for imputation. Refer to the documentation for the `--posfile` argument of STITCH for more information. + pattern: "*.tsv" + - input: + type: directory + description: | + Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. + pattern: "input" + - rdata: + type: directory + description: | + Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. + pattern: "RData" + - chromosome_name: + type: string + description: Name of the chromosome to impute. Should match a chromosome name + in the reference genome. + - K: + type: integer + description: Number of ancestral haplotypes to use for imputation. Refer to + the documentation for the `--K` argument of STITCH for more information. + - nGen: + type: integer + description: Number of generations since founding of the population to use for + imputation. Refer to the documentation for the `--nGen` argument of STITCH + for more information. + - - meta3: + type: map + description: | + Groovy Map containing information about the reference genome used + e.g. `[ id:'test' ]` + - fasta: + type: file + description: FASTA reference genome file + pattern: "*.{fa,fasta}" + - fasta_fai: + type: file + description: FASTA index file + pattern: "*.{fai}" + - - seed: + type: integer + description: Seed for random number generation output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test' ]` - input: - type: directory - description: | - Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. - pattern: "input" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - 'input", type: "dir': + type: directory + description: | + Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. + pattern: "input" - rdata: - type: directory - description: | - Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. - pattern: "RData" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - 'RData", type: "dir': + type: directory + description: | + Folder of pre-generated input RData objects used when STITCH is called with the `--regenerateInput FALSE` flag. It is generated by running STITCH with the `--generateInputOnly TRUE` flag. + pattern: "RData" - plots: - type: directory - description: | - Folder containing plots produced by STITCH during imputation. Which plots are produced depends on the command-line arguments passed to STITCH. - pattern: "plots" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - 'plots", type: "dir': + type: directory + description: | + Folder containing plots produced by STITCH during imputation. Which plots are produced depends on the command-line arguments passed to STITCH. + pattern: "plots" - vcf: - type: file - description: | - Imputed genotype calls for the positions in `posfile`, in vcf format. This is the default output. - pattern: ".vcf.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - "*.vcf.gz": + type: file + description: | + Imputed genotype calls for the positions in `posfile`, in vcf format. This is the default output. + pattern: ".vcf.gz" - bgen: - type: file - description: | - Imputed genotype calls for the positions in `posfile`, in vcf format. This is the produced if `--output_format bgen` is specified. - pattern: ".bgen" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - "*.bgen": + type: file + description: | + Imputed genotype calls for the positions in `posfile`, in vcf format. This is the produced if `--output_format bgen` is specified. + pattern: ".bgen" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@saulpierotti" maintainers: diff --git a/modules/nf-core/stitch/stitch.diff b/modules/nf-core/stitch/stitch.diff index 0a987c1b..78ceb435 100644 --- a/modules/nf-core/stitch/stitch.diff +++ b/modules/nf-core/stitch/stitch.diff @@ -1,24 +1,22 @@ Changes in module 'nf-core/stitch' +'modules/nf-core/stitch/environment.yml' is unchanged +Changes in 'stitch/main.nf': --- modules/nf-core/stitch/main.nf +++ modules/nf-core/stitch/main.nf -@@ -8,8 +8,8 @@ +@@ -8,8 +8,7 @@ 'biocontainers/r-stitch:1.6.10--r43h06b5641_0' }" input: -- tuple val(meta) , path(posfile), path(input, stageAs: "input"), path(rdata, stageAs: "RData_in"), val(chromosome_name), val(K), val(nGen) -- tuple val(meta2), path(collected_crams), path(collected_crais), path(cramlist) -+ tuple val(meta), path(collected_crams), path(collected_crais), path(cramlist) -+ tuple val(meta2), path(posfile), path(input, stageAs: "input"), path(rdata, stageAs: "RData_in"), val(chromosome_name), val(K), val(nGen) +- tuple val(meta), path(collected_crams), path(collected_crais), path(cramlist) +- tuple val(meta2), path(posfile), path(input, stageAs: "input"), path(rdata, stageAs: "RData_in"), val(chromosome_name), val(K), val(nGen) ++ tuple val(meta), path(collected_crams), path(collected_crais), path(cramlist), path(posfile), path(input, stageAs: "input"), path(rdata, stageAs: "RData_in"), val(chromosome_name), val(K), val(nGen) tuple val(meta3), path(fasta), path(fasta_fai) val seed ---- modules/nf-core/stitch/meta.yml -+++ modules/nf-core/stitch/meta.yml -@@ -117,4 +117,4 @@ - authors: - - "@saulpierotti" - maintainers: -- - "@saulpierotti" -+ - "@saulpierotti" +'modules/nf-core/stitch/meta.yml' is unchanged +'modules/nf-core/stitch/tests/main.nf.test' is unchanged +'modules/nf-core/stitch/tests/main.nf.test.snap' is unchanged +'modules/nf-core/stitch/tests/stitch_generate_input.config' is unchanged +'modules/nf-core/stitch/tests/stitch_impute_only.config' is unchanged ************************************************************ diff --git a/modules/nf-core/stitch/tests/main.nf.test b/modules/nf-core/stitch/tests/main.nf.test new file mode 100644 index 00000000..9a7d1803 --- /dev/null +++ b/modules/nf-core/stitch/tests/main.nf.test @@ -0,0 +1,178 @@ +def pathbam = "file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/" +def pathgenome = "file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/" +// positions and essential parameters +def posfile = "${pathgenome}dbsnp_138.hg38.first_10_biallelic_sites.tsv', checkIfExists: true)" +def stitch_params = "[ [ id: 'test_positions' ], $posfile, [], [], 'chr21', 2, 1 ]" + +// sequencing data in cram format +def crams_val = "[${pathbam}cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), ${pathbam}cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true)]" +def crais_val = "[${pathbam}cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), ${pathbam}cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true)]" +def reads_cram = "[ [ id: 'test_reads' ], $crams_val, $crais_val ]" + +// sequencing data in bam format +def bams_val = "[${pathbam}bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), ${pathbam}bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true)]" +def bais_val = "[${pathbam}bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), ${pathbam}bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true)]" +def reads_bam = "[ [ id:'test_reads' ], $bams_val, $bais_val ]" + +// reference genome +def reference = "[[ id:'test_reference' ], ${pathgenome}genome.fasta', checkIfExists: true), ${pathgenome}genome.fasta.fai', checkIfExists: true)]" + +// for reproducibility +def seed = 1 + +nextflow_process { + name "Test Process STITCH" + script "../main.nf" + process "STITCH" + + tag "modules" + tag "modules_nfcore" + tag "stitch" + + test("test_no_seed") { + when { + process { + """ + filelist = Channel.fromPath( $crams_val ) + .map { it[-1] as String } // get only filename + .collectFile( name: "cramlist.txt", newLine: true, sort: true ) + + input[0] = Channel.of( $reads_cram ).combine( filelist ) + input[1] = $stitch_params + input[2] = $reference + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.input.collect{ file(it[1]).listFiles().sort().name }, + process.out.rdata.collect{ file(it[1]).listFiles().sort().name }, + process.out.plots.collect{ file(it[1]).listFiles().sort().name }, + process.out.vcf.collect{ file(it[1]).name }, + process.out.versions + ).match() } + ) + } + } + + test("test_with_seed") { + when { + process { + """ + filelist = Channel.fromPath( $crams_val ) + .map { it[-1] as String } // get only filename + .collectFile( name: "cramlist.txt", newLine: true, sort: true ) + input[0] = Channel.of( $reads_cram ).combine( filelist ) + input[1] = $stitch_params + input[2] = $reference + input[3] = $seed + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.input.collect{ file(it[1]).listFiles().sort().name }, + process.out.rdata.collect{ file(it[1]).listFiles().sort().name }, + process.out.plots.collect{ file(it[1]).listFiles().sort().name }, + process.out.vcf.collect{ file(it[1]).name }, + process.out.versions + ).match() } + ) + } + } + + test("test_two_stage_imputation") { + setup { + run ("STITCH", alias: "STITCH_GENERATE_INPUTS") { + script "../main.nf" + config "./stitch_generate_input.config" + process { + """ + filelist = Channel.fromPath( $crams_val ) + .map { it[-1] as String } // get only filename + .collectFile( name: "cramlist.txt", newLine: true, sort: true ) + input[0] = Channel.of( $reads_cram ).combine( filelist ) + input[1] = $stitch_params + input[2] = $reference + input[3] = $seed + """ + } + } + } + + when { + config "./stitch_impute_only.config" + process { + """ + ch_input_2step = Channel.of( $stitch_params ) + .map { + meta, positions, target, rdata, chromosome_name, K, nGen -> + [ meta, positions ] + } + .combine( + STITCH_GENERATE_INPUTS.out.input + .join ( STITCH_GENERATE_INPUTS.out.rdata ) + ) + .map { + meta, positions, metaT, target, rdata -> + [ metaT, positions, target, rdata, "chr21", 2, 1 ] + } + input[0] = [[id: null], [], [], []] + input[1] = ch_input_2step + input[2] = [[id: null], [], []] + input[3] = $seed + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.input.collect{ file(it[1]).listFiles().sort().name }, + process.out.rdata.collect{ file(it[1]).listFiles().sort().name }, + process.out.plots.collect{ file(it[1]).listFiles().sort().name }, + process.out.vcf.collect{ file(it[1]).name }, + process.out.versions + ).match() } + ) + } + } + + test("test_with_bam") { + when { + process { + """ + filelist = Channel.fromPath( $bams_val ) + .map { it[-1] as String } // get only filename + .collectFile( name: "cramlist.txt", newLine: true, sort: true ) + input[0] = Channel.of( $reads_bam ).combine( filelist ) + input[1] = $stitch_params + input[2] = $reference + input[3] = $seed + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.input.collect{ file(it[1]).listFiles().sort().name }, + process.out.rdata.collect{ file(it[1]).listFiles().sort().name }, + process.out.plots.collect{ file(it[1]).listFiles().sort().name }, + process.out.vcf.collect{ file(it[1]).name }, + process.out.versions + ).match() } + ) + } + } + +} diff --git a/modules/nf-core/stitch/tests/main.nf.test.snap b/modules/nf-core/stitch/tests/main.nf.test.snap new file mode 100644 index 00000000..ee28277f --- /dev/null +++ b/modules/nf-core/stitch/tests/main.nf.test.snap @@ -0,0 +1,170 @@ +{ + "test_with_bam": { + "content": [ + [ + [ + "sample.1.input.chr21.RData", + "sample.2.input.chr21.RData" + ] + ], + [ + [ + "EM.all.chr21.RData", + "end.chr21.RData", + "endEM.chr21.RData", + "sampleNames.chr21.RData", + "start.chr21.RData", + "startEM.chr21.RData" + ] + ], + [ + [ + "alphaMat.chr21.all.s.1.png", + "alphaMat.chr21.normalized.s.1.png", + "hapSum.chr21.s.1.png", + "hapSum_log.chr21.s.1.png", + "metricsForPostImputationQC.chr21.sample.jpg", + "metricsForPostImputationQCChromosomeWide.chr21.sample.jpg", + "r2.chr21.goodonly.jpg" + ] + ], + [ + "stitch.chr21.vcf.gz" + ], + [ + "versions.yml:md5,23ba0a3cec10c1bdb411b3e1f31b008e" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T20:16:19.412761604" + }, + "test_no_seed": { + "content": [ + [ + [ + "sample.1.input.chr21.RData", + "sample.2.input.chr21.RData" + ] + ], + [ + [ + "EM.all.chr21.RData", + "end.chr21.RData", + "endEM.chr21.RData", + "sampleNames.chr21.RData", + "start.chr21.RData", + "startEM.chr21.RData" + ] + ], + [ + [ + "alphaMat.chr21.all.s.1.png", + "alphaMat.chr21.normalized.s.1.png", + "hapSum.chr21.s.1.png", + "hapSum_log.chr21.s.1.png", + "metricsForPostImputationQC.chr21.sample.jpg", + "metricsForPostImputationQCChromosomeWide.chr21.sample.jpg", + "r2.chr21.goodonly.jpg" + ] + ], + [ + "stitch.chr21.vcf.gz" + ], + [ + "versions.yml:md5,23ba0a3cec10c1bdb411b3e1f31b008e" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T18:49:25.941823568" + }, + "test_two_stage_imputation": { + "content": [ + [ + [ + "sample.1.input.chr21.RData", + "sample.2.input.chr21.RData" + ] + ], + [ + [ + "EM.all.chr21.RData", + "end.chr21.RData", + "endEM.chr21.RData", + "sampleNames.chr21.RData", + "start.chr21.RData", + "startEM.chr21.RData" + ] + ], + [ + [ + "alphaMat.chr21.all.s.1.png", + "alphaMat.chr21.normalized.s.1.png", + "hapSum.chr21.s.1.png", + "hapSum_log.chr21.s.1.png", + "metricsForPostImputationQC.chr21.sample.jpg", + "metricsForPostImputationQCChromosomeWide.chr21.sample.jpg", + "r2.chr21.goodonly.jpg" + ] + ], + [ + "stitch.chr21.vcf.gz" + ], + [ + "versions.yml:md5,019f1127aacfb7d14a0c4ae3d740a07d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T20:14:01.151837306" + }, + "test_with_seed": { + "content": [ + [ + [ + "sample.1.input.chr21.RData", + "sample.2.input.chr21.RData" + ] + ], + [ + [ + "EM.all.chr21.RData", + "end.chr21.RData", + "endEM.chr21.RData", + "sampleNames.chr21.RData", + "start.chr21.RData", + "startEM.chr21.RData" + ] + ], + [ + [ + "alphaMat.chr21.all.s.1.png", + "alphaMat.chr21.normalized.s.1.png", + "hapSum.chr21.s.1.png", + "hapSum_log.chr21.s.1.png", + "metricsForPostImputationQC.chr21.sample.jpg", + "metricsForPostImputationQCChromosomeWide.chr21.sample.jpg", + "r2.chr21.goodonly.jpg" + ] + ], + [ + "stitch.chr21.vcf.gz" + ], + [ + "versions.yml:md5,23ba0a3cec10c1bdb411b3e1f31b008e" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-10-22T18:59:46.592393397" + } +} \ No newline at end of file diff --git a/modules/nf-core/stitch/tests/stitch_generate_input.config b/modules/nf-core/stitch/tests/stitch_generate_input.config new file mode 100644 index 00000000..cb629a8e --- /dev/null +++ b/modules/nf-core/stitch/tests/stitch_generate_input.config @@ -0,0 +1,6 @@ +process { + withName: STITCH_GENERATE_INPUTS { + ext.args2 = "--generateInputOnly TRUE" + } +} + diff --git a/modules/nf-core/stitch/tests/stitch_impute_only.config b/modules/nf-core/stitch/tests/stitch_impute_only.config new file mode 100644 index 00000000..f3304cea --- /dev/null +++ b/modules/nf-core/stitch/tests/stitch_impute_only.config @@ -0,0 +1,5 @@ +process { + withName: STITCH { + ext.args2 = "--regenerateInputWithDefaultValues TRUE" + } +} From d0f2d8168409e5a5374879f51343f6e465c953b1 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:28:50 +0100 Subject: [PATCH 22/25] Update tabix --- modules/nf-core/tabix/bgzip/environment.yml | 5 +- modules/nf-core/tabix/bgzip/main.nf | 4 +- modules/nf-core/tabix/bgzip/meta.yml | 53 +++++---- .../nf-core/tabix/bgzip/tests/main.nf.test | 8 +- .../tabix/bgzip/tests/main.nf.test.snap | 56 +++++++-- modules/nf-core/tabix/tabix/environment.yml | 5 +- modules/nf-core/tabix/tabix/main.nf | 11 +- modules/nf-core/tabix/tabix/meta.yml | 55 +++++---- .../nf-core/tabix/tabix/tests/main.nf.test | 44 +++---- .../tabix/tabix/tests/main.nf.test.snap | 111 +++++++++--------- 10 files changed, 196 insertions(+), 156 deletions(-) diff --git a/modules/nf-core/tabix/bgzip/environment.yml b/modules/nf-core/tabix/bgzip/environment.yml index 361c078b..017c259d 100644 --- a/modules/nf-core/tabix/bgzip/environment.yml +++ b/modules/nf-core/tabix/bgzip/environment.yml @@ -1,8 +1,7 @@ -name: tabix_bgzip channels: - conda-forge - bioconda - - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::tabix=1.11 - - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/bgzip/main.nf b/modules/nf-core/tabix/bgzip/main.nf index 3065dab0..67991c74 100644 --- a/modules/nf-core/tabix/bgzip/main.nf +++ b/modules/nf-core/tabix/bgzip/main.nf @@ -4,8 +4,8 @@ process TABIX_BGZIP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : - 'biocontainers/htslib:1.19.1--h81da01d_1' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/tabix/bgzip/meta.yml b/modules/nf-core/tabix/bgzip/meta.yml index 621d49ea..131e92cf 100644 --- a/modules/nf-core/tabix/bgzip/meta.yml +++ b/modules/nf-core/tabix/bgzip/meta.yml @@ -13,33 +13,42 @@ tools: documentation: http://www.htslib.org/doc/bgzip.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:tabix input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: file to compress or to decompress + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: file to compress or to decompress output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - output: - type: file - description: Output compressed/decompressed file - pattern: "*." + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${output}: + type: file + description: Output compressed/decompressed file + pattern: "*." - gzi: - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${output}.gzi: + type: file + description: Optional gzip index file for compressed inputs + pattern: "*.gzi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test b/modules/nf-core/tabix/bgzip/tests/main.nf.test index 95fd4c50..d784aa07 100644 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [ id:'bgzip_test' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } @@ -39,7 +39,7 @@ nextflow_process { """ input[0] = [ [ id:'bedgz_test' ], - [ file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true) ] ] """ } @@ -66,7 +66,7 @@ nextflow_process { """ input[0] = [ [ id:"test_stub" ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } @@ -91,7 +91,7 @@ nextflow_process { """ input[0] = [ [ id:"gzi_compress_test" ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap index 53d59932..0748143f 100644 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap @@ -3,6 +3,10 @@ "content": [ "gzi_compress_test.vcf.gz.gzi" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:29.328146" }, "homo_genome_bedgz_compress": { @@ -20,7 +24,7 @@ ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ @@ -34,16 +38,24 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:12.422209" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:34.159992362" }, "test_stub": { "content": [ "test_stub.vcf.gz" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:20.811489" }, "sarscov2_vcf_bgzip_compress": { @@ -61,7 +73,7 @@ ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ @@ -75,11 +87,15 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:03.706028" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:22.087769106" }, "sarscov2_vcf_bgzip_compress_gzi": { "content": [ @@ -101,7 +117,7 @@ ] ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ [ @@ -120,22 +136,34 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:29.271494" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:57.15091665" }, "bgzip_test": { "content": [ "bgzip_test.vcf.gz" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:03.768295" }, "bedgz_test": { "content": [ "bedgz_test.bed" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:12.453855" }, "sarscov2_vcf_bgzip_compress_stub": { @@ -158,7 +186,7 @@ ] ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ [ @@ -177,10 +205,14 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:20.769619" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:45.219404786" } } \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/environment.yml b/modules/nf-core/tabix/tabix/environment.yml index 76b45e16..017c259d 100644 --- a/modules/nf-core/tabix/tabix/environment.yml +++ b/modules/nf-core/tabix/tabix/environment.yml @@ -1,8 +1,7 @@ -name: tabix_tabix channels: - conda-forge - bioconda - - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::tabix=1.11 - - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf index 1737141d..13acd670 100644 --- a/modules/nf-core/tabix/tabix/main.nf +++ b/modules/nf-core/tabix/tabix/main.nf @@ -4,8 +4,8 @@ process TABIX_TABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : - 'biocontainers/htslib:1.19.1--h81da01d_1' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(tab) @@ -21,7 +21,10 @@ process TABIX_TABIX { script: def args = task.ext.args ?: '' """ - tabix $args $tab + tabix \\ + --threads $task.cpus \\ + $args \\ + $tab cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -33,8 +36,8 @@ process TABIX_TABIX { """ touch ${tab}.tbi touch ${tab}.csi - cat <<-END_VERSIONS > versions.yml + cat <<-END_VERSIONS > versions.yml "${task.process}": tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS diff --git a/modules/nf-core/tabix/tabix/meta.yml b/modules/nf-core/tabix/tabix/meta.yml index ae5b4f43..7864832d 100644 --- a/modules/nf-core/tabix/tabix/meta.yml +++ b/modules/nf-core/tabix/tabix/meta.yml @@ -11,34 +11,43 @@ tools: documentation: https://www.htslib.org/doc/tabix.1.html doi: 10.1093/bioinformatics/btq671 licence: ["MIT"] + identifier: biotools:tabix input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - tab: - type: file - description: TAB-delimited genome position file compressed with bgzip - pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tab: + type: file + description: TAB-delimited genome position file compressed with bgzip + pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - tbi: - type: file - description: tabix index file - pattern: "*.{tbi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: tabix index file + pattern: "*.{tbi}" - csi: - type: file - description: coordinate sorted index file - pattern: "*.{csi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: coordinate sorted index file + pattern: "*.{csi}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test index 3a150c70..102b0d7b 100644 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test @@ -16,7 +16,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_bed' ], - [ file(params.test_data['sarscov2']['genome']['test_bed_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed.gz', checkIfExists: true) ] ] """ } @@ -25,11 +25,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_bed") - } + process.out, + file(process.out.tbi[0][1]).name + ).match() } ) } } @@ -41,7 +40,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_gff' ], - [ file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true) ] ] """ } @@ -50,11 +49,9 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_gff") - } + process.out, + file(process.out.tbi[0][1]).name).match() } ) } @@ -67,7 +64,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_vcf' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -76,11 +73,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_vcf") - } + process.out, + file(process.out.tbi[0][1]).name + ).match() } ) } @@ -93,7 +89,7 @@ nextflow_process { """ input[0] = [ [ id:'vcf_csi' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -102,11 +98,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.csi[0][1]).name - ).match("vcf_csi") - } + process.out, + file(process.out.csi[0][1]).name + ).match() } ) } @@ -120,7 +115,7 @@ nextflow_process { """ input[0] = [ [ id:'vcf_csi_stub' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -129,11 +124,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.csi[0][1]).name - ).match("vcf_csi_stub") - } + process.out, + file(process.out.csi[0][1]).name + ).match() } ) } diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap index 034e38b6..c2b9ed0b 100644 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap @@ -1,16 +1,4 @@ { - "vcf_csi_stub": { - "content": [ - "test.vcf.gz.csi" - ], - "timestamp": "2024-03-04T14:51:59.788002" - }, - "tbi_gff": { - "content": [ - "genome.gff3.gz.tbi" - ], - "timestamp": "2024-02-19T14:53:37.420216" - }, "sarscov2_gff_tbi": { "content": [ { @@ -19,14 +7,14 @@ { "id": "tbi_gff" }, - "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -36,15 +24,20 @@ { "id": "tbi_gff" }, - "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "genome.gff3.gz.tbi" ], - "timestamp": "2024-02-19T14:53:37.388157" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:25.653807564" }, "sarscov2_bedgz_tbi": { "content": [ @@ -54,14 +47,14 @@ { "id": "tbi_bed" }, - "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -71,27 +64,20 @@ { "id": "tbi_bed" }, - "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } - ], - "timestamp": "2024-02-19T14:53:28.879408" - }, - "tbi_vcf": { - "content": [ - "test.vcf.gz.tbi" - ], - "timestamp": "2024-02-19T14:53:46.402522" - }, - "vcf_csi": { - "content": [ - "test.vcf.gz.csi" + }, + "test.bed.gz.tbi" ], - "timestamp": "2024-02-19T14:53:54.921189" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:09.754082161" }, "sarscov2_vcf_tbi": { "content": [ @@ -101,14 +87,14 @@ { "id": "tbi_vcf" }, - "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -118,15 +104,20 @@ { "id": "tbi_vcf" }, - "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "test.vcf.gz.tbi" ], - "timestamp": "2024-02-19T14:53:46.370358" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:40.042648294" }, "sarscov2_vcf_csi_stub": { "content": [ @@ -148,7 +139,7 @@ ] ], "2": [ - "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ [ @@ -167,11 +158,16 @@ ] ], "versions": [ - "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "test.vcf.gz.csi" ], - "timestamp": "2024-03-04T14:51:59.766184" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:07:08.700367261" }, "sarscov2_vcf_csi": { "content": [ @@ -184,34 +180,33 @@ { "id": "vcf_csi" }, - "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" ] ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ [ { "id": "vcf_csi" }, - "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" ] ], "tbi": [ ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } - ], - "timestamp": "2024-02-19T14:53:54.886876" - }, - "tbi_bed": { - "content": [ - "test.bed.gz.tbi" + }, + "test.vcf.gz.csi" ], - "timestamp": "2024-02-19T14:53:28.947628" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:55.362067748" } } \ No newline at end of file From 0a35afc3b15a66fadf047af94964814896805763 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 17:30:02 +0100 Subject: [PATCH 23/25] Update vcflib --- modules.json | 10 ++-- .../nf-core/vcflib/vcffixup/environment.yml | 2 - modules/nf-core/vcflib/vcffixup/meta.yml | 56 ++++++++++--------- .../vcflib/vcffixup/tests/main.nf.test | 17 +++--- 4 files changed, 43 insertions(+), 42 deletions(-) diff --git a/modules.json b/modules.json index a5f29005..15475670 100644 --- a/modules.json +++ b/modules.json @@ -176,29 +176,29 @@ }, "shapeit5/phasecommon": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["vcf_phase_shapeit5"], "patch": "modules/nf-core/shapeit5/phasecommon/shapeit5-phasecommon.diff" }, "stitch": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "55e411128ca5036def5dae1aa28a09e3776f59ea", "installed_by": ["modules"], "patch": "modules/nf-core/stitch/stitch.diff" }, "tabix/bgzip": { "branch": "master", - "git_sha": "09d3c8c29b31a2dfd610305b10550f0e1dbcd4a9", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "tabix/tabix": { "branch": "master", - "git_sha": "9502adb23c0b97ed8e616bbbdfa73b4585aec9a1", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "vcflib/vcffixup": { "branch": "master", - "git_sha": "072cf562e143252953a1b5c5ed38ec55eaa930c8", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] } } diff --git a/modules/nf-core/vcflib/vcffixup/environment.yml b/modules/nf-core/vcflib/vcffixup/environment.yml index d06c4c7b..d0a99ffd 100644 --- a/modules/nf-core/vcflib/vcffixup/environment.yml +++ b/modules/nf-core/vcflib/vcffixup/environment.yml @@ -1,9 +1,7 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -name: "vcflib_vcffixup" channels: - conda-forge - bioconda - - defaults dependencies: - "bioconda::vcflib=1.0.3" diff --git a/modules/nf-core/vcflib/vcffixup/meta.yml b/modules/nf-core/vcflib/vcffixup/meta.yml index be7eac6a..4d95e4f0 100644 --- a/modules/nf-core/vcflib/vcffixup/meta.yml +++ b/modules/nf-core/vcflib/vcffixup/meta.yml @@ -1,5 +1,6 @@ name: "vcflib_vcffixup" -description: Generates a VCF stream where AC and NS have been generated for each record using sample genotypes. +description: Generates a VCF stream where AC and NS have been generated for each record + using sample genotypes. keywords: - vcf - vcflib @@ -12,34 +13,37 @@ tools: documentation: https://github.com/vcflib/vcflib#USAGE doi: "10.1101/2021.05.21.445151" licence: ["MIT"] + identifier: biotools:vcflib input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: Compressed VCF file - pattern: "*.{.vcf.gz,vcf}" - - tbi: - type: file - description: Index of VCF file - pattern: "*.vcf.gz.tbi" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Compressed VCF file + pattern: "*.{.vcf.gz,vcf}" + - tbi: + type: file + description: Index of VCF file + pattern: "*.vcf.gz.tbi" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - vcf: - type: file - description: Compressed VCF file - pattern: "*.vcf.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.vcf.gz": + type: file + description: Compressed VCF file + pattern: "*.vcf.gz" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@atrigila" maintainers: diff --git a/modules/nf-core/vcflib/vcffixup/tests/main.nf.test b/modules/nf-core/vcflib/vcffixup/tests/main.nf.test index f819eef6..b17eaae7 100644 --- a/modules/nf-core/vcflib/vcffixup/tests/main.nf.test +++ b/modules/nf-core/vcflib/vcffixup/tests/main.nf.test @@ -14,9 +14,10 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] """ } } @@ -37,9 +38,10 @@ nextflow_process { when { process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] """ } } @@ -55,7 +57,4 @@ nextflow_process { } } - - - } From 28e0ff75710b89dffab6f3bd2d8a9b1bc520b61a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 18:04:03 +0100 Subject: [PATCH 24/25] Fix linting --- CHANGELOG.md | 1 + .../bcftools/mpileup/bcftools-mpileup.diff | 30 ++++++++++++++ .../pluginsplit/bcftools-pluginsplit.diff | 39 +++++++++++++++++++ .../local/bam_region_samtools/main.nf | 2 +- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff create mode 100644 modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f74f5a8..d1553af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Initial release of nf-core/phaseimpute, created with the [nf-core](https://nf-co - [#102](https://github.com/nf-core/phaseimpute/pull/102) - Update all test and recompute snapshot to match new version of the phaseimpute test dataset. - [#103](https://github.com/nf-core/phaseimpute/pull/103) - Update Glimpse2 phase, gunzip and multiqc - [#135](https://github.com/nf-core/phaseimpute/pull/135) - Impute by batch of 100 individuals by default using `--batch_size` parameter. All individuals BAM files are gathered and VCF are allowed for glimpse1 and glimpse2. Channel preprocessing of stitch is done in stitch subworkflow. Genotype likelihood computation for glimpse1 is now done outside of the subworkflow and merge the resulting vcf with all the samples. New test added to check batch separation. Improve `usage.md` documentation. Add validation to initialisation of the pipeline to ensure compatibility between tools, steps and the files provided by the user. +- [#139](https://github.com/nf-core/phaseimpute/pull/139) - Update all nf-core modules ### `Fixed` diff --git a/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff b/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff new file mode 100644 index 00000000..a24a121f --- /dev/null +++ b/modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff @@ -0,0 +1,30 @@ +Changes in module 'nf-core/bcftools/mpileup' +'modules/nf-core/bcftools/mpileup/environment.yml' is unchanged +Changes in 'bcftools/mpileup/main.nf': +--- modules/nf-core/bcftools/mpileup/main.nf ++++ modules/nf-core/bcftools/mpileup/main.nf +@@ -9,7 +9,7 @@ + + input: + tuple val(meta), path(bam), path(intervals) +- tuple val(meta2), path(fasta) ++ tuple val(meta2), path(fasta), path(fai) + val save_mpileup + + output: +@@ -40,7 +40,7 @@ + $bam \\ + $intervals \\ + $mpileup \\ +- | bcftools call --output-type v $args2 \\ ++ | bcftools call --output-type v $args2 $intervals \\ + | bcftools reheader --samples sample_name.list \\ + | bcftools view --output-file ${prefix}.vcf.gz --output-type z $args3 + + +'modules/nf-core/bcftools/mpileup/meta.yml' is unchanged +'modules/nf-core/bcftools/mpileup/tests/main.nf.test' is unchanged +'modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap' is unchanged +'modules/nf-core/bcftools/mpileup/tests/nextflow.config' is unchanged +'modules/nf-core/bcftools/mpileup/tests/tags.yml' is unchanged +************************************************************ diff --git a/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff b/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff new file mode 100644 index 00000000..fa8118aa --- /dev/null +++ b/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff @@ -0,0 +1,39 @@ +Changes in module 'nf-core/bcftools/pluginsplit' +'modules/nf-core/bcftools/pluginsplit/environment.yml' is unchanged +Changes in 'bcftools/pluginsplit/main.nf': +--- modules/nf-core/bcftools/pluginsplit/main.nf ++++ modules/nf-core/bcftools/pluginsplit/main.nf +@@ -26,11 +26,17 @@ + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" ++ def suffix = task.ext.suffix ?: "" + + def samples_arg = samples ? "--samples-file ${samples}" : "" + def groups_arg = groups ? "--groups-file ${groups}" : "" + def regions_arg = regions ? "--regions-file ${regions}" : "" + def targets_arg = targets ? "--targets-file ${targets}" : "" ++ def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : ++ args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : ++ args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : ++ args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : ++ "vcf" + + """ + bcftools plugin split \\ +@@ -42,7 +48,7 @@ + ${targets_arg} \\ + --output ${prefix} + +- mv ${prefix}/* . ++ for i in ${prefix}/*; do cp "\$i" "./\$(basename "\$i" .${extension})${suffix}.${extension}"; done + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + +'modules/nf-core/bcftools/pluginsplit/meta.yml' is unchanged +'modules/nf-core/bcftools/pluginsplit/tests/main.nf.test' is unchanged +'modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap' is unchanged +'modules/nf-core/bcftools/pluginsplit/tests/nextflow.config' is unchanged +'modules/nf-core/bcftools/pluginsplit/tests/tags.yml' is unchanged +************************************************************ diff --git a/subworkflows/local/bam_region_samtools/main.nf b/subworkflows/local/bam_region_samtools/main.nf index ca4d9fc2..abdf6f2c 100644 --- a/subworkflows/local/bam_region_samtools/main.nf +++ b/subworkflows/local/bam_region_samtools/main.nf @@ -22,7 +22,7 @@ workflow BAM_REGION_SAMTOOLS { // Extract region of interest SAMTOOLS_VIEW( ch_input_region, - [[], []], + [[], [], []], [] ) ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions.first()) From 3ac39502e03443af0f81a94afe5d92c7ace64fd5 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 28 Oct 2024 18:21:13 +0100 Subject: [PATCH 25/25] Update pluginsplit --- .../bcftools/pluginsplit/bcftools-pluginsplit.diff | 14 ++++++++++++-- modules/nf-core/bcftools/pluginsplit/main.nf | 12 +++++++++++- tests/config/nf-test.config | 1 + 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff b/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff index fa8118aa..f06044e4 100644 --- a/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff +++ b/modules/nf-core/bcftools/pluginsplit/bcftools-pluginsplit.diff @@ -21,12 +21,22 @@ Changes in 'bcftools/pluginsplit/main.nf': """ bcftools plugin split \\ -@@ -42,7 +48,7 @@ +@@ -42,7 +48,17 @@ ${targets_arg} \\ --output ${prefix} - mv ${prefix}/* . -+ for i in ${prefix}/*; do cp "\$i" "./\$(basename "\$i" .${extension})${suffix}.${extension}"; done ++ for file in ${prefix}/*; do ++ # Extract the basename ++ base_name=\$(basename "\$file") ++ # Extract the part of the basename before the first dot ++ name_before_dot="\${base_name%%.*}" ++ # Extract the extension ++ extension="\${base_name#\${name_before_dot}}" ++ # Construct the new name ++ new_name="\${name_before_dot}${suffix}\${extension}" ++ mv "\$file" "./\$new_name" ++ done cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 70ee882a..8b493087 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -48,7 +48,17 @@ process BCFTOOLS_PLUGINSPLIT { ${targets_arg} \\ --output ${prefix} - for i in ${prefix}/*; do cp "\$i" "./\$(basename "\$i" .${extension})${suffix}.${extension}"; done + for file in ${prefix}/*; do + # Extract the basename + base_name=\$(basename "\$file") + # Extract the part of the basename before the first dot + name_before_dot="\${base_name%%.*}" + # Extract the extension + extension="\${base_name#\${name_before_dot}}" + # Construct the new name + new_name="\${name_before_dot}${suffix}\${extension}" + mv "\$file" "./\$new_name" + done cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 3d813e2f..deb46598 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -1,5 +1,6 @@ params { publish_dir_mode = "copy" + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' } process {
Process Name \\", - " \\ Software Version
CUSTOM_DUMPSOFTWAREVERSIONSpython3.11.7
yaml5.4.1
TOOL1tool10.11.9
TOOL2tool21.9
WorkflowNextflow