This javascript tool based on the library D3, will allow you to display the features covering your sequence of DNA, protein, or others.
You will first need to create the SVG that will contains the features.
To do so, give whithin the parameters, the sequence (or length) and the div in which the features will be
display.
You can also adjust some rendering options :
The brush zoom will allow you to select a part of the sequence to zoom in.
It may happen that the div is too small to display the sequence, but a zoom will make it
appears.
To zoom out, just do a right click.
To add a feature to the SVG you have to pass an object as parameter.
This object will take :
Note 1 : In case of "line" feature, you can add 2 arrays of data within an array (e.g. data:[dataArray1,dataArray2]), and 2 colors for each data within an array (e.g. color:["#C50063","#005572"])
Note 2 : Be carefull to specify different className for each type of feature
You can listen for some events :
Those methods take a custom function (callback) in parameter, receiving the event object, allowing you to link the event with the rest of your application.
You can zoom into the feature viewer by selecting the area of interest with your mouse.
But you can also do it programmatically.
The feature-viewer has two methods for that :
It is possible to fill the feature viewer with protein features from NeXtProt, the human protein database.