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

Allow hamming circle around N #126

Merged
merged 2 commits into from
Nov 10, 2020
Merged

Conversation

tp2750
Copy link
Contributor

@tp2750 tp2750 commented Oct 31, 2020

Allow hamming circle around N

This fixes #124 : Demultiplexer fails for Levenshtein distance > 1

The problem was that the levenshtein_circle function generates sequences containing N, but the hamming_circle function was not able to create a circle around those.

With this change, the circle around N is created as [A,C,G,T]

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

Before the change:

julia> BioSequences.hamming_circle(dna"N",1)
ERROR: MethodError: no method matching isless(::Nothing, ::Int64)
Closest candidates are:
  isless(::Missing, ::Any) at missing.jl:87
  isless(::AbstractFloat, ::Real) at operators.jl:167
  isless(::Real, ::Real) at operators.jl:355
  ...
Stacktrace:
 [1] <(::Nothing, ::Int64) at /opt/Julia/julia-1.5.2/share/julia/base/operators.jl:277
 [2] <=(::Nothing, ::Int64) at /opt/Julia/julia-1.5.2/share/julia/base/operators.jl:326
 [3] hamming_circle(::LongSequence{DNAAlphabet{4}}, ::Int64) at /home/tp/Julia/Pull/2020-10-31_demultiplex/BioSequences.jl/src/demultiplexer.jl:240
 [4] top-level scope at REPL[41]:1

With change

julia> BioSequences.hamming_circle(dna"N",1)
4-element Array{LongSequence{DNAAlphabet{4}},1}:
 A
 C
 G
 T

☑️ 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.

@codecov
Copy link

codecov bot commented Oct 31, 2020

Codecov Report

Merging #126 (4e1bda1) into master (6f0e437) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
- Coverage   83.21%   83.20%   -0.01%     
==========================================
  Files          44       44              
  Lines        2949     2948       -1     
==========================================
- Hits         2454     2453       -1     
  Misses        495      495              
Flag Coverage Δ
unittests 83.20% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/demultiplexer.jl 94.25% <100.00%> (ø)
src/biosequence/indexing.jl 87.03% <0.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f0e437...4e1bda1. Read the comment docs.

@tp2750
Copy link
Contributor Author

tp2750 commented Nov 10, 2020

This is a very small change, but it will have a large impact by fixing #124 .

Is there something more I can do to help it get merged?

@kescobo
Copy link
Member

kescobo commented Nov 10, 2020

Thanks for the detailed bu
g report and PR! We appreciate the work! I don't have a good sense of the implications of this change, so I'll wait on @benjward (or maybe @jakobnissen ??) to review. Don't hesitate to bump if this doesn't get a look in a reasonable amount of time (defined however makes sense to you :-) )

@TransGirlCodes TransGirlCodes merged commit 5c14f3f into BioJulia:master Nov 10, 2020
@TransGirlCodes
Copy link
Member

Thanks @tp2750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demultiplexer fails for Levenshtein distance > 1
3 participants