BLAST seed and extend

Finds shared words between two sequences and extends them into HSPs, the way BLAST starts.

HSPs found

A model of BLAST's first two steps on one pair of sequences, not a database search. Use NCBI BLAST for that, the E-value calculatorfor the statistics of a score, and Smith-Watermanfor the best local alignment without heuristics.

Search parameters

How BLAST actually finds a hit

A full Smith-Waterman comparison of a query against a database is exact and far too slow, so BLAST replaces it with a heuristic in three steps. This page runs the first two on one pair of sequences so you can watch them work.

  1. Seeding. Every word of w letters in the query is looked up in the subject. Each place both share a word is a word hit, or seed. For nucleotides the word must match exactly; for proteins a word counts when its BLOSUM62 score against the query word is at least the threshold T, so similar words seed as well as identical ones.
  2. Ungapped extension. Each seed is extended left and right one position at a time, adding the score of each new pair, until the running score has dropped X below the best value seen. The best-scoring stretch that comes out is a high-scoring segment pair, an HSP.
  3. Gapped extension and statistics, which this page does not do. A real BLAST extends promising HSPs with gaps and reports an E-value for each, and only the ones that pass the threshold are shown.

For a real database search use NCBI BLAST, or blast+ locally. To turn a raw score from this page into the number of chance hits expected in a database of a given size, use theE-value calculator. To get the alignment BLAST would have found if it never took a shortcut, useSmith-Waterman, orNeedleman-Wunsch for an end-to-end alignment.

The parameters, and what each one costs

ParameterNCBI defaultEffect
Word size w11 blastn, 28 megablast, 3 blastpSmaller finds more, and takes longer
Threshold T11 (blastp)Lower lets less similar words seed
Drop-off X20 blastn, 7 bits blastpLarger pushes extensions through diverged patches
Match, mismatch+2, −3 blastnSets the identity at which extension breaks even

X is entered here in raw score points, the same units as the HSP score. NCBI states the protein drop-off in bits instead, and 7 bits under BLOSUM62 is roughly 15 raw points, which is why the protein tab starts at 16.

With +2 for a match and −3 for a mismatch, an extension gains ground only while the region is more than 60 % identical, because 0.6 × 2 = 0.4 × 3. That single ratio is what decides how far an HSP runs into a diverged flank, and why changing the match and mismatch scores changes the length of every hit.

Worked example

The DNA example is a 200 nt query against a 200 nt subject that is 83 % identical overall, but unevenly: two conserved blocks with a heavily diverged stretch between them. At the defaults (w = 11, match +2, mismatch −3, X = 20) the tool finds 67 word hits that collapse into 2 HSPs:

  • Query 128 to 200, score 131, 70 of 73 identical (95.9 %).
  • Query 1 to 83, score 126, 75 of 83 identical (90.4 %).

The 44 nt between them, query 84 to 127, is never reported although the two sequences are still 48 % identical there. No exact 11-mer occurs in it, so no seed lands there, and below the 60 % break-even identity the extensions from either side run out of score and stop. Two settings recover it. Drop the word size to 7 and the seeds appear: 99 word hits and 6 HSPs, the four new ones only 7 to 9 nt long. Or raise the drop-off to 40 and the extension from the left block survives the bad stretch: the two HSPs merge into a single one covering query 1 to 200 with a score of 230.

The protein example is the first 76 residues of human beta-globin against human myoglobin, two globins with the same fold. With w = 3, T = 11 and BLOSUM62 there are 21 word hits and 16 HSPs, and the top one is the real alignment: query 24 to 70 against subject 25 to 71, score 65, 17 of 47 identical (36 %). Three word hits fall inside it, the best being the query word AHG against the subject's KHG, worth 13. Three weak near-matches in the middle of the protein were enough to find a 47-residue alignment that is barely a third identical, which is what the neighbourhood-word threshold T buys.

What the numbers mean

  • Word hits is how much work the seeding step created. Most lead nowhere; several seeds on the same diagonal usually belong to one HSP and are counted together.
  • Score is the raw score S of the HSP under the scoring system shown, the same S the Karlin-Altschul equation takes. It is not a bit score and not an E-value.
  • Identity is over the HSP only, not the whole sequence, which is why a short HSP often looks better than the pair really is.
  • No gaps. Every HSP here is ungapped, so an insertion breaks a hit into two HSPs on different diagonals instead of one alignment.

Frequently asked questions

Is this a BLAST search?

No. It is a working model of the two steps that make BLAST fast, word hits and ungapped extension, run on one query against one subject sequence you supply. There is no database, no gapped extension, no low-complexity filter and no E-value. For a real search, use NCBI BLAST or a local blast+ installation. Use this page to understand why a real search finds what it finds.

What is a word hit or seed?

A short stretch, w letters long, that the query and the subject share. BLAST indexes every w-letter word of the query, scans the subject for them, and only where one is found does it do any alignment work. That is the whole trick: instead of comparing every position with every other, it looks only where a short exact or near-exact match already exists. blastn uses w = 11, megablast 28, and blastp 3.

What does the X drop-off do?

It decides when to stop extending. The extension walks outward from the seed adding the score of each new pair of letters, and it stops when the running score has fallen X below the best score seen so far. The alignment is then trimmed back to that best point. A small X stops at the first bad patch and gives short, tight HSPs; a large X pushes through a diverged region and can join two conserved blocks into one HSP.

Why does BLAST miss a similar region?

Because no seed lands in it. If two sequences are 70 percent identical but their matches are scattered, an exact 11-letter word may never occur, and with no seed there is no extension and no hit. Lower the word size and the region appears; that is exactly the speed-for-sensitivity trade every BLAST parameter set makes. A Smith-Waterman alignment has no word step and so cannot miss it.

How do I turn an HSP score into an E-value?

Through the Karlin-Altschul equation, which needs the raw score, the query length, the size of the database searched, and the lambda and K parameters of the scoring system. The raw scores this page reports are the S in that equation. Put one into the E-value calculator together with a database size and you get the number of chance hits that good expected in a real search.