skbio.sequence.DNASequence.nondegenerates

DNASequence.nondegenerates()[source]

Yield all nondegenerate versions of the sequence.

Returns:

generator

Generator yielding all possible nondegenerate versions of the sequence. Each sequence will have the same type, id, description, and quality scores as self.

Raises:

BiologicalSequenceError

If the sequence contains an invalid character (a character that isn’t an IUPAC character or a gap character).

Notes

There is no guaranteed ordering to the generated sequences.

Examples

>>> from skbio.sequence import NucleotideSequence
>>> seq = NucleotideSequence('TRG')
>>> seq_generator = seq.nondegenerates()
>>> for s in sorted(seq_generator, key=str): print(s)
TAG
TGG