Skip to content

Add subworkflow for gridss somatic structural variant calling - #12574

Open
imsarath wants to merge 8 commits into
nf-core:masterfrom
imsarath:subworkflow_gridss_somatic_svs_calling
Open

Add subworkflow for gridss somatic structural variant calling#12574
imsarath wants to merge 8 commits into
nf-core:masterfrom
imsarath:subworkflow_gridss_somatic_svs_calling

Conversation

@imsarath

@imsarath imsarath commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds bam_tumor_normal_somatic_structural_variant_calling_gridss, a subworkflow that calls somatic structural variants from a tumor/normal BAM pair. It chains the full GRIDSS workflow - optional targeted fragment extraction, per-sample preprocess, joint assembly and call, then gridss_somatic_filter. It emits the unfiltered joint VCF plus the all-somatic and high-confidence somatic call sets.

PR checklist

Closes #4498

  • 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.
  • Broadcast software version numbers to topic: versions - See version_topics
  • 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

@imsarath imsarath self-assigned this Aug 4, 2026
Comment thread subworkflows/nf-core/bam_somatic_sv_calling_gridss/tests/main.nf.test Outdated
Comment thread subworkflows/nf-core/bam_somatic_sv_calling_gridss/main.nf Outdated

@SPPearce SPPearce 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.

Can you format the main.nf with each module argument on its own line too please

Comment on lines +70 to +74
{ assert snapshot(
path(workflow.out.gridss_vcf[0][1]).vcf.summary,
workflow.out.all_somatic_vcf.collect { meta, vcf -> [ meta, file(vcf).name ] },
workflow.out.high_confidence_somatic_vcf.collect { meta, vcf -> [ meta, file(vcf).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.

Try this (untested):

Suggested change
{ assert snapshot(
path(workflow.out.gridss_vcf[0][1]).vcf.summary,
workflow.out.all_somatic_vcf.collect { meta, vcf -> [ meta, file(vcf).name ] },
workflow.out.high_confidence_somatic_vcf.collect { meta, vcf -> [ meta, file(vcf).name ] }
).match() }
{ assert snapshot(sanitizeOutput(workflow.out, variantsMD5Keys: ["gridss_vcf", "all_somatic_vcf", "high_confidence_somatic_vcf"]).match() }

@SPPearce SPPearce 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.

A couple of comments.
You should be able to calculate is_targeted based on whether ch_target_bed exists?
Should the input tuple be flatter, rather than [tumour_bam, normal_bam] as a nested tuple.
Should the target bed be part of the input tuple? I could see scenarios where you are only interested in certain variants per sample.
What happens if you have more than one tumour sample per normal sample, can the subworkflow deal with that?

@imsarath

imsarath commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the slow reply, and thanks for the detailed review!

  1. is_targeted from ch_target_bed - I did try that first, but I couldn't get it to work. The problem is that is_targeted drives an if block that decides which processes get included in the DAG, and that decision happens at workflow-composition time - the channel contents aren't available yet, so an empty vs. non-empty ch_target_bed can't be inspected there. A boolean was the simplest thing that worked. Happy to switch if there's a better pattern.
  2. Flatter input tuple - Is there a specific advantage to the flat form? I used the nested one because GRIDSS_ASSEMBLE/CALL take the paired BAMs as a list anyway. Easy to change if flat is the convention.
  3. Target BED in the input tuple - Agreed, makes sense. Note that GRIDSS_EXTRACTOVERLAPPINGFRAGMENTS currently takes the BED as a separate channel, so that module would need updating too.
  4. Multiple tumours per normal - I hadn't considered it; the focus was one tumour/one normal, so it won't handle that today. We can add it, but it'd need a nested structure for the tumour BAMs/BAIs, which conflicts with point 2.

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.

new subworkflow: distributed computing GRIDSS subworkflow

2 participants