Skip to content

Commit 5a8cb6b

Browse files
committed
BROKEN: Add meta-operation support to PairwiseAlignment iterator
Signed-off-by: Thomas A. Christensen II <[email protected]>
1 parent 6916a0e commit 5a8cb6b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/pairwise/alignment.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ function Base.iterate(aln::PairwiseAlignment, ij=(2,1))
2222

2323
anchors = aln.a.aln.anchors
2424
anchor = anchors[i]
25+
26+
# If this is a meta-operation, then advance to the next non-meta anchor, if available
27+
# If there are no non-meta anchors left, then the iterator is finished
28+
for k in i:lastindex(anchors)
29+
i = k
30+
anchor = anchors[i]
31+
if !ismetaop(anchor.op)
32+
break
33+
elseif i == lastindex(anchors)
34+
return nothing
35+
end
36+
end
37+
2538
seq = aln.a.seq
2639
ref = aln.b
2740
seqpos = anchors[i-1].seqpos

0 commit comments

Comments
 (0)