From b5da92285bf155cb49f4a46b0771f571cceebe9f Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Wed, 26 Mar 2025 17:03:24 -0300 Subject: [PATCH 01/20] add gcta/gsmr tool --- modules/nf-core/gcta/gsmr/environment.yml | 7 ++ modules/nf-core/gcta/gsmr/main.nf | 63 +++++++++++ modules/nf-core/gcta/gsmr/meta.yml | 67 ++++++++++++ modules/nf-core/gcta/gsmr/nextflow.config | 12 +++ modules/nf-core/gcta/gsmr/tests/main.nf.test | 102 ++++++++++++++++++ .../nf-core/gcta/gsmr/tests/main.nf.test.snap | 38 +++++++ 6 files changed, 289 insertions(+) create mode 100644 modules/nf-core/gcta/gsmr/environment.yml create mode 100644 modules/nf-core/gcta/gsmr/main.nf create mode 100644 modules/nf-core/gcta/gsmr/meta.yml create mode 100644 modules/nf-core/gcta/gsmr/nextflow.config create mode 100644 modules/nf-core/gcta/gsmr/tests/main.nf.test create mode 100644 modules/nf-core/gcta/gsmr/tests/main.nf.test.snap diff --git a/modules/nf-core/gcta/gsmr/environment.yml b/modules/nf-core/gcta/gsmr/environment.yml new file mode 100644 index 000000000000..543862387283 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::gcta=1.94.1" diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf new file mode 100644 index 000000000000..6d3849c36680 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -0,0 +1,63 @@ +process GCTA_GSMR { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gcta:1.94.1--h9ee0642_0': + 'quay.io/biocontainers/gcta:1.94.1--h9ee0642_0' }" + + input: + + tuple val(meta), path(exposure) + tuple val(meta2), path(outcome) + path(reference) + + output: + path "${meta.id}_${meta2.id}.log", emit: log + path "${meta.id}_${meta2.id}.gsmr", emit: gsmr + path "${meta.id}_${meta2.id}.eff_plot.gz", emit: eff_plot, optional: true + path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, 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}" + + """ + echo "${meta.id} ${exposure}" > ${meta.id}.input.txt + echo "${meta2.id} ${outcome}" > outcome.txt + file=\$(ls $reference | sed 's/\\.[^.]*\$//') + echo "${reference}/\$file" | head -n1 > reference.txt + + gcta \ + --mbfile reference.txt \ + --gsmr-file ${meta.id}.input.txt outcome.txt \ + --out "${meta.id}_${meta2.id}" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gcta: \$(gcta 2>&1 | awk '/no analysis has been launched/ {exit 0} {print}' | sed -n 's/.*version \\(v[0-9.]*\\).*/\\1/p') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${meta.id}_${meta2.id}.log + touch ${meta.id}_${meta2.id}.gsmr + touch ${meta.id}_${meta2.id}.mono.badsnps + echo "" | gzip > ${meta.id}_${meta2.id}.eff_plot.gz + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gcta: \$(gcta 2>&1 | awk '/no analysis has been launched/ {exit 0} {print}' | sed -n 's/.*version \\(v[0-9.]*\\).*/\\1/p') + END_VERSIONS + """ +} diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml new file mode 100644 index 000000000000..1ec6f6af4027 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -0,0 +1,67 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "gcta_gsmr" +description: Module that performs a Mendelian Randomization analysis with summary data and plink bfile +keywords: + - Mendelian Randomization + - GWAS + - gsmr +tools: + - "gcta": + description: "GCTA (Genome-wide Complex Trait Analysis) estimates the proportion of phenotypic variance explained by all genome-wide SNPs for complex traits." + homepage: "https://yanglab.westlake.edu.cn/software/gcta" + documentation: "https://yanglab.westlake.edu.cn/software/gcta/" + tool_dev_url: "https://github.com/jianyangqt/gcta" + doi: "10.1038/s41467-017-02317-2" + licence: ['GPL v3'] + identifier: biotools:gcta + +input: + - meta: + type: map + description: Groovy Map containing sample information e.g. `[ id:'sample1' ]` + - exposure: + type: file + description: Exposure data file for GSMR analysis + pattern: "*.txt" + - meta2: + type: map + description: Groovy Map containing sample information for outcome e.g. `[ id:'sample2' ]` + - outcome: + type: file + description: Outcome data file for GSMR analysis + pattern: "*.txt" + - reference: + type: directory + description: Directory containing reference files (BED, BIM, FAM) for GCTA analysis + pattern: "*" + +output: + - gsmr_log: + type: file + description: Log file from GSMR analysis + pattern: "*.log" + - gsmr_res: + type: file + description: Results file from GSMR analysis + pattern: "*.gsmr" + - gsmr_effplot: + type: file + description: Effect plot from GSMR analysis (optional) + pattern: "*.eff_plot.gz" + - mono_badsnps: + type: file + description: File containing bad SNPs identified in GSMR analysis (optional) + pattern: "*.mono.badsnps" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@juliaapolonio" +maintainers: + - "@juliaapolonio" + +thread_id: + - 1d3cb393-7630-45b3-b965-4cf5d1fc7272 diff --git a/modules/nf-core/gcta/gsmr/nextflow.config b/modules/nf-core/gcta/gsmr/nextflow.config new file mode 100644 index 000000000000..09b1312c3a38 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/nextflow.config @@ -0,0 +1,12 @@ +process { + publishDir = [ + path: { "${params.outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" }, + mode: 'copy', + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] +} + +docker.enabled = true + +// Uncomment and modify the following line if you want to use a specific container +// process.container = 'biocontainers/gcta:1.94.1--h9ee0642_0' diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test new file mode 100644 index 000000000000..29ed85d7f66a --- /dev/null +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -0,0 +1,102 @@ +// nf-core modules test gcta/gsmr +nextflow_process { + + name "Test Process GCTA_GSMR" + script "../main.nf" + process "GCTA_GSMR" + + tag "modules" + tag "modules_nfcore" + tag "gcta" + tag "gcta/gsmr" + + test("homo_sapiens - gsmr") { + + when { + process { + """ + input[0] = [ + [ id:'test_exposure' ], + file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats.tsv") + ] + input[1] = [ + [ id:'test_outcome' ], + file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats_copy.tsv") + ] + + // Stage individual files + def bedFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bed") + def bimFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bim") + def famFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.fam") + + // Create a folder and move files into it + def referenceDir = file("reference") + referenceDir.mkdirs() + bedFile.copyTo(referenceDir.resolve("reference.bed")) + bimFile.copyTo(referenceDir.resolve("reference.bim")) + famFile.copyTo(referenceDir.resolve("reference.fam")) + + // Pass the folder as input + input[2] = referenceDir """ + } + } + + then { + assert process.success + assert snapshot( + process.out.gsmr, + process.out.eff_plot, + process.out.mono_badsnps + ).match() + assert path(process.out.versions.get(0)).text.contains("GSMR") + } + + } + + test("homo_sapiens - gsmr - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test_exposure' ], + file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats.tsv") + ] + input[1] = [ + [ id:'test_outcome' ], + file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats_copy.tsv") + ] + + // Stage individual files + def bedFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bed") + def bimFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bim") + def famFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.fam") + + // Create a folder and move files into it + def referenceDir = file("reference") + referenceDir.mkdirs() + bedFile.copyTo(referenceDir.resolve("reference.bed")) + bimFile.copyTo(referenceDir.resolve("reference.bim")) + famFile.copyTo(referenceDir.resolve("reference.fam")) + + // Pass the folder as input + input[2] = referenceDir """ + } + } + + then { + assert process.success + assert snapshot( + process.out.gsmr, + process.out.eff_plot, + process.out.mono_badsnps + ).match() + + assert path(process.out.versions.get(0)).text.contains("GSMR") + } + + } + +} diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap new file mode 100644 index 000000000000..a6b54899deaf --- /dev/null +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap @@ -0,0 +1,38 @@ +{ + "homo_sapiens - gsmr": { + "content": [ + [ + "test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa" + ], + [ + + ], + [ + "test_exposure_test_outcome.mono.badsnps:md5,0fe7dcfd9384c40361e7009ed28098cc" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-26T15:38:16.042312787" + }, + "homo_sapiens - gsmr - stub": { + "content": [ + [ + "test_exposure_test_outcome.gsmr:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "test_exposure_test_outcome.eff_plot.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ], + [ + "test_exposure_test_outcome.mono.badsnps:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-26T15:38:25.616277161" + } +} \ No newline at end of file From 179a1b30ac41497b58f97fc69aeb078c287f127c Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 08:05:16 -0300 Subject: [PATCH 02/20] solve part of linting issues --- modules/nf-core/gcta/gsmr/main.nf | 2 +- modules/nf-core/gcta/gsmr/meta.yml | 16 ++++++++-------- modules/nf-core/gcta/gsmr/tests/main.nf.test | 6 ++++-- .../nf-core/gcta/gsmr/tests/main.nf.test.snap | 10 ++++++++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 6d3849c36680..418b0b2f21b9 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -5,7 +5,7 @@ process GCTA_GSMR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/gcta:1.94.1--h9ee0642_0': - 'quay.io/biocontainers/gcta:1.94.1--h9ee0642_0' }" + 'biocontainers/gcta:1.94.1--h9ee0642_0' }" input: diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 1ec6f6af4027..16da6c5d050a 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -32,20 +32,21 @@ input: description: Outcome data file for GSMR analysis pattern: "*.txt" - reference: - type: directory - description: Directory containing reference files (BED, BIM, FAM) for GCTA analysis - pattern: "*" + type: file + description: Reference files (BED, BIM, FAM) for GCTA analysis + pattern: "*.{bed,bim,fam}" + multiple: true output: - - gsmr_log: + - gsmr: type: file description: Log file from GSMR analysis pattern: "*.log" - - gsmr_res: + - gsmr: type: file description: Results file from GSMR analysis pattern: "*.gsmr" - - gsmr_effplot: + - eff_plot: type: file description: Effect plot from GSMR analysis (optional) pattern: "*.eff_plot.gz" @@ -63,5 +64,4 @@ authors: maintainers: - "@juliaapolonio" -thread_id: - - 1d3cb393-7630-45b3-b965-4cf5d1fc7272 + diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index 29ed85d7f66a..5f273d0fbe0b 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -46,7 +46,8 @@ nextflow_process { assert snapshot( process.out.gsmr, process.out.eff_plot, - process.out.mono_badsnps + process.out.mono_badsnps, + process.out.versions ).match() assert path(process.out.versions.get(0)).text.contains("GSMR") } @@ -91,7 +92,8 @@ nextflow_process { assert snapshot( process.out.gsmr, process.out.eff_plot, - process.out.mono_badsnps + process.out.mono_badsnps, + process.out.versions ).match() assert path(process.out.versions.get(0)).text.contains("GSMR") diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap index a6b54899deaf..05b8bc648eed 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap @@ -9,13 +9,16 @@ ], [ "test_exposure_test_outcome.mono.badsnps:md5,0fe7dcfd9384c40361e7009ed28098cc" + ], + [ + "versions.yml:md5,9d63b9cb692159dbd3c08b55eca5212b" ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.5" }, - "timestamp": "2025-03-26T15:38:16.042312787" + "timestamp": "2025-03-26T16:57:12.009292265" }, "homo_sapiens - gsmr - stub": { "content": [ @@ -27,12 +30,15 @@ ], [ "test_exposure_test_outcome.mono.badsnps:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "versions.yml:md5,9d63b9cb692159dbd3c08b55eca5212b" ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.5" }, - "timestamp": "2025-03-26T15:38:25.616277161" + "timestamp": "2025-03-26T16:57:20.670192583" } } \ No newline at end of file From acab75fcc3d161c4f50b558ec6bf17435ce84f2f Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 08:23:27 -0300 Subject: [PATCH 03/20] fix identation of meta.yml --- modules/nf-core/gcta/gsmr/meta.yml | 91 +++++++++++++++--------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 16da6c5d050a..9a314b26657f 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -1,67 +1,66 @@ ---- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "gcta_gsmr" -description: Module that performs a Mendelian Randomization analysis with summary data and plink bfile +description: "Module that performs a Mendelian Randomization analysis with summary + data and plink bfile." keywords: - Mendelian Randomization - GWAS - - gsmr + - GSMR tools: - - "gcta": - description: "GCTA (Genome-wide Complex Trait Analysis) estimates the proportion of phenotypic variance explained by all genome-wide SNPs for complex traits." + - gcta: + description: "GCTA (Genome-wide Complex Trait Analysis) estimates the proportion + of phenotypic variance explained by all genome-wide SNPs for complex traits." homepage: "https://yanglab.westlake.edu.cn/software/gcta" documentation: "https://yanglab.westlake.edu.cn/software/gcta/" tool_dev_url: "https://github.com/jianyangqt/gcta" doi: "10.1038/s41467-017-02317-2" - licence: ['GPL v3'] - identifier: biotools:gcta + licence: + - "GPL v3" + identifier: "biotools:gcta" input: - - meta: - type: map - description: Groovy Map containing sample information e.g. `[ id:'sample1' ]` - - exposure: - type: file - description: Exposure data file for GSMR analysis - pattern: "*.txt" - - meta2: - type: map - description: Groovy Map containing sample information for outcome e.g. `[ id:'sample2' ]` - - outcome: - type: file - description: Outcome data file for GSMR analysis - pattern: "*.txt" - - reference: - type: file - description: Reference files (BED, BIM, FAM) for GCTA analysis - pattern: "*.{bed,bim,fam}" - multiple: true - + - - meta: + type: "map" + description: "Groovy Map containing sample information e.g. `[ id:'sample1' + ]`" + - exposure: + type: "file" + description: "Exposure data file for GSMR analysis." + pattern: "*.txt" + - - meta2: + type: "map" + description: "Groovy Map containing sample information for outcome e.g. `[ id:'sample2' + ]`" + - outcome: + type: "file" + description: "Outcome data file for GSMR analysis." + pattern: "*.txt" + - - reference: + type: "file" + description: "Reference files (BED, BIM, FAM) for GCTA analysis." + pattern: "*.{bed,bim,fam}" + multiple: true output: + - log: + - ${meta.id}_${meta2.id}.log: {} - gsmr: - type: file - description: Log file from GSMR analysis - pattern: "*.log" - - gsmr: - type: file - description: Results file from GSMR analysis - pattern: "*.gsmr" + - ${meta.id}_${meta2.id}.gsmr: {} - eff_plot: - type: file - description: Effect plot from GSMR analysis (optional) - pattern: "*.eff_plot.gz" + - ${meta.id}_${meta2.id}.eff_plot.gz: + type: "file" + description: "Effect plot from GSMR analysis (optional)." + pattern: "*.eff_plot.gz" - mono_badsnps: - type: file - description: File containing bad SNPs identified in GSMR analysis (optional) - pattern: "*.mono.badsnps" + - ${meta.id}_${meta2.id}.mono.badsnps: + type: "file" + description: "File containing bad SNPs identified in GSMR analysis (optional)." + pattern: "*.mono.badsnps" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - + - versions.yml: + type: "file" + description: "File containing software versions." + pattern: "versions.yml" authors: - "@juliaapolonio" maintainers: - "@juliaapolonio" - - From ed697657e767a1841d8d70f68b2406ee6bfd2c25 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 08:38:42 -0300 Subject: [PATCH 04/20] fix all linting issues --- modules/nf-core/gcta/gsmr/meta.yml | 84 +++++++++++++++++------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 9a314b26657f..90345ef8406f 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -1,65 +1,79 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: "gcta_gsmr" -description: "Module that performs a Mendelian Randomization analysis with summary - data and plink bfile." +name: gcta_gsmr +description: Module that performs a Mendelian Randomization analysis with summary + data and plink bfile. keywords: - Mendelian Randomization - GWAS - - GSMR + - gsmr tools: - gcta: - description: "GCTA (Genome-wide Complex Trait Analysis) estimates the proportion - of phenotypic variance explained by all genome-wide SNPs for complex traits." - homepage: "https://yanglab.westlake.edu.cn/software/gcta" - documentation: "https://yanglab.westlake.edu.cn/software/gcta/" - tool_dev_url: "https://github.com/jianyangqt/gcta" - doi: "10.1038/s41467-017-02317-2" - licence: - - "GPL v3" - identifier: "biotools:gcta" - + description: | + GCTA (Genome-wide Complex Trait Analysis) estimates the proportion of phenotypic variance explained + by all genome-wide SNPs for complex traits. + homepage: https://yanglab.westlake.edu.cn/software/gcta + documentation: https://yanglab.westlake.edu.cn/software/gcta/ + tool_dev_url: https://github.com/jianyangqt/gcta + doi: 10.1038/s41467-017-02317-2 + licence: ["GPL v3"] + identifier: biotools:gcta input: - - meta: - type: "map" - description: "Groovy Map containing sample information e.g. `[ id:'sample1' - ]`" + type: map + description: | + Groovy Map containing sample information for exposure + e.g. [ id:'sample1' ] - exposure: - type: "file" - description: "Exposure data file for GSMR analysis." + type: file + description: Exposure data file for GSMR analysis pattern: "*.txt" + ontologies: [] - - meta2: - type: "map" - description: "Groovy Map containing sample information for outcome e.g. `[ id:'sample2' - ]`" + type: map + description: | + Groovy Map containing sample information for outcome + e.g. [ id:'sample2' ] - outcome: - type: "file" - description: "Outcome data file for GSMR analysis." + type: file + description: Outcome data file for GSMR analysis pattern: "*.txt" + ontologies: [] - - reference: - type: "file" - description: "Reference files (BED, BIM, FAM) for GCTA analysis." + type: file + description: Reference files (BED, BIM, FAM) for GCTA analysis pattern: "*.{bed,bim,fam}" multiple: true + ontologies: [] output: - log: - - ${meta.id}_${meta2.id}.log: {} + - ${meta.id}_${meta2.id}.log: + type: file + description: Log file from GSMR analysis + pattern: "*.log" + ontologies: [] - gsmr: - - ${meta.id}_${meta2.id}.gsmr: {} + - ${meta.id}_${meta2.id}.gsmr: + type: file + description: Results file from GSMR analysis + pattern: "*.gsmr" + ontologies: [] - eff_plot: - ${meta.id}_${meta2.id}.eff_plot.gz: - type: "file" - description: "Effect plot from GSMR analysis (optional)." + type: file + description: Effect plot from GSMR analysis (optional) pattern: "*.eff_plot.gz" + ontologies: [] - mono_badsnps: - ${meta.id}_${meta2.id}.mono.badsnps: - type: "file" - description: "File containing bad SNPs identified in GSMR analysis (optional)." + type: file + description: File containing bad SNPs identified in GSMR analysis (optional) pattern: "*.mono.badsnps" + ontologies: [] - versions: - versions.yml: - type: "file" - description: "File containing software versions." + type: file + description: File containing software versions pattern: "versions.yml" + ontologies: [] authors: - "@juliaapolonio" maintainers: From 6b09431a84c10eef58c50f3ad87a4f860c265c63 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 09:14:33 -0300 Subject: [PATCH 05/20] remove unecessary file --- modules/nf-core/gcta/gsmr/nextflow.config | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 modules/nf-core/gcta/gsmr/nextflow.config diff --git a/modules/nf-core/gcta/gsmr/nextflow.config b/modules/nf-core/gcta/gsmr/nextflow.config deleted file mode 100644 index 09b1312c3a38..000000000000 --- a/modules/nf-core/gcta/gsmr/nextflow.config +++ /dev/null @@ -1,12 +0,0 @@ -process { - publishDir = [ - path: { "${params.outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" }, - mode: 'copy', - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] -} - -docker.enabled = true - -// Uncomment and modify the following line if you want to use a specific container -// process.container = 'biocontainers/gcta:1.94.1--h9ee0642_0' From 662c58271b62f6823806a79bee2d2a0a13c05d05 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 09:15:34 -0300 Subject: [PATCH 06/20] fix prefix definition --- modules/nf-core/gcta/gsmr/main.nf | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 418b0b2f21b9..3d9c5887ddb1 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -9,14 +9,14 @@ process GCTA_GSMR { input: - tuple val(meta), path(exposure) + tuple val(meta), path(exposure) tuple val(meta2), path(outcome) path(reference) output: - path "${meta.id}_${meta2.id}.log", emit: log - path "${meta.id}_${meta2.id}.gsmr", emit: gsmr - path "${meta.id}_${meta2.id}.eff_plot.gz", emit: eff_plot, optional: true + path "${meta.id}_${meta2.id}.log" , emit: log + path "${meta.id}_${meta2.id}.gsmr" , emit: gsmr + path "${meta.id}_${meta2.id}.eff_plot.gz" , emit: eff_plot, optional: true path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, optional: true path "versions.yml" , emit: versions @@ -24,8 +24,8 @@ process GCTA_GSMR { 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}_${meta2.id}" """ echo "${meta.id} ${exposure}" > ${meta.id}.input.txt @@ -36,7 +36,7 @@ process GCTA_GSMR { gcta \ --mbfile reference.txt \ --gsmr-file ${meta.id}.input.txt outcome.txt \ - --out "${meta.id}_${meta2.id}" + --out "${prefix}" cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -45,14 +45,14 @@ process GCTA_GSMR { """ stub: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}" """ - touch ${meta.id}_${meta2.id}.log - touch ${meta.id}_${meta2.id}.gsmr - touch ${meta.id}_${meta2.id}.mono.badsnps - echo "" | gzip > ${meta.id}_${meta2.id}.eff_plot.gz + touch ${prefix}.log + touch ${prefix}.gsmr + touch ${prefix}.mono.badsnps + echo "" | gzip > ${prefix}.eff_plot.gz cat <<-END_VERSIONS > versions.yml From 5f3af7c7c8ebd485fb933bdee85027009ab4b490 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 27 Mar 2025 09:21:19 -0300 Subject: [PATCH 07/20] fix harshil alignment --- modules/nf-core/gcta/gsmr/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 3d9c5887ddb1..2dd5dcd452fa 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -9,7 +9,7 @@ process GCTA_GSMR { input: - tuple val(meta), path(exposure) + tuple val(meta) , path(exposure) tuple val(meta2), path(outcome) path(reference) @@ -18,7 +18,7 @@ process GCTA_GSMR { path "${meta.id}_${meta2.id}.gsmr" , emit: gsmr path "${meta.id}_${meta2.id}.eff_plot.gz" , emit: eff_plot, optional: true path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, optional: true - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when From 5d734e06be0fb1d3a54c628f58319e81e60d24a1 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 09:18:11 -0300 Subject: [PATCH 08/20] address daniel suggestions --- modules/nf-core/gcta/gsmr/main.nf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 2dd5dcd452fa..8ce26b67f7f1 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -8,7 +8,6 @@ process GCTA_GSMR { 'biocontainers/gcta:1.94.1--h9ee0642_0' }" input: - tuple val(meta) , path(exposure) tuple val(meta2), path(outcome) path(reference) @@ -33,10 +32,11 @@ process GCTA_GSMR { file=\$(ls $reference | sed 's/\\.[^.]*\$//') echo "${reference}/\$file" | head -n1 > reference.txt - gcta \ - --mbfile reference.txt \ - --gsmr-file ${meta.id}.input.txt outcome.txt \ - --out "${prefix}" + gcta \\ + $args \\ + --mbfile reference.txt \\ + --gsmr-file ${meta.id}.input.txt outcome.txt \\ + --out "${prefix}" cat <<-END_VERSIONS > versions.yml "${task.process}": From fff21d87d45ed95447b0a0bdf9945fc9bf623d40 Mon Sep 17 00:00:00 2001 From: Julia Apolonio Date: Thu, 3 Apr 2025 09:22:14 -0300 Subject: [PATCH 09/20] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> --- modules/nf-core/gcta/gsmr/main.nf | 11 ++++------- modules/nf-core/gcta/gsmr/tests/main.nf.test | 7 ++++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 8ce26b67f7f1..40e6df91b4c0 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -13,10 +13,10 @@ process GCTA_GSMR { path(reference) output: - path "${meta.id}_${meta2.id}.log" , emit: log - path "${meta.id}_${meta2.id}.gsmr" , emit: gsmr - path "${meta.id}_${meta2.id}.eff_plot.gz" , emit: eff_plot, optional: true - path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, optional: true + path "*.log" , emit: log + path "*.gsmr" , emit: gsmr + path "*.eff_plot.gz" , emit: eff_plot, optional: true + path "*.mono.badsnps", emit: mono_badsnps, optional: true path "versions.yml" , emit: versions when: @@ -25,7 +25,6 @@ process GCTA_GSMR { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}" - """ echo "${meta.id} ${exposure}" > ${meta.id}.input.txt echo "${meta2.id} ${outcome}" > outcome.txt @@ -47,14 +46,12 @@ process GCTA_GSMR { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}" - """ touch ${prefix}.log touch ${prefix}.gsmr touch ${prefix}.mono.badsnps echo "" | gzip > ${prefix}.eff_plot.gz - cat <<-END_VERSIONS > versions.yml "${task.process}": gcta: \$(gcta 2>&1 | awk '/no analysis has been launched/ {exit 0} {print}' | sed -n 's/.*version \\(v[0-9.]*\\).*/\\1/p') diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index 5f273d0fbe0b..3edfeec456c0 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -1,4 +1,3 @@ -// nf-core modules test gcta/gsmr nextflow_process { name "Test Process GCTA_GSMR" @@ -37,7 +36,8 @@ nextflow_process { famFile.copyTo(referenceDir.resolve("reference.fam")) // Pass the folder as input - input[2] = referenceDir """ + input[2] = referenceDir + """ } } @@ -83,7 +83,8 @@ nextflow_process { famFile.copyTo(referenceDir.resolve("reference.fam")) // Pass the folder as input - input[2] = referenceDir """ + input[2] = referenceDir + """ } } From dacd85209b4e33c1f34673fe3fd6f069102c1342 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 09:39:17 -0300 Subject: [PATCH 10/20] fix linting --- modules/nf-core/gcta/gsmr/package-lock.json | 6 +++++ modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf | 28 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 modules/nf-core/gcta/gsmr/package-lock.json create mode 100644 modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf diff --git a/modules/nf-core/gcta/gsmr/package-lock.json b/modules/nf-core/gcta/gsmr/package-lock.json new file mode 100644 index 000000000000..2efcc1c4a954 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "gsmr", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf b/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf new file mode 100644 index 000000000000..5683b66d76b2 --- /dev/null +++ b/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf @@ -0,0 +1,28 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +// Import the GCTA_GSMR module +include { GCTA_GSMR } from './' + +// Define the workflow +workflow { + // Create input channels + exposure_ch = Channel.of([[id: "exposure"], [file(params.exposure)]]) + outcome_ch = Channel.of([[id: "outcome"], [file(params.outcome)]]) + + + // Run GCTA_GSMR + + GCTA_GSMR ( + exposure_ch, + outcome_ch, + params.reference + ) + + // Publish results + GCTA_GSMR.out.gsmr_log.collectFile(name: 'gsmr_logs.txt', storeDir: params.outdir) + GCTA_GSMR.out.gsmr_res.collectFile(name: 'gsmr_results.txt', storeDir: params.outdir) + GCTA_GSMR.out.gsmr_effplot.collectFile(name: 'gsmr_effplots.txt', storeDir: params.outdir) + GCTA_GSMR.out.versions.collectFile(name: 'software_versions.yml', storeDir: params.outdir) +} From a8d926fc7224a0214cc7990f7f630aade26f8d8f Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 09:51:22 -0300 Subject: [PATCH 11/20] delete unnecessary files --- modules/nf-core/gcta/gsmr/package-lock.json | 6 ----- modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf | 28 --------------------- 2 files changed, 34 deletions(-) delete mode 100644 modules/nf-core/gcta/gsmr/package-lock.json delete mode 100644 modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf diff --git a/modules/nf-core/gcta/gsmr/package-lock.json b/modules/nf-core/gcta/gsmr/package-lock.json deleted file mode 100644 index 2efcc1c4a954..000000000000 --- a/modules/nf-core/gcta/gsmr/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "gsmr", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf b/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf deleted file mode 100644 index 5683b66d76b2..000000000000 --- a/modules/nf-core/gcta/gsmr/run_gcta_gsmr.nf +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -// Import the GCTA_GSMR module -include { GCTA_GSMR } from './' - -// Define the workflow -workflow { - // Create input channels - exposure_ch = Channel.of([[id: "exposure"], [file(params.exposure)]]) - outcome_ch = Channel.of([[id: "outcome"], [file(params.outcome)]]) - - - // Run GCTA_GSMR - - GCTA_GSMR ( - exposure_ch, - outcome_ch, - params.reference - ) - - // Publish results - GCTA_GSMR.out.gsmr_log.collectFile(name: 'gsmr_logs.txt', storeDir: params.outdir) - GCTA_GSMR.out.gsmr_res.collectFile(name: 'gsmr_results.txt', storeDir: params.outdir) - GCTA_GSMR.out.gsmr_effplot.collectFile(name: 'gsmr_effplots.txt', storeDir: params.outdir) - GCTA_GSMR.out.versions.collectFile(name: 'software_versions.yml', storeDir: params.outdir) -} From 8ee10830fc5b3cbe8613316ff57bc4296f221e5e Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 09:53:35 -0300 Subject: [PATCH 12/20] fix one linting issue --- modules/nf-core/gcta/gsmr/meta.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 90345ef8406f..60175f773e6b 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -45,25 +45,25 @@ input: ontologies: [] output: - log: - - ${meta.id}_${meta2.id}.log: + - "*.log": type: file description: Log file from GSMR analysis pattern: "*.log" ontologies: [] - gsmr: - - ${meta.id}_${meta2.id}.gsmr: + - "*.gsmr": type: file description: Results file from GSMR analysis pattern: "*.gsmr" ontologies: [] - eff_plot: - - ${meta.id}_${meta2.id}.eff_plot.gz: + - "*.eff_plot.gz": type: file description: Effect plot from GSMR analysis (optional) pattern: "*.eff_plot.gz" ontologies: [] - mono_badsnps: - - ${meta.id}_${meta2.id}.mono.badsnps: + - "*.mono.badsnps": type: file description: File containing bad SNPs identified in GSMR analysis (optional) pattern: "*.mono.badsnps" From 0431c2bce1e489f3a355aa276634459ec0d77cc2 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 10:03:25 -0300 Subject: [PATCH 13/20] change meta.yml according to main --- modules/nf-core/gcta/gsmr/main.nf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 40e6df91b4c0..129faa4369fb 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -13,10 +13,10 @@ process GCTA_GSMR { path(reference) output: - path "*.log" , emit: log - path "*.gsmr" , emit: gsmr - path "*.eff_plot.gz" , emit: eff_plot, optional: true - path "*.mono.badsnps", emit: mono_badsnps, optional: true + path "${meta.id}_${meta2.id}.log" , emit: log + path "${meta.id}_${meta2.id}.gsmr" , emit: gsmr + path "${meta.id}_${meta2.id}.eff_plot.gz" , emit: eff_plot, optional: true + path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, optional: true path "versions.yml" , emit: versions when: From 1086cef1b6f27991d9e2883497d622635c075c96 Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 10:09:40 -0300 Subject: [PATCH 14/20] forgot to add meta.yml --- modules/nf-core/gcta/gsmr/meta.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 60175f773e6b..90345ef8406f 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -45,25 +45,25 @@ input: ontologies: [] output: - log: - - "*.log": + - ${meta.id}_${meta2.id}.log: type: file description: Log file from GSMR analysis pattern: "*.log" ontologies: [] - gsmr: - - "*.gsmr": + - ${meta.id}_${meta2.id}.gsmr: type: file description: Results file from GSMR analysis pattern: "*.gsmr" ontologies: [] - eff_plot: - - "*.eff_plot.gz": + - ${meta.id}_${meta2.id}.eff_plot.gz: type: file description: Effect plot from GSMR analysis (optional) pattern: "*.eff_plot.gz" ontologies: [] - mono_badsnps: - - "*.mono.badsnps": + - ${meta.id}_${meta2.id}.mono.badsnps: type: file description: File containing bad SNPs identified in GSMR analysis (optional) pattern: "*.mono.badsnps" From 7755b75131b5f3c3d62915e616fdd788323d5e6a Mon Sep 17 00:00:00 2001 From: Julia Amorim Date: Thu, 3 Apr 2025 11:54:56 -0300 Subject: [PATCH 15/20] change output format to tuple --- modules/nf-core/gcta/gsmr/main.nf | 10 ++-- modules/nf-core/gcta/gsmr/meta.yml | 53 +++++++++++++++----- modules/nf-core/gcta/gsmr/tests/main.nf.test | 5 +- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 129faa4369fb..7f415de0a8d5 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -13,11 +13,11 @@ process GCTA_GSMR { path(reference) output: - path "${meta.id}_${meta2.id}.log" , emit: log - path "${meta.id}_${meta2.id}.gsmr" , emit: gsmr - path "${meta.id}_${meta2.id}.eff_plot.gz" , emit: eff_plot, optional: true - path "${meta.id}_${meta2.id}.mono.badsnps", emit: mono_badsnps, optional: true - path "versions.yml" , emit: versions + tuple val(meta), val(meta2), path("*.log") , emit: log + tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr + tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true + tuple val(meta), val(meta2), path("*.mono.badsnsps"), emit: mono_badsnps, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 90345ef8406f..b6d76fed1d78 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -45,35 +45,64 @@ input: ontologies: [] output: - log: - - ${meta.id}_${meta2.id}.log: + - meta: + type: map + description: | + Groovy Map containing sample information for exposure + - meta2: + type: map + description: | + Groovy Map containing sample information for outcome + - "*.log": type: file description: Log file from GSMR analysis pattern: "*.log" - ontologies: [] - gsmr: - - ${meta.id}_${meta2.id}.gsmr: + - meta: + type: map + description: | + Groovy Map containing sample information for exposure + - meta2: + type: map + description: | + Groovy Map containing sample information for outcome + - "*.gsmr": type: file - description: Results file from GSMR analysis + description: Result file from GSMR analysis pattern: "*.gsmr" - ontologies: [] - eff_plot: - - ${meta.id}_${meta2.id}.eff_plot.gz: + - meta: + type: map + description: | + Groovy Map containing sample information for exposure + - meta2: + type: map + description: | + Groovy Map containing sample information for outcome + - "*.eff_plot.gz": type: file - description: Effect plot from GSMR analysis (optional) + description: Effect plot file from GSMR analysis (gzipped) pattern: "*.eff_plot.gz" - ontologies: [] + optional: true - mono_badsnps: - - ${meta.id}_${meta2.id}.mono.badsnps: + - meta: + type: map + description: | + Groovy Map containing sample information for exposure + - meta2: + type: map + description: | + Groovy Map containing sample information for outcome + - "*.mono.badsnsps": type: file - description: File containing bad SNPs identified in GSMR analysis (optional) + description: Bad SNPs file from GSMR analysis pattern: "*.mono.badsnps" - ontologies: [] + optional: true - versions: - versions.yml: type: file description: File containing software versions pattern: "versions.yml" - ontologies: [] authors: - "@juliaapolonio" maintainers: diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index 3edfeec456c0..0a3c1707de9f 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -36,7 +36,7 @@ nextflow_process { famFile.copyTo(referenceDir.resolve("reference.fam")) // Pass the folder as input - input[2] = referenceDir + input[2] = referenceDir """ } } @@ -83,7 +83,7 @@ nextflow_process { famFile.copyTo(referenceDir.resolve("reference.fam")) // Pass the folder as input - input[2] = referenceDir + input[2] = referenceDir """ } } @@ -97,7 +97,6 @@ nextflow_process { process.out.versions ).match() - assert path(process.out.versions.get(0)).text.contains("GSMR") } } From 3448573020df0d0da8b67f1cebed5d5240b5c41a Mon Sep 17 00:00:00 2001 From: juliaapolonio Date: Fri, 13 Mar 2026 16:20:14 -0300 Subject: [PATCH 16/20] migrate to topics; fix linting and nf-test --- modules/nf-core/gcta/gsmr/main.nf | 20 +-- modules/nf-core/gcta/gsmr/meta.yml | 127 +++++++++--------- modules/nf-core/gcta/gsmr/tests/main.nf.test | 42 ++---- .../nf-core/gcta/gsmr/tests/main.nf.test.snap | 120 +++++++++++++---- 4 files changed, 178 insertions(+), 131 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 7f415de0a8d5..44b33cab2031 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -13,12 +13,11 @@ process GCTA_GSMR { path(reference) output: - tuple val(meta), val(meta2), path("*.log") , emit: log - tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr - tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true - tuple val(meta), val(meta2), path("*.mono.badsnsps"), emit: mono_badsnps, optional: true - path "versions.yml" , emit: versions - + tuple val(meta), val(meta2), path("*.log") , emit: log + tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr + tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true + tuple val(meta), val(meta2), path("*.mono.badsnps"), emit: mono_badsnps, optional: true + tuple val("${task.process}"), val('gcta'), eval('gcta 2>&1 | grep -oE "v[0-9]+\\.[0-9]+\\.[0-9]+" | sed \'s/v//\''), emit: versions_gcta, topic: versions when: task.ext.when == null || task.ext.when @@ -36,11 +35,6 @@ process GCTA_GSMR { --mbfile reference.txt \\ --gsmr-file ${meta.id}.input.txt outcome.txt \\ --out "${prefix}" - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gcta: \$(gcta 2>&1 | awk '/no analysis has been launched/ {exit 0} {print}' | sed -n 's/.*version \\(v[0-9.]*\\).*/\\1/p') - END_VERSIONS """ stub: @@ -52,9 +46,5 @@ process GCTA_GSMR { touch ${prefix}.mono.badsnps echo "" | gzip > ${prefix}.eff_plot.gz - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gcta: \$(gcta 2>&1 | awk '/no analysis has been launched/ {exit 0} {print}' | sed -n 's/.*version \\(v[0-9.]*\\).*/\\1/p') - END_VERSIONS """ } diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index b6d76fed1d78..4808ba933631 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -1,108 +1,115 @@ -name: gcta_gsmr -description: Module that performs a Mendelian Randomization analysis with summary - data and plink bfile. +name: "gcta_gsmr" +description: Perform GSMR Mendelian Randomization analysis using GCTA with + exposure and outcome summary statistics. keywords: - Mendelian Randomization - GWAS - - gsmr + - GSMR + - causal inference tools: - - gcta: - description: | - GCTA (Genome-wide Complex Trait Analysis) estimates the proportion of phenotypic variance explained - by all genome-wide SNPs for complex traits. - homepage: https://yanglab.westlake.edu.cn/software/gcta - documentation: https://yanglab.westlake.edu.cn/software/gcta/ - tool_dev_url: https://github.com/jianyangqt/gcta - doi: 10.1038/s41467-017-02317-2 - licence: ["GPL v3"] + - "gcta": + description: "GCTA implements GSMR for Mendelian Randomization using summary statistics." + homepage: "https://yanglab.westlake.edu.cn/software/gcta" + documentation: "https://yanglab.westlake.edu.cn/software/gcta/" + tool_dev_url: "https://github.com/jianyangqt/gcta" + doi: "10.1038/s41467-017-02317-2" + licence: + - "GPL v3" identifier: biotools:gcta input: - - meta: type: map - description: | - Groovy Map containing sample information for exposure - e.g. [ id:'sample1' ] + description: Groovy Map containing exposure dataset metadata - exposure: type: file - description: Exposure data file for GSMR analysis + description: Exposure GWAS summary statistics formatted for GSMR pattern: "*.txt" ontologies: [] - - meta2: type: map - description: | - Groovy Map containing sample information for outcome - e.g. [ id:'sample2' ] + description: Groovy Map containing outcome dataset metadata - outcome: type: file - description: Outcome data file for GSMR analysis + description: Outcome GWAS summary statistics formatted for GSMR pattern: "*.txt" ontologies: [] - - - reference: - type: file - description: Reference files (BED, BIM, FAM) for GCTA analysis - pattern: "*.{bed,bim,fam}" - multiple: true - ontologies: [] + - reference: + type: file + description: PLINK reference dataset files (BED/BIM/FAM) + pattern: "*.{bed,bim,fam}" + multiple: true + ontologies: [] output: - - log: - - meta: + log: + - - meta: type: map - description: | - Groovy Map containing sample information for exposure + description: Groovy Map containing sample information for exposure - meta2: type: map - description: | - Groovy Map containing sample information for outcome + description: Groovy Map containing sample information for outcome - "*.log": type: file description: Log file from GSMR analysis pattern: "*.log" - - gsmr: - - meta: + ontologies: [] + gsmr: + - - meta: type: map - description: | - Groovy Map containing sample information for exposure + description: Groovy Map containing sample information for exposure - meta2: type: map - description: | - Groovy Map containing sample information for outcome + description: Groovy Map containing sample information for outcome - "*.gsmr": type: file description: Result file from GSMR analysis pattern: "*.gsmr" - - eff_plot: - - meta: + ontologies: [] + eff_plot: + - - meta: type: map - description: | - Groovy Map containing sample information for exposure + description: Groovy Map containing sample information for exposure - meta2: type: map - description: | - Groovy Map containing sample information for outcome + description: Groovy Map containing sample information for outcome - "*.eff_plot.gz": type: file - description: Effect plot file from GSMR analysis (gzipped) + description: Effect plot file from GSMR analysis pattern: "*.eff_plot.gz" - optional: true - - mono_badsnps: - - meta: + ontologies: + - edam: http://edamontology.org/format_3989 + mono_badsnps: + - - meta: type: map - description: | - Groovy Map containing sample information for exposure + description: Groovy Map containing sample information for exposure - meta2: type: map - description: | - Groovy Map containing sample information for outcome - - "*.mono.badsnsps": + description: Groovy Map containing sample information for outcome + - "*.mono.badsnps": type: file description: Bad SNPs file from GSMR analysis pattern: "*.mono.badsnps" - optional: true - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + ontologies: [] + versions_gcta: + - - ${task.process}: + type: string + description: The name of the process + - gcta: + type: string + description: The name of the tool + - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - gcta: + type: string + description: The name of the tool + - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': + type: eval + description: The expression to obtain the version of the tool authors: - "@juliaapolonio" maintainers: diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index 0a3c1707de9f..9c652b308a1f 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -23,35 +23,28 @@ nextflow_process { file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats_copy.tsv") ] - // Stage individual files def bedFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bed") def bimFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bim") def famFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.fam") - // Create a folder and move files into it def referenceDir = file("reference") referenceDir.mkdirs() bedFile.copyTo(referenceDir.resolve("reference.bed")) bimFile.copyTo(referenceDir.resolve("reference.bim")) famFile.copyTo(referenceDir.resolve("reference.fam")) - // Pass the folder as input input[2] = referenceDir """ } } then { - assert process.success - assert snapshot( - process.out.gsmr, - process.out.eff_plot, - process.out.mono_badsnps, - process.out.versions - ).match() - assert path(process.out.versions.get(0)).text.contains("GSMR") + assertAll( + { assert process.success }, + { assert snapshot(process.out.gsmr).match("gsmr")}, + { assert snapshot(process.out.versions_gcta).match("versions_gcta")} + ) } - } test("homo_sapiens - gsmr - stub") { @@ -70,35 +63,22 @@ nextflow_process { file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats_copy.tsv") ] - // Stage individual files - def bedFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bed") - def bimFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.bim") - def famFile = file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/bfile/bfile.fam") - - // Create a folder and move files into it def referenceDir = file("reference") referenceDir.mkdirs() - bedFile.copyTo(referenceDir.resolve("reference.bed")) - bimFile.copyTo(referenceDir.resolve("reference.bim")) - famFile.copyTo(referenceDir.resolve("reference.fam")) - - // Pass the folder as input input[2] = referenceDir """ } } then { - assert process.success - assert snapshot( - process.out.gsmr, - process.out.eff_plot, - process.out.mono_badsnps, - process.out.versions - ).match() - + assertAll( + { assert process.success }, + { assert snapshot(process.out.gsmr).match("gsmr_stub")}, + { assert snapshot(process.out.versions_gcta).match("versions_gcta_stub")} + ) } } } + diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap index 05b8bc648eed..6ff3d0d34976 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap @@ -1,44 +1,114 @@ { - "homo_sapiens - gsmr": { + "gsmr": { "content": [ [ - "test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa" - ], - [ - - ], - [ - "test_exposure_test_outcome.mono.badsnps:md5,0fe7dcfd9384c40361e7009ed28098cc" - ], + [ + { + "id": "test_exposure" + }, + { + "id": "test_outcome" + }, + "test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa" + ] + ] + ], + "timestamp": "2026-03-13T16:02:41.214728046", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "homo_sapiens - gsmr": { + "content": [ [ - "versions.yml:md5,9d63b9cb692159dbd3c08b55eca5212b" + [ + { + "id": "test_exposure" + }, + { + "id": "test_outcome" + }, + "test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa" + ] ] ], + "timestamp": "2026-03-13T15:06:14.608903963", "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" - }, - "timestamp": "2025-03-26T16:57:12.009292265" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "homo_sapiens - gsmr - stub": { "content": [ [ - "test_exposure_test_outcome.gsmr:md5,d41d8cd98f00b204e9800998ecf8427e" - ], + [ + { + "id": "test_exposure" + }, + { + "id": "test_outcome" + }, + "test_exposure_test_outcome.gsmr:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "timestamp": "2026-03-13T15:06:21.555456661", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "versions_gcta": { + "content": [ [ - "test_exposure_test_outcome.eff_plot.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ], + [ + "GCTA_GSMR", + "gcta", + "1.94.1" + ] + ] + ], + "timestamp": "2026-03-13T16:16:22.216759135", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "versions_gcta_stub": { + "content": [ [ - "test_exposure_test_outcome.mono.badsnps:md5,d41d8cd98f00b204e9800998ecf8427e" - ], + [ + "GCTA_GSMR", + "gcta", + "1.94.1" + ] + ] + ], + "timestamp": "2026-03-13T16:16:27.849357278", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "gsmr_stub": { + "content": [ [ - "versions.yml:md5,9d63b9cb692159dbd3c08b55eca5212b" + [ + { + "id": "test_exposure" + }, + { + "id": "test_outcome" + }, + "test_exposure_test_outcome.gsmr:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ] ], + "timestamp": "2026-03-13T16:04:41.062546751", "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" - }, - "timestamp": "2025-03-26T16:57:20.670192583" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } } } \ No newline at end of file From d274b217a82eed4626ec39b864ad8d88678f9412 Mon Sep 17 00:00:00 2001 From: juliaapolonio Date: Fri, 13 Mar 2026 17:01:40 -0300 Subject: [PATCH 17/20] make module pass pre-commit --- modules/nf-core/gcta/gsmr/environment.yml | 2 +- modules/nf-core/gcta/gsmr/main.nf | 3 +- modules/nf-core/gcta/gsmr/meta.yml | 60 +++++++---------------- 3 files changed, 20 insertions(+), 45 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/environment.yml b/modules/nf-core/gcta/gsmr/environment.yml index 543862387283..3e22ea7b9f20 100644 --- a/modules/nf-core/gcta/gsmr/environment.yml +++ b/modules/nf-core/gcta/gsmr/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - "bioconda::gcta=1.94.1" + - bioconda::gcta=1.94.1 diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 44b33cab2031..8901d3c88bd8 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -17,7 +17,8 @@ process GCTA_GSMR { tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true tuple val(meta), val(meta2), path("*.mono.badsnps"), emit: mono_badsnps, optional: true - tuple val("${task.process}"), val('gcta'), eval('gcta 2>&1 | grep -oE "v[0-9]+\\.[0-9]+\\.[0-9]+" | sed \'s/v//\''), emit: versions_gcta, topic: versions + tuple val("${task.process}"), val('gcta'), eval('gcta 2>&1 | grep -oE "v[0-9]+\\.[0-9]+\\.[0-9]+" | sed \'s/v//\''), emit: versions_gcta, topic: versions + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 4808ba933631..20762e7bfe5c 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -33,15 +33,15 @@ input: description: Outcome GWAS summary statistics formatted for GSMR pattern: "*.txt" ontologies: [] - - reference: - type: file - description: PLINK reference dataset files (BED/BIM/FAM) - pattern: "*.{bed,bim,fam}" - multiple: true - ontologies: [] + reference: + type: file + description: PLINK reference dataset files (BED/BIM/FAM) + pattern: "*.{bed,bim,fam}" + multiple: true + ontologies: [] output: - log: - - - meta: + - log: + - meta: type: map description: Groovy Map containing sample information for exposure - meta2: @@ -51,9 +51,8 @@ output: type: file description: Log file from GSMR analysis pattern: "*.log" - ontologies: [] - gsmr: - - - meta: + - gsmr: + - meta: type: map description: Groovy Map containing sample information for exposure - meta2: @@ -63,42 +62,17 @@ output: type: file description: Result file from GSMR analysis pattern: "*.gsmr" - ontologies: [] - eff_plot: - - - meta: - type: map - description: Groovy Map containing sample information for exposure - - meta2: - type: map - description: Groovy Map containing sample information for outcome - - "*.eff_plot.gz": - type: file - description: Effect plot file from GSMR analysis - pattern: "*.eff_plot.gz" - ontologies: - - edam: http://edamontology.org/format_3989 - mono_badsnps: - - - meta: - type: map - description: Groovy Map containing sample information for exposure - - meta2: - type: map - description: Groovy Map containing sample information for outcome - - "*.mono.badsnps": - type: file - description: Bad SNPs file from GSMR analysis - pattern: "*.mono.badsnps" - ontologies: [] - versions_gcta: - - - ${task.process}: + - versions_gcta: + - "${task.process}": type: string description: The name of the process - gcta: type: string description: The name of the tool - - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': - type: eval + - gcta 2>&1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/v//': + type: string description: The expression to obtain the version of the tool + topics: versions: - - ${task.process}: @@ -107,8 +81,8 @@ topics: - gcta: type: string description: The name of the tool - - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': - type: eval + - gcta 2>&1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/v//': + type: string description: The expression to obtain the version of the tool authors: - "@juliaapolonio" From 6fd2487367d5a246d120b31a96daa126c791b568 Mon Sep 17 00:00:00 2001 From: jvfe Date: Sat, 14 Mar 2026 10:05:04 -0300 Subject: [PATCH 18/20] fix: Linting & obsolete snap --- modules/nf-core/gcta/gsmr/meta.yml | 60 +++++++++++++------ .../nf-core/gcta/gsmr/tests/main.nf.test.snap | 40 ------------- 2 files changed, 43 insertions(+), 57 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/meta.yml b/modules/nf-core/gcta/gsmr/meta.yml index 20762e7bfe5c..ab6535848ca0 100644 --- a/modules/nf-core/gcta/gsmr/meta.yml +++ b/modules/nf-core/gcta/gsmr/meta.yml @@ -33,15 +33,15 @@ input: description: Outcome GWAS summary statistics formatted for GSMR pattern: "*.txt" ontologies: [] - reference: - type: file - description: PLINK reference dataset files (BED/BIM/FAM) - pattern: "*.{bed,bim,fam}" - multiple: true - ontologies: [] + - reference: + type: file + description: PLINK reference dataset files (BED/BIM/FAM) + pattern: "*.{bed,bim,fam}" + multiple: true + ontologies: [] output: - - log: - - meta: + log: + - - meta: type: map description: Groovy Map containing sample information for exposure - meta2: @@ -51,8 +51,9 @@ output: type: file description: Log file from GSMR analysis pattern: "*.log" - - gsmr: - - meta: + ontologies: [] + gsmr: + - - meta: type: map description: Groovy Map containing sample information for exposure - meta2: @@ -62,17 +63,42 @@ output: type: file description: Result file from GSMR analysis pattern: "*.gsmr" - - versions_gcta: - - "${task.process}": + ontologies: [] + versions_gcta: + - - ${task.process}: type: string description: The name of the process - gcta: type: string description: The name of the tool - - gcta 2>&1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/v//': - type: string + - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': + type: eval description: The expression to obtain the version of the tool - + eff_plot: + - - meta: + type: map + description: Groovy Map containing sample information for exposure + - meta2: + type: map + description: Groovy Map containing sample information for outcome + - "*.eff_plot.gz": + type: file + description: Result effect plot from GSMR analysis + pattern: "*.eff_plot.gz" + ontologies: + - edam: http://edamontology.org/format_3989 + mono_badsnps: + - - meta: + type: map + description: Groovy Map containing sample information for exposure + - meta2: + type: map + description: Groovy Map containing sample information for outcome + - "*.mono.badsnps": + type: file + description: Result badsnps file from GSMR analysis + pattern: "*.mono.badsnps" + ontologies: [] topics: versions: - - ${task.process}: @@ -81,8 +107,8 @@ topics: - gcta: type: string description: The name of the tool - - gcta 2>&1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/v//': - type: string + - gcta 2>&1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+" | sed 's/v//': + type: eval description: The expression to obtain the version of the tool authors: - "@juliaapolonio" diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap index 6ff3d0d34976..7f3b48236ccf 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test.snap @@ -19,46 +19,6 @@ "nextflow": "25.10.4" } }, - "homo_sapiens - gsmr": { - "content": [ - [ - [ - { - "id": "test_exposure" - }, - { - "id": "test_outcome" - }, - "test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa" - ] - ] - ], - "timestamp": "2026-03-13T15:06:14.608903963", - "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" - } - }, - "homo_sapiens - gsmr - stub": { - "content": [ - [ - [ - { - "id": "test_exposure" - }, - { - "id": "test_outcome" - }, - "test_exposure_test_outcome.gsmr:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "timestamp": "2026-03-13T15:06:21.555456661", - "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" - } - }, "versions_gcta": { "content": [ [ From 943d57ee86156309cf82cb8893ef076989f6c105 Mon Sep 17 00:00:00 2001 From: jvfe Date: Sat, 14 Mar 2026 10:12:30 -0300 Subject: [PATCH 19/20] fix: Remove linebreak --- modules/nf-core/gcta/gsmr/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index 9c652b308a1f..cd9c77a5414e 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -81,4 +81,3 @@ nextflow_process { } } - From 97e85f95e5b40c2e8d5b2fcab720563ccb96b612 Mon Sep 17 00:00:00 2001 From: Julia Apolonio Date: Wed, 20 May 2026 12:23:53 -0300 Subject: [PATCH 20/20] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> --- modules/nf-core/gcta/gsmr/main.nf | 13 ++++++------- modules/nf-core/gcta/gsmr/tests/main.nf.test | 5 ++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/gcta/gsmr/main.nf b/modules/nf-core/gcta/gsmr/main.nf index 8901d3c88bd8..b2e28f3d4d06 100644 --- a/modules/nf-core/gcta/gsmr/main.nf +++ b/modules/nf-core/gcta/gsmr/main.nf @@ -13,9 +13,9 @@ process GCTA_GSMR { path(reference) output: - tuple val(meta), val(meta2), path("*.log") , emit: log - tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr - tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true + tuple val(meta), val(meta2), path("*.log") , emit: log + tuple val(meta), val(meta2), path("*.gsmr") , emit: gsmr + tuple val(meta), val(meta2), path("*.eff_plot.gz") , emit: eff_plot, optional: true tuple val(meta), val(meta2), path("*.mono.badsnps"), emit: mono_badsnps, optional: true tuple val("${task.process}"), val('gcta'), eval('gcta 2>&1 | grep -oE "v[0-9]+\\.[0-9]+\\.[0-9]+" | sed \'s/v//\''), emit: versions_gcta, topic: versions @@ -27,14 +27,14 @@ process GCTA_GSMR { def prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}" """ echo "${meta.id} ${exposure}" > ${meta.id}.input.txt - echo "${meta2.id} ${outcome}" > outcome.txt + echo "${meta2.id} ${outcome}" > ${meta2.id} .outcome.txt file=\$(ls $reference | sed 's/\\.[^.]*\$//') echo "${reference}/\$file" | head -n1 > reference.txt gcta \\ $args \\ --mbfile reference.txt \\ - --gsmr-file ${meta.id}.input.txt outcome.txt \\ + --gsmr-file ${meta.id}.input.txt ${meta2.id}.outcome.txt \\ --out "${prefix}" """ @@ -45,7 +45,6 @@ process GCTA_GSMR { touch ${prefix}.log touch ${prefix}.gsmr touch ${prefix}.mono.badsnps - echo "" | gzip > ${prefix}.eff_plot.gz - + echo | gzip > ${prefix}.eff_plot.gz """ } diff --git a/modules/nf-core/gcta/gsmr/tests/main.nf.test b/modules/nf-core/gcta/gsmr/tests/main.nf.test index cd9c77a5414e..9e154501de43 100644 --- a/modules/nf-core/gcta/gsmr/tests/main.nf.test +++ b/modules/nf-core/gcta/gsmr/tests/main.nf.test @@ -43,7 +43,10 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out.gsmr).match("gsmr")}, { assert snapshot(process.out.versions_gcta).match("versions_gcta")} - ) + { assert snapshot( + process.out.gsmr, + process.out.versions_gcta + ).match("versions_gcta")} } }