Skip to content

add gcta/gsmr tool#8140

Open
juliaapolonio wants to merge 24 commits into
nf-core:masterfrom
juliaapolonio:gcta_gsmr
Open

add gcta/gsmr tool#8140
juliaapolonio wants to merge 24 commits into
nf-core:masterfrom
juliaapolonio:gcta_gsmr

Conversation

@juliaapolonio
Copy link
Copy Markdown
Contributor

PR checklist

Closes #7975

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

@juliaapolonio
Copy link
Copy Markdown
Contributor Author

Hi, I'm having linting issues with my code, in the meta.yml file. The error message is " The meta.yml of the module gcta/gsmr is not valid: {'reference': {'type': 'file', 'description': 'Reference files (BED, BIM, FAM) for GCTA analysis', 'pattern': '*.{bed,bim,fam}', multiple': True}} is not of type 'array'. Check the entry for input. "
I wasn't able to figure this out...

Copy link
Copy Markdown
Contributor

@d4straub d4straub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but args seem quite important to me.

Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf
Comment thread modules/nf-core/gcta/gsmr/tests/main.nf.test Outdated
Comment thread modules/nf-core/gcta/gsmr/tests/main.nf.test Outdated
Comment on lines +46 to +52
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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")
assert snapshot(process.out).match()

That should work or is the md5sum of the log instable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the log is instable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then still this line is not neceassry :)
assert path(process.out.versions.get(0)).text.contains("GSMR")

Comment thread modules/nf-core/gcta/gsmr/tests/main.nf.test Outdated
Comment thread modules/nf-core/gcta/gsmr/tests/main.nf.test Outdated
"test_exposure_test_outcome.gsmr:md5,f137c763773522ea37849d919f6de9aa"
],
[

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected that there is no eff_plot?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, gsmr only emits the eff_plot when there are significant IVs which is not the case for this test data.

Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment on lines +17 to +20
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be generic so that the pipeline dev can in therory change the prefix :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true! But when I remove these {meta}, the lint fails with this message: 'meta' map not emitted in output channel(s)
Do you know a workaround for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah its because you do not emit the meta map :) the output needs to be structured as tuples:

tuple val(meta), path("*.log"), emit: log

and so on :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help! I added this modification in my last commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we allow only one meta map per output. Maybe you can ask in the slack for help for your specific use-case.

juliaapolonio and others added 3 commits April 3, 2025 09:18
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
@juliaapolonio juliaapolonio requested a review from d4straub April 3, 2025 12:47
@atrigila atrigila added the awaiting-changes will be closed after 30 days label Mar 5, 2026
juliaapolonio and others added 5 commits March 13, 2026 16:20
* master: (1721 commits)
  Remove non-standard ext keys to comply with nf-core guidelines (nf-core#10806)
  Migrate bam2fastx/bam2fastq module to topic channels (nf-core#10438)
  Remove ext.batch_size to comply with nf-core guidelines (nf-core#10655)
  Add an input channel to `blast/makeblastedb` for taxonomic information. (nf-core#10802)
  Move ext.postprocessing script to input to comply with nf-core guidelines (nf-core#10819)
  Update to topics `eido/*` (nf-core#10881)
  Remove ext.metrics to comply with nf-core guidelines (nf-core#10900)
  Ensure fastq_list is always a list in `generateReadgroupBCLCONVERT` function (nf-core#10901)
  Remove ext.context_type to conform to nf-core guidelines (nf-core#10442)
  Update to topics `crisprcleanr/normalize` (nf-core#10828)
  Migrate Diann versions to topic (nf-core#10883)
  feat(stardist): update to Seqera Containers GPU image with model input (nf-core#10332)
  Add SVIM module (nf-core#10350)
  samtools merge - single index output (nf-core#10898)
  Rattle cluster (nf-core#7447)
  Adding a log to record stdout from Genescopefk (nf-core#10897)
  This pr closes nf-core#10757 (nf-core#10871)
  10657 migration to topics channels cnvpytorhistogram (nf-core#10870)
  10660 migration to topics channels cnvpytorview (nf-core#10874)
  esearch migration to topics (nf-core#10887)
  ...
@jvfe jvfe added Ready for Review and removed awaiting-changes will be closed after 30 days labels Mar 14, 2026
@famosab famosab mentioned this pull request Apr 8, 2026
14 tasks
@famosab
Copy link
Copy Markdown
Contributor

famosab commented Apr 8, 2026

Might be replaced by #10995?

@juliaapolonio
Copy link
Copy Markdown
Contributor Author

Might be replaced by #10995?

No, it's the same tool but different functions (#10995 is --make-grm and #8140 is gsmr)

Copy link
Copy Markdown
Contributor

@famosab famosab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things and then we can get this merged :)

Comment thread modules/nf-core/gcta/gsmr/tests/main.nf.test Outdated
{ assert process.success },
{ assert snapshot(process.out.gsmr).match("gsmr_stub")},
{ assert snapshot(process.out.versions_gcta).match("versions_gcta_stub")}
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above commenz

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run

nextflow lint -format -sort-declarations -spaces 4 -harshil-alignment

on this file to clean this up nicely.

Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
Comment thread modules/nf-core/gcta/gsmr/main.nf Outdated
@SPPearce
Copy link
Copy Markdown
Contributor

Bump for @juliaapolonio , shall we get this finished off?

juliaapolonio and others added 2 commits May 20, 2026 12:23
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
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':
'biocontainers/gcta:1.94.1--h9ee0642_0' }"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'biocontainers/gcta:1.94.1--h9ee0642_0' }"
'quay.io/biocontainers/gcta:1.94.1--h9ee0642_0' }"

def prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}"
"""
echo "${meta.id} ${exposure}" > ${meta.id}.input.txt
echo "${meta2.id} ${outcome}" > ${meta2.id} .outcome.txt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "${meta2.id} ${outcome}" > ${meta2.id} .outcome.txt
echo "${meta2.id} ${outcome}" > ${meta2.id}.outcome.txt

"""
input[0] = [
[ id:'test_exposure' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats.tsv")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you swap to using the modules_testdata_base_path like this:

Suggested change
file("https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/modules/data/genomics/homo_sapiens/gsmr/sumstats.tsv")
file(params.modules_testdata_base_path + "genomics/homo_sapiens/gsmr/sumstats.tsv")

Comment on lines +44 to +49
{ 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")}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ 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")}
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["log"]).match()}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants