DNA.
to_regex
()[source]¶Return regular expression object that accounts for degenerate chars.
State: Stable as of 0.4.1.
Returns: | Pre-compiled regular expression object (as from re.compile )
that matches all definite versions of this sequence, and nothing
else. |
---|---|
Return type: | regex |
Examples
>>> from skbio import DNA
>>> seq = DNA('TRG')
>>> regex = seq.to_regex()
>>> regex.match('TAG').string
'TAG'
>>> regex.match('TGG').string
'TGG'
>>> regex.match('TCG') is None
True