Rather a local alignmnet is extended and stops if the score becomes zero, at which point a new local alignment is started. This may lead to a number of local alignments, the one with the best score is reported as the optimal local alignment. The scoring function is critical to determining good alignments. Scoring is such as to provide a scale of scoring for absolute conservation, versus coservative substitution versus unconserved substitution. This is maifest in a substitution matrix which we will discuss subsequently.
Gaps represent insertions and deletions in one or other of the sequences being aligned.
Too large a gap may represent an inplausible set of mutations - in other works could imply a loss of biological function. Such a statistical treatment is difficult for global alignments, but better for local alignments. The probability density function used to describe the behavior of HSPs is known as the extreme value distribution which differs from a normal value distribution. By relating a score S to the expected distribution it is possible to calculate a p value which indicates the probability that the specified score could occur by chance. Thus p values close to zero are the most significant.