Skip to content

Use peak calling for ChIP-exo and ChEC-seq in Figures tab - #300

Merged
michael-brent merged 9 commits into
BrentLab:mainfrom
michael-brent:feature/299-peak-calling-in-figures
Oct 12, 2026
Merged

michael-brent merged 9 commits into
BrentLab:mainfrom
michael-brent:feature/299-peak-calling-in-figures

Conversation

@michael-brent

Copy link
Copy Markdown
Contributor

Closes #299

ChIP-exo and ChEC-seq now use peak calling instead of promoter enrichment on the Figures tab, still over the 500bp promoter set. Calling Cards has no peak-calling arm and stays promoter enrichment.

  • New FIGURE_BINDING_500BP (callingcards_500bp, rossi_peaks_500bp, chec_m2025_peaks_500bp) drives figures 1, 2, 4, 5 and 10, and the figure 6 default selection (default settings only).
  • Figures 7 and 8 resolve the peak-calling variant per promoter set for Rossi and ChEC-seq.
  • Figures 3 and 9 are unchanged.
  • Figure 10 reads topn_target_sets, so its binding panels need a database rebuild (noted in CHANGELOG).
  • Updated figure descriptions, docs, and tests; unit tests pass (299).

Not verified against a freshly built database; the local brentlab_yeast.duckdb predates the current schema.

🤖 Generated with Claude Code

Add FIGURE_BINDING_500BP (Calling Cards promoter enrichment, rossi_peaks_500bp,
chec_m2025_peaks_500bp) and use it for figures 1, 2, 4, 5, 6 (defaults only) and 10.
Figures 7/8 resolve peak-calling variants per promoter set for Rossi and ChEC-seq.
Figures 3 and 9 are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

This PR is against the main branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @michael-brent,

Copilot AI left a comment

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.

🟡 Changes recommended

The snapshot oracle no longer covers two Figure 7 assays, and two changed lines fail pre-commit formatting checks.

4 open findings
What changed in this PR

Updates Figures to use 500bp peak-calling datasets for ChIP-exo and ChEC-seq while retaining promoter enrichment for Calling Cards.

Changes:

  • Adds shared figure dataset defaults and applies them across Figures 1–8 and 10.
  • Resolves peak-calling variants per promoter set for Figures 7–8.
  • Updates materialization, documentation, and tests.
File Description
tfbpshiny/​modules/​figures/​ui.py Updates figure descriptions.
tfbpshiny/​modules/​figures/​server/​fig7_9.py Resolves Figure 7–8 method-specific variants.
tfbpshiny/​modules/​figures/​server/​fig10.py Updates Figure 10 documentation.
tfbpshiny/​modules/​figures/​queries.py Applies new figure dataset defaults.
tfbpshiny/​materialize/​comparison/​target_sets.py Materializes peak-based Figure 10 targets.
tfbpshiny/​datasets.py Defines FIGURE_BINDING_500BP.
tests/​unit/​test_figures_queries.py Updates Figure 6 default assertions.
tests/​unit/​test_figures_plots.py Adds peak-variant labels.
docs/​materialized_db_schema.md Documents revised datasets.
CHANGELOG.md Records behavior and rebuild requirement.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/unit/test_figures_queries.py Outdated
promoter_set, method = reg[db]
assert promoter_set == "500bp", f"{db} uses promoter set {promoter_set!r}"
assert method == "promoter_enrichment", f"{db} uses method {method!r}"
expected = "promoter_enrichment" if db == "callingcards_500bp" else "peak_calling"
Comment thread tfbpshiny/datasets.py
Comment on lines +205 to +209
#: The binding datasets the Figures tab draws (figures 1, 2, 4, 5, 6 and 10): Calling
#: Cards promoter enrichment, plus ChIP-exo and ChEC-seq peak calling, all over the
#: 500bp start-codon window. Calling Cards has no peak-calling arm. Figures 3 and 9
#: choose their own datasets, and figures 7 and 8 resolve variants per promoter set
#: from :data:`PROMOTER_ENRICHMENT_500BP`'s primaries.
Comment thread tfbpshiny/modules/figures/queries.py Outdated
#: Binding datasets shown in the figures, in display order. These are the *primary*
#: db_names -- the promoter-set and peak variants are not separate figure series.
BINDING_ORDER: tuple[str, ...] = ("harbison", *PROMOTER_ENRICHMENT_500BP)
BINDING_ORDER: tuple[str, ...] = ("harbison", *FIGURE_BINDING_500BP)
Comment thread tfbpshiny/modules/figures/ui.py Outdated
Comment on lines 389 to 390
" enrichment and ChIP-exo and ChEC-seq peak calling. Samples follow the dataset filters, which by"
" default leave one sample per TF in each dataset."

@cmatKhan cmatKhan left a comment

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.

the comments and documentation correctly describe the intended change. However, I see repeated code. Can that be reduced based on DRY principle? Additionally, the new global variable is not named in a way that makes its purpose obvious

variant_cell[variant] = (b_primary, box_key)
return variant_cell

def _fig78_variant_cells() -> dict[str, tuple[str, str]]:

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.

this function is repeated in fig10.py and target_sets.py. Is there a good reason to have repeated code?

b for b in PROMOTER_ENRICHMENT_500BP if b not in METHOD_COMPARISON_ASSAYS
)
return {
**_resolve_variant_cells(

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.

explain what _resolve_variant_cells does

Comment thread tfbpshiny/datasets.py Outdated
#: 500bp start-codon window. Calling Cards has no peak-calling arm. Figures 3 and 9
#: choose their own datasets, and figures 7 and 8 resolve variants per promoter set
#: from :data:`PROMOTER_ENRICHMENT_500BP`'s primaries.
FIGURE_BINDING_500BP: tuple[str, ...] = (

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.

FIGURE_BINDING_500BP isn't obviously related to what this variable is used for. please make a more specific name

michael-brent and others added 8 commits October 9, 2026 11:19
…ments, line lengths

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ture/299-peak-calling-in-figures

# Conflicts:
#	CHANGELOG.md
…res' into feature/299-peak-calling-in-figures

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@michael-brent
michael-brent merged commit 4753fe5 into BrentLab:main Oct 12, 2026
3 of 4 checks passed
@michael-brent
michael-brent deleted the feature/299-peak-calling-in-figures branch October 12, 2026 22:10
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.

Change ChEC-seq and ChIP-exo in Figures tab to use peak calling instead of promoter enrichment

3 participants