Related Tracks

From Genecats
Jump to navigationJump to search

Background

The Related Tracks feature is a snippet on hgc/hgTrackUi that shows other tracks that are related to the track that is currently being viewed. This is intended to increase awareness of available tracks.

How it's made

The Related Tracks section of hgc/hgTrackUi is built during a trackDb make, and the relationships are taken from the file: kent/src/hg/makeDb/trackDb/relatedTracks.ra

Anyone can modify this file, it has a simple space delimited format:

database track1 track2 reason for relatedness

Here's a few example lines, illustrating how comment lines starting with '#' are ignored:

# A space delimited file of track relatedness, format:
# ucscDb track1 track2 reason

# hg38:
hg38 omimGene2 interactions no good reason
hg38 omimGene2 dbSnp153Composite no good reason either
hg38 omimGene2 ncbiRefSeqCurated no reason
hg38 interactions omimGene2 test of duplicate line

During a make of trackDb, all of the lines starting with $db are taken out of this file and loaded into the table relatedTrack_$USER:

$ hgsql -e "select * from relatedTrack_chmalee" hg38
+--------------+-------------------+------------------------+
| track1       | track2            | why                    |
+--------------+-------------------+------------------------+
| interactions | omimGene2         | test of duplicate line |
| omimGene2    | dbSnp153Composite | no good reason either  |
| omimGene2    | interactions      | no good reason         |
| omimGene2    | ncbiRefSeqCurated | no reason              |
+--------------+-------------------+------------------------+

Please see ~/kent/src/hg/makeDb/trackDb/buildRelatedTracks for more information on the build process.

How to enable the feature in your sandbox

This feature is currently under hg.conf control, meaning even if the MySQL table exists for a given database, you still need an hg.conf variable pointing to the name of the table (similar to trackDb):

db.relatedTrack=relatedTrack_$USER