Skip to content

Add differential peak calling extension#2

Open
dhusmann wants to merge 52 commits into
masterfrom
differential_peak_calling_2
Open

Add differential peak calling extension#2
dhusmann wants to merge 52 commits into
masterfrom
differential_peak_calling_2

Conversation

@dhusmann
Copy link
Copy Markdown
Owner

@dhusmann dhusmann commented Jan 4, 2026

Summary

  • add differential peak calling subworkflow with DiffBind, ChipBinner, and SPAN support plus summary/multiqc outputs
  • wire differential params into config/schema/docs and add differential-only workflow
  • add scripts/modules for manifest/design/annotation and new tests/assets

Testing

  • pytest --keep-workflow-wd tests/test_07_differential.yml

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7611f07405

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/diffbind_run.R
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (comment)

  • Parse --diffbind_extra_params (JSON/YAML) and apply to DiffBind calls in bin/diffbind_run.R
  • Added conda deps for jsonlite/yaml

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12859643)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

// Check mandatory parameters that cannot be checked in the groovy lib as we want a channel for them
if (params.input) { ch_input = file(params.input) } else { exit 1, "Input samplesheet not specified!" }

P1 Badge Differential-only entrypoint still aborts for missing samplesheet

The new -entry DIFFERENTIAL_ONLY workflow is meant to consume precomputed manifests via --differential_from_run, but workflows/cutandrun.nf still executes at import time and unconditionally exits if params.input is unset. Because main.nf includes workflows/cutandrun.nf regardless of the selected entrypoint, invoking nextflow run main.nf -entry DIFFERENTIAL_ONLY --differential_from_run … without a samplesheet will hit the exit at load time and terminate before the differential-only workflow can start. The input check needs to be gated so it only runs when the CUTANDRUN workflow is actually executed.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (review)

  • Gate CUTANDRUN input samplesheet check so differential-only entrypoint can run without --input

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12859800)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32264bc90c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/local/differential_summary.nf
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (comment)

  • Join summary file list before passing to differential_summary.py so all summary TSVs are picked up

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12859903)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 528d3f9dd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/span_diff.py Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (comment)

  • Detect missing Java in span_diff.py and fall back with an explicit warning/reason instead of hard-failing
  • Added openjdk to the SPAN conda env for non-container runs

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12860059)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

include { paramsSummaryLog; paramsSummaryMap } from 'plugin/nf-validation'
// Validate input parameters in specialised library
WorkflowCutandrun.initialise(params, log)
def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs)
def citation = '\n' + WorkflowMain.citation(workflow) + '\n'

P1 Badge Differential-only entry still blocked by genome/gtf validation

The new DIFFERENTIAL_ONLY entrypoint can’t actually run without the full reference inputs because workflows/cutandrun.nf still invokes WorkflowCutandrun.initialise unconditionally. That initializer (lib/WorkflowCutandrun.groovy:25–36) errors out when params.fasta or params.gtf are unset, so running nextflow run main.nf -entry DIFFERENTIAL_ONLY --differential_from_run … --gene_bed … fails before the entry workflow starts unless users also supply a genome FASTA and GTF—inputs the entry was meant to avoid. Please gate the initialisation or relax those checks for the differential-only path so the new entry is usable with just the manifests/gene_bed it requires.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/annotate_regions.py Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (comment)

  • Use the BED name column from the closest output (based on column counts) so nearest_gene_name/id are correct for bed12 and bed3 inputs

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12860193)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (review)

  • Gate WorkflowCutandrun.initialise in workflows/cutandrun.nf so differential-only entry avoids genome/gtf validation

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12860193)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 315dcc66e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread subworkflows/local/differential_peak_calling.nf Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

Fix for #2 (comment)

  • Select SPAN peaks deterministically using the caller order from params.callers (fallback to sorted callers) and warn if multiple are present

Tests: pytest --keep-workflow-wd tests/test_07_differential.yml (SLURM 12860462)

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 4, 2026

@codex review

1 similar comment
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 5, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17fa79c473

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/WorkflowMain.groovy
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 5, 2026

Full pytest suite passed: 296 tests, 1 warning. Slurm job 12889297 COMPLETED 0:0 (02:43:02). Log: /scratch/users/dhusmann/runs/pytest_full/20260104_181233/logs/pytest_full_12889297.out

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

Normalization tweak in bc423f2.\n\n- When spike-in/MS scaling is applied, CPM is now skipped (scaling becomes the normalization), and applied_steps reflects that; this avoids cancellation/double-scaling while keeping factors effective (#2 (comment)).

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc423f2cb0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread workflows/differential_only.nf Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

Cache lookup tweak in 687d16d.\n\n- differential-only now accepts cached chipbinner windows even if --blacklist isn’t provided, by only enforcing the hash match when a blacklist path is set (#2 (comment)).

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 687d16dd25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/chipbinner_run.py
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

Spike-in validation in d3d4c9e.\n\n- ChIPBinner now errors (allow_partial -> SKIP) if --use-spikein is set and any sample is missing a spikein_scale_factor, preventing mixed scaling states (#2 (comment)).

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3d4c9eb65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/chipbinner_run.py Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

Allow-partial fix in dd781b6.\n\n- Window lookup now happens inside the try/except so missing/invalid windows fall back to SKIP when --allow-partial is set (#2 (comment)).

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd781b6338

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread subworkflows/local/differential_peak_calling.nf Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

Posthoc spike-in auto fix in 4725d67.\n\n- When differential_use_spikein=auto in posthoc mode, we now infer Spikein vs non-Spikein from the manifest normalisation_mode column and broadcast that value to DiffBind/ChIPBinner/SPAN (#2 (comment)).

@dhusmann
Copy link
Copy Markdown
Owner Author

dhusmann commented Jan 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4725d67527

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/span_diff.py Outdated
@dhusmann
Copy link
Copy Markdown
Owner Author

Fixes review items in 865bd9b: normalize SKIPPED→SKIP in differential summaries, add per-method MultiQC tables (chipbinner/span), validate --mode in span_diff.py, and avoid Channel redefinition in differential_peak_calling. The remote --gene_bed handling in differential-only was already fixed in c86079c (file() + gunzip), so that thread is resolved as well. Addresses #2 (comment) and #2 (comment).

@dhusmann
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dhusmann
Copy link
Copy Markdown
Owner Author

✅ Full pytest-workflow suite passed on Sherlock (Slurm).

Branch: differential_peak_calling_2
Commit: a64a69c

Most recent test-history entry (docs/test_history/differential_peak_calling_2.md):

2026-01-12 — pytest-suite (Slurm)

  • JobID: 13250786
  • Run dir: /scratch/users/dhusmann/runs/pytest-suite/20260111_183752
  • Result: COMPLETED 0:0

@dhusmann
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant