skbio.alignment.PairAlignPath.to_coordinates#

PairAlignPath.to_coordinates()[source]#

Generate an array of segment coordinates in the original sequences.

Returns:
ndarray of int of shape (n_seqs, n_segments)

Array where each value defines the start positions (index) of each segment for each sequence.

Examples

>>> from skbio.alignment import AlignPath
>>> path = AlignPath(lengths=[1, 2, 2, 1],
...                  states=[0, 5, 2, 6],
...                  starts=[0, 0, 0])
>>> path.to_coordinates() 
array([[0, 1, 1, 3, 4],
       [0, 1, 3, 3, 3],
       [0, 1, 1, 3, 3]]...