Skip to content

Commit 2c6f47f

Browse files
committed
Add info to printing and add tests
1 parent d71c399 commit 2c6f47f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ authors = ["Kenta Sato <[email protected]>", "Ben J. Ward <benjward@protonma
44
version = "2.0.0"
55

66
[deps]
7-
BioGenerics = "47718e42-2ac5-11e9-14af-e5595289c2ea" # Note: required for distance function.
7+
BioGenerics = "47718e42-2ac5-11e9-14af-e5595289c2ea"
88
BioSequences = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
99
BioSymbols = "3c28c6f8-a34d-59c4-9654-267d177fcfa9"
1010
IntervalTrees = "524e6230-43b7-53ae-be76-1e9e4d08d11b"
1111
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1212

1313
[compat]
14-
julia = "1"
1514
BioGenerics = "0.1"
1615
BioSequences = "2"
1716
BioSymbols = "4"
1817
IntervalTrees = "1"
18+
julia = "1"
1919

2020
[extras]
2121
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/pairwise/alignment.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ aln2ref(aln::PairwiseAlignment, i::Integer) = aln2ref(aln.a, i)
132132
# Printers
133133
# --------
134134

135-
showshort(io::IO, aln::PairwiseAlignment) = print(io, summary(aln), "()")
135+
function showshort(io::IO, aln::PairwiseAlignment)
136+
print(io, summary(aln), "(lengths=(",
137+
length(aln.a.seq), ", ", length(aln.b),
138+
")/", length(aln), ')'
139+
)
140+
end
141+
136142
Base.show(io::IO, aln::PairwiseAlignment) = showshort(io, aln)
137143

138144
function Base.show(io::IO, ::MIME"text/plain", aln::PairwiseAlignment)

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,12 @@ end
10411041
| |||| | |
10421042
ref: 49 CVVESSVLRA 58
10431043
"""
1044+
buf = IOBuffer()
1045+
print(buf, (aln,))
1046+
@test String(take!(buf)) == (
1047+
"""(PairwiseAlignment{$seqtype,$(VERSION >= v"1.6" ? " " : "")$(seqtype)}""" *
1048+
"""(lengths=(58, 58)/60),)"""
1049+
)
10441050
# Result from EMBOSS Needle:
10451051
# EMBOSS_001 1 EPVTSHPKAVSPTETK--PTEKGQHLPVSAPPKITQSLKAEASKDIAKLT 48
10461052
# || |||||||||||| ||||.|||||||||||||.|||||||:|||||

0 commit comments

Comments
 (0)