Class MotifTools
- java.lang.Object
-
- org.biojava.bio.symbol.MotifTools
-
public class MotifTools extends Object
MotifTools
contains utility methods for sequence motifs.- Author:
- Keith James
-
-
Constructor Summary
Constructors Constructor Description MotifTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createRegex(SymbolList motif)
createRegex
creates a regular expression which matches theSymbolList
.
-
-
-
Constructor Detail
-
MotifTools
public MotifTools()
-
-
Method Detail
-
createRegex
public static String createRegex(SymbolList motif)
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.
-
-