  The detection of similarities between long DNA and protein sequences is
studied using concepts of statistical physics. It is shown that mutual
similarities can be detected by sequence alignment methods only if their amount
exceeds a threshold value. The onset of detection is a continuous phase
transition which can be viewed as a localization-delocalization transition. The
``fidelity'' of the alignment is the order parameter of that transition; it
leads to criteria for the selection of optimal alignment parameters.
