Add getter methods (and forwarded getter methods) for alignment types #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of changes
This PR implements the following changes:
📋 Additional detail
The idea for these getter functions first came up in the discussion at #80 (comment). These functions are intended to be user-friendly band-aids over the disjointed API between
Alignment
,AlignedSequence
,PairwiseAlignment
, andPairwiseAlignmentResult
. There are five new methods, with one new exported function.alignment(::AlignedSequence) -> Alignment
alignment(::PairwiseAlignment) -> Alignment
sequence(::AlignedSequence) -> LongSequence
sequence(::PairwiseAlignment) -> LongSequence
sequence(::PairwiseAlignmentResult) -> LongSequence
Note that
alignment(::PairwiseAlignmentResult)
already returns aPairwiseAlignment
. I opted for liberal documentation over breaking the API.I added extra documentation and tests in the form of doctests. I didn't add any additional tests to the regular test suite, as getter function tests are pretty redundant.
My hope is that this closes out the feature list of BioAlignments v2, and we can get #44 merged and move on to BioAlignments v3 after this.
☑️ Checklist
docs/src/
.[UNRELEASED]
section of the manually curatedCHANGELOG.md
file for this repository.