TabularMSA.to_dict()[source]¶Create a dict from this TabularMSA.
State: Experimental as of 0.4.1.
| Returns: | Dictionary constructed from the index labels and sequences in this
TabularMSA. |
|---|---|
| Return type: | dict |
| Raises: | ValueError – If index labels are not unique. |
See also
from_dict(), index(), reassign_index()
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