How to load user-defined genome in IGV-webapp

27 views
Skip to first unread message

Fardokht

unread,
Sep 9, 2021, 10:39:28 AM9/9/21
to igv-help

Hello,

I would like to create a session in IGV-webapp using a HTML file.

The following works with pre-defined genomes (g.e. genome: “hg38”), but I would like to load my own genome. Is there a way to achieve this?


```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script src=""></script>
<div id="igv-div"></div>

<script>
var igvDiv = document.getElementById("igv-div");
var options =
{
genome: "hg38",
locus: "chr8:127,736,588-127,739,371",
tracks: [
{
"name": "",
"url": "",
"indexURL": "",
"format": ""
}
]
};

igv.createBrowser(igvDiv, options)
.then(function (browser) {
console.log("Created IGV browser");
})
</script>
</body>
</html>
```

James Robinson

unread,
Sep 9, 2021, 6:44:30 PM9/9/21
to igv-help
Please see the documentation in the igv.js wiki, its described there.  You will need to specify a "reference" property instead of "genome",  "reference" takes an object described here:  https://github.com/igvteam/igv.js/wiki/Reference-Genome.  

The "genome" property is just shorthand for our hg38 reference object, which I include below as an example.    properties except id, name, fastaURL, and indexURL are optional.  Again see the igv.js wiki
.
{
"id": "hg38",
"name": "Human (GRCh38/hg38)",
"fastaURL": "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa",
"indexURL": "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa.fai",
"cytobandURL": "https://s3.amazonaws.com/igv.org.genomes/hg38/annotations/cytoBandIdeo.txt.gz"
"tracks": [
{
"name": "Refseq Genes",
"format": "refgene",
"url": "https://s3.amazonaws.com/igv.org.genomes/hg38/ncbiRefSeq.sorted.txt.gz",
"indexURL": "https://s3.amazonaws.com/igv.org.genomes/hg38/ncbiRefSeq.sorted.txt.gz.tbi",
"visibilityWindow": -1,
"removable": false,
"order": 1000000
}
]
}
Reply all
Reply to author
Forward
0 new messages