Skip to content

Commit 450b43c

Browse files
committed
Adding missing methods to the interface
1 parent a3edf54 commit 450b43c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

biojava-core/src/main/java/org/biojava/nbio/core/alignment/template/AlignedSequence.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,20 @@ enum Step { COMPOUND, GAP }
142142
*/
143143
boolean isGap(int alignmentIndex);
144144

145+
/**
146+
* Returns number of gap positions (gap openings and extensions) in the sequence. This could be determined from the {@link Location}
147+
* information or from gap {@link Compound}s, which may not necessarily result in the same number.
148+
*
149+
* @return number of gap positions in the sequence
150+
*/
151+
int getNumGapPositions();
152+
153+
/**
154+
* Returns the coverage, as a fraction between 0 and 1, of this {@link AlignedSequence} with respect to the original sequence.
155+
* This is equivalent to ({@link #getLength()} - {@link #getNumGapPositions()}) / getOriginalSequence().getLength().
156+
*
157+
* @return coverage of the original sequence by the aligned sequence
158+
*/
159+
double getCoverage();
160+
145161
}

0 commit comments

Comments
 (0)