Creating bigPsl track for UCSC genome browser

Starting point is to have a psl file.

Its also needed to have in your path pslToBigPsl, bedToBigBed, bigPsl.as and chrom.sizes file.

The Makefile to automatize it is:

SHELL=/bin/bash
.ONESHELL:

PSL=$(wildcard *.psl)
TXT:=$(addsuffix .txt, $(basename $(PSL)))
BB:=$(addsuffix .bb,$(basename $(TXT)))

.PHONY: all clear


all: $(BB)


%.txt: %.psl
        pslToBigPsl $< stdout | sort -k1,1 -k2,2n > $@

%.bb: %.txt
        wget -c https://genome.ucsc.edu/goldenPath/help/examples/bigPsl.as && \
        bedToBigBed -as=bigPsl.as -type=bed12+13 -tab $< chrom.sizes $@

clear:
        rm *.txt && \
        rm *.bb

A trackDb.ra snippet:

track FOOBAR
parent foo
shortLabel FOOBAR
longLabel FOOBAR
group genes
priority 4
visibility dense
color 51,153,255
altcolor 0,102,0
searchTable FOOBAR
searchType bigBed
searchMethod prefix
maxWindowToDraw 10000000
colorByStrand 50,50,150 150,50,50
type bigBed 6 +
bigDataUrl /gbdb/foo/bar
spectrum on

References

UCSC Genome Browser – bigPsl

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s