Skip to main content
`Ctrl`+`K`

# skbio.alignment.AlignPath.from_aligned

classmethod AlignPath.from_aligned(aln, gap_chars='-', starts=None)

  Create an alignment path from aligned sequences.

  Parameters:
    aln iterable of `Sequence`, str or sequence

      Aligned sequences. Can be skbio sequences, strings or sequences of any scalars.

    gap_chars str or container, optional

      Characters that should be treated as gaps in aligned sequences. Default is “-“.

    starts array_like of int of shape (2,), optional

      Start positions of sequences. If omitted, will be all zeros.

  Returns:
    AlignPath

      The alignment path created from the aligned sequences.

  See also

  `to_aligned`
  `from_tabular`

  Notes

  This method is more general but less efficient than `from_tabular`. It works with various sequence formats.

  Examples

      >>> from skbio.alignment import AlignPath
      >>> aln = [
      ...    'CGTCGTGC',
      ...    'CA--GT-C',
      ...    'CGTCGT-T'
      ... ]
      >>> path = AlignPath.from_aligned(aln)
      >>> path
      <AlignPath, sequences: 3, positions: 8, segments: 5>