Skip to content

Add the finaletoolkit/delfi module#11547

Open
lbeltrame wants to merge 19 commits into
nf-core:masterfrom
DIncalciLab:finale-toolkit-delfi
Open

Add the finaletoolkit/delfi module#11547
lbeltrame wants to merge 19 commits into
nf-core:masterfrom
DIncalciLab:finale-toolkit-delfi

Conversation

@lbeltrame
Copy link
Copy Markdown
Contributor

@lbeltrame lbeltrame commented May 7, 2026

PR checklist

This PR introduces support for the delfi subcommand in finaletoolkit, which calculates the DELFI score, a popular measure used in fragmentomics introduced in Cristiano et al., 2019.

References #11365

  • 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

lbeltrame added 2 commits May 6, 2026 14:42
This uses FinaleToolkit to calculate the DELFI score (Cristiano et al.,
2019).

cf. nf-core#11365
@lbeltrame lbeltrame self-assigned this May 7, 2026
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/main.nf Outdated
@lbeltrame
Copy link
Copy Markdown
Contributor Author

lbeltrame commented May 8, 2026

@SPPearce I should've handled it but I need to check the tests here, locally they fail probably because my Nextflow version is too old (error in an unrelated module).

EDIT: tests are green.

Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/tests/main.nf.test Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/meta.yml Outdated
Comment on lines +23 to +28
- bam:
type: file
description: Sorted BAM file
pattern: "*.bam"
ontologies:
- edam: "http://edamontology.org/format_2572"
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.

Does this work with cram files?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Honestly I'm not sure. I'll check the code directly, but it looks like it wants BAM. I'll investigate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked and it does, in principle. How should I handle this?

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.

cram files require the fasta file to be staged, not the 2bit file, so it could do with another input channel. You can say in the meta that the fasta is only for cram input.
You can still call it bam/bai, just make it clear that it also accepts cram.

Copy link
Copy Markdown
Contributor Author

@lbeltrame lbeltrame May 14, 2026

Choose a reason for hiding this comment

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

I triple checked. While it claims to support CRAM files, the delfi command does not actually support them, because it doesn't pass the required FASTA reference to the input function (see https://github.com/epifluidlab/FinaleToolkit/blob/5431559c7fbe79d9bfaf70054fc064084b7a35eb/src/finaletoolkit/utils/_frag_generator.py#L14 and https://github.com/epifluidlab/FinaleToolkit/blob/5431559c7fbe79d9bfaf70054fc064084b7a35eb/src/finaletoolkit/frag/_delfi.py#L387 for reference)

So I'll stay with BAM for the moment. I'll raise an issue upstream.

EDIT: filed epifluidlab/FinaleToolkit#173

@lbeltrame
Copy link
Copy Markdown
Contributor Author

Many thanks @SPPearce for the review. Most of these show why copy-pasting is bad. ;)
I'll get to these shortly.

@lbeltrame
Copy link
Copy Markdown
Contributor Author

lbeltrame commented May 13, 2026

I don't understand the test failures...
Should be fixed now.

Comment thread modules/nf-core/finaletoolkit/delfi/main.nf Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/main.nf Outdated
Comment on lines +23 to +28
- bam:
type: file
description: Sorted BAM file
pattern: "*.bam"
ontologies:
- edam: "http://edamontology.org/format_2572"
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.

cram files require the fasta file to be staged, not the 2bit file, so it could do with another input channel. You can say in the meta that the fasta is only for cram input.
You can still call it bam/bai, just make it clear that it also accepts cram.

Comment thread modules/nf-core/finaletoolkit/delfi/main.nf Outdated
Comment thread modules/nf-core/finaletoolkit/delfi/main.nf Outdated
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.

2 participants