Skip to content

Refactor subworkflows and add tests#780

Merged
ramprasadn merged 31 commits into
devfrom
updatesubwfs
Mar 5, 2026
Merged

Refactor subworkflows and add tests#780
ramprasadn merged 31 commits into
devfrom
updatesubwfs

Conversation

@ramprasadn

Copy link
Copy Markdown
Collaborator

PR checklist

  • 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 pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/raredisease branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Ensure the test suite passes (nextflow run . -profile test_singleton,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@nf-core-bot

Copy link
Copy Markdown
Member

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 3.5.1.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 41cbed0

+| ✅ 234 tests passed       |+
#| ❔   7 tests were ignored |#
!| ❗   8 tests had warnings |!
Details

❗ Test warnings:

  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ mq_metrics = SENTIEON_DATAMETRICS.out.mq_metrics.ifEmpty(null) // channel: [ val(meta), path(mq_metrics) ]
    _
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ qd_metrics = SENTIEON_DATAMETRICS.out.qd_metrics.ifEmpty(null) // channel: [ val(meta), path(qd_metrics) ]
    _
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ gc_metrics = SENTIEON_DATAMETRICS.out.gc_metrics.ifEmpty(null) // channel: [ val(meta), path(gc_metrics) ]
    _
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ gc_summary = SENTIEON_DATAMETRICS.out.gc_summary.ifEmpty(null) // channel: [ val(meta), path(gc_summary) ]
    _
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ aln_metrics = SENTIEON_DATAMETRICS.out.aln_metrics.ifEmpty(null) // channel: [ val(meta), path(aln_metrics) ]
    _
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/raredisease/raredisease/subworkflows/local/align_sentieon/main.nf: _ is_metrics = SENTIEON_DATAMETRICS.out.is_metrics.ifEmpty(null) // channel: [ val(meta), path(is_metrics) ]
    _
  • schema_lint - Input mimetype is missing or empty
  • schema_description - No description provided in schema for parameter: hisat2

❔ Tests ignored:

  • files_exist - File is ignored: conf/modules.config
  • files_unchanged - File ignored due to lint config: .github/CONTRIBUTING.md
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: assets/nf-core-raredisease_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-raredisease_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-raredisease_logo_dark.png
  • modules_config - modules_config

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2026-03-05 12:23:39

@ramprasadn ramprasadn marked this pull request as ready for review March 4, 2026 07:51

@fellen31 fellen31 left a comment

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.

Awesome!

Missing a CHANGELOG (use dangoslen/changelog-enforcer@v3 perhaps?)

I understand if all tests can't be real tests from the start, but I would also include stub tests for all normal tests. Sometimes the stubs in the modules might differ, and it's good to check that both work as expected.

Comment on lines +33 to +34
path(workflow.out.vcf_ann[0][1].toString()).vcf.variantsMD5,
path(workflow.out.vcf_ann[0][1].toString()).vcf.summary

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.

Should work, no? Or is there a difference between .get() and [] (e.g. path(process.out.vcf.get(0).get(1)).vcf.variantsMD5)?

Suggested change
path(workflow.out.vcf_ann[0][1].toString()).vcf.variantsMD5,
path(workflow.out.vcf_ann[0][1].toString()).vcf.summary
path(workflow.out.vcf_ann[0][1]).vcf.variantsMD5,
path(workflow.out.vcf_ann[0][1]).vcf.summary

Comment on lines +32 to +35
{ assert snapshot(
workflow.out.vcf.collect { meta, vcf -> file(vcf).name },
workflow.out.tbi.collect { meta, tbi -> file(tbi).name }
).match() }

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.

Since it's a stub test, could you not just do?

Suggested change
{ assert snapshot(
workflow.out.vcf.collect { meta, vcf -> file(vcf).name },
workflow.out.tbi.collect { meta, tbi -> file(tbi).name }
).match() }
{ assert snapshot(workflow.out).match() }

tag "subworkflows"
tag "call_snv"

test("CALL_SNV - deepvariant wgs") {

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.

Such a massive number of input parameters 😄 Should you have a stub test as well?

Comment on lines +62 to +64
workflow.out.genome_vcf.collect { meta, vcf -> file(vcf).name },
workflow.out.genome_tabix.collect { meta, tbi -> file(tbi).name },
workflow.out.mt_vcf.collect { meta, vcf -> file(vcf).name }

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.

What about also using vcf.variantsMD5 and vcf.summary here?

assertAll(
{ assert workflow.success },
{ assert snapshot(
path(workflow.out.vcf[0][1]).vcf.variantsMD5,

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.

👍

Comment on lines +27 to +29
params {
outdir = "$outputDir"
}

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.

Why do you need an outdir? 🤔

assertAll(
{ assert workflow.success },
{ assert snapshot(
path(workflow.out.vcf[0][1]).vcf.summary

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.

no md5?

Comment on lines +13 to +15
params {
outdir = "$outputDir"
}

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.

Why do you need an outdir? 🤔

}

withName: '.*SUBSAMPLE_MT_FRAC:SAMTOOLS_VIEW' {
ext.args = { "--output-fmt BAM -h -F 4 -s ${meta.seedfrac}" }

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 seedfrac set in the subworkflow? I didn't see it in the inputs.

when {
params {
mt_subsample_reads = 18000
outdir = "$outputDir"

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.

Why do you need an outdir? 🤔

@fellen31 fellen31 Mar 5, 2026

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.

This outdir is still here.

@ramprasadn ramprasadn requested a review from fellen31 March 5, 2026 09:07

@fellen31 fellen31 left a comment

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.

Nice! One outdir left, then I would also add stub tests for those that doesn't have it.

NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 7
max_shards: 14

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.

👍

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.

Would have a stub test here as well.

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.

Would add a stub test here as well.

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.

Would add a stub test here as well.

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.

Would add a stub test here as well.

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.

Would add a stub test here as well.

when {
params {
mt_subsample_reads = 18000
outdir = "$outputDir"

@fellen31 fellen31 Mar 5, 2026

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.

This outdir is still here.

@fellen31

fellen31 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

I would also add this PR to the Changelog.

@ramprasadn ramprasadn merged commit 0a21ec5 into dev Mar 5, 2026
62 of 64 checks passed
@ramprasadn ramprasadn deleted the updatesubwfs branch March 5, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants