skbio.alignment.PairAlignPath#
- class skbio.alignment.PairAlignPath(lengths, states, starts=(0, 0))[source]#
Store a pairwise alignment path between two sequences.
PairAlignPath
is a subclass ofAlignPath
, with additional methods specific to pairwise alignments, such as the processing of CIGAR strings.- Parameters:
- lengthsarray_like of int of shape (n_segments,)
Length of each segment in the alignment.
- statesarray_like of uint8 of shape (n_segments,)
Bits representing character (0) or gap (1) status per sequence per segment in the alignment.
- startsarray_like of (int, int), optional
Start position (0-based) of each sequence in the alignment. Default is (0, 0).
Attributes (inherited)
Array of lengths of segments in alignment path.
Number of sequences (rows) and positions (columns).
Array of start positions of sequences in the alignment.
Array of gap status of segments in alignment path.
Methods
from_bits
(bits[, starts])Create a pairwise alignment path from a bit array.
from_cigar
(cigar[, starts])Create a pairwise alignment path from a CIGAR string.
to_cigar
([seqs])Generate a CIGAR string representing the pairwise alignment path.
Methods (inherited)
from_coordinates
(coords)Create an alignment path from an array of segment coordinates.
from_indices
(indices[, gap])Create an alignment path from character indices in the original sequences.
from_tabular
(msa)Create an alignment path from a TabularMSA object.
stops
()Calculate the stop positions of sequences in the alignment.
to_bits
([expand])Unpack the alignment path into an array of bits.
Generate an array of segment coordinates in the original sequences.
to_indices
([gap])Generate an array of indices of characters in the original sequences.
Special methods
__str__
()Return string representation of this alignment path.
Special methods (inherited)
__eq__
(value, /)Return self==value.
__ge__
(value, /)Return self>=value.
__getstate__
(/)Helper for pickle.
__gt__
(value, /)Return self>value.
__hash__
(/)Return hash(self).
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
Details