Sessions
You can save the current state of an IGV session to a named session file. You can use that file to restore the IGV session yourself or share it with colleagues, as long as they also have access to any data files that were loaded when the session file was saved. For example, if the data files are loaded into IGV from a shared directory and the IGV session file is saved to that shared directory, anyone with access to the directory can restore the saved IGV session.
Saving and using sessions#
To save a session:
- Click File > Save Session.
- Use the Save Session window that pops up to select a target directory and file name for the new session file.
To restore a saved session:
- Click File > Open Session.
- Use the Open Session window that pops up to select a session file. IGV ends the current session and restores the saved session.
To reload a previously loaded session:
- Click File > Reload Session.
To clear the current session:
- Click File > New Session. This removes all data tracks and resets the view, but does not change the reference genome.
Session autosave#
IGV supports the ability to autosave your current session in the igv/autosave
directory. These session files can then be loaded through the File > Autosaved Sessions menu.
Two autosave methods are supported:
- Autosave on exit
- Timed autosave
Autosave on exit#
Whenever you exit IGV, a copy of your current session will be saved to the igv/autosave
directory with the name exit_session_autosave.xml
. Each time you exit IGV, that file will be overwritten with a new save of the current session.
Autosave on exit is enabled by default. Autosave on exit can be enabled/disabled via the General tab in View > Preferences.
Timed autosave#
You have the option of enabling a periodic autosave of your current session in IGV. This works by saving a copy of your current session every x minutes to the igv/autosave
directory, named in the form session_autosave[timestamp].xml
where [timestamp]
is the current date and time at the time of the autosave, in ISO 8601 UTC date and time format.
Timed autosave is disabled by default. There are two options in the General tab of the View > Preferences window menu for timed autosave. You can set how often the autosave should be done by setting the value for How often, in minutes, to autosave the current session. You can set how many autosave files created by the timed autosave to keep by setting the value for How many timed autosave session files to keep. Setting this option to 0 (which is the default) disables timed autosave.
Autoload#
IGV provides the option to automatically load your last autosave on startup. This can be enabled in the General tab of the View > Preferences window. If this is enabled, when you open IGV, the most recent session file in the igv/autosave
directory will be loaded, if there is one. This setting will be ignored if running IGV from the command line and specifying a file to open on start.
Session file format#
The following description is for IGV version 2.1 and greater
Session files describe the session in XML. If you wish to manually create or edit a session file, use the information below to better understand the components of each session file.
Session XML hierarchy#
<Session>
<Resources>
<Resource>
<Panel>
<Track>
<DataRange>
Session components#
Required#
These elements are required in a session file. All session files must follow XML standards.
- <Session> Contains information about the general state of IGV when the session was saved
- genome = The genome id.
- A file path or URL to an indexed fasta or .genome file can be used in place of the genome id. The path can be absolute or relative to the parent directory of the session file.
- locus = The genomic range selected when the session was saved
- version = The session version (this must equal '3')
- genome = The genome id.
- <Resources> An enclosing element for all Resource elements
- <Resource> Contains the location and other important information for your data files
- name = The name of the track for single track files
- path = The file path or URL to the track file
- index = An optional path or URL to an index file
- url = An optional URL to associate with features of the track
Optional#
These elements are optional in a session file and are added by IGV to help determine the placement of the data and visual style choices.
- <Panel> Contains information about the placement of Tracks in the visual panels
- name = The display name for the Panel
- height = The default height for the Panel
- width = The default width for the Panel
- <Track> Details information about every track in a session
- color = The default color for the data in the track
- expand = Whether the track is expanded or not
- height = The default height of the track
- id = The id assigned by IGV to this track
- name = The display name for the track
- renderer = The renderer to be used with this Track (non-default)
- visible = Whether the track is visible or loaded in the background
- windowFunction = The function to be used when displaying data
- <DataRange> A set of attributes used to determine the look of the Panel
- baseline =
- drawbaseline =
- flipAxis =
- maximum =
- minimum =
- type =
Example session file#
The XML below is an example of a simple session created by IGV.
<?xml version="1.0" encoding="UTF-8"?>
<Global genome="hg18" locus="All" version="3">
<Resources>
<Resource url="http://genome.cse.ucsc.edu/cgi-bin/hgTrackUi?g=rnaGene" label="RNA Genes" name="RNA Genes" path="http://www.broadinstitute.org/igvdata/annotations/hg18/rna\_genes.bed"/>
<Resource url="http://genome.cse.ucsc.edu/cgi-bin/hgTrackUi?g=wgRna" label="sno/miRNA" name="sno/miRNA" path="http://www.broadinstitute.org/igvdata/annotations/hg18/sno\_mirna.bed"/>
</Resources>
<Panel height="445" name="DataPanel" width="1000">
<Track color="0,0,178" colorScale="ContinuousColorScale;0.0;20.0;255,255,255;0,0,178" displayName="Non coding RNA" expand="false" height="45" id="http://www.broadinstitute.org/igvdata/annotations/hg18/rna\_genes.bed" name="RNA Genes" renderer="BASIC\_FEATURE" visible="true" windowFunction="count">
<DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="20.0" minimum="0.0" type="LINEAR"/>
</Track>
<Track color="0,0,178" colorScale="ContinuousColorScale;0.0;20.0;255,255,255;0,0,178" displayName="sno miRNA" expand="false" height="45" id="http://www.broadinstitute.org/igvdata/annotations/hg18/sno\_mirna.bed" name="sno/miRNA" renderer="BASIC\_FEATURE" visible="true" windowFunction="count">
<DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="20.0" minimum="0.0" type="LINEAR"/>
</Track>
</Panel>
<Panel height="65" name="FeaturePanel" width="1000">
<Track color="0,0,178" colorScale="ContinuousColorScale;0.0;20.0;255,255,255;0,0,178" displayName="RefSeq genes" expand="false" height="30" id="Genes" name="Genes" renderer="BASIC\_FEATURE" visible="true" windowFunction="count">
<DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="20.0" minimum="0.0" type="LINEAR"/>
</Track>
</Panel>
</Global>