Skip to content

disable automatic filling of 0s in profile#433

Open
FerriolCalvet wants to merge 7 commits intodevfrom
upd-profile-flagged
Open

disable automatic filling of 0s in profile#433
FerriolCalvet wants to merge 7 commits intodevfrom
upd-profile-flagged

Conversation

@FerriolCalvet
Copy link
Copy Markdown
Member

@FerriolCalvet FerriolCalvet commented Mar 18, 2026

  • Add the option to smooth the mutational profile when having less than 200 mutations in the sample (this is hardcoded since we conducted entropy tests to define the threshold).
  • Fix the flagging of omegas.
  • Added the computation of proportion of SNP sites mutated to inform contamination in samples independent from the samples being analyzed in the same batch/cohort.

@FerriolCalvet FerriolCalvet changed the base branch from main to dev March 18, 2026 07:49
@FerriolCalvet FerriolCalvet requested a review from Copilot March 18, 2026 07:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds optional Bayesian smoothing for low-mutation samples when generating mutational profiles, refines omega QC flag annotation, and extends contamination QC with a SNP-site–based metric.

Changes:

  • Introduce profile_smoothing parameter and wire a cohort-level prior profile into profile computation.
  • Extend mut_profile.py to support smoothing via --smoothed/--prior_profile and perform the Bayesian update under a hardcoded (200) mutation threshold.
  • Refactor omega-flag annotation logic and add an additional contamination QC output based on SNP sites.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
subworkflows/local/mutationprofile/main.nf Adds cohort prior computation and passes it into per-sample profile generation when smoothing is enabled.
modules/local/compute_profile/main.nf Extends module inputs to accept a cohort prior profile and conditionally adds CLI args for smoothing.
conf/modules.config Plumbs params.profile_smoothing into COMPUTEPROFILE via ext.smoothing.
bin/mut_profile.py Implements Bayesian smoothing and exposes new CLI flags to apply it.
nextflow.config Adds params.profile_smoothing default.
nextflow_schema.json Exposes profile_smoothing in the schema/UI.
bin/check_contamination.py Refactors contamination entrypoints and adds SNP-based contamination proportion output.
bin/annotate_omega_failing.py Splits flagged tables into gene/sample criteria, updates plots, and changes omega annotation merge logic.

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

Copy link
Copy Markdown
Collaborator

@koszulordie koszulordie left a comment

Choose a reason for hiding this comment

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

I focused on the mut_profile.py script and as far as I can tell everything looks correct. I commented on the definition of MUT_PROBABILITY in line 302, we can add a comment here for clarity, as this step is critical. I also suggest to provide this profile in normalized form so that the scale, although arbitrary, always displays the same range of values.

@FerriolCalvet FerriolCalvet marked this pull request as ready for review March 20, 2026 10:51
@FerriolCalvet
Copy link
Copy Markdown
Member Author

we agreed this branch is ready to be merged, only pending to be fully tested with the update that removes the pseudocount of relative mutability per channel

once we merge #390

@FerriolCalvet FerriolCalvet linked an issue Mar 20, 2026 that may be closed by this pull request
@FerriolCalvet FerriolCalvet changed the title Add profile smoothing disable automatic filling of 0s in profile Mar 29, 2026
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.

3 participants