skbio.alignment.Alignment.position_frequencies

Alignment.position_frequencies()[source]

Return frequencies of characters for positions in Alignment

Returns:

list

List of collection.defaultdict objects, one for each position in the Alignment, representing the frequency of each character in the Alignment at that position.

Examples

>>> from skbio.alignment import Alignment
>>> from skbio.sequence import DNA
>>> sequences = [DNA('AC--', id="seq1"),
...              DNA('AT-C', id="seq2"),
...              DNA('TT-C', id="seq3")]
>>> a1 = Alignment(sequences)
>>> position_freqs = a1.position_frequencies()
>>> print(round(position_freqs[0]['A'],3))
0.667
>>> print(round(position_freqs[1]['A'],3))
0.0