skbio.alignment.AlignPath.from_aligned#
- classmethod AlignPath.from_aligned(aln, gap_chars='-', starts=None)[source]#
Create an alignment path from aligned sequences.
- Parameters:
- aln
TabularMSAor iterable of equal-length sequence-like Aligned sequences. All sequences must have equal length.
- gap_charsiterable of hashable, optional
Symbols that should be treated as gaps in aligned sequences. Default is “-“.
- startsarray-like of int of shape (n_sequences,), optional
Start positions of sequences. If omitted, will be all zeros.
- aln
- Returns:
AlignPathThe alignment path created from the aligned sequences.
See also
Notes
This method consumes aligned sequences, i.e., sequences with gaps inserted to make them equal in length. It is more general but less efficient than
from_tabular.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>