Query Parameters

An igv.js instance can be initialized on page load with query parameters. To enable use of query parameters set

supportQueryParameters: true

in the browser configuration. All query parameter values must be URI Encoded.

Parameter Description
genome reference genome id. See list of hosted genomes above.
locus initial locus, e.g. chr1:100-200. For multi-locus view use percent encoding for space, (%20) to separate loci, e.g. chr1%20chr2.
file comma-delimited list of data file URLs.
sessionURL URL to a json or IGV desktop session file, or a base 64 encoded blob object obtained from browser.compressedSession(). See examples below. Note if sessionURL is provided genome, locus, and file parameters are ignored.

Examples#

The examples below use the igv web app (igv.org/app), which embeds igv.js. Replace https://igv.org/app/ with the URL to your app. You must enable query paramters for the embedded igv.js in the configuration file.

Load a bam file and view the region for the gene myc.#

https://igv.org/app/?genome=hg19&locus=myc&file=https%3A%2F%2F1000genomes.s3.amazonaws.com%2Fphase3%2Fdata%2FHG01879%2Fexome_alignment%2FHG01879.mapped.ILLUMINA.bwa.ACB.exome.20120522.bam

Load an IGV desktop (xml) session#

https://igv.org/app/?sessionURL=https%3A%2F%2Fwww.dropbox.com%2Fs%2Fi28zsloz8b75b1g%2Falignments_session.xml%3Fdl%3D0

Load a session as a compressed blob parameter#

https://igv.org/app/?sessionURL=blob:tZRRa9swEMe_StHTxhzZjpLa8WM7SAfbS9oxxghBts.OmCVlkpykDfnuPbl2WFlXtpaGEMLd6X66u__pQAxUYEAVQLIDESXJyLpmKQmI4hJt5KqVXJ29my8u1ywNve89OituHf.6.OzDndvYLAwto2XLG7QXP2lrR4Aho5hyye.04jtLCy1DUW9pbjQvhbJOuNYB1aYOa1Bagg0t_OoQ3Q.tOJKEKmH_9iT8CqQVt07nXJUvBCKBDoQuO1dKO.6EVjb0uS8w96cSNHV7R.s7cgxIo4vWkuwHKdYmzeJxEiRsEkzYZNT9n7BgNo3JMiC1g_01NFB06fy4nj2BfryKH.GX75dYmlUbkqm2aY4IdQZL8dQDcbcbH4QNaTsZBESbEgzJsMJklpzPWMwm6fmYxdMEPrAoRWno641Qygc508IxOJzUMo.iOBpjktY0_9vBOIqioXsldzzss4W8EbWSoNxgobxxq3yHTLl6UObHKzqO4mmUxCmdXyxoo3erQm_B8BpoYbh8hZTe9F7.xyuv0kZyh1frL9uP5YTwIaKBx31.WR.sbk0BNw8AnxRtaxD1GvEsinAL.gM3XiVXvWeKjl4Z7DkJLKBCLZ3NUXv297rwoen0.CJpPLlcmNFTqNXGQTms1OuejH.DUJf7mW2FFblohLv9hky98zsTYKFSb3mObc0qRMKpbV5H.PmjeY8m.7einhraoJHTI4M2yfcLvcPVnnoSBjow_tTwxGipLVaHkd00lsfl8R4-

Note the blob can be obtained from an igv.js browser instance as follows. See Browser API.

const blob = browser.compressedSession()