LingPy

This documentation is for version 2.0.dev, which is not released yet.

lingpy.align.multiple.Multiple.swap_check

Multiple.swap_check(swap_penalty=-3, score_mode='classes')

Check for possibly swapped sites in the alignment.

Parameters :

swap_penalty : int or float

Specify the penalty for swaps in the alignment.

score_mode : { ‘classes’, ‘library’ }

Define the score-mode of the calculation which is either based on sound classes proper, or on the specific scores derived from the library approach.

Returns :

result : bool

Returns True, if a swap was identified, and False otherwise. The information regarding the position of the swap is stored in the attribute swap_index.

Notes

The method for swap detection is described in detail in List2012b.

Examples

Load a file containing swaps from the test data.

>>> from lingpy import *
>>> mult = Multiple(get_file('test.msq'))

Align the data, using the progressive approach.

>>> mult.prog_align()

Check for swaps.

This Page