Skip to content

Add profile smoothing and contamination check#436

Merged
FerriolCalvet merged 6 commits intodevfrom
profile-smoothing-n-contamination
Mar 23, 2026
Merged

Add profile smoothing and contamination check#436
FerriolCalvet merged 6 commits intodevfrom
profile-smoothing-n-contamination

Conversation

@FerriolCalvet
Copy link
Copy Markdown
Member

  • 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.

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 introduces optional Bayesian smoothing for mutational profiles (using a cohort-derived prior profile), adjusts omega-flagging/visualization logic, and adds an additional contamination indicator based on the proportion of mutated SNP sites.

Changes:

  • Add a profile_smoothing parameter and plumb a cohort prior profile into COMPUTE_PROFILE to enable smoothing for low-mutation samples.
  • Extend mut_profile.py with Bayesian update logic and new CLI flags (--smoothed, --prior_profile).
  • Refactor contamination checking to include SNP-site mutation proportion output and revise omega-flagging annotation/plots.

Reviewed changes

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

Show a summary per file
File Description
subworkflows/local/mutationprofile/main.nf Adds cohort prior computation and passes it into profile computation when smoothing is enabled.
nextflow_schema.json Adds profile_smoothing parameter to the schema.
nextflow.config Adds default params.profile_smoothing = false.
modules/local/compute_profile/main.nf Extends module inputs and wires new smoothing args into the mut_profile.py profile call.
conf/modules.config Adds config hook intended to toggle smoothing based on params.profile_smoothing.
bin/mut_profile.py Implements Bayesian smoothing and exposes CLI options to activate it.
bin/check_contamination.py Refactors loading and adds SNP-based contamination summary output.
bin/annotate_omega_failing.py Splits flagged tables by criteria and updates annotation/plotting functions accordingly.

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

Comment thread subworkflows/local/mutationprofile/main.nf
Comment thread subworkflows/local/mutationprofile/main.nf
Comment thread subworkflows/local/mutationprofile/main.nf
Comment thread conf/modules.config
@FerriolCalvet FerriolCalvet merged commit e28ed6e into dev Mar 23, 2026
8 checks passed
@FerriolCalvet FerriolCalvet deleted the profile-smoothing-n-contamination branch March 24, 2026 08:01
@FerriolCalvet FerriolCalvet linked an issue Mar 29, 2026 that may be closed by this pull request
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.

Fix bug in applyomegaqc plots

2 participants