LingPy

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

lingpy.align.sca.MSA

class lingpy.align.sca.MSA(infile, **keywords)

Basic class for carrying out multiple sequence alignment analyses.

Parameters :

infile : file

A file in msq-format or msa-format.

merge_vowels : bool (default=True)

Indicate, whether neighboring vowels should be merged into diphtongs, or whether they should be kept separated during the analysis.

comment : char (default=’#’)

The comment character which, inserted in the beginning of a line, prevents that line from being read.

Notes

There are two possible input formats for this class: the MSQ-format, and the MSA-format.

This class inherits the methods of the Multiple class.

Examples

Get the path to a file from the testset.

>>> from lingpy import *
>>> seq_file = get_file('test.seq')

Load the file into the Multiple class.

>>> mult = Multiple(seq_file)

Carry out a progressive alignment analysis of the sequences.

>>> mult.prog_align()

Print the result to the screen:

>>> print(mult)
w    o    l    -    d    e    m    o    r    t
w    a    l    -    d    e    m    a    r    -
v    -    l    a    d    i    m    i    r    -

Methods

get_pairwise_alignments([new_calc, model, ...]) Function creates a dictionary of all pairwise alignments scores.
get_peaks([gap_weight]) Calculate the profile score for each column of the alignment.
get_pid([mode]) Return the Percentage Identity (PID) score of the calculated MSA.
ipa2cls([model]) Retrieve sound-class strings from aligned IPA sequences.
iterate_all_sequences([check, mode, gop, ...]) Iterative refinement based on a complete realignment of all sequences.
iterate_clusters(threshold[, check, mode, ...]) Iterative refinement based on a flat cluster analysis of the data.
iterate_orphans([check, mode, gop, scale, ...]) Iterate over the most divergent sequences in the sample.
iterate_similar_gap_sites([check, mode, ...]) Iterative refinement based on the Similar Gap Sites heuristic.
lib_align([model, mode, modes, scale, ...]) Carry out a library-based progressive alignment analysis of the sequences.
output([fileformat, filename, sorted_seqs, ...]) Write data to file.
prog_align([model, mode, gop, scale, ...]) Carry out a progressive alignment analysis of the input sequences.
sum_of_pairs([alm_matrix, mat, gap_weight, gop]) Calculate the sum-of-pairs score for a given alignment analysis.
swap_check([swap_penalty, score_mode]) Check for possibly swapped sites in the alignment.

This Page