Writing a new track type: Difference between revisions

From genomewiki
Jump to navigationJump to search
(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...")
 
No edit summary
Line 2: Line 2:


* 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 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 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]]
* 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.  
* 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.
* 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.

Revision as of 19:56, 12 March 2012

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 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
  • 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.