Skip to content

Commit 26e05f7

Browse files
authored
Fix small errors (#228)
1 parent 40222ac commit 26e05f7

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/geneticcode.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Base.getindex(code::GeneticCode, codon::UInt64)
3333
return @inbounds code.tbl[codon + one(UInt64)]
3434
end
3535

36-
Base.copy(code::GeneticCode) = GeneticCode(copy(code.name), copy(code.tbl))
36+
Base.copy(code::GeneticCode) = code
3737
Base.length(code::GeneticCode) = 64
3838

3939
Base.show(io::IO, code::GeneticCode) = print(io, code.name)

src/search/re.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ Biological regular expression to seatch for `pattern` in sequences of type `T`,
585585
`T` can be `DNA`, `RNA`, and `AminoAcid`. `syntax` can be `:pcre` or `:prosite` for AminoAcid
586586
acids.
587587
"""
588-
struct Regex{T}
588+
struct Regex{T <: Union{BioSequences.DNA, BioSequences.RNA, BioSequences.AminoAcid}}
589589
pat::String # regular expression pattern (for printing)
590590
code::Vector{Op} # compiled code
591591
nsaves::Int # the number of `save` operations in `code`
@@ -616,10 +616,8 @@ function Base.show(io::IO, re::Regex{T}) where {T}
616616
opt = "dna"
617617
elseif T == BioSequences.RNA
618618
opt = "rna"
619-
elseif T == BioSequences.AminoAcid
619+
else T == BioSequences.AminoAcid
620620
opt = "aa"
621-
else
622-
assert(false)
623621
end
624622
print(io, "biore\"", re.pat, "\"", opt)
625623
end

0 commit comments

Comments
 (0)