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

Fix softclips causing Variant construction errors #26

Merged
merged 10 commits into from
Dec 17, 2022
Merged

Fix softclips causing Variant construction errors #26

merged 10 commits into from
Dec 17, 2022

Conversation

MillironX
Copy link
Member

Types of changes

This PR implements the following changes:
(Please tick any or all of the following that are applicable)

  • ✨ New feature (A non-breaking change which adds functionality).
  • 🐛 Bug fix (A non-breaking change, which fixes an issue).
  • 💥 Breaking change (fix or feature that would cause existing functionality to change).

📋 Additional detail

This is a direct fix for #25

Before

julia> using BioAlignments, BioSequences, SequenceVariation

julia> bad_aln = PairwiseAlignment(AlignedSequence(dna"GATTACAAAA", Alignment("7=3S", 1, 1)), dna"GATTACA")
PairwiseAlignment{LongSequence{DNAAlphabet{4}}, LongSequence{DNAAlphabet{4}}}:
  seq:  1 GATTACAAAA 10
          |||||||   
  ref:  1 GATTACA---  7


julia> Variant(bad_aln)
Variant{LongSequence{DNAAlphabet{4}}, DNA} with 1 edit:Error showing value of type Variant{LongSequence{DNAAlphabet{4}}, DNA}:
ERROR: ArgumentError: Invalid variant
...

This PR

julia> using BioAlignments, BioSequences, SequenceVariation

julia> bad_aln = PairwiseAlignment(AlignedSequence(dna"GATTACAAAA", Alignment("7=3S", 1, 1)), dna"GATTACA")

PairwiseAlignment{LongSequence{DNAAlphabet{4}}, LongSequence{DNAAlphabet{4}}}:
  seq:  1 GATTACAAAA 10
          |||||||   
  ref:  1 GATTACA---  7


julia> Variant(bad_aln)
Variant{LongSequence{DNAAlphabet{4}}, DNA} with 0 edit:

☑️ Checklist

  • 🎨 The changes implemented is consistent with the julia style guide.
  • 📘 I have updated and added relevant docstrings, in a manner consistent with the documentation styleguide.
  • 📘 I have added or updated relevant user and developer manuals/documentation in docs/src/.
  • 🆗 There are unit tests that cover the code changes I have made.
  • 🆗 The unit tests cover my code changes AND they pass.
  • 📝 I have added an entry to the [UNRELEASED] section of the manually curated CHANGELOG.md file for this repository.
  • 🆗 All changes should be compatible with the latest stable version of Julia.
  • 💭 I have commented liberally for any complex pieces of internal code.

Testing indicates that some Variants (particularly those with insertions
and/or clips at the send of the query sequence) will validate fine as a
Variant, but will fail validation as a Variation. This problem is
particularly annoying when constructing Variants in the REPL, as the
creation will complete successfully, but the show of the Variant will
error out. To fix this, leverage the existing validation of Variation to
check each Edit within a Variant upon construction.
@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Base: 60.47% // Head: 61.71% // Increases project coverage by +1.24% 🎉

Coverage data is based on head (4d02616) compared to base (3ed27f0).
Patch coverage: 90.90% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   60.47%   61.71%   +1.24%     
==========================================
  Files           1        1              
  Lines         253      256       +3     
==========================================
+ Hits          153      158       +5     
+ Misses        100       98       -2     
Flag Coverage Δ
unittests 61.71% <90.90%> (+1.24%) ⬆️

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

Impacted Files Coverage Δ
src/SequenceVariation.jl 61.71% <90.90%> (+1.24%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MillironX MillironX merged commit 17f4cd6 into BioJulia:master Dec 17, 2022
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.

1 participant