From a55519ee954a3f7bd6e228254ecc7204d9eee877 Mon Sep 17 00:00:00 2001 From: DavideBag <96130443+DavideBag@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:28:17 +0100 Subject: [PATCH] Plink linkage disequilibrium additional output (#5388) * adding outputs * output and style correction * fixing stub --------- Co-authored-by: Francesco Lescai <53608000+lescai@users.noreply.github.com> --- modules/nf-core/plink/ld/main.nf | 8 +++++-- modules/nf-core/plink/ld/meta.yml | 11 +++++++-- modules/nf-core/plink/ld/tests/main.nf.test | 18 ++++++++++---- .../nf-core/plink/ld/tests/main.nf.test.snap | 24 +++++++++++++++---- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/modules/nf-core/plink/ld/main.nf b/modules/nf-core/plink/ld/main.nf index 72493681d97..b6315689d79 100644 --- a/modules/nf-core/plink/ld/main.nf +++ b/modules/nf-core/plink/ld/main.nf @@ -14,8 +14,10 @@ process PLINK_LD { tuple val(meta4), path(snpfile) output: - tuple val(meta), path("*.ld") , emit: ld - path "versions.yml" , emit: versions + tuple val(meta), path("*.ld") , emit: ld + tuple val(meta), path("*.log") , emit: log + tuple val(meta), path("*.nosex"), emit: nosex, optional:true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -83,6 +85,8 @@ process PLINK_LD { } """ touch ${prefix}.ld + touch ${prefix}.log + touch ${prefix}.nosex cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/plink/ld/meta.yml b/modules/nf-core/plink/ld/meta.yml index b948141ffd7..3e16ab4b6bc 100644 --- a/modules/nf-core/plink/ld/meta.yml +++ b/modules/nf-core/plink/ld/meta.yml @@ -38,7 +38,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - meta is associated to phenotype files input + meta is associated to randomly selected snp files input - bed: type: file description: PLINK binary biallelic genotype table file @@ -76,11 +76,18 @@ output: type: file description: File containing software versions pattern: "versions.yml" - - ld: type: file description: | The output of a linkage disequilibrium analysis in PLINK typically includes a table showing variant pairs and their associated LD values, often expressed as R². + - log: + type: file + description: | + Log file of the ld process + - nosex: + type: file + description: | + Ambiguous sex ID file authors: - "@davidebag" maintainers: diff --git a/modules/nf-core/plink/ld/tests/main.nf.test b/modules/nf-core/plink/ld/tests/main.nf.test index d05fdb676c5..66384aae897 100644 --- a/modules/nf-core/plink/ld/tests/main.nf.test +++ b/modules/nf-core/plink/ld/tests/main.nf.test @@ -1,4 +1,3 @@ - nextflow_process { name "Test Process PLINK_LD" @@ -35,7 +34,11 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out.version).match("version") }, - { assert snapshot(process.out.ld).match() } + { assert snapshot( + process.out.ld, + process.out.nosex + ).match() }, + { assert process.out.log.get(0).get(1) ==~ ".*/*.log" } ) } } @@ -66,7 +69,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.ld).match() } + { assert snapshot( + process.out.ld + ).match() }, + { assert process.out.log.get(0).get(1) ==~ ".*/*.log" } ) } } @@ -95,7 +101,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.ld).match() } + { assert snapshot( + process.out.ld, + process.out.nosex + ).match() }, + { assert process.out.log.get(0).get(1) ==~ ".*/*.log" } ) } } diff --git a/modules/nf-core/plink/ld/tests/main.nf.test.snap b/modules/nf-core/plink/ld/tests/main.nf.test.snap index 49a979eb172..fccd93e6b4d 100644 --- a/modules/nf-core/plink/ld/tests/main.nf.test.snap +++ b/modules/nf-core/plink/ld/tests/main.nf.test.snap @@ -8,13 +8,21 @@ }, "test.ld:md5,647636ceb985a3ff66b17c79004d284f" ] + ], + [ + [ + { + "id": "test" + }, + "test.nosex:md5,4f9aa36c44a417ff6d7caa9841e66ad9" + ] ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:33:55.438572792" + "timestamp": "2024-03-22T13:56:51.1545332" }, "plink - binary": { "content": [ @@ -31,7 +39,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:33:36.640948294" + "timestamp": "2024-03-22T13:56:40.371392669" }, "plink - VCF": { "content": [ @@ -42,13 +50,21 @@ }, "test.ld:md5,647636ceb985a3ff66b17c79004d284f" ] + ], + [ + [ + { + "id": "test" + }, + "test.nosex:md5,4f9aa36c44a417ff6d7caa9841e66ad9" + ] ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:33:15.208380485" + "timestamp": "2024-03-22T13:56:29.029809559" }, "version": { "content": null, @@ -56,6 +72,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:33:15.199523947" + "timestamp": "2024-03-22T13:56:29.02167666" } } \ No newline at end of file