igv.js
示例
修改genomes.json,使用本地基因组等文件 支持URL传参 添加鼠标滚轮监控
<script src="static/js/jquery.min.js"></script>
<script src="static/js/jquery.mousewheel.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/igv@2.3.5/dist/igv.min.js"></script>
<div class="container-fluid">
<div id="igv-div"></div>
</div>
<script>
var igvDiv = document.getElementById("igv-div");
var options = {
genome: "hg19",
locus: "chr1:10086",
genomeList: "genomes.json",
queryParametersSupported: true,
tracks: [
]
};
igv.createBrowser(igvDiv, options).then(function (browser) {
console.log("Created IGV browser");
igv.browser = browser;
});
$('#igv-div').bind('mousewheel', function(event, delta) {
event.preventDefault();
console.log(delta);
if( delta > 0) {
igv.browser.zoomIn();
} else {
igv.browser.zoomOut();
}
})