Writing a new track type

From genomewiki
Jump to: navigation, search

If you have a new type of data and you want to show it up on the genome browser, you need to change many different source code files. Here are some ideas how all of it works together:

  • Do not forget release tags!! Without a "release alpha" tag, your track may leak out to the RR and code may fail there.
  • Add tables to the database, then describe their files in hg/lib/<trackType>.as. . See AutoSql. The table and field descriptions are imported into the table browser by src/test/buildTableDescriptions.pl, see TableDescriptions
  • Add your table to trackDb.ra to make it appear on the genome browser, possibly using some related track type at first.
  • Add relationships between the tables in hg/makeDb/schema, to the file "all.joiner". See File:Kent allJoiner.ppt. To see the results of your modifications, go to hg/hgTables and run "make", then use the table browser to see if you're happy with the linking of the tables.
    • There is a page for [1] that explains how to check all.joiner
  • Change the visualisation code in hg/hgTracks/hgTracks.c. Most tracks are handled in simpleBed.c . Each track has a struct that describes the track with various function pointers that are called to draw the features, get the name of the feature, get it's dimensions, etc.
  • Once a user clicks on a feature, hg/hgc/hgc.c get's called with the feature id, the track name, the coordinates and it will show more details about a single feature. Most track types have their own .c file in here that will show a html page with the feature details.