Circos spits out SVG, and d3.js could be used to make the SVG-formatted ideograms interactive.
However, on cursory examination of some example SVG outputs from Circos, some patching would be needed, either of Circos or its output. The id
values of g
(group) and other SVG element primitives do not appear to have a useful naming scheme applied to them (if even present). If they were named in a reliable way, that would make it a lot easier to write a d3.js-based web application to make the SVG interactive (triggering hiding or showing of annotations on mouseover
or mouseout
events on specific UI or ideogram elements, etc.).
If the naming issue can be resolved, you'd probably have a web service running on a server somewhere that generates Circos figures on demand, based on whatever parameters the end user sets in the request. The response contains (compressed) SVG, d3.js event handlers are attached to elements within the SVG, and the SVG is poured into a container div somewhere in your web tool.
Update
Looks like there is functionality in a recent version of Circos to append identifier and other attributes to the SVG output:
From the CHANGES file:
Most data SVG elements can now have attributes for their SVG tags by adding svg\ parameters to the data point track. Any parameter that starts with svg (e.g. svgNNN) will be turned into an attribute whose name is derived from the parameter by stripping the leading "svg" out (e.g. NNNN). (e.g. svgid -> id, svgclass -> class).*
hs1 100 200 0.5 svgid=123,svgclass=abc
-> <circle ... id="123" class="abc"/>
- Ideograms now accept SVG attributes using
svg*
parameters in <ideogram>
block. These can be eval()'ed
<ideogram>
...
svgclass = eval(var(chr))
svgid = eval(sprintf("chrid%s",var(label)))
The 2 links you provides are very cool. Specially the second one, is nice. Me too, I was lookign for somethink like that. My project is to create a database to group everything in genomic field related to dental science. If you find some the second one open source, please, let me know. If not we can develop in JS together.