BioJulia / BioAlignments.jl

Sequence alignment tools
MIT License
60 stars 24 forks source link

Add getter methods (and forwarded getter methods) for alignment types #83

Closed MillironX closed 2 years ago

MillironX commented 2 years ago

Types of changes

This PR implements the following changes:

:clipboard: Additional detail

The idea for these getter functions first came up in the discussion at https://github.com/BioJulia/BioAlignments.jl/discussions/80#discussioncomment-2959292. These functions are intended to be user-friendly band-aids over the disjointed API between Alignment, AlignedSequence, PairwiseAlignment, and PairwiseAlignmentResult. There are five new methods, with one new exported function.

Note that alignment(::PairwiseAlignmentResult) already returns a PairwiseAlignment. 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.

Note: I branched off of the hotfix/v2.2.0 branch, so this branch is out-of-date with master and will likely need merged manually. Another reason to move beyond #44.

:ballot_box_with_check: Checklist

codecov[bot] commented 2 years ago

Codecov Report

Base: 88.50% // Head: 87.60% // Decreases project coverage by -0.90% :warning:

Coverage data is based on head (fb312a5) compared to base (6d96e79). Patch coverage: 83.65% of modified lines in pull request are covered.

:exclamation: Current head fb312a5 differs from pull request most recent head 797c566. Consider uploading reports for the commit 797c566 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #83 +/- ## ========================================== - Coverage 88.50% 87.60% -0.91% ========================================== Files 16 16 Lines 1114 1138 +24 ========================================== + Hits 986 997 +11 - Misses 128 141 +13 ``` | [Impacted Files](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia) | Coverage Δ | | |---|---|---| | [src/pairwise/result.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL3BhaXJ3aXNlL3Jlc3VsdC5qbA==) | `44.00% <0.00%> (-1.84%)` | :arrow_down: | | [src/alignment.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL2FsaWdubWVudC5qbA==) | `80.46% <77.77%> (-4.54%)` | :arrow_down: | | [src/pairwise/alignment.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL3BhaXJ3aXNlL2FsaWdubWVudC5qbA==) | `96.58% <80.00%> (-1.77%)` | :arrow_down: | | [src/alignedseq.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL2FsaWduZWRzZXEuamw=) | `94.93% <83.33%> (-2.33%)` | :arrow_down: | | [src/anchors.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL2FuY2hvcnMuamw=) | `100.00% <100.00%> (ø)` | | | [src/operations.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL29wZXJhdGlvbnMuamw=) | `87.50% <100.00%> (ø)` | | | [src/pairwise/algorithms/common.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL3BhaXJ3aXNlL2FsZ29yaXRobXMvY29tbW9uLmps) | `90.62% <100.00%> (+5.62%)` | :arrow_up: | | [src/pairwise/algorithms/hamming\_distance.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL3BhaXJ3aXNlL2FsZ29yaXRobXMvaGFtbWluZ19kaXN0YW5jZS5qbA==) | `100.00% <100.00%> (ø)` | | | [src/submat.jl](https://codecov.io/gh/BioJulia/BioAlignments.jl/pull/83/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia#diff-c3JjL3N1Ym1hdC5qbA==) | `97.67% <0.00%> (-0.78%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BioJulia)

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