Writing a new track type

From genomewiki
Revision as of 19:54, 12 March 2012 by Max (talk | contribs) (Created page with "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 toge...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to 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:

  • Add tables to the database, then describe their files in hg/lib/<trackType>.as. The table and field descriptions somehow appear in the table browser one day. See AutoSql
  • Add relationships between the tables in hg/makeDb/schema, to the file "all.joiner". See File:Kent allJoiner.ppt
  • 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.