The detection of similarities between long DNA and protein sequences i
s studied using concepts of statistical physics. It is shown that mutu
al similarities can be detected by sequence alignment methods only if
their amount exceeds a threshold value. The onset of detection is a cr
itical phase transition viewed as a localization-delocalization transi
tion. The fidelity of the alignment is the order parameter of that tra
nsition; it leads to criteria to select optimal alignment parameters.