-
Notifications
You must be signed in to change notification settings - Fork 14
/
lab_igv.Rmd
70 lines (49 loc) · 3.33 KB
/
lab_igv.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: "Using IGV"
subtitle: "Workshop on RNA-Seq"
output:
bookdown::html_document2:
highlight: textmate
toc: true
toc_float:
collapsed: true
smooth_scroll: true
print: false
toc_depth: 4
number_sections: true
df_print: default
code_folding: none
self_contained: false
keep_md: false
encoding: 'UTF-8'
css: "assets/lab.css"
include:
after_body: assets/footer-lab.html
---
```{r,child="assets/header-lab.Rmd"}
```
# Introduction
Integrated Genomics Viewer (IGV) is a visualization tool for interactive exploration of large, integrated genomic data sets. It supports a wide variety of data types, including array-based and next-generation sequence data, and genomic annotations. Our purpose of IGV is to visualise reads mapped to reference in BAM files. IGV is also useful in curating/verifying results from analyses pipelines.
<div class="boxy boxy-lightbulb">
IGV is installed on Uppmax, but since you would then access it over a network connection, the graphics might be sluggish. We recommend that you download and run IGV locally and download the files that you will look at locally. Alternatively, you can put the files in the webexport folder on Uppmax and view them from there. More information about that further down.
If you still want to try to run IGV on Uppmax, please refer to the Uppmax [instructions](https://www.uppmax.uu.se/support/user-guides/integrative-genomics-viewer--igv--guide/) for IGV.
</div>
# BAM, BED, GTF
To visualise a BED, BAM or GTF file from your local computer, select **File > Load from File …** and navigate to the file of interest. From the file extension, IGV will automatically treat the information in the file accordingly.
To visualise a BED, BAM or GTF file from a URL, select **File > Load from URL …**. A window will pop up and ask you to give the correct URL for the file you want to view. Paste in the URL, and the file will be downloaded. From the file extension, IGV will automatically treat the information in the file accordingly.
# SAM file
If the file you would like to view is in SAM format (file ends with **.sam**), which is a uncompressed text format, you need to convert it to BAM format (file ends with **.bam**). A BAM file contains the same information as the SAM file but now it is in a binary compressed format unreadable for a human.
To convert a SAM file to BAM format type:
```{sh,chunk.title=TRUE,eval=FALSE}
samtools view -bS fileName.sam > fileName.bam
```
Before the visualization, you need to sort it and then build a BAM file index (**.bai**).
```{sh,chunk.title=TRUE,eval=FALSE}
samtools sort fileName.bam fileName.sorted
samtools index fileName.sorted.bam
```
This is explained in some more detail in the read mapping tutorial.
Then, in IGV, just follow the instruction above for choose **File > Load from File …** and select the BAM file. If you are running IGV locally and did the mapping on Uppmax, you will have to download the BAM file and the corresponding index file (**.bai**) from your work folder to your own computer first.
# Going to a locus
In IGV, click the text box which has the word **Go** on its right hand side. This text box will typically contain genomic coordinates for the locus you are presently looking at, but it can also be used to find gene locations. Type a gene name in it and press <kbd>Enter</kbd>.
***