Skip to content

Calculate the Number of Gap Positions in a Sequence Alignment (and Coverage) #491

@lafita

Description

@lafita

I have not found a way to easily calculate the number of gap positions in a sequence alignment. I was using the function AlignedSequence.getNumGaps(), which is said to return the number of gaps in the sequence, but actually returns the number of gap openings (without taking the length of the gap into account), which I found it a bit confusing.

I think it could be useful to have a function AlignedSequence.getNumGapPositions() that returns the total number of gaps (with symbol -) in the aligned sequence and documents properly the differences with the other function.

The applications of such a function would be to calculate the coverage of the sequence alignment on one of the aligned sequences. I also could not find a function to calculate coverage, but it should be easily calculated from the original sequence length, the alignment length and the number of gap positions:

Coverage = ( alignment length - number of gap positions ) / sequence length

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationJavadoc relatedenhancementImprovement of existing code or methodnew featureNew method or data structure

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions