Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option to disable normal hardfilter #1509

Merged
merged 54 commits into from
Jan 31, 2025

Conversation

mathiasbio
Copy link
Collaborator

@mathiasbio mathiasbio commented Nov 29, 2024

Description

Some customers have requested a feature to get better control over the normal filtration in Scout. We can achieve this by transforming the matched normal filter to as soft-filter that can be optionally applied in Scout.

Linked MTP-BALSAMIC story: https://github.com/Clinical-Genomics/MTP-BALSAMIC/issues/1

To enable this feature we need to do two more things:

  1. enable the new argument in CG: add soft-filter-normal argument to paired tga analyses cg#4157
  2. activate the filtering by matched normal soft-filters in Scout: Enable filtering on matched normal scout#5201

After applying this soft filter argument there will be 2 new filters appearing in the final VCF:

  • germline_risk (from TNscope)
  • in_normal (from custom bcftools normal af / tumor af fraction filter)

Added

  • new argument --soft-filter-normal to disable hard filtration of matched normal filters

Changed

  • refactored variant-filter constants and reworked bcftools filters
  • renamed high_normal_tumor_af_frac to in_normal

Documentation

  • N/A
  • Updated Balsamic documentation to reflect the changes as needed for this PR.
    • [balsamic_filters.rst] with new soft-filter normal behaviour

Tests

Feature Tests

Pipeline Integrity Tests

  • Report deliver (generation of the .hk file)
    • N/A
    • Verified
  • TGA T/O Workflow
    • N/A
    • Verified
  • TGA T/N Workflow
    • N/A
    • Verified
  • UMI T/O Workflow
    • N/A
    • Verified
  • UMI T/N Workflow
    • N/A
    • Verified
  • WGS T/O Workflow
    • N/A
    • Verified
  • WGS T/N Workflow
    • N/A
    • Verified
  • QC Workflow
    • N/A
    • Verified
  • PON Workflow
    • N/A
    • Verified

Clinical Genomics Stockholm

Documentation

  • Atlas documentation
    • N/A
    • Updated: [Link]
  • Web portal for Clinical Genomics
    • N/A
    • Updated: [Link]

Panel of Normal specific criteria

User Changes

  • N/A
  • This PR affects the output files or results.
    • User feedback is considered unnecessary because [Justification].
    • Affected users have been included in the development process and given a chance to provide feedback.

Infrastructure Changes

Checklist

Important

Ensure that all checkboxes below are ticked before merging.

For Developers

  • PR Description
    • Provided a comprehensive description of the PR.
    • Linked relevant user stories or issues to the PR.
  • Documentation
    • Verified and updated documentation if necessary.
  • Tests
    • Described and tested the functionality addressed in the PR.
    • Ensured integration of the new code with existing workflows.
    • Confirmed that meaningful unit tests were added for the changes introduced.
    • Checked that the PR has successfully passed all relevant code smells and coverage checks.
  • Review
    • Addressed and resolved all the feedback provided during the code review process.
    • Obtained final approval from designated reviewers.

For Reviewers

  • Code
    • Code implements the intended features or fixes the reported issue.
    • Code follows the project's coding standards and style guide.
  • Documentation
    • Pipeline changes are well-documented in the CHANGELOG and relevant documentation.
  • Tests
    • The author provided a description of their manual testing, including consideration of edge cases and boundary
      conditions where applicable, with satisfactory results.
  • Review
    • Confirmed that the developer has addressed all the comments during the code review.

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.50%. Comparing base (7d529e6) to head (8490657).
Report is 38 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1509      +/-   ##
===========================================
+ Coverage    99.48%   99.50%   +0.02%     
===========================================
  Files           40       40              
  Lines         1932     2036     +104     
===========================================
+ Hits          1922     2026     +104     
  Misses          10       10              
Flag Coverage Δ
unittests 99.50% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mathiasbio mathiasbio changed the base branch from master to develop January 14, 2025 14:53
@mathiasbio
Copy link
Collaborator Author

This PR isn't finished yet in terms of all the testing and documentation, but I can take some reviews on the code!

@mathiasbio mathiasbio marked this pull request as ready for review January 14, 2025 14:54
@mathiasbio mathiasbio requested a review from a team as a code owner January 14, 2025 14:54
Copy link
Contributor

@fevac fevac left a comment

Choose a reason for hiding this comment

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

First round of reviews. I think the way how filters and configurations are set is quite messy. It would be nice to try to clean up as much as possible to make it more readable. In my opinion it would be nicer to use classes instead, but the classes should be properly defined and with a clear scope so there is no confusion between them. It is already a bit confusing the VariantCallerFilters and VarCallerFilters. It would be good to either merge, rename or refactor to know what is going on

BALSAMIC/constants/variant_filters.py Outdated Show resolved Hide resolved
BALSAMIC/models/params.py Outdated Show resolved Hide resolved
@mathiasbio mathiasbio requested a review from fevac January 27, 2025 15:22
@mathiasbio mathiasbio requested a review from a team January 29, 2025 09:27
Copy link
Contributor

@fevac fevac left a comment

Choose a reason for hiding this comment

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

Nice improvements! 🌟 Just some questions below

Copy link
Contributor

@fevac fevac left a comment

Choose a reason for hiding this comment

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

Thanks for addressing it. I'm still unsure if there would be any unexpected behaviour from the code. But it seems that you have tested this and it's good to go. So 🚀

@mathiasbio
Copy link
Collaborator Author

Thanks a lot for the review and the great suggestions @fevac ! ❤️

@mathiasbio mathiasbio merged commit 36c2c56 into develop Jan 31, 2025
9 checks passed
@mathiasbio mathiasbio deleted the disable_normal_hardfilter branch January 31, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants