Skip to content

Use a custom depths table#385

Merged
FerriolCalvet merged 3 commits intodevfrom
custom-depths-table
Nov 2, 2025
Merged

Use a custom depths table#385
FerriolCalvet merged 3 commits intodevfrom
custom-depths-table

Conversation

@FerriolCalvet
Copy link
Copy Markdown
Member

Add one new option to run deepCSA with a custom depths table, this is particularly useful for applying tailored downsampling outside the pipeline and then re-running the analysis with the updated sets of mutations and depths.

AI summary

This pull request adds support for using a precomputed depths table in the pipeline, allowing users to skip the depth computation step when such data is already available. This enhancement makes the workflow more flexible and can save significant compute time for large cohorts. The changes include new configuration parameters, updates to the documentation, schema additions, and logic in the depth analysis subworkflow.

Documentation and configuration updates:

  • Added a section to docs/usage.md describing how to use a precomputed depths table, including setup instructions and requirements for the input file format.
  • Introduced new parameters use_custom_depths and custom_depths_table in nextflow.config to control the use of a custom depths table.

Pipeline and schema enhancements:

  • Extended nextflow_schema.json with a new custom_depths_table_usage object, detailing configuration options for using a precomputed depths table.
  • Updated the depth analysis subworkflow (subworkflows/local/depthanalysis/main.nf) to use the custom depths table when enabled, bypassing depth computation from BAM files.

- documentation on how to downsample
- documentation on how to provide the input
- not tested
@FerriolCalvet FerriolCalvet added this to the Phase 2 milestone Oct 27, 2025
@FerriolCalvet FerriolCalvet requested a review from Copilot October 27, 2025 14:36
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 enables the pipeline to use a precomputed depths table, allowing users to bypass depth computation from BAM files. This feature is particularly useful for applying custom downsampling or re-running analyses with modified depth data without re-computing depths from scratch.

Key Changes

  • Added configuration parameters use_custom_depths and custom_depths_table to control custom depths table usage
  • Updated the depth analysis subworkflow to conditionally use the custom depths table or compute depths from BAMs
  • Included documentation and an example Jupyter notebook demonstrating how to prepare a custom depths table

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nextflow.config Added two new parameters to enable and specify custom depths table
nextflow_schema.json Added schema definition for the custom depths table configuration options
subworkflows/local/depthanalysis/main.nf Implemented conditional logic to use custom depths table when enabled
docs/usage.md Documented the new feature with setup instructions and requirements
assets/useful_scripts/downsample_depths.ipynb Added example notebook showing how to downsample depths and prepare custom table
Comments suppressed due to low confidence (1)

assets/useful_scripts/downsample_depths.ipynb:1

  • The VAF calculation uses the original filtered_df index but calculates from the unfiltered df, which may cause index misalignment. The calculation should use filtered_df['ALT_DEPTH'] / filtered_df['DEPTH'] instead.
{

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

Comment thread docs/usage.md
@FerriolCalvet FerriolCalvet merged commit 73f4752 into dev Nov 2, 2025
@FerriolCalvet FerriolCalvet deleted the custom-depths-table branch November 2, 2025 09:35
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.

2 participants