Skip to content

Commit 41ff952

Browse files
author
Ben J. Ward
committed
πŸ› in iscanonical / canonical
Fixes #225 Add tests for edge case Fixup Fiixup πŸ› in iscanonical / canonical Fixes #225 πŸ› in iscanonical / canonical Fixes #225 Update Project.toml
1 parent 16ec1ca commit 41ff952

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [3.0.1]
8+
### Removed
9+
10+
### Added
11+
12+
### Changed
13+
- Fixed a bug in `iscanonical`.
14+
715
## [3.0]
816
### Removed
917
- Removed `unsafe_setindex!`. Instead, use normal setindex with `@inbounds`.

β€ŽProject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BioSequences"
22
uuid = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
33
authors = ["Sabrina Jaye Ward <sabrinajward@protonmail.com>", "Jakob Nissen <jakobnybonissen@gmail.com>"]
4-
version = "3.0.0"
4+
version = "3.0.1"
55

66
[deps]
77
BioSymbols = "3c28c6f8-a34d-59c4-9654-267d177fcfa9"

β€Žsrc/biosequence/predicates.jlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ two i.e. `canonical_seq < other_seq`.
115115
function iscanonical(seq::NucleotideSeq)
116116
i = 1
117117
j = lastindex(seq)
118-
@inbounds while i < j
118+
@inbounds while i <= j
119119
f = seq[i]
120120
r = complement(seq[j])
121121
f < r && return true

β€Žtest/biosequences/misc.jlβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ end
126126
seq = SimpleSeq("CGAU")
127127
canonical!(seq)
128128
@test seq == SimpleSeq("AUCG")
129+
130+
@test iscanonical(SimpleSeq("UCA"))
131+
@test !iscanonical(SimpleSeq("UGA"))
129132
end
130133

131134
@testset "Ispalindromic" begin

β€Žtest/longsequences/predicates.jlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,8 @@
7575
@test isrepetitive(aa"PGQQ", 2)
7676
@test !isrepetitive(aa"PPQQ", 3)
7777
@test isrepetitive(aa"PPPQQ", 3)
78+
79+
# iscanonical
80+
@test iscanonical(dna"TCA")
81+
@test !iscanonical(dna"TGA")
7882
end

0 commit comments

Comments
Β (0)