skbio.alignment.TabularMSA.to_dict

TabularMSA.to_dict()[source]

Create a dict from this TabularMSA.

State: Experimental as of 0.4.1.

Returns:

dict

Dictionary constructed from the index labels and sequences in this TabularMSA.

Raises:

ValueError

If index labels are not unique.

Examples

>>> from skbio import DNA, TabularMSA
>>> seqs = [DNA('ACGT'), DNA('A--T')]
>>> msa = TabularMSA(seqs, index=['a', 'b'])
>>> dictionary = msa.to_dict()
>>> dictionary == {'a': DNA('ACGT'), 'b': DNA('A--T')}
True