Skip to content

Commit 40222ac

Browse files
author
Ben J. Ward
committed
Merge branch 'canonical-bugfix'
2 parents d3d8fc4 + 41ff952 commit 40222ac

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
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`.

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)