Fuzzy search
Finds a query in DNA or protein allowing mismatches, or insertions and deletions.
Finds a query in DNA or protein allowing mismatches, or insertions and deletions.
An exact search answers "is this string there". A fuzzy search answers the question people usually have: "is anything close to it there, and how close". A primer with one mismatch still anneals, an sgRNA with three mismatches still cuts, a peptide motif survives a conservative substitution, and a sequencing read rarely matches the reference letter for letter. This page scans the whole sequence and reports every window within the number of differences you allow, on both strands for DNA.
Mismatches compares the query with every window of exactly its own length. It is the right model for primer and probe annealing, for off-target search of a fixed-length guide RNA, and whenever positions must stay aligned. Overlapping windows are all reported.
With indels uses the Sellers algorithm, which is the Needleman-Wunsch recurrence with a free start and a free end in the searched sequence. A hit may then be shorter or longer than the query, which is what you want for indel-prone reads, homopolymer runs and short motifs in a diverged homologue. One hit is reported per region: the end position with the lowest distance.
The DNA example searches a 240 nt sequence for the 20 nt primerAAACTTACCCTTAAATTTAT with up to 2 mismatches on both strands, and finds3 hits: a perfect one at 121 to 140, one with a single mismatch at 21 to 40 (AAACTTACCCTTGAATTTAT), and one with two mismatches at 191 to 210 on the minus strand. Set "Maximum differences" to 1 and the minus strand hit drops out.
The protein example searches an 85 residue sequence for the peptide KPEALVRQLTDA with up to 2 differences and finds 4 hits: exact at 7, one difference at 29, two at 51, and at 65 a copy that counts as two mismatches. Switch "Count" to "With indels" and that last hit is recognised for what it is: one deleted residue, distance 1, shown as KPEALVRQLT-A.
| Task | Query | Usual allowance |
|---|---|---|
| PCR primer, off-target check | 18 to 25 nt | 2 to 3 mismatches |
| CRISPR guide, off-target check | 20 nt | 3 to 4 mismatches |
| Restriction or TF site variant | 6 to 12 nt | 1 mismatch |
| Peptide motif in a homologue | 8 to 15 aa | 2 to 3, indels on |
| Adapter or barcode in reads | 8 to 30 nt | 1 to 2, indels on |
A useful check: a random DNA sequence of length L contains roughly L × 4−m × (number of ways to place the differences) copies of an m-long query. Allowing 4 mismatches in a 20 nt query already gives thousands of chance hits in a mammalian genome, so keep the allowance tight and make the query longer rather than the other way round.
For an exact motif with IUPAC or PROSITE syntax use pattern find; for a full alignment of two sequences useSmith-Waterman orNeedleman-Wunsch; for repeated units use thetandem repeat finder.
Type the query in the query field, paste the sequence to search or choose a FASTA file, and set how many differences you will accept. Every window that is close enough is listed with its position, strand, number of differences and the matched text, with the differing letters marked.
Counting mismatches (the Hamming distance) compares the query with a window of exactly the same length, letter by letter, so only substitutions are allowed. Edit distance (the Sellers algorithm) also allows insertions and deletions, so the match can be shorter or longer than the query. Use mismatches for primers and probes, edit distance when a residue may be missing.
Yes. On the DNA tab the IUPAC codes work, so N matches any base and R matches A or G, and a position that the code covers is not counted as a mismatch. On the protein tab X matches any residue, B matches D or N, Z matches E or Q and J matches L or I.
In mismatch mode every window that is close enough is a hit, so a repeat can produce several hits one position apart. With indels the alignment score is followed along the sequence and only the best end position of each run is reported, which keeps one hit per region rather than a cluster around it.
A megabase with a 30 nt query takes well under a second, and everything runs in your browser, so nothing is uploaded. The work grows with the length of the sequence multiplied by the length of the query, so a very long query against a very long sequence is refused with a note rather than freezing the page.