Skip to content

feat(coverm/{contig,genome}): add bam output#11111

Merged
dialvarezs merged 18 commits intonf-core:masterfrom
dialvarezs:update-coverm
Apr 6, 2026
Merged

feat(coverm/{contig,genome}): add bam output#11111
dialvarezs merged 18 commits intonf-core:masterfrom
dialvarezs:update-coverm

Conversation

@dialvarezs
Copy link
Copy Markdown
Member

@dialvarezs dialvarezs commented Apr 1, 2026

This PR adds BAM output to coverm modules via the enable_bam_output input flag that triggers the --bam-file-cache-directory option with a fixed directory. The contents of this directory are emited as an optional output.

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

@dialvarezs dialvarezs changed the title coverm/contig: add bam output feat(coverm/contig): add bam output Apr 1, 2026
@dialvarezs dialvarezs changed the title feat(coverm/contig): add bam output feat(coverm/*): add bam output Apr 1, 2026
@dialvarezs dialvarezs changed the title feat(coverm/*): add bam output feat(coverm/{contig,genome}): add bam output Apr 1, 2026
Copy link
Copy Markdown
Member

@jfy133 jfy133 left a comment

Choose a reason for hiding this comment

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

Main concern is the the empty lists in the tests, but otherwise minor commetns

]
],
"1": [

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.

Should this be empty?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Empty list is because the bam output is optional. If it's not enabled, then the list is 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.

Another empty list...

]
],
[

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.

Empty list...

],
"1": [

],
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.

And again

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.

Thank you for your contribution to nf-core! We really appreciate it. I added a few comments to your PR.

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.

Looks good I added a few more comments.

I am wondering whether there is even a better way to handle short vs long read bams in the way we structure the output. And if we are able to control the bam file naming.

Comment on lines 11 to +15
tuple val(meta), path(input)
tuple val(meta2), path(reference)
val bam_input
val interleaved
val enable_bam_output
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 we put all these inputs into one tuple? That will make sure you're sure that EVERY time everything comes together in the right combination.

Copy link
Copy Markdown
Member Author

@dialvarezs dialvarezs Apr 2, 2026

Choose a reason for hiding this comment

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

You mean this?

tuple val(meta), path(input), path(reference), val(bam_input), val(interleaved), val(enable_bam_output)

I'm not so sure about that. In my opinion that would introduce extra complexity in the workflows, because you will have to build the channel by joining/combinig all together.
And other similar modules use this pattern too: minimap2, bwa, bowtie. All of them separates the reads, the reference and additional flags as separate inputs.

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 get that, we just try to converge more on that because the combine statements make sure that the channels do not get mixed up, but its more of a goal and not something I would enforce here.

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 don't think it's a bad idea to put most of these as a single input, as they're sample-dependent vals - but presumably enable_bam_output is something you'd want to configure once as a single input?

@dialvarezs
Copy link
Copy Markdown
Member Author

@famosab @jfy133 can I get a ✅ then?

@dialvarezs
Copy link
Copy Markdown
Member Author

Thanks @jfy133!

@dialvarezs dialvarezs added this pull request to the merge queue Apr 6, 2026
Merged via the queue into nf-core:master with commit 38c52b0 Apr 6, 2026
62 checks passed
@dialvarezs dialvarezs deleted the update-coverm branch April 6, 2026 11:58
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.

4 participants