Writing a new track type: Difference between revisions

From genomewiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 4: Line 4:
* Add your table to trackDb.ra to make it appear on the genome browser, possibly using some related track type at first.
* 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.
* 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 [http://genomewiki.ucsc.edu/genecats/index.php/Running_joinerCheck_for_all_databases] 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.  
* 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 20:22, 19 May 2017

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