MafftApp#

class biotite.application_v2.mafft.MafftApp(path: PathLike[str] | str = 'mafft')[source]#

Bases: LocalApp

A handle to MAFFT.

Parameters:
pathstr, optional

Path of the MAFFT binary.

Examples

>>> sequences = [
...     ProteinSequence("BIQTITE"),
...     ProteinSequence("TITANITE"),
...     ProteinSequence("BISMITE"),
...     ProteinSequence("IQLITE"),
... ]
>>> result = MafftApp().run(sequences).result()
>>> print(result.alignment)
-BIQTITE
TITANITE
-BISMITE
--IQLITE
run(sequences: Sequence[Sequence], matrix: SubstitutionMatrix | None = None, gap_penalty: float | tuple[float, float] | None = None, **kwargs: Any) → CommandSetup[MafftResult]#

Perform a multiple sequence alignment.

Parameters:
sequencesiterable object of Sequence

The sequences to be aligned.

matrixSubstitutionMatrix, optional

A custom substitution matrix.

gap_penaltyfloat or tuple of (float, float), optional

If a float is provided, the value will be interpreted as general gap penalty. If a tuple is provided, an affine gap penalty is used. The first value in the tuple is the gap opening penalty, the second value is the gap extension penalty. The values need to be negative.

**kwargs

Additional command line options.

Returns:
futureFuture of MafftResult

A handle to the running alignment. Call Future.result() to obtain the MafftResult.