This is a sketch for a htmlwidget wrapper for JavScript genome browser dalliance.
A dalliance function call generates a genome browser htmlwidget with a given reference genome (eg. GRCh38) and a given gene annotation (eg. GENCODEv21):
dalliance()
The corresponding javascript would look like this:
<script language="javascript" src="http://www.biodalliance.org/dev/dalliance-compiled.js"></script>
<script language="javascript">
new Browser({
chr: '14',
viewStart: 75276274,
viewEnd: 75284730,
cookieKey: 'human',
coordSystem: {
speciesName: 'Human',
taxon: 9606,
auth: 'GRCh',
version: '38'
},
sources: [{name: 'GRCh38',
twoBitURI: 'http://www.biodalliance.org/datasets/hg38.2bit',
tier_type: 'sequence',
provides_entrypoints: true}
,{name: 'GENCODEv21',
desc: 'Gene structures from GENCODE 21',
bwgURI: 'http://www.biodalliance.org/datasets/GRCh38/gencode.v21.annotation.bb',
stylesheet_uri: 'http://www.biodalliance.org/stylesheets/gencode2.xml',
collapseSuperGroups: true,
trixURI: 'http://www.biodalliance.org/datasets/GRCh38/gencode.v21.annotation.ix'}
]});
</script>
<div id="svgHolder"></div>
A common workflow loads…
.bigbed, .bigwig or indexed .bam..gff and .vcf (future)Where grouped tracks should be added in lists. In general, syntax to build a genome browser could resemble the leaflet syntax to build maps.
dalliance %>%
addReference("GRCh38") %>%
addAnnotation("GENCODEv21") %>%
addTrack(list("my_track_A_rep1", "my_track_A_rep2"),
list("my_track_B_rep1", "my_track_B_rep2")) %>%