Skip to content

Add depth-vs-metric QC plots and summaries for mutdensity/omega outputs#439

Merged
FerriolCalvet merged 13 commits into
devfrom
copilot/add-qc-plots-metrics-vs-depth
Apr 22, 2026
Merged

Add depth-vs-metric QC plots and summaries for mutdensity/omega outputs#439
FerriolCalvet merged 13 commits into
devfrom
copilot/add-qc-plots-metrics-vs-depth

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

This PR adds QC focused on how sequencing depth relates to mutagenesis/selection metrics, using compiled cohort outputs and per-gene per-sample depth tables. It introduces scatterplot outputs (per sample) and TSV summaries to quantify depth effects and highlight depth-associated missingness.

  • New QC capability: metric vs depth (per sample, per gene points)

    • Added bin/metrics_vs_depth_qc.py to analyze:
      • all_mutdensities.tsv (required)
      • all_adjusted_mutdensities.tsv (optional)
      • all_omegas*_global_loc.tsv (optional)
      • all_groups.json + *.depth_per_gene_per_sample.tsv
    • Generates:
      • paginated scatterplot PDFs (metric vs MEAN_GENE_DEPTH, split by sample)
      • depth-effect summaries (pearson/spearman, slope, p-value)
      • missingness summaries per gene (fraction missing + depth context)
  • Pipeline integration

    • Added module: modules/local/plot/qc/metrics_vs_depth/main.nf (PLOT_METRICS_VS_DEPTH_QC)
    • Wired into QC subworkflow: subworkflows/local/plotting_qc/main.nf
    • Wired required/optional inputs in main workflow: workflows/deepcsa.nf
    • Optional inputs are handled so mutdensity-depth QC still runs when omega global-loc is unavailable.
  • Published outputs and docs

    • Added publish route for the new process:
      • qc/metrics_vs_depth in conf/results_outputs.config
    • Updated output docs (docs/output.md) to include the new QC artifact group.
    • Added minimal placeholder asset for optional-channel fallback (assets/placeholder_no_file.tsv).
  • Test surface update

    • Updated tests/deepcsa.nf.test omega scenario to assert presence of the new QC output directory.
PLOTMETRICSVSDEPTHQC(
    all_mutdensities,
    average_depth_gene_sample.map { it[1] },
    groups_definition,
    group_name,
    all_adjusted_mutdensities,
    all_omegas_globalloc
)

Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
Copilot AI and others added 5 commits April 4, 2026 14:46
Agent-Logs-Url: https://github.com/bbglab/deepCSA/sessions/a3d27832-9c45-4e45-8f40-3262358fa1f2

Co-authored-by: FerriolCalvet <38539786+FerriolCalvet@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bbglab/deepCSA/sessions/a3d27832-9c45-4e45-8f40-3262358fa1f2

Co-authored-by: FerriolCalvet <38539786+FerriolCalvet@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bbglab/deepCSA/sessions/a3d27832-9c45-4e45-8f40-3262358fa1f2

Co-authored-by: FerriolCalvet <38539786+FerriolCalvet@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bbglab/deepCSA/sessions/a3d27832-9c45-4e45-8f40-3262358fa1f2

Co-authored-by: FerriolCalvet <38539786+FerriolCalvet@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bbglab/deepCSA/sessions/a3d27832-9c45-4e45-8f40-3262358fa1f2

Co-authored-by: FerriolCalvet <38539786+FerriolCalvet@users.noreply.github.com>
Copilot AI changed the title [WIP] Add module for QC plots of metrics vs depth Add depth-vs-metric QC plots and summaries for mutdensity/omega outputs Apr 4, 2026
Copilot AI requested a review from FerriolCalvet April 4, 2026 14:52
- sample comparisons are relevant within a gene
- comparisons between genes of the same sample are not that relevant
- add FIXME for defining command line arguments properly
@FerriolCalvet FerriolCalvet marked this pull request as ready for review April 11, 2026 14:05
@FerriolCalvet FerriolCalvet deleted the branch dev April 11, 2026 15:40
@FerriolCalvet FerriolCalvet reopened this Apr 11, 2026
Copy link
Copy Markdown
Member

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

tested and it works!

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

Adds a new QC analysis to relate sequencing depth to mutagenesis/selection metrics, wiring it into the DeepCSA plotting QC path and publishing the resulting plots/tables.

Changes:

  • Introduces bin/metrics_vs_depth_qc.py and a new Nextflow process PLOT_METRICS_VS_DEPTH_QC to generate metric-vs-depth PDFs and TSV summaries.
  • Integrates the new QC step into the QC plotting subworkflow and main workflow wiring, including placeholder handling for optional inputs.
  • Adds a publishDir route and documents the new output location.

Reviewed changes

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

Show a summary per file
File Description
workflows/deepcsa.nf Wires new QC inputs into PLOTTINGQC and adds placeholder channels for optional inputs.
subworkflows/local/plotting_qc/main.nf Includes and invokes the new metrics-vs-depth QC module; emits new outputs.
modules/local/plot/qc/metrics_vs_depth/main.nf New Nextflow process wrapper around metrics_vs_depth_qc.py with stub outputs.
bin/metrics_vs_depth_qc.py New QC implementation producing scatterplot PDFs and depth-effect/missingness TSV summaries.
conf/results_outputs.config Publishes outputs under qc/metrics_vs_depth.
conf/modules.config Adds process config for optional-arg gating via task.ext.*.
docs/output.md Documents the new QC output path.
assets/placeholder_no_file.tsv Placeholder file used for optional-channel fallbacks.
tests/deepcsa.nf.test Minor edit (removes trailing blank line).

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

Comment thread modules/local/plot/qc/metrics_vs_depth/main.nf
Comment thread subworkflows/local/plotting_qc/main.nf Outdated
Comment thread tests/deepcsa.nf.test
Comment thread conf/modules.config
Comment thread conf/modules.config
@FerriolCalvet FerriolCalvet merged commit c6f7503 into dev Apr 22, 2026
@FerriolCalvet FerriolCalvet deleted the copilot/add-qc-plots-metrics-vs-depth branch April 22, 2026 17:01
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.

Add plots of metrics vs depth

3 participants