skbio.alignment.PairAlignPath.from_cigar#

classmethod PairAlignPath.from_cigar(cigar, starts=None)[source]#

Create a pairwise alignment path from a CIGAR string.

Parameters:
cigarstr

CIGAR format string used to build the PairAlignPath.

startsarray_like of (int, int), optional

Start position (0-based) of each sequence in the alignment. If omitted, will set as zeros.

Returns:
PairAlignPath

The pairwise alignment path created from the given CIGAR string.

Examples

>>> from skbio.alignment import PairAlignPath
>>> cigar = "2M5P3D1I"
>>> path = PairAlignPath.from_cigar(cigar)
>>> path
<PairAlignPath, shape: Shape(sequence=2, position=11), CIGAR: '2M5P3D1I'>