skbio.alignment.Alignment.position_counters

Alignment.position_counters()[source]

Return collections.Counter object for positions in Alignment

Returns:

list

List of collections.Counter objects, one for each position in the Alignment.

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)
>>> for counter in a1.position_counters():
...     print(counter)
Counter({'A': 2, 'T': 1})
Counter({'T': 2, 'C': 1})
Counter({'-': 3})
Counter({'C': 2, '-': 1})