Skip to content
Alignment viewer for linux terminal
Branch: master
Clone or download
Latest commit 57e16a1 Sep 3, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
alan_museum Alan rehaul. Changed to executable file rather than function set. May 3, 2018
alan Speed improvement. May 10, 2018

alt text

Alan — a simple in-terminal alignment viewer

Alan is a simple, light command line alignment viewer, for viewing amino acid and DNA alignments in a linux terminal.

It can be used for viewing FASTA or Clustal format alignment files, and relies on just a few standard unix packages.

Current Alan version (2.1.0):


Alan is essentially a modified version of the ubiquitous less text reader. It uses a number of very common unix tools (awk, sed, grep among others).

The alan command should be ready to use straight out of the box - no installation is required.

Before using Alan, you may wish to add the directory containing the alan executable to your $PATH by editing the .bashrcfile in your home directory (e.g. add the line PATH=$PATH:/path/to/alan_dir). If you've done this, Alan can be run by simply typing alan your_alignment.fa. Alternatively, explicitly reference the location of the alan executable, for example by typing /path/to/alan your_alignment.fa.

Alan does not work well on large alignments.

File types and options

Alan works on FASTA and Clustal format alignments. It's a very basic alignment reader, and any other alignment formats will confuse it. If this is an issue, convert files before viewing. The choice of file format (FASTA or Clustal) is detected automatically. Alan has been principally tested with FASTA files -- raise a support request if you have any trouble with Clustal files.

If no information on molecule type is supplied, Alan will try to detect whether an alignment is composed of protein or nucleotide sequences, and will display them accordingly. To override this, use the options -n for nucleotides, or -p for protein sequences.

To navigate the alignment, use the keyboard arrow keys. The amount by which an alignment is shifted using the arrow keys can be set using the -s or --shift options, followed by a numeric value. The default is 10.

Alan uses less as its main viewer, and so any other in-viewer commands contained in less will also work in Alan. This includes searching (use /), and more: see for a few.


By default, Alan uses the clustal colour scheme as described here. The formatting is not context-dependent, and so always displays one colour per character. The formatting is designed to work on a black-screen terminal.

You can update the colour scheme used by Alan in two ways. Alan colour schemes are defined by colour files. The default one for protein alignments looks like this:

-                  0;0
KkRr               01;41
SsTtQqNn           01;37;42
AaIiLlMmFfWwVvCc   01;44
Cc                 01;105
EeDd               01;45
Gg                 01;90;103
HhYy               01;46
Pp                 01;90;43

The default one for nucleotide alignments looks like this:

-Nn     0;0
Aa      01;31
Gg      01;33
Cc      01;32
Tt      01;34

These are tab-delimited text files, and are embedded in the alan script itself. The first column defines the symbols to be coloured, the second defines the colouring as defined here. There can be no blank lines, and any instance of "-" must be at the start of a line.

To include a custom colour file, include a colp.csv or coln.csv file (for protein and nucleotides respectively) in the same directory as the alan file, the contents of which should be in the same format as the above. Alternatively, if you wish to use multiple colour schemes for different purposes, you may wish to explicitly refer to a colour scheme file using the --colp or --coln options. For example:

alan my_alignment.fa --colp my_colours.csv.


Alt Text Alt Text

The Alan museum

The original Alan command was a one-line modification of the less command. For its simplicity and portability, you may wish to use the orignal alan on your system. This and some derived commands are contained in the alan_museum directory, and they are loaded as functions, so type source alan_museum/ to load them, and then type the individual commands to use them. The original Alan commands are:

Command Name Command Description Example
Alan Bennett alanbennett Fasta, automatic alanbennett alignment.fasta
Alan Davies alandavies Fasta, protein alandavies prot_alignment.fasta
Alan Rickman alanrickman Fasta, nucleotide alanrickman nuc_alignment.fasta
Alan Partridge alanpartridge Clustal, automatic alanpartridge alignment.fasta
Alan Menken alanmenken Clustal, protein alanmenken prot_alignment.fasta
Alan Shearer alanshearer Clustal, nucleotide alanshearer nuc_alignment.fasta
You can’t perform that action at this time.