Skip to content
Sven Willger edited this page Jul 7, 2023 · 2 revisions

IGV on HILBERT

Use IGV on HILBERT (or other HPC)

Problem: IGV wants to download reference genomes from Amazon S3 Server, which is not possible and is operated through a X11-based GUI that is not automatically available.

Solution: Follow the steps in the following tutorial to run IGV on HILBERT (or other HPC)

Steps to use IGV directly on HILBERT (or other HPC)

Install IGV on server

If IGV is not installed globally, which it is not on HILBERT the easiest solution is to install IGV in a conda environment.

conda create --name IGV igv

This will install IGV in your home directory and also creates 2 folders:

  • <userhome>/.igv
  • <userhome>/igv

Downloading Hosted Genomes for Offline Use

The following instruction uses the human T2T (hg38T2T CHM13-v2.0) genome and has been modified based from a manual by the igv developers.

This page describes how to download a genome specification (json) file and configure it for use in IGV without an internet connection. This requires downloading all dependent files, including the sequence. The following example uses H. sapiens T2T(ce11T2T CHM13-v2.0); for other genomes see the Hosted Genomes list below.

NOTE: Some of the more frequently used genomes are available for download here as a package ready for offline use. If you download one of these packages, skip to step 4 below.

Example

1. Download the .json genome specification file

For our Human T2T example: curl -O https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.json

{
  "id": "chm13v2.0",
  "name": "Human (T2T CHM13-v2.0)",
  "fastaURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa",
  "indexURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa.fai",
  "cytobandURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/CHM13_v2.0.cytoBandMapped.bed",
  "aliasURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/GCA_009914755.4.chromAlias.txt",
  "tracks": [
    {
      "id": "catLiftOffGenesV1",
      "name": "CAT/Liftoff Genes",
      "format": "bigbed",
      "description": " <a target = \"_blank\" href = \"https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/html/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1.html\">CAT + Liftoff Gene Annotations</a>",
      "url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb",
      "displayMode": "EXPANDED",
      "height": 200,
      "visibilityWindow": -1,
      "supportsWholeGenome": false,
      "order": 1000000
    },
    {
      "id": "augustus",
      "name": "Augustus",
      "format": "bigbed",
      "description": " <a target = \"_blank\" href = \"https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/html/GCA_009914755.4_T2T-CHM13v2.0.augustus\">Augustus Gene Predictions</a>",
      "url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.augustus.bb",
      "displayMode": "EXPANDED",
      "color": "180,0,0",
      "height": 200,
      "visibilityWindow": -1,
      "supportsWholeGenome": false,
      "order": 1000001
    },
    {
      "name": "Genes",
      "format": "bed",
      "url": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0_geneLocations.short.bed.gz",
      "hidden" : true,
      "searchable": true
    }
  ]
}

2. Download the files referenced in the genome specification

For our example, these files are:

https://s3.amazonaws.com/igv.broadinstitute.org/genomes/chm13v2.0/chm13v2.0.fa
https://s3.amazonaws.com/igv.broadinstitute.org/genomes/chm13v2.0/chm13v2.0.fa.fai
https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/CHM13_v2.0.cytoBandMapped.bed
https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/GCA_009914755.4.chromAlias.txt
https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb
https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.augustus.bb
https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0_geneLocations.short.bed.gz

3. Edit your local copy of the genome specification file

Your local copy of the .json file should reference the downloaded files. Reference can be by URL to a file on your local network, or by file path, which can be relative to the location of the .json file. Assuming the downloaded data files are in a subfolder called /data relative to the .json file, the chm13v2.0.json file will look like this:

{
  "id": "chm13v2.0",
  "name": "Human(T2T CHM13-v2.0)",
  "fastaURL": "data/chm13v2.0.fa",
  "indexURL": "data/chm13v2.0.fa.fai",
  "cytobandURL": "data/CHM13_v2.0.cytoBandMapped.bed",
  "aliasURL": "data/GCA_009914755.4.chromAlias.txt",
  "tracks": [
    {
      "id": "catLiftOffGenesV1",
      "name": "CAT/Liftoff Genes",
      "format": "bigbed",
      "description": " <a target = \"_blank\" href = \"data/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1.html\">CAT + Liftoff Gene Annotations</a>",
      "url": "data/catLiftOffGenesV1.bb",
      "displayMode": "EXPANDED",
      "height": 200,
      "visibilityWindow": -1,
      "supportsWholeGenome": false,
      "order": 1000000
    },
    {
      "id": "augustus",
      "name": "Augustus",
      "format": "bigbed",
      "description": " <a target = \"_blank\" href = \"data/GCA_009914755.4_T2T-CHM13v2.0.augustus.html\">Augustus Gene Predictions</a>",
      "url": "data/GCA_009914755.4_T2T-CHM13v2.0.augustus.bb",
      "displayMode": "EXPANDED",
      "color": "180,0,0",
      "height": 200,
      "visibilityWindow": -1,
      "supportsWholeGenome": false,
      "order": 1000001
    },
    {
      "name": "Genes",
      "format": "bed",
      "url": "data/chm13v2.0_geneLocations.short.bed.gz",
      "hidden" : true,
      "searchable": true
    }
  ]
}

Run IGV with the X11-based GUI

For the IGV GUI to work the -X switch must be on when ssh'ing to the remote server.

That means, when conecting to HILBERT you have to run:

ssh -X <username>@hpc.rz.uni-duesseldorf.de

This brings you just to the login node and since it's not allowed to work there, you also have to switch X11 also on a working node like e.g. the snakemake-node.

ssh -X snakemake-node

Now you can activate the conda environment and start igv:

conda activate IGV
igv

This will open the GUI that allows you to load the local genomes. To do so load the updated .json genome specification file into IGV using the Genomes > Load from File... menu.

Use the local version of the genome in IGV

NOTE: For some of the more frequently used genomes I already prepared the .json files and the connecting /data subfolder. Those can be found under /gpfs/project/projects/medbioinf/projects/cubi/resources/IGV_genomes. To get there, click on the left arrow on the top of the file explorer and then on the icon right from the left arrow button. That brings you to the base folder and you have to click your way to your folder of interest. Click and hold the folder of interest, drag it to the left panel and drop it in the New bookmark area (the window is reacting slow, so give it a moment) for future quick access.

You can also store your local genomes there or under <userhome>/igv/data/<genome name>. Then you should upload in this destination folder the modified .json file and the subfolder /data with the downloaded genome files.

After adding the local genomes manually, in the folder <userhome>/igv/genomes a file called user-definded-genomes.txt will be created (and/or updated, when new genomes will be added) with the location of the .json file(s) so that the genomes will be available through the drowpdown menu.

For better performance open the file <userhome>/.igv/java_arguments and uncomment line 3 and maybe raise the memory to 24GB (instead of the default 4GB).

Import data from server

To import data from the server into IGV use File > Load from File.... As for the import of the genomes, in the file explorer that opens click on the left arrow on the top and then on the icon right from the left arrow button. That brings you to the base folder and you have to click your way to your folder of interest. Click and hold the folder of interest, drag it to the left panel and drop it in the New bookmark area (the window is reacting slow, so give it a moment) for future quick access.