Skip to content

Conversation

@trishorts
Copy link
Contributor

@trishorts trishorts commented Oct 27, 2025

Few things here:

  1. Simple expansion of some unit tests to better reveal current behavior for the treatment of sequence variants that are supported by VCF data.
  2. Homozygous variants with depth greater than specified results in only the production of the variant protein or RNA. you do not get the consensus protein or RNA in that case. This was a surprise.
  3. List of sequence variants in proteins and RNAs wasn't properly adjust when variants get applied. Desired behavior is to remove applied variants from the sequence variants list when they get applied.
  4. This PR helps display proper handling of modifications on variants.

@trishorts trishorts requested a review from Copilot October 28, 2025 15:46
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 enhances the variant modification system by explicitly separating unapplied database sequence variants from applied sequence variants. The key improvement is that applied variants are now removed from the SequenceVariations collection and tracked separately in AppliedSequenceVariations, providing clearer representation of variant state throughout the codebase.

Key changes:

  • Modified CreateVariant signatures to accept both sequenceVariants (database variants) and appliedSequenceVariants parameters
  • Implemented logic to remove applied variants from SequenceVariations collection in variant construction
  • Updated all test assertions to reflect the new behavior where variants with applied sequence variations have empty SequenceVariations lists

Reviewed Changes

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

Show a summary per file
File Description
mzLib/Transcriptomics/RNA.cs Added overloaded constructor with explicit sequenceVariants parameter and removal logic for applied variants
mzLib/Transcriptomics/NucleicAcid.cs Updated abstract CreateVariant signature to include sequenceVariants parameter
mzLib/Proteomics/Protein/Protein.cs Updated CreateVariant implementation with variant removal logic matching RNA implementation
mzLib/Omics/BioPolymer/VariantApplication.cs Modified variant application logic to pass database variants explicitly through construction chain
mzLib/Omics/BioPolymer/IHasSequenceVariants.cs Updated interface signature and documentation for CreateVariant method
mzLib/Test/Transcriptomics/TestVariantOligo.cs Updated test assertions to expect 0 unapplied variants after application; split test cases and added documentation
mzLib/Test/DatabaseTests/TestVariantProtein.cs Updated test assertions and added comprehensive test for VCF variant with modifications
mzLib/Test/Test.csproj Added new test data file to project
mzLib/Test/DatabaseTests/oneVcfProteinWithModsOnVariant.xml New test data file for VCF variant testing

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

// • maxHeterozygousVariants only affects heterozygous logic.It does nothing for homozygous ALT variants.
// Why your specific test applies the variant Your vcfstring is GT= 1 / 1 with AD = 0,15 (ALT depth 15). With the default minAlleleDepth=1 (you didn’t override it),
// ApplyVariants treats this as homozygous ALT with sufficient depth and applies it, returning only the variant protein.
// </summary>
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Corrected XML comment closing tag from '// ' to '/// '.

Suggested change
// </summary>
/// </summary>

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 96.82540% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.01%. Comparing base (57f1327) to head (8c67a7c).

⚠️ Current head 8c67a7c differs from pull request most recent head c503815

Please upload reports for the commit c503815 to get more accurate results.

Files with missing lines Patch % Lines
mzLib/Proteomics/Protein/Protein.cs 93.33% 0 Missing and 1 partial ⚠️
mzLib/Transcriptomics/RNA.cs 96.77% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #974      +/-   ##
==========================================
+ Coverage   81.00%   81.01%   +0.01%     
==========================================
  Files         269      269              
  Lines       38826    38869      +43     
  Branches     4241     4247       +6     
==========================================
+ Hits        31450    31490      +40     
  Misses       6640     6640              
- Partials      736      739       +3     
Files with missing lines Coverage Δ
mzLib/Omics/BioPolymer/VariantApplication.cs 82.44% <100.00%> (+0.67%) ⬆️
mzLib/Transcriptomics/NucleicAcid.cs 94.83% <ø> (ø)
mzLib/Proteomics/Protein/Protein.cs 97.11% <93.33%> (-0.31%) ⬇️
mzLib/Transcriptomics/RNA.cs 98.18% <96.77%> (-1.82%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@trishorts trishorts changed the title Variant modification test expansion Handling of applied variants with and without modifications Oct 28, 2025
trishorts and others added 2 commits October 28, 2025 10:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@trishorts trishorts requested a review from Copilot October 28, 2025 15:58
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

mzLib/Test/DatabaseTests/TestVariantProtein.cs:1

  • The test attribute [Test] is missing from this test method. Without it, the test will not be executed by the test runner.
using System;

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant