Load Files with HTML Links
Data and session files can be loaded into IGV from a web browser or other application supporting hyperlinks. This makes use of the listener port. To use this option you must enable the port listener on the Advanced tab of the Preferences window, accessed from the View menu. Links can be created to load data or jump to a locus as follows.
http://localhost:port/load?file=URL&locus=locus&genome=genome&merge=[true|false|ask]&name=name
http://localhost:port/goto?locus=locus
-
The file parameter value can be a URL or a comma-delimited list of URLs to most IGV-supported data file types (exceptions listed below), or a session file.
-
The merge parameter (optional) controls whether or not the loaded data is merged with the existing IGV session, or a loaded into a new session.
-
If true, the data specified in the link will be added to the existing IGV session. This is the default behavior if the parameter is not specified.
-
If false, any data currently loaded will be unloaded after clicking the link.
-
If ask, a dialog will pop up to ask the user whether or not to unload the current session before loading new tracks. (Available as of IGV 2.15.4)
The merge paramater is ignored if loading a session; loading a session will alway unload the previous session.
-
The name parameter (optional) specifies a name or names for the track. If multiple tracks are loaded as a comma-delimited list, the name parameter value should also be a comma-delimited list of the same size. The name parameter is ignored if loading a session.
Examples:
http://localhost:60151/load?file=http://www.broadinstitute.org/igvdata/annotations/hg18/conservation/pi.12mer.wig.tdf&locus=egfr&genome=hg18&merge=ask
http://localhost:60151/load?file=http://www.broadinstitute.org/igvdata/exampleFiles/gbm_session.xml
http://localhost:60151/goto?locus=egfr
Session File Format
IGV produces a session file in XML format when a user clicks on File>Save Session. You can also create a session file manually. The XML format (IGV version 1.5) is described below.
Session XML Hierarchy
Description of Session Components
Required - These elements are required in a session file.
-
<Global>: The root XML element.
-
genome= The genome id (e.g., hg18).
-
locus= The initial genomic region to be viewed (chromosome:start-end or gene name).
-
version= The session version (this must equal '3').
-
<Resources>: An enclosing element for all Resource elements.
-
<Resource>: Contains information about the data sources to be loaded, including data files, feature files, sample information files, and DAS servers.
-
name= The name of the track (single track files only).
-
path= The location of the data source (file path or URL).
-
url= Defines a URL for external links associated with a feature track. Any '$$' in this string will be substituted with the name of the current feature.
Optional - These elements are optional in a session file and are used to determine the placement of tracks and visual style choices. They are included in an XML file produce when you save a session in IGV, but are typically not included in an XML file that is created manually.
-
<Panel>:
-
name= A panel identifier used internally by IGV.
-
height= The default height for the panel.
-
<Track>:
-
color= The default color for the data in the track.
-
expand= Whether the track is initially expanded or not.
-
height= The default height of the track.
-
id= A track identified used internally by IGV.
-
name= The display name for the track.
-
renderer= The renderer used to display the data.
-
visible= Whether the track is visible or has been filtered out.
-
windowFunction= The function to be used when displaying data
-
<DataRange>: Defines the y axis for tracks when rendered as charts.
-
baseline= Line is drawn at this y value. Default is 0.
-
maximum= Maximum y value.
-
minimum= Minimum y value. Default is 0.
-
type= Scale type, "LINEAR" or "LOG"
-
drawBaseline (not used)
-
flipAxis (not used)
Session File Example
The XML below is an example of a minimal session file.
------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Global genome="hg18" locus="EGFR" version="3">
<Resources>
<Resource name="RNA Genes" path="http://www.broadinstitute.org/igvdata/tcga/gbm/GBM_batch1-8_level3_exp.txt.recentered.080820.gct.tdf"/>
<Resource name="RNA Genes" path="http://www.broadinstitute.org/igvdata/annotations/hg18/rna_genes.bed"/>
<Resource name="sno/miRNA" path="http://www.broadinstitute.org/igvdata/tcga/gbm/Sample_info.txt"/>
</Resources>
</Global>