Status of key selling points and planned work.
- The data structure stores directional scores as ordered tuples
(
("A","B")can differ from("B","A")). Both ANW and YenKSP use directional lookups. ScoringMatrix.from_substitution_counts()creates asymmetric matrices from observed substitution frequencies using log-odds scoring (same approach as BLOSUM/PAM matrices).- N-dimensional alignment natively handles asymmetric matrices.
from_distfeat()produces symmetric feature distances; for asymmetric scoring, usefrom_substitution_counts()with directional substitution data, or refine a distfeat prior viabootstrap_matrix()/learn_matrix().
Sequences can have completely different alphabets (Latin, Cyrillic, IPA, etc.). Each domain is independent. Well-tested and documented.
- For N <= 4 sequences (within grid-size limits), true N-dimensional alignment is performed via YenKSP on an N-dimensional graph.
- For N > 4 or very long sequences, UPGMA-guided progressive alignment with beam search for k-best results.
- Pairwise alignment (N=2) is dispatched directly without overhead.
learn_matrix()learns from pre-clustered cognate sets (EM or gradient descent). Supportsprior_matrixfor regularization with linear decay.bootstrap_matrix()learns from arbitrary sequence pairs without clustering (unsupervised). Uses iterative log-odds re-estimation with Laplace smoothing.- Both
learn_matrix()andbootstrap_matrix()accept aprior_matrixparameter (e.g. fromfrom_distfeat()) whose influence decays linearly over iterations, enabling the distfeat → learn/bootstrap → asymmetric pipeline. from_distfeat()infers scores from phonological feature knowledge (symmetric only).from_substitution_counts()converts observed counts to log-odds scores (supports asymmetric).- Matrix imputation fills sparse matrices from partial data.
detect_blocks()identifies complementary-gap patterns (diphthongization, metathesis) in alignments. Configurablemax_block_size(default 2).merge_alignment_blocks()merges block columns into compound symbols (tuples). Available as post-processing viaalign(merge_blocks=True).bootstrap_matrix(block_merge=True)adjusts pair counts to reduce gap inflation caused by block patterns during matrix learning.
- Investigate capping NW backtrace to enable N-dim NW for cases where scoring matrices have few ties.
- Automatic clustering or cognate discovery (beyond current scope).