Skip to content

Add contigs input to savana/run + minor version bump - #13108

Open
manascripts wants to merge 2 commits into
nf-core:masterfrom
manascripts:savana-add-contigs
Open

manascripts wants to merge 2 commits into
nf-core:masterfrom
manascripts:savana-add-contigs

Conversation

@manascripts

Copy link
Copy Markdown
Member

This pull request updates the savana/run and savana/classify modules to use version 1.3.8 and adds support for providing an optional contigs list file to restrict analysis to specific contigs. Corresponding tests and meta.yml are also updated.

PR checklist

Closes #XXX

  • 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

@github-actions github-actions Bot added the size/s label Oct 8, 2026

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed with Claude Code.

Thanks, the contigs input itself looks good and matches savana/to. My comments are about the tests:

  • The contigs test can't fail. The test genome (genome.fasta) has only chr22, and the list given is chr22, so the restriction is a no-op. The nanopore snapshot is unchanged from master, where no list was passed. A test where the list actually excludes something would show the option is honoured. One option: a list naming a contig that has no reads, then check the output is empty. I haven't tried whether SAVANA accepts that.
  • The default path is no longer tested. Every test now passes a list, so nothing runs without --contigs (inline suggestion).
  • The pacbio test now runs the nanopore data and gives an identical snapshot (inline question).
  • Minor: meta.yml could say the file has one contig name per line (inline suggestion).

Comment thread modules/nf-core/savana/run/tests/main.nf.test
Comment thread modules/nf-core/savana/run/tests/main.nf.test
Comment thread modules/nf-core/savana/run/meta.yml Outdated
@github-actions github-actions Bot added size/m and removed size/s labels Oct 9, 2026
@manascripts

Copy link
Copy Markdown
Member Author

The tests have been changed according to the suggestions - empty outputs are asserted for the test where the target contig (chr1) is not in present in the input bam.

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed with Claude Code.

Thanks, the earlier points are addressed. The chr1 test now shows the contigs list is honoured: I dropped --contigs locally and it fails on variantCount=28. All four tests pass with docker.

Remaining, all minor (inline):

  • The chr22 test still has a snapshot identical to "no contig", so it cannot fail on the restriction. I'd drop it.
  • In the chr1 test, assert process.out.findAll { ... } is true for any non-empty map. Snapshotting it pins the version like the other tests.
  • meta.yml: "when empty" reads as an empty file. "when not given" matches what the module handles.

tag "savana/run"

test("homo_sapiens - nanopore") {
test("homo_sapiens - nanopore - chr22") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test still cannot fail on the restriction: genome.fasta only has chr22, so its snapshot is identical to the "no contig" one (28 variants, 16 read-support lines). The new chr1 test now covers that the list is honoured (I dropped ${contigs_arg} locally and it fails on variantCount=28), so this one only duplicates "no contig" and is the slowest test (~97 s here). I'd drop it, or keep it only if you want a case where the list matches the contig in the data.

{ assert file(process.out.sv_breakpoints_bedpe.get(0).get(1)).size() == 0 }, // BEDPE file is empty
{ assert file(process.out.sv_breakpoints_read_support.get(0).get(1)).readLines().size() == 1 }, // read support file has only header line
{ assert file(process.out.inserted_sequences.get(0).get(1)).size() == 0 }, // inserted sequences file is empty
{ assert process.out.findAll { key, val -> key.startsWith('versions') } }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

assert process.out.findAll { ... } is true for any non-empty map, so it never checks the version. The other tests snapshot it, which pins 1.3.8:

Suggested change
{ assert process.out.findAll { key, val -> key.startsWith('versions') } }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() }

That adds a small entry to the .snap. Also, the trailing // comments on lines 87 to 90 repeat what the assertion says and can go.

e.g. `[ id:'contigs' ]`
- contigs:
type: file
description: Optional file listing the contigs to analyse, one contig per line. All contigs in the bam files are analysed when empty.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"when empty" reads as an empty file. What the module handles is the input not being given ([]); an empty file would be passed on as --contigs and I haven't checked what SAVANA does with it.

Suggested change
description: Optional file listing the contigs to analyse, one contig per line. All contigs in the bam files are analysed when empty.
description: Optional file listing the contigs to analyse, one contig per line. All contigs in the bam files are analysed when not given.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants