Aligner#

class pyfamsa.Aligner#

A single FAMSA aligner.

scoring_matrix#

The scoring matrix used for scoring alignments.

Type:

ScoringMatrix

New in version 0.4.0: The scoring_matrix attribute.

__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:

Changed in version 0.6.1: Sequences are now checked against the scoring_matrix alphabet.

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:
  • profile1 (Alignment) – The first profile to align.

  • profile2 (Alignment) – The second profile to align.

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:

Changed in version 0.6.1: Sequences are now checked against the scoring_matrix alphabet.