Pattern find

Finds a motif in DNA or protein. IUPAC codes, PROSITE patterns or a regular expression.

Matches

How to search DNA for a motif with IUPAC codes

Type the motif in the pattern field. Plain letters match themselves, and the IUPAC ambiguity codes stand for a set of bases, so one pattern covers a degenerate site. GANTC is the HinfI site, TATAWAW is the TATA box consensus, CANNTG is an E-box. Both strands are searched by default, because a motif on the template strand is just as real as one on the coding strand, and the position given is always counted on the plus strand.

CodeBasesCodeBasesCodeBases
AARA GBC G T
CCYC TDA G T
GGSG CHA C T
TT or UWA TVA C G
KG TMA CNany

Worked example

The DNA example loads a 180 nt promoter region and the pattern TATAWAW, which is T-A-T-A-(A or T)-A-(A or T). The tool reports 3 matches: TATAAAT at 38 to 44 andTATATAT at 60 to 66 on the plus strand, and TATAAAT at 104 to 110 on the minus strand, where the plus strand reads ATTTATA. Turn "Search both strands" off and 2 are left.

The protein example loads mature human erythropoietin and the PROSITE N-glycosylation motifN-{P}-[ST]-{P}. It reports 3 matches, at residues 24, 38 and 83, which are the three N-linked glycosylation sites of the hormone.

PROSITE pattern syntax

ElementMeaningExample
xAny residueA-x-C
[ST]Any one of these residuesN-x-[ST]
{P}Any residue except theseN-{P}-[ST]
x(3)Exactly three of the elementC-x(3)-C
x(2,4)Two to four of the elementC-x(2,4)-C
<Start of the sequence<M-A
>End of the sequenceK-D-E-L>

Elements are joined with hyphens and a trailing full stop is ignored, so a pattern copied straight out of a PROSITE entry works. The letters allowed are the twenty amino acids plus B, Z, X, J, U and O.

Regular expressions

Switch "Pattern syntax" to "Regular expression" to use the full JavaScript syntax on either tab: character classes, alternation with the vertical bar, quantifiers, anchors and lookahead. The sequence is searched as one uppercase string per record, with no line breaks in it, so a motif is never split across a line of the FASTA file.

[AG]{2}C.TG  two purines, C, any base, T, G
GAATTC|GGATCC  EcoRI or BamHI
C.{2,4}C.{3}[LIVMFYWC]  the start of a zinc finger

On the DNA tab with both strands on, the reverse complement of the sequence is searched as well, so a regular expression never has to be written twice. A pattern that can match an empty string, such as A*, only has its non-empty matches reported. A pattern with a repeat inside a repeat is refused, because it can take longer than the rest of your day on a megabase of sequence.

Reading the results

  • Position is 1-based and counted on the plus strand of the record, both ends included.
  • Strand is + for the sequence as given and − for its reverse complement. A minus strand match is written the way it reads 5' to 3' on that strand.
  • Matches may overlap, and an overlapping pair is two separate rows.
  • A palindromic site such as GAATTC matches on both strands at the same position, so it is listed twice. Turn "Search both strands" off to count sites rather than occurrences.

For a search that tolerates differences, use fuzzy search. For repeated units rather than one motif, use thetandem repeat finder, and for counting all motifs of one length, the k-mer counter.

Frequently asked questions

How do I search a DNA sequence for a motif?

Choose the DNA tab, type the motif in the pattern field using IUPAC codes, then paste the sequence or choose a FASTA file. Every match is listed with its position, strand and matched text, overlapping matches included, and the table can be copied or downloaded as tab-separated text.

Which IUPAC ambiguity codes can I use in a pattern?

All of them: R is A or G, Y is C or T, S is G or C, W is A or T, K is G or T, M is A or C, B is not A, D is not C, H is not G, V is not T, and N is any base. U is read as T, so RNA works as well. A code in the pattern matches the concrete bases it stands for; N in the pattern also matches an ambiguous base in the sequence.

What is a PROSITE pattern?

It is the motif syntax used by the PROSITE database. Elements are joined by hyphens, x is any residue, square brackets list the residues allowed, curly brackets list the residues forbidden, a number in round brackets repeats an element, and the less-than and greater-than signs anchor the pattern to the N or C terminus. The N-glycosylation motif is written N-{P}-[ST]-{P}.

Why does the tool report matches that overlap?

Because they are real occurrences. In AAAA the pattern AA occurs at positions 1, 2 and 3. A plain regular expression engine skips past each match and finds only the first and the third, which undercounts motifs such as poly-A tracts and direct repeats.

Why did my regular expression not run?

Either the syntax is not valid, in which case the message names the problem, or it contains a repeat inside a repeat, such as a group ending in a plus that is itself followed by a plus. Those patterns can take an extremely long time on a long sequence, so they are refused rather than left to freeze the page. Rewrite the inner repeat as a character class.