Assignment for Friday:

Assignments for Monday


Sequence alignment

Pairwise alignment


The easiest way to align two sequences is to use a dotplot. In its most straight forward implementation the two sequences to be aligned are written along the coordinate axis.

In more realistic implementations a window of 5 to 20 nucleotides or amino acids is slid along one of the axes (i.e., sequences) and compared to every possible window on the other axis (sequence). The dot intensity is adjusted to reflect the percent identity (or similarity) in the two windows.

See the Dotlet exercises from last Friday.


Global and Local alignments.

There are many different algorithms to calculate pairwise sequence alignments. For two sequences it is "easy" to calculate an optimal global alignment. (According to the motto: "It can be easily shown" -- see here). The so called Needleman-Wunsch algorithm is widely used, it optimizes a positive alignment score, a related (and under some conditions equivalent approach) is to minimize the differences between to sequences.


Multiple Sequence Alignments



Usually global alignments are the easiest to calculate (local see discussion of blast )

One of the easiest to use and most versatile alignment programs is clustalw

(Higgins DG, Sharp PM (1988) CLUSTAL: a package for performing multiple sequence alignment on a microcomputer. Gene 73:237-244;
Thompson, J.D., Higgins, D.G. and Gibson, T.J. (1994). CLUSTAL W: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, positions-specific gap penalties and weight matrix choice. Nucleic Acids Research, 22, 4673-4680

Clustalw runs on all possible platforms (unix, mac, pc), and it is part of most multiprogram packages, and it is also available via different web interfaces (for examples here, and here). 

Clustalw uses a very simple menu driven command-line interface, and you also can run it from the command line only (i.e. it is easy to incorporate into scripts.)

Clustalx uses the same algorithms as clustalw.  However, it has a much nicer interface, it displays information on the level of similarity, and it uses color in the alignment.  Especially for amino acids the use of color greatly enhances the ability to recognize conservative replacements. Clustalx2.1 is available for different platforms at the ebi's ftp site (follow your platform, clustalx is stored in the clustalw folders)

Clustal reads and writes most formats used by different programs.  The easiest format is the FASTA format:

> name of sequence or any other information goes in the first line. This line starts with ">". The line can be longer than 80 characters. The first line ends with the first paragraph sign. (pi if you look at the file in word, \n in a texteditor)
The second line contains the sequence itself; numbers and other non standard characters are ignored. Be careful if you download sequences. Often the transfer programs introduce paragraph signs every 100 characters, and the end of a command line frequently ends up as the beginning of the sequence.
All sequences to be read should be in a single file.

(sample clustalw input file)

(sample clustalw output file)

Clustal also reads aligned sequences.  If you input aligned sequences you can go directly to the tree section.
!! Be careful if you make a mistake, and the sequences are not aligned, your tree will look strange!!

Clustal also is useful to reformat and edit alignments, it is very forgiving in reading formats, e.g., you can open the clustal format (*.aln) in a text editor and delete columns and reload the file into clustalw, and output it in the other formats available.

For calculating an alignment, you can select different substitution matrices, and gap penalties (end-gaps can be considered differently!)

Clustal is better than its reputation. It is doing a great job in handling gaps, especially terminal gaps, and it makes good use of different substitution matrices.

To align sequences clustal performs the following steps (aka as progressive alignment):

1) Pairwise distance calculation
2) Clustering analysis of the sequences
3) Iterated alignment of two most similar sequences or groups of sequences.

It is important to realize that the second step is the most important. The relationships found here will create a serious bias in the final alignment. The better your guide tree, the better your final alignment. You can load a guide tree into clustal. This tree will then be used instead of the neighbor joining tree calculated by clustalw as a default. (The guide tree needs to be in normal parenthesis notation WITH branch lengths).


Other programs often used for multiple sequence alignment

Available via the web: SAM (sequence alignment and modeling system) by Richard Hughey, Anders Krogh, Christian Barrett, & Leslie Grate at UCSC. The input consists of a multiple sequence file (aligned or not aligned) in FASTA format. The program uses secondary structure predictions, neighboring sites, etc. to place gaps. The program can be accessed at

If your sequences are not very similar, and if you are not able to generate a trustworthy multiple sequence alignment, you can calculate distance trees based on pairwise alignments only. The best program for this purpose is statalign from Jeff Thorne (Thorne JL, Kishino H (1992) Freeing phylogenies from artifacts of alignment. Mol Bio Evol 9:1148-1162). It runs under standard UNIX.  It's only worth your effort if you are getting gray hairs because of a data set you cannot reliably align. Very out of fashion these days.

MUSCLE is the current alignment program of choice. It is thought to give better alignments compared to clustal, it is faster and works with larger datasets. The program is available through a webserver at the ebi, as a commandline program to download here, and as part of Seaview (see below).

MAFFT (Multiple Alignment using Fast Fourier Transform) also is popular, fast and results in good alignments. Often similar to MUSLE alignments.

Most multiple sequence alignment programs produce alignments that are pleasing to the human eye by placing only a few large gaps into the sequences. However, for many applications it is better to align a particular amino acid to gaps in the other sequences, if one is not certain about the homology of the position. These programs that introduce more gaps are at present underutilized. An example is PRANK. (Web version is here)

In case of divergent sequences, a popular program that combines phylogenetic reconstruction and multiple sequence alignment is SATe.

If you need to use MSA in your work, the current recommendation is to use muscle, and test if an alignment calculated under PRANK gives similar results. Also, if you use less than 100 sequences, try SATe2. (Note the time needed for computation is very different!).

To avoid artifacts reflecting the guide tree used for the alignment, many prefer to filter the alignment using only sites that are reliably aligned. One such approach is GBLOCK (implemented in seaview, see below, web server is here), another is guidance from Tal Pupko's lab at TAU (I like this one, because it allows to remove positions from poorly aligned individual sequences, not only complete columns).

Alignments by Eye:

Useful sequence editor are part of the Jalview (see comp Lab 8, and slides on sequence space from class 14) and seaview packages. The latter runs on PC and most unix flavors (including Macs). The latest version (4.5) includes phylogenetic reconstruction using phyml and parsimony, multiple sequence alignment using clustalo and muscle, filtering of poorly aligned regions using GBlocks, and allows to create subset of sites from your alignment (aka data partitions, e.g. 1st, 2nd 3rd codon position, or conserved and more variable sites).


Progressive alignment of multiple sequences
(e.g. clustalw/clustalx):

1) Pairwise distance calculation
2) Clustering analysis of the sequences based on pairwise alignment.
3) Iterated alignment of two most similar sequences or groups of sequences.

Problem: Step two can create a strong bias, that is recovered as "signal" in future analyses of the multiple sequence alignment.


Goals class 16:


Discussion - two debate teams on the function of introns in evolution:
Team A) Introns Early versus Team B) Introns Late

1) discuss arguments within group (5 minutes)
2) present arguments in favor of your thesis (each site, one person one argument)
3) discuss counter arguments within group (3 minutes)
4) present arguments against opposing teams evidence



If time discuss trees:

Leaves, branch, split, OTUs, root, clades. Under which operations does the tree remain the "same" tree? (see here)