Why do I need to sort and index gtf file for IGV?
1
0
Entering edit mode
9 months ago
bioinfo ▴ 150

I want to visualize some bam files on IGV. I had aligned my samples to a custom reference through STAR so I am trying to add this to IGV. I added the .fa file easily but I am having issues with the gtf file. When i try to add it I get the following error: An index file for custom.gtf could not be located. An index is recommended to view files of this size. Click "Go" to create one now or "Cancel to proceed without an index.

If I press cancel then it loads and I can search for my genes of interest. However, I did notice that the plot for the BAM file slightly changes whenever I start a new session. However, if I use igv tools to sort and index the gtf file I cannot get it to work. I I try to just load the sorted file it will load but I am not able to search for any genes. However, I can look for them if I zoom in the chromosomes. If I try to load the indexed.idx file then it will add a weird image on the top of the igv viewer to the leeft of the part that shows the bp.

Since the gtf file that I have seems to be working even though it is not indexed can I keep working with it? Also, why would the plot change slightly every time I load a new session?

igv • 1.5k views
ADD COMMENT
0
Entering edit mode
9 months ago
ATpoint 82k

GTF (like many genomics files) are large, so unsorted and no index means a lot of computational burden to find locations and entries. SOrted and indexed means you add a table of content for quick lookup. Imagine a book, and you need to find a chapter, but page order was random and there is no table of content, and you have to find different chapters and pages all the time...a huge uneconomic effort, but with a TOC you just look up the location and go to it.

ADD COMMENT
0
Entering edit mode

Thank you so much for the reply. Then that means that I can use the unsorted one too right? Since it seems that my computer can handle the computational burden.

ADD REPLY
0
Entering edit mode

Sorting is recommended. And it is very easy to sort your BAM file using samtools. @4 uses 4 cores

samtools sort [youBAMfilename].bam -o [youBAMfilename]_sorted.bam -@ 4
ADD REPLY
0
Entering edit mode

Sorting a GTF does not take long and saves time when browsing on the IGV, just do it: Is there a tool that sorts gtf files?

ADD REPLY

Login before adding your answer.

Traffic: 1364 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6