Alignment quality scorer

Sum-of-pairs and column scores for an aligned FASTA, and SP and TC against a reference.

Sum-of-pairs score

Scoring system

The sum-of-pairs score

SP = Σcolumns Σi < j s(ai, aj)

Take a column, score every pair of sequences in it with a substitution matrix, and add the results up. Do that for every column and the total is the sum-of-pairs score, the objective function most progressive aligners are built to maximise. A pair in which one sequence has a residue and the other a gap costs the gap penalty; a pair in which both have a gap costs nothing, since neither sequence claims that position.

With k sequences there are k(k−1)/2 pairs in every column, so the score grows with the square of the number of sequences and with the length of the alignment. That is why the raw number on its own says nothing, and why the tool also reports the score per column: the same number divided by the number of columns, which can be compared between alignments of different length.

The column score

column score = fully conserved columns ÷ columns

A column is fully conserved when every sequence carries the same residue in it and none has a gap. The column score is the share of such columns. It answers a different question from the sum-of-pairs score: not "how well does this alignment score" but "how much of it is unambiguous". A high column score means a family with a strong conserved core; a low one means either a divergent family or a doubtful alignment, and only looking at the columns tells you which.

SP and TC against a reference alignment

The scores above measure an alignment against a scoring system. To measure it against the truth you need an alignment you trust, usually one built from superposed structures, as in the BAliBASE, PREFAB and SABmark benchmarks. Paste it on the "Vs reference" tab and the tool reports the two standard benchmark numbers:

SP = reference residue pairs also aligned in the test ÷ reference residue pairs
TC = reference columns reproduced exactly ÷ reference columns

SP is forgiving: getting most of a column right still earns most of its pairs.TC is all or nothing: a reference column counts only when every one of its residues sits together in one test column and nothing else is in it, so a single misplaced sequence loses the whole column. TC is therefore always at or below SP, and the gap between them tells you whether the errors are scattered across many columns or concentrated in a few. Both alignments must hold the same sequences, and each sequence must read the same once its gaps are removed; the tool checks that and says which record is the odd one out.

Worked example

The example is a 40-column alignment of four globin fragments, one of which carries a three-column deletion. On the "Quality scores" tab, with BLOSUM62 and a gap penalty of 1:

  • Sum-of-pairs score 900 over 6 pairs in each of 40 columns, which is22.5 per column.
  • Column score 55.0 %: 22 of the 40 columns carry the same residue in all four sequences. Column 15 is tryptophan in every sequence and contributes 6 × 11 = 66, the largest single column in the alignment.
  • Raise the gap penalty from 1 to 8 and the score falls from 900 to 837, because the three gapped columns each hold 3 residue-to-gap pairs: 9 pairs × 7 extra points = 63.

Switch to "Vs reference" and the example loads the same alignment together with a reference in which those three gap columns sit three positions to the right. The test alignment then scores SP 0.961 (222 of 231 reference pairs) and TC 0.850 (34 of 40 columns). Nine misplaced pairs cost six columns: that is the difference between the two measures in one number.

What these scores cannot tell you

  • They cannot say an alignment is correct. The sum-of-pairs score rewards agreement with a matrix and a gap penalty, and an aligner that maximised that same function will always score well on it. Only a reference alignment or a structure is evidence.
  • They do not locate the error. A total is one number for the whole alignment; the per-column table under Details is where a bad region shows up, as a run of columns with negative scores.
  • They are not comparable across settings. Change the matrix, the gap penalty or the set of sequences and the numbers move for reasons that have nothing to do with alignment quality.
  • A low column score is not a verdict. Add one distant homologue to a set of close ones and the column score collapses while the alignment stays right.

Before scoring, it is usually worth removing the ragged ends with thealignment trimmer, since gappy columns depress every measure on this page. To see conservation column by column, usecoloured conservation orShannon entropy, and for the pairwise percentages behind the scores, the identity and similarity calculator.

Frequently asked questions

What is a good sum-of-pairs score?

There is no threshold, because the raw score depends on the substitution matrix, the gap penalty, how many sequences there are and how long the alignment is. It is a comparison number: score two alignments of the same sequences under the same settings and the higher one is the better alignment by that objective function. To compare across alignments of different size, use the score per column, which the tool reports next to it.

How is the column score calculated?

A column counts if every sequence carries the same residue there and none of them has a gap. The column score is the number of such columns divided by the total number of columns. It is a strict measure: one divergent sequence in a set of twenty can pull the column score close to zero even though the alignment is correct.

What are the SP and TC scores used by BAliBASE?

They compare an alignment against a reference that is taken to be correct, usually a structure-based one. The SP score is the fraction of residue pairs aligned in the reference that the test alignment also aligns. The TC, or total column, score is the fraction of reference columns that the test alignment reproduces exactly, every sequence included. TC is always the harsher of the two, because one misplaced residue ruins a whole column.

Why does my alignment score well but look wrong?

Because the sum-of-pairs score measures agreement with a scoring system, not with biology. An aligner optimises that same objective, so it will happily produce a high-scoring alignment that puts unrelated residues together, especially where a gap penalty is too cheap or the sequences are below about 25 percent identity. A score can rank two alignments; only a reference alignment or a structure can say one is right.

Does the gap penalty here open and extend?

No, the gap cost is linear: every pair in which exactly one sequence has a gap costs the same amount, and a pair of gaps costs nothing. Real aligners use an affine penalty, a larger cost to open a gap plus a smaller one per residue extended, which is why a score from this page will not match the one your aligner prints. Keep the setting fixed while you compare alignments.