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:

To restore a saved session:

To reload a previously loaded session:

To clear the current session:

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#

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.

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.

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>