Motif search with regular expressions
The Motif Search function let you search for matches with known motifs represented by a regular expression. A regular expression is a string that describes or matches a set of strings, according to certain syntax rules.
The regular expressions are usually used to give a concise description of a set, without having to list all elements. The simplest form of a regular expression is a literal string.
The following are examples of the syntax rules (see the Java regular expression syntax for a complete list):
- [A − Z] will match the characters A through Z (Range). You can also put single characters between the brackets: The expression [AGT] matches the characters A, G or T.
- [A − D[M − P]] will match the characters A through D and M through P (Union). You can also put single characters between the brackets: The expression [AG[M −P]] matches the characters A,G and M through P.
- X{n} will match a repetition of an element indicated by following that element with a numerical value or a numerical range between the curly brackets. For example, ACG{2} matches the string ACGACG.
- X{n,m} will match a certain number of repetitions of an element indicated by following that element with two numerical values between the curly brackets. The first number is a lower limit on the number of repetitions and the second number is an upper limit on the number of repetitions. For example, ACT{1, 3} matches ACT,ACTACT and ACTACTACT.
- X{n, } represents a repetition of an element at least n times. For example, AC{2, } matches all strings ACAC, ACACAC, ACACACAC,...
- The symbol ˆ restricts the search to the beginning of your sequence. For example, if you search through a sequence with the regular expressionˆAC, the algorithm will find a match if AC occurs in the beginning of the sequence.
As an example the expression [ACG][ˆAC]G{2} matches all strings of length 4, where the first character is A,C or G and the second is any character except A,C and the third and fourth character is G.
See Motif search for basic patterns for more information regarding Motif search.
























