igv.js

示例

修改genomes.json,使用本地基因组等文件 支持URL传参 添加鼠标滚轮监控

  1. <script src="static/js/jquery.min.js"></script>
  2. <script src="static/js/jquery.mousewheel.min.js"></script>
  3. <script src="https://cdn.jsdelivr.net/npm/igv@2.3.5/dist/igv.min.js"></script>
  4. <div class="container-fluid">
  5. <div id="igv-div"></div>
  6. </div>
  7. <script>
  8. var igvDiv = document.getElementById("igv-div");
  9. var options = {
  10. genome: "hg19",
  11. locus: "chr1:10086",
  12. genomeList: "genomes.json",
  13. queryParametersSupported: true,
  14. tracks: [
  15. ]
  16. };
  17. igv.createBrowser(igvDiv, options).then(function (browser) {
  18. console.log("Created IGV browser");
  19. igv.browser = browser;
  20. });
  21. $('#igv-div').bind('mousewheel', function(event, delta) {
  22. event.preventDefault();
  23. console.log(delta);
  24. if( delta > 0) {
  25. igv.browser.zoomIn();
  26. } else {
  27. igv.browser.zoomOut();
  28. }
  29. })

JBrowse

UCSC

Genoverse