Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1.41 KB

ClipAlignments.rst

File metadata and controls

37 lines (23 loc) · 1.41 KB

ToC

Computing Positions In Clipped Alignments

This page describes how to compute view and source positions in an unclipped and clipped Align.

Position Computation Overview

There are four coordinate systems related to each gap object. One can consider the positions with and without gaps, both with and without clipping. The following picture and list show the easiest transformations between the coordinate systems.

  1. Translate between view (gapped clipped) position and source (ungaped unclipped) position using the functions Gaps#toSourcePosition and Gaps#toViewPosition.
  2. Translate between clipped and unclipped gapped position by adding/subtracting Gaps#clippedBeginPosition of the gaps object.
  3. Translate between clipped ungapped and unclipped ungapped position by adding/subtracting Gaps#beginPosition of the gaps object.

All other transformations are most easily done following one of the paths from the picture above.

An Example

The following extensive example shows how to practically translate between the coordinate systems.

demos/howto/align_gaps_clipping.cpp

The output looks as follows:

demos/howto/align_gaps_clipping.cpp.stdout