Aligner#
- class pyfamsa.Aligner#
A single FAMSA aligner.
- scoring_matrix#
The scoring matrix used for scoring alignments.
- Type:
New in version 0.4.0: The
scoring_matrixattribute.- __init__(*args, **kwargs)#
- align(sequences)#
Align sequences together.
Example
>>> aligner = Aligner() >>> seqs = [Sequence(b't1', b'MMYK'), Sequence(b't2', b'MYKLP')] >>> ali = aligner.align(seqs) >>> list(ali) [GappedSequence(b't1', b'MMYK--'), GappedSequence(b't2', b'-MYKLP')]
- Parameters:
sequences (iterable of
Sequence) – An iterable yielding the digitized sequences to align.- Returns:
Alignment– The aligned sequences, in aligned format.- Raises:
ValueError – When the given sequences contain symbols that are not supported by the
Aligner.scoring_matrix.RuntimeError – When the internal FAMSA failed to align the sequences.
Changed in version 0.6.1: Sequences are now checked against the
scoring_matrixalphabet.
- align_profiles(profile1, profile2)#
Align two profiles together.
Profile-profile alignment computes a new alignment using sequences from the two input alignments while preserving the columns of each profile.
- Parameters:
- Returns:
Alignment– The resulting profile-profile alignment.
New in version 0.5.0.
- build_tree(sequences)#
Build a tree from the given sequences.
- Parameters:
sequences (iterable of
Sequence) – An iterable yielding the digitized sequences to build a tree from.- Returns:
GuideTree– The guide tree obtained from the sequences.- Raises:
ValueError – When the given sequences contain symbols that are not supported by the
Aligner.scoring_matrix.RuntimeError – When the internal FAMSA failed to align the sequences.
Changed in version 0.6.1: Sequences are now checked against the
scoring_matrixalphabet.