We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0156de4 commit cc8237cCopy full SHA for cc8237c
src/pairwise/alignment.jl
@@ -118,16 +118,7 @@ Count the number of aligned positions.
118
"""
119
function count_aligned(aln::PairwiseAlignment)
120
anchors = aln.a.aln.anchors
121
- n = 0
122
- for i in 2:lastindex(anchors)
123
- op = anchors[i].op
124
- if ismatchop(op) || isinsertop(op)
125
- n += anchors[i].seqpos - anchors[i-1].seqpos
126
- elseif isdeleteop(op)
127
- n += anchors[i].refpos - anchors[i-1].refpos
128
- end
129
130
- return n
+ return isempty(anchors) ? 0 : last(anchors).alnpos
131
end
132
133
seq2ref(aln::PairwiseAlignment, i::Integer) = seq2ref(aln.a, i)
0 commit comments