From 5513d095f5240a0240cd327e3b86fa619819d3d4 Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen Date: Tue, 31 May 2022 15:37:26 +0200 Subject: [PATCH 1/6] Adding tbi-files to the output from GATK4_MERGEVCFS. #1709 --- modules/gatk4/mergevcfs/main.nf | 1 + modules/gatk4/mergevcfs/meta.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index 964c1a3b..35930a6e 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -13,6 +13,7 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi path "versions.yml" , emit: versions when: diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 8d4123d9..6110e944 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -35,6 +35,12 @@ output: type: file description: merged vcf file pattern: "*.vcf.gz" + - tbi: + type: file + description: index files for the merged vcf files + pattern: "*.tbi" + + - versions: type: file description: File containing software versions From 3e20ca7e9a0400b3d878e6c846a3b3733bfb867c Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:46:28 +0200 Subject: [PATCH 2/6] Don't hardcode forced output names --- tests/modules/filtlong/nextflow.config | 1 + tests/modules/filtlong/test.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index ec9854c2..f0b90e67 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,5 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" + ext.prefix = "${meta.id}_lr" } diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml index 93f847ec..87bd491b 100644 --- a/tests/modules/filtlong/test.yml +++ b/tests/modules/filtlong/test.yml @@ -3,7 +3,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -12,7 +12,7 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" @@ -21,6 +21,6 @@ tags: - filtlong files: - - path: output/filtlong/test_lr_filtlong.fastq.gz + - path: output/filtlong/test_lr.fastq.gz contains: - "@00068f7a-51b3-4933-8fc6-7d6e29181ff9" From 089f761f0bf79c4a486f1df9b6205f650196a2c1 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 15:49:57 +0200 Subject: [PATCH 3/6] Actually add the changes --- modules/filtlong/main.nf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf index 67500053..9dbf05b2 100644 --- a/modules/filtlong/main.nf +++ b/modules/filtlong/main.nf @@ -11,7 +11,7 @@ process FILTLONG { tuple val(meta), path(shortreads), path(longreads) output: - tuple val(meta), path("${meta.id}_lr_filtlong.fastq.gz"), emit: reads + tuple val(meta), path("*.fastq.gz"), emit: reads path "versions.yml" , emit: versions when: @@ -21,12 +21,13 @@ process FILTLONG { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + if ("$longreads" == "${prefix}.fastq.gz") error "Longread FASTQ input and output names are the same, set prefix in module configuration to disambiguate!" """ filtlong \\ $short_reads \\ $args \\ $longreads \\ - | gzip -n > ${prefix}_lr_filtlong.fastq.gz + | gzip -n > ${prefix}.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": From 98bb45cf4e93801116d9435f2c1e644f91f0628d Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 13:59:56 +0000 Subject: [PATCH 4/6] Updating test for gatk4/mergevcfs --- tests/modules/gatk4/mergevcfs/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/modules/gatk4/mergevcfs/test.yml b/tests/modules/gatk4/mergevcfs/test.yml index da2f7578..eb43a184 100644 --- a/tests/modules/gatk4/mergevcfs/test.yml +++ b/tests/modules/gatk4/mergevcfs/test.yml @@ -6,6 +6,8 @@ files: - path: output/gatk4/test.vcf.gz md5sum: 5b289bda88d3a3504f2e19ee8cff177c + - path: output/gatk4/test.vcf.gz.tbi + md5sum: a81673763b13086cfce9a23e72a35a16 - path: output/gatk4/versions.yml - name: gatk4 mergevcfs test_gatk4_mergevcfs_no_dict From 4199a05aeb0ec277d40cb112949bb85893310873 Mon Sep 17 00:00:00 2001 From: asp8200 Date: Tue, 31 May 2022 15:34:34 +0000 Subject: [PATCH 5/6] Removing redundant empty line --- modules/gatk4/mergevcfs/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 6110e944..3ebce0b9 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -40,7 +40,6 @@ output: description: index files for the merged vcf files pattern: "*.tbi" - - versions: type: file description: File containing software versions From df22cd80df8bee4d3f1d5750026c26c560be7392 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 31 May 2022 20:07:52 +0200 Subject: [PATCH 6/6] Fix config for tests --- tests/modules/filtlong/nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config index f0b90e67..5e4c9fbb 100644 --- a/tests/modules/filtlong/nextflow.config +++ b/tests/modules/filtlong/nextflow.config @@ -3,6 +3,6 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.args = "--min_length 10" - ext.prefix = "${meta.id}_lr" + ext.prefix = "test_lr" }