skbio.sequence.Protein.expand_degenerates#

Protein.expand_degenerates()[source]#

Yield all possible definite versions of the sequence.

Yields:
GrammaredSequence

Definite version of the sequence.

See also

degenerate_map

Notes

There is no guaranteed ordering to the definite sequences that are yielded.

Each definite sequence will have the same type, metadata, and positional metadata as the biological sequence.

Examples

>>> from skbio import DNA
>>> seq = DNA('TRG')
>>> seq_generator = seq.expand_degenerates()
>>> for s in sorted(seq_generator, key=str):
...     s
...     print('')
DNA
--------------------------
Stats:
    length: 3
    has gaps: False
    has degenerates: False
    has definites: True
    GC-content: 33.33%
--------------------------
0 TAG

DNA
--------------------------
Stats:
    length: 3
    has gaps: False
    has degenerates: False
    has definites: True
    GC-content: 66.67%
--------------------------
0 TGG