Take the 2-minute tour ×
Biology Stack Exchange is a question and answer site for biology researchers, academics, and students. It's 100% free, no registration required.

Obviously there are a bunch of different alignment tools out there, and I don't want to get bogged down in the maths behind them as this differs from software version to version.

I am aware that there are two main divides in the programs; some use local alignments and others use global alignments. I want to know what the fundamental differences are between the two, the advantages and disadvantages of each and when to use either.

share|improve this question

2 Answers 2

up vote 13 down vote accepted

The very basic difference between a local and a global alignments is that in a local alignment, you try to match your query with a substring (a portion) of your subject (reference). Whereas in a global alignment you perform an end to end alignment with the subject (and therefore as von mises said, you may end up with a lot of gaps in global alignment if the sizes of query and subject are dissimilar). You may have gaps in local alignment also.

Local Alignment

             |||| |||||| |||||||||||||||

Global Alignment

   |||||||||||    |||||||  |||||||||||||| |||||||

I shall give the example of the well known dynamic programming algorithms. In the Needleman-Wunsch (Global) algorithm the score tracking is done from the (m,n) co-ordinate corresponding to the bottom right corner of the scoring matrix (i.e. the end of the aligned sequences) whereas the Smith-Waterman (local) it is done from the element with highest score in the last row (i.e. the end of the highest scoring pair). You can check these algorithms for details.

You can adopt any scoring schemes and there is no fixed rule for it.

Global alignments are usually done for comparing homologous genes whereas local alignment can be used to find homologous domains in otherwise non-homologous genes.

share|improve this answer

Global alignment is when you take the entirety of both sequences into consideration when finding alignments, whereas in local you may only take a small portion into account. This sounds confusing so here an example:

Lets say you have a large reference, maybe 2000 bp. And you have a sequence, which is about 100 bp. Lets say that the reference contains the sequence almost exactly. If you did a local alignment, you would have a very good match. But if you did a global alignment, it may not match. Instead, it may look for matches throughout the entire reference, so youd end up with an alignment with many large gaps. It does not matter that it matches near perfectly at one particular region on the reference, because its looking for matches globally (ie throughout the reference).

If you have a really good match it may not matter what type of alignment you use. But when you have mismatches and such it starts to get important. This is because of the scoring algorithms used. In the example above lets say that there is a 100bp region in the reference that matches your 100bp sequence with 85% accuracy. In local alignment its very likely it will align there. Now lets say that the first 30 bp of your sequence matches a region in the beginning of the reference 95%, and the next 30bp matches a region in the middle of the reference 85%, and the final 40bp matches a region at the end of the reference about 90%. In global alignment the best match is the gapped alignment, whereas in local alignment the ungapped alignment would be best. I think in general gap penalties are less in global alignments, but Im not really an expert on the scoring algorithms.

What you want to use depends on what you are doing. If you think your sequence is a subsequence of the reference, do a local alignment. But if you think your entire sequence should match your entire reference, you would do a global alignment.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.