What is the optimal alignment? Dynamic programming methods ensure the optimal global alignment by exploring all possible alignments and choosing the best. It does this by reading in a scoring matrix that contains values for every possible residue or nucleotide match. Needle finds an alignment with the maximum possible score where the score of an alignment is equal to the sum of the matches taken from the scoring matrix.
An important problem is the treatment of gaps, i.e., spaces inserted to optimise the alignment score. A penalty is subtracted from the score for each gap opened (the 'gap open' penalty) and a penalty is subtracted from the score for the total number of gap spaces multiplied by a cost (the 'gap extension' penalty).
Typically, the cost of extending a gap is set to be 5-10 times lower than the cost for opening a gap.
There are two ways to compute a penalty for a gap of n positions :
gap opening penalty + (n - 1) * gap extension penalty gap penalty + n * gap length penalty
The first way is used by EMBOSS and WU-BLAST
The second way is used by NCBI-BLAST, GCG, Staden and CLUSTAL.
Fasta used it for a long time the first way, but Prof. Pearson decided
recently to shift to the second.
The two methods are basically equivalent.
In a Needleman-Wunsch global alignment, the entire length of each sequence is aligned. This can be thought of as an overlap between the two sequences (one can be completely within the otehr, or their ends can overlap).
This leaves no penalty for the hanging ends of the overlap. In bioinformatics, it is usually reasonable to assume that the sequences are incomplete and there should be no penalty for failing to align the missing bases.
|
The Identity: is the percentage of identical matches between the two sequences over the reported aligned region (including any gaps in the length).
The Similarity: is the percentage of matches between the two sequences over the reported aligned region (including any gaps in the length).
A true Needleman Wunsch implementation like needle needs memory proportional to the product of the sequence lengths. For two sequences of length 10,000,000 and 1,000 it therefore needs memory proportional to 10,000,000,000 characters. Two arrays of this size are produced, one of ints and one of floats so multiply that figure by 8 to get the memory usage in bytes. That doesn't include other overheads. Therefore only use water and needle for accurate alignment of reasonably short sequences.
If you run out of memory, try using stretcher instead.
Uncaught exception Assertion failed raised at ajmem.c:xxx
Probably means you have run out of memory. Try using stretcher if this happens.
When you want an alignment that covers the whole length of both sequences, use needle.
When you are trying to find the best region of similarity between two sequences, use water.
stretcher is a more suitable program to use to find global alignments of very long sequences.