Skip to content

Support CRAM in the hifitrimmer module#11040

Merged
muffato merged 3 commits intomasterfrom
hifitrimmer_cram
Mar 25, 2026
Merged

Support CRAM in the hifitrimmer module#11040
muffato merged 3 commits intomasterfrom
hifitrimmer_cram

Conversation

@muffato
Copy link
Member

@muffato muffato commented Mar 25, 2026

To complete the support matrix of the module (and our readmapping pipeline). Support for (unaligned) CRAM

Requires nf-core/test-datasets#1950

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

@muffato muffato requested a review from prototaxites March 25, 2026 08:24
@muffato muffato self-assigned this Mar 25, 2026
Copilot AI review requested due to automatic review settings March 25, 2026 08:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the nf-core/hifitrimmer/filterbam module to support (unaligned) CRAM inputs, completing the module’s supported input formats for downstream readmapping usage.

Changes:

  • Add CRAM handling to HIFITRIMMER_FILTERBAM by converting CRAM to BAM on-the-fly via samtools view.
  • Add an nf-test case for CRAM input and record the expected snapshot output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
modules/nf-core/hifitrimmer/filterbam/main.nf Adds CRAM-specific input conversion logic prior to running hifi_trimmer filter_bam.
modules/nf-core/hifitrimmer/filterbam/tests/main.nf.test Adds a new test scenario for CRAM input.
modules/nf-core/hifitrimmer/filterbam/tests/main.nf.test.snap Adds snapshot expectations for the new CRAM test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@prototaxites prototaxites 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 - looks like you need a new container to pin the latest version of samtools.

Otherwise, one small comment.

Copy link
Contributor

@prototaxites prototaxites left a comment

Choose a reason for hiding this comment

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

LGTM!

@muffato muffato added this pull request to the merge queue Mar 25, 2026
@muffato
Copy link
Member Author

muffato commented Mar 25, 2026

Thank you !

Merged via the queue into master with commit 55ec168 Mar 25, 2026
27 checks passed
@muffato muffato deleted the hifitrimmer_cram branch March 25, 2026 11:16
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.

3 participants