Skip to content

feat (closes #7246): add new component: leafcutter/differentialsplicing#12271

Open
JTL-lab wants to merge 4 commits into
nf-core:masterfrom
JTL-lab:leafcutter/differentialsplicing
Open

feat (closes #7246): add new component: leafcutter/differentialsplicing#12271
JTL-lab wants to merge 4 commits into
nf-core:masterfrom
JTL-lab:leafcutter/differentialsplicing

Conversation

@JTL-lab

@JTL-lab JTL-lab commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

PR Description

This PR adds a new module leafcutter/differentialsplicing for running Leafcutter differential splicing analysis to determine statistically significant junction usage changes between biological conditions of interest. This module relies on the new Python reimplementation of Leafcutter (leafcutter-ds) here (also documented in the meta.yml).

PR checklist

Closes #7246

  • 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

@JTL-lab JTL-lab enabled auto-merge July 8, 2026 18:55
Comment on lines +84 to +91
{ assert snapshot(
process.out.findAll { key, val -> key.startsWith('versions') },
process.out.cluster_significance.collect { file(it[1]).getName() },
process.out.effect_sizes.collect { file(it[1]).getName() }
).match() },
// Check non-deterministic files exist
{ assert file(process.out.cluster_significance[0][1]).exists() },
{ assert file(process.out.effect_sizes[0][1]).exists() }

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:

Suggested change
{ assert snapshot(
process.out.findAll { key, val -> key.startsWith('versions') },
process.out.cluster_significance.collect { file(it[1]).getName() },
process.out.effect_sizes.collect { file(it[1]).getName() }
).match() },
// Check non-deterministic files exist
{ assert file(process.out.cluster_significance[0][1]).exists() },
{ assert file(process.out.effect_sizes[0][1]).exists() }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["cluster_significance", "effect_sizes"])).match()}

Comment on lines +114 to +119
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.cluster_significance != null },
{ assert process.out.effect_sizes != null }
)

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.

Suggested change
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.cluster_significance != null },
{ assert process.out.effect_sizes != null }
)
assert process.success
assertAll(
{ assert snapshot(sanitizeOutput(process.out)).match() }
)

process {

withName: 'LEAFCUTTER_DIFFERENTIALSPLICING' {
ext.args = '--min_samples_per_group 2 --min_samples_per_intron 2 --num_threads 1'

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.

Shouldn't need num_threads in here, that should already be in the tool?

def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
export USER=\${USER:-nobody}

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.

Is this required?

@@ -0,0 +1,44 @@
process LEAFCUTTER_DIFFERENTIALSPLICING {
tag "$meta.id"
label 'process_medium'

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.

Is this an appropriate requirement, how much RAM does the tool generally take?

process LEAFCUTTER_DIFFERENTIALSPLICING {
tag "$meta.id"
label 'process_medium'

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.

Suggested change
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.

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 module: leafcutter/differential_splicing

2 participants