Skip to content

New mutation density calculation: closes #272#338

Merged
FerriolCalvet merged 19 commits intodevfrom
272-new-mutation-rate-per-consequence-type
Aug 19, 2025
Merged

New mutation density calculation: closes #272#338
FerriolCalvet merged 19 commits intodevfrom
272-new-mutation-rate-per-consequence-type

Conversation

@koszulordie
Copy link
Collaborator

Calculation of mutation density adjusted for the trinucleotide-context-specific mutabilities (mutability-adjusted, for short) at the set of predefined consequence types discussed in #272. The calculation produces two types of outputs:

  • dataframes: file name of the form $OUTPUT/mutdensity/<sample_id>.mutdenisities.tsv, comprising the mutation density values for each gene and consequence type;
  • heatmap plots: file name of the form $OUTPUT/mutdensity/<sample_id>.logfoldchangeplot.pdf, representing the log2 fold change of the mutability-adjusted mutation density vs the flat mutation density where each trinucleotide is assumed to have the same mutability.

This PR should be considered a first usable version subject to minimal testing with which we can start to survey more broadly across all cohorts and samples. Possible adjustments in future versions may include:

  • Expanding the consequence type definitions
  • New running options or configs: user-defined collections of sites, user-defined regions, non-coding regions, non-coding consequence types, user-defined mutability profiles.

Ways in which this new feature may be used to improve other features of the pipeline:

  • Using the synonymous mutation density to improve the so-called globalloc background mutagenesis estimate employed by the omega method.

Copy link
Collaborator

@FerriolCalvet FerriolCalvet left a comment

Choose a reason for hiding this comment

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

All looks good, I have this specific question about the 0s in the depths vector which I don't fully wrap my head around.

On the side I branched the PR for the integration of your python script to the definitions of utils in deepCSA, but let's first address all the comments here and then we can take care of the merging later.

FerriolCalvet added a commit that referenced this pull request Aug 13, 2025
* connect mut_density with pipeline's utils

* apply changes from PR #338
@FerriolCalvet
Copy link
Collaborator

FerriolCalvet commented Aug 13, 2025

functional tests passed, but there are a couple of things to be discussed:

  • Add sample name to output table, this allows the posterior combination of all TSV files generated and makes our life easier for downstream analysis.

@FerriolCalvet FerriolCalvet requested a review from Copilot August 19, 2025 12:00
Copy link
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 implements a new mutability-adjusted mutation density calculation feature that addresses issue #272. The feature calculates mutation densities adjusted for trinucleotide-context-specific mutabilities and generates both tabular outputs and visualization plots comparing adjusted vs flat mutation densities.

  • Adds a new mutation density workflow that incorporates trinucleotide context mutability adjustments
  • Integrates the new feature into the main DeepCSA workflow with conditional execution
  • Creates output files including TSV data files and PDF heatmap plots for log fold change analysis

Reviewed Changes

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

File Description
workflows/deepcsa.nf Integrates the new mutability-adjusted mutation density workflow into the main pipeline
subworkflows/local/mut_density/main.nf Defines the new mutation density subworkflow with mutability adjustments
modules/local/mut_density/main.nf Implements the core mutation density calculation process module
conf/tools/mutdensity.config Adds configuration for the new mutation density subset filtering process

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@FerriolCalvet FerriolCalvet merged commit eca9197 into dev Aug 19, 2025
@FerriolCalvet FerriolCalvet deleted the 272-new-mutation-rate-per-consequence-type branch August 19, 2025 13:30
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