feat: add Smith-Waterman algorithm for local sequence alignment#960
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #960 +/- ##
==========================================
- Coverage 95.48% 95.46% -0.02%
==========================================
Files 335 336 +1
Lines 21797 21956 +159
==========================================
+ Hits 20813 20961 +148
- Misses 984 995 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@siriak, This is ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR adds an implementation of the Smith-Waterman algorithm for local sequence alignment to the dynamic programming module. The Smith-Waterman algorithm is a well-known bioinformatics algorithm for finding optimal local alignments between sequences using dynamic programming with O(m×n) time and space complexity.
Key Changes:
- Implements Smith-Waterman algorithm with configurable scoring parameters (match, mismatch, gap penalties)
- Provides traceback functionality to reconstruct optimal alignments from the scoring matrix
- Includes comprehensive test coverage with multiple test cases
- Case-insensitive sequence handling
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/dynamic_programming/smith_waterman.rs | New implementation of Smith-Waterman algorithm with score matrix generation, traceback, and helper scoring function |
| src/dynamic_programming/mod.rs | Module and public API declarations for smith_waterman functions |
| DIRECTORY.md | Documentation entry for Smith-Waterman algorithm, maintaining alphabetical order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
siriak
left a comment
There was a problem hiding this comment.
Please check the comments and address if they are relevant
AliAlimohammadi
left a comment
There was a problem hiding this comment.
Review completed.
Description
This PR adds the Smith-Waterman algorithm implementation to the dynamic programming module.
Algorithm Overview
The Smith-Waterman algorithm is a dynamic programming algorithm for determining similar regions between two sequences (nucleotide or protein sequences). It performs local sequence alignment and is particularly useful in bioinformatics.
Key Features:
Implementation Details:
score_function: Calculates alignment scores for character pairssmith_waterman: Builds the scoring matrix using dynamic programmingtraceback: Reconstructs the optimal alignment from the scoring matrixTesting
The implementation includes comprehensive tests:
All tests pass:
cargo test smith_watermanDocumentation
Checklist
cargo fmtReferences