Skip to content

Customizing BLAT

Jim Robinson edited this page Jul 23, 2021 · 5 revisions

IGV supports on-the-fly alignment of short sequences by making use of a Blat webservice. By default a public service hosted at UCSC is used, and Blat support is limited to genomes derived from UCSC's hosted set. This can be customized in the advanced preferences to use another Blat service, or a locally executable command line program returning Blat like results.

To change the default blat service, open the advanced preferences in IGV by selecting View > Preferences > Advanced tab, and edit the "Blat url". The value is a string template with placeholders for the sequence and genome (blat database) id: $SEQUENCE and $DB. These values are substituted at runtime. The default value is

https://genome.ucsc.edu/cgi-bin/hgBlat?userSeq=$SEQUENCE&type=DNA&db=$DB&output=json

Output from the webservice or command line program should be JSON containing a "blat" property at the top level, followed by an array of PSL records representing the alignments. Each PSL record is represented as a JSON array. An example is given below. Details of the PSL format is available at UCSC. If configuring a local command line program output should be written to STDOUT.

{
    "blat" : [
        [33,1,0,0,0,0,0,0,"+","YourSeq",40,0,34,"chr1",249250621,155161117,155161151,1, 34,0,155161117],
        [33,1,0,0,0,0,0,0,"+","YourSeq",40,0,34,"chr1",249250621,155161255,155161289,1, 34,0,155161255],
        [33,1,0,0,0,0,0,0,"+","YourSeq",40,0,34,"chr1",249250621,155161315,155161349,1, 34,0,155161315],
        [33,1,0,0,0,0,0,0,"+","YourSeq",40,0,34,"chr1",249250621,155161435,155161469,1, 34,0,155161435],
        [33,1,0,0,0,0,0,0,"+","YourSeq",40,0,34,"chr1",249250621,155161495,155161529,1, 34,0,155161495]
    ]
}

An example of configuring a command line Blat shell script, written for Linux and Mac systems, is given below. This script takes the sequence and database ID as arguments, and simply calls the UCSC service reference above with output diverted to STDOUT.

Clone this wiki locally