Skip to content

Compute selection for known hotspots analysis - #474

Merged
FerriolCalvet merged 8 commits into
devfrom
copilot/compute-selection-for-known-hotspots
Jul 24, 2026
Merged

Compute selection for known hotspots analysis#474
FerriolCalvet merged 8 commits into
devfrom
copilot/compute-selection-for-known-hotspots

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Compute selection for known hotspots</issue_title>
<issue_description>Using the information provided in the optional hotspots file of deepCSA, we could provide a computation of whether the (known) tumor hotspots are selected or not for each specific gene.

This could be done by taking the output of a site comparison process, and then also the file with the hotspots annotation, and with these two you could:

  1. Annotate whether each position is or is not a known hotspot.
  2. Group positions based on Gene and Hotspot(Yes/No). Apply the sum to the expected and observed columns independently.
  3. Perform 3 different groupings based on: site, amino acid change and amino acid, and for each of them...
  4. Compute the updated Obs/Exp ratios and the p-values in the same way as it is being done for the individual site selection computations.
  5. Apply multiple testing correction to the p-values.

For this we need to have a new nf module, a new python script and import some of the functions that are already present.</issue_description>

Comments on the Issue (you are @copilot in this section)

Copilot AI linked an issue Jun 9, 2026 that may be closed by this pull request
Copilot AI requested a review from FerriolCalvet June 9, 2026 12:38
@FerriolCalvet
FerriolCalvet removed their request for review June 9, 2026 22:06
@FerriolCalvet FerriolCalvet changed the title [WIP] Compute selection for known hotspots analysis Compute selection for known hotspots analysis Jun 9, 2026
@FerriolCalvet
FerriolCalvet marked this pull request as ready for review July 7, 2026 11:51
@FerriolCalvet

FerriolCalvet commented Jul 7, 2026

Copy link
Copy Markdown
Member

This branch has now been tested and it works well. there are only a couple of things left to test/understand/decide.

  • Yes includes the hotspots, can we confirm that No includes all non-hotspot positions even if not mutated?
  • Do we want to report in each row how many positions had the chance to be mutated in each category, let's say that for hotspots in KRAS we have 3 aminoacid positions and 151 positions for non-hotspots, this way we know how are thing computed more accurately.

I would double check the first point and make a decision on the second one and then we can merge this branch.

@FerriolCalvet
FerriolCalvet marked this pull request as draft July 7, 2026 11:53
@FerriolCalvet
FerriolCalvet marked this pull request as ready for review July 23, 2026 15:01

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.

Pull request overview

Adds a “known hotspots selection” computation to the omega/site-comparison pipeline path, producing hotspot vs non-hotspot aggregated Obs/Exp statistics from existing site-comparison outputs and an external hotspots definition file. Also updates depth plotting to avoid generating heavy plots for very large panels/samples and adjusts process outputs accordingly.

Changes:

  • Integrates a new HOTSPOTS_SELECTION Nextflow module into the omega subworkflow, gated by params.hotspots_annotation and params.hotspots_definition_file.
  • Adds bin/compute_hotspots_selection.py to aggregate site-comparison outputs into hotspot/non-hotspot groups and compute Obs/Exp and p-values.
  • Makes depth plot PDF outputs optional and skips plot generation when samples_list/genes_list are large.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
subworkflows/local/omega/main.nf Wires hotspots-selection module into the omega analysis workflow behind params.
modules/local/hotspots_selection/main.nf New process wrapper to run compute_hotspots_selection.py on site-comparison outputs.
bin/compute_hotspots_selection.py New CLI tool computing hotspot selection statistics from site-comparison outputs + hotspots file.
conf/results_outputs.config Adds publishing rule for hotspot-selection outputs.
bin/plot_depths.py Skips plotting (and within-gene plotting) for large sample/gene counts.
modules/local/plot/depths_summary/main.nf Marks plot/depth wildcard outputs optional to accommodate skipped plot generation.
patch_omega_main.py Adds an unreferenced patching utility script (should likely not be in repo).
patch_omega_main2.py Adds an incomplete/unreferenced patching utility script (should likely not be in repo).

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

Comment thread subworkflows/local/omega/main.nf Outdated
Comment thread conf/results_outputs.config
Comment thread patch_omega_main.py Outdated
Comment thread patch_omega_main2.py Outdated
@FerriolCalvet
FerriolCalvet merged commit 11039c9 into dev Jul 24, 2026
@FerriolCalvet
FerriolCalvet deleted the copilot/compute-selection-for-known-hotspots branch July 24, 2026 08:51
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.

Compute selection for known hotspots

3 participants