Install Blat

Click here to go back to the identity Installation page.

BLAT is a program that compares strings of DNA and is used for comparing SNP barcodes in this identity program. It is often already installed on HPCs used for genomics, however the following instructions can be used to install it if not.

Download, unzip, and install libpng-1.6.2 - this will add some essential library files for blat

Install libpng-1.6.2

This is an essential group of library files for installing BLAT. While newer versions exist we have checked that this version works correctly. The source files can be downloaded here: libpng-1.6.2 or uploaded directly to the HPC using the wget command below. This list of commands will download, unpack, and install the package into the current directory.

tar -xvf libpng-1.6.2.tar.gz
cd libpng-1.6.2
./configure --prefix=`pwd`
make install
cd ..

Download and unzip BLAT

With libpng installed we can now download and unzip BLAT. The file '' is available at this link: BLAT source, however the following command will download and unpackBLAT into the current directory and then copy three essential files from libpng:

cd blatSrc
cp $LIBPNGDIR/png.h lib/
cp $LIBPNGDIR/pngconf.h lib/
cp $LIBPNGDIR/pnglibconf.h lib/

Identifying the machine type

BLAT needs to know the type of machine which should read as one of these:

  • i386
  • i686
  • x86_64
  • sparc
  • alpha
  • ppc

To check your machine type use the echo command (below) then set 'MACHTYPE' to one of the options above and create a directory using 'mkdir' specific to the machine type. BLAT is then installed in this directory using the 'make' command:

# response example: 'x86_64-redhat-linux-gnu'
mkdir -p ~/bin/$MACHTYPE

Adding BLAT to the path

To make using BLAT simple the directory is often added to the 'path' so that the directory it has been installed in does not need to be specified. This can be done by editing the '.bashrc' file directly, e.g. using nano, which is installed on most HPCs, or by using these commands:

echo 'export MACHTYPE=x86_64' >> ~/.bashrc
echo 'export PATH=$PATH:~/bin/$MACHTYPE' >> ~/.bashrc
source ~/.bashrc

NB: If you are installing on a Mac then you will need to use '~/.profile' instead of '~/.bashrc'.

Once this is complete you should be able to run BLAT by typing 'blat' and pressing return in any directory.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License