This article explains three ways you can use the Integrative Genomics Viewer (IGV) to examine tracks from BAM (.bam) files in Terra.
- From the workspace Data tab
- By adding a startup script to a notebook runtime creation
- From the IGV web app
1. From the workspace Data tab
Data files in the cloud linked to your workspace will appear in the data table of the Data tab of your workspace. To view these files in IGV, select a row from the table that has both a BAM and BAM.bai and choose the "Open files with IGV option" from the modal.
- Navigate to the region of interest:
2. By adding a startup script to a notebook cloud environment creation
You can view in IGV from a notebook by adding a startup script. The startup script that you would need to put in a publicly accessible Google Cloud Storage bucket is here:
pip3 install igv-jupyter
jupyter serverextension enable --py igv --sys-prefix
jupyter nbextension install --py igv --sys-prefix
jupyter nbextension enable --py igv --sys-prefix
To add a script to a notebook, click on the gear icon in the "Cloud Environment" box in the corner, and click the Customize button near the bottom.
Then select "Custom Environment" from the Application Configuration drop down menu, and paste the path to your startup script in the provided field:
3. Using the IGV web app
You can also use IGV in a web browser by going to http://igv.org/app/. First select "Genomes" and choose the appropriate reference genome. Then select "Tracks" --> "URL":
Paste the file locations from your data table using "Copy Link Address" in the dropdown menu:
The tracks are now viewable in the web browser:
You can save the tracks for viewing later by pressing "Share" at the top menu.
To see the example IGV web browser file created from this example, go to this URL: http://bit.ly/2IqsQqM.