Class MotifTools
MotifTools
contains utility methods for sequence
motifs.- Author:
- Keith James
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createRegex
(SymbolList motif) createRegex
creates a regular expression which matches theSymbolList
.
-
Constructor Details
-
MotifTools
public MotifTools()
-
-
Method Details
-
createRegex
createRegex
creates a regular expression which matches theSymbolList
. AmbiguousSymbol
s are simply transformed into character classes. For example the nucleotide sequence "AAGCTT" becomes "A{2}GCT{2}" and "CTNNG" is expanded to "CT[ABCDGHKMNRSTVWY]{2}G". The character class is generated using thegetMatches
method of an ambiguity symbol to obtain the alphabet ofAtomicSymbol
s it matches, followed by callinggetAllSymbols
on this alphabet, removal of any gap symbols and then tokenization of the remainder. The ordering of the tokens in a character class is by ascending numerical order of their tokens as determined byArrays.sort(char [])
.The
Alphabet
of theSymbolList
must be finite and must have a character token type. Regular expressions may be generated for any suchSymbolList
, not just DNA, RNA and protein.- Parameters:
motif
- aSymbolList
.- Returns:
- a
String
regular expression.
-