Scoring matrix calculator
Score an aligned pair with BLOSUM or PAM, view the matrices, or build a log-odds matrix from an alignment.
Score an aligned pair with BLOSUM or PAM, view the matrices, or build a log-odds matrix from an alignment.
A scoring matrix, or substitution matrix, gives a score to every pair of residues that can face each other in an alignment. Alignment programs add these scores up over all columns, so the matrix decides which alignment is called the best. For proteins the scores arelog-odds values: they compare how often two amino acids are actually seen aligned in related proteins with how often they would meet by chance. Identical and chemically similar pairs (I/L, K/R, D/E) score positive, unlikely replacements (W/G, C/E) score negative.
The build mode follows these steps on your alignment and can display every intermediate table. It does not cluster or weight the sequences, which the published BLOSUM procedure does to keep closely related sequences from dominating the counts. Pairs that never occur have q = 0 and a score of −∞; a small pseudocount added to every pair count avoids this.
The build example is a DNA alignment of 6 sequences and 12 columns. Each column holds 6 × 5 / 2 = 15 pairs, so T = 180. C is aligned with C 30 times, which gives q(C, C) = 30/180 = 0.1667. The row sum for C is p(C) = 0.0111 + 0.1667 + 0.0167 + 0.0556 = 0.2500, so the chance frequency is 0.25 × 0.25 = 0.0625 and the odds ratio is 2.667. In half bits, s(C, C) = 2 × log₂ 2.667 = 2.83, rounded to 3. C faces T in 20 pairs: q(C, T) = 20/360 = 0.0556, expected 0.2500 × 0.2639 = 0.0660, ratio 0.842 and s(C, T) = −0.50. The transversion A/C is seen only 4 times and scores −4.82. Over the whole table the relative entropy is H = Σ q × log₂ ratio = 0.591 bits per pair and the expected score Σ p(i) p(j) s(i, j) is −1.35, negative as a usable matrix requires.
| Matrix | Units | Entropy (bits) | Use for |
|---|---|---|---|
| BLOSUM80 | half bits | 0.99 | closely related proteins, short queries |
| BLOSUM62 | half bits | 0.70 | general default, BLAST |
| BLOSUM45 | third bits | 0.38 | distant relatives, long alignments |
| PAM120 | half bits | 0.98 | closer relatives, about 40 % identity |
| PAM250 | third bits | 0.35 | distant relatives, about 20 % identity |
The values are the integer matrices distributed with NCBI BLAST. BLOSUM80 is the BLAST version in half bits (A/A = 5); some packages ship a third-bit BLOSUM80 with larger numbers (A/A = 7), which describes the same odds ratios on a different scale. The relative entropy is the average information per aligned position: matrices with high entropy separate true from chance alignments over a short length but only for similar sequences.
The score mode looks up every aligned pair in the chosen matrix and adds the values. The pair MVHLTPEEK / MVHLTDAEK scores 5 + 4 + 8 + 4 + 5 − 1 − 1 + 5 + 5 = 34 with BLOSUM62: seven identities, and P/D and E/A at −1 each. Identities are columns with the same residue, positives are identities plus substitutions with a score above zero, the definition BLAST uses. Both are given as a fraction of the compared columns; columns with a gap or a non-standard residue are not compared. Gap penalties are not part of a substitution matrix and are not subtracted here. To produce the alignment in the first place use the Needleman–Wunsch calculatoror the pairwise protein alignment; for identity and similarity across a whole multiple alignment use theidentity and similarity calculator.
BLOSUM62 is a 20 × 20 table of log-odds scores for amino acid substitutions, built by Henikoff and Henikoff (1992) from ungapped blocks of conserved protein families in which sequences more than 62 % identical were clustered. Scores are in half-bit units: s = 2 × log2 of the observed pair frequency divided by the frequency expected by chance, rounded to an integer. W/W scores 11, A/A 4, K/R 2 and W/G −2. It is the default matrix of protein BLAST.
Count how often residues i and j are aligned to each other, convert the counts to the observed pair frequency q_ij, and compare it with the frequency expected if the residues paired at random, p_i × p_j. The score is s_ij = (1/λ) × ln(q_ij / (p_i p_j)). With λ = ln 2 / 2 this equals 2 × log2 of the ratio, the half-bit scale of BLOSUM62. A positive score means the pair is seen more often than chance, a negative score less often.
BLOSUM matrices are computed directly from observed substitutions in conserved blocks, clustered at a chosen identity level, so a higher number means more similar sequences (BLOSUM80 for close, BLOSUM45 for distant relatives). PAM matrices are extrapolated from a model of closely related sequences: PAM1 corresponds to 1 accepted mutation per 100 residues and is multiplied by itself, so a higher number means more divergence (PAM120 for closer, PAM250 for distant relatives).
The integer in the table is the log-odds ratio multiplied by a scale factor and rounded. BLOSUM62, BLOSUM80 (BLAST version) and PAM120 use half bits (2 × log2), BLOSUM45 and PAM250 use third bits (3 × log2). To compare them, convert back to an odds ratio: a score of 11 in half bits is 2^(11/2), about 45 times more frequent than chance.
No. The score mode compares the two sequences column by column exactly as entered, so they must already be aligned and of equal length; gap columns are skipped. To align them first, use the Needleman–Wunsch or the pairwise protein alignment tool.