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

BioSequences v3 and BioSymbols v5 #72

Merged
merged 5 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, this is long overdue...

- '1'
- 'nightly'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- *master* set as the main development branch (#49, #50)
- Updated chat links (#ebea200c)
- Expanded test matrix, adding julia v1.6 (#77)
- Incremented BioSequences compatibility to v3 (#72)
- Incremented BioSymbols compatibility to v5 (#72)
- Adjusted test matrix for minimum compatibility (#72)
- Updated doctests (#72)

### Removed
- :exclamation: Reverted the use of *BioJulia* registry,
the package switched to [General Julia Registry](https://github.com/JuliaRegistries/General) (#48)
- :exclamation: Removed Gitter chat links (#ebea200c)
- :exclamation: Dropped support for julia less than v1.6 (#72)

### Fixed
- Doctests (#78)
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[compat]
BioGenerics = "0.1"
BioSequences = "2"
BioSymbols = "4"
BioSequences = "3"
BioSymbols = "5"
IntervalTrees = "1"
julia = "1"

Expand Down
8 changes: 4 additions & 4 deletions docs/src/pairalign.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ julia> s2 = dna"ACCTGGTATGATAGCG";
julia> scoremodel = AffineGapScoreModel(EDNAFULL, gap_open=-5, gap_extend=-1);

julia> res = pairalign(GlobalAlignment(), s1, s2, scoremodel) # run pairwise alignment
PairwiseAlignmentResult{Int64, BioSequences.LongDNASeq, BioSequences.LongDNASeq}:
PairwiseAlignmentResult{Int64, BioSequences.LongSequence{BioSequences.DNAAlphabet{4}}, BioSequences.LongSequence{BioSequences.DNAAlphabet{4}}}:
score: 13
seq: 0 -CCTAGG------AGGG 10
||| || || |
Expand All @@ -85,7 +85,7 @@ julia> score(res) # get the achieved score of this alignment
13

julia> aln = alignment(res)
PairwiseAlignment{BioSequences.LongDNASeq, BioSequences.LongDNASeq}:
PairwiseAlignment{BioSequences.LongSequence{BioSequences.DNAAlphabet{4}}, BioSequences.LongSequence{BioSequences.DNAAlphabet{4}}}:
seq: 0 -CCTAGG------AGGG 10
||| || || |
ref: 1 ACCT-GGTATGATAGCG 16
Expand Down Expand Up @@ -126,11 +126,11 @@ julia> collect(aln) # pairwise alignment is iterable
(DNA_G, DNA_C)
(DNA_G, DNA_G)

julia> LongDNASeq([x for (x, _) in aln]) # create aligned `s1` with gaps
julia> LongDNA{4}([x for (x, _) in aln]) # create aligned `s1` with gaps
17nt DNA Sequence:
-CCTAGG------AGGG

julia> LongDNASeq([y for (_, y) in aln]) # create aligned `s2` with gaps
julia> LongDNA{4}([y for (_, y) in aln]) # create aligned `s2` with gaps
17nt DNA Sequence:
ACCT-GGTATGATAGCG

Expand Down
4 changes: 2 additions & 2 deletions src/submat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ end

# Return the row/column index of `nt`.
function index(nt::BioSymbols.NucleicAcid)
return convert(Int, nt)
return reinterpret(Int8, nt)
end

# Return the row/column index of `aa`.
function index(aa::BioSymbols.AminoAcid)
return convert(Int, aa) + 1
return reinterpret(Int8, aa) + 1
end


Expand Down
9 changes: 3 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1012,15 +1012,12 @@ end
seq2 = aa"EPSHPKAVSPTETKRCPTEKVQHLPVSAPPKITQFLKAEASKEIAKLTCVVESSVLRA"
model = AffineGapScoreModel(BLOSUM62, gap_open=-10, gap_extend=-1)
aln = alignment(pairalign(GlobalAlignment(), seq1, seq2, model))
# julia 1.6+ uses shorter type aliases when printing types
seqtype = VERSION >= v"1.6" ?
"BioSequences.LongAminoAcidSeq" :
"BioSequences.LongSequence{BioSequences.AminoAcidAlphabet}"
seqtype = "BioSequences.LongAA"
buf = IOBuffer()
show(buf, MIME"text/plain"(), aln)
@test String(take!(buf)) ==
"""
PairwiseAlignment{$(seqtype),$(VERSION >= v"1.6" ? " " : "")$(seqtype)}:
PairwiseAlignment{$seqtype, $seqtype}:
seq: 1 EPVTSHPKAVSPTETK--PTEKGQHLPVSAPPKITQSLKAEASKDIAKLTCAVESSALCA 58
|| |||||||||||| |||| ||||||||||||| ||||||| |||||| |||| | |
ref: 1 EP--SHPKAVSPTETKRCPTEKVQHLPVSAPPKITQFLKAEASKEIAKLTCVVESSVLRA 58
Expand All @@ -1046,7 +1043,7 @@ end
buf = IOBuffer()
print(buf, (aln,))
@test String(take!(buf)) == (
"""(PairwiseAlignment{$seqtype,$(VERSION >= v"1.6" ? " " : "")$(seqtype)}""" *
"""(PairwiseAlignment{$seqtype, $seqtype}""" *
"""(lengths=(58, 58)/60),)"""
)
# Result from EMBOSS Needle:
Expand Down