Loading BAM and BAI files

3,443 views
Skip to first unread message

sc...@ncsu.edu

unread,
Jan 17, 2014, 3:21:24 PM1/17/14
to igv-...@googlegroups.com
Hello,

1. I have SAM file.
2. I converted sam file to bam file.
3. The bam file was sorted.
4. The sorted bam file was indexed.
5. Finally, sorted bam and bai file were gained.
6. When I tried loading bam and bai files, ERROR message keeps occurring:
  - ERROR: Loading SAM/BAM index files are not supported. Load the SAM or BAM file directly.
  - Could not load index file. An index file is required for SAM and BAM files.
7. Would you please help me to fix these errors?

Thanks in advance.

sc...@ncsu.edu

unread,
Jan 17, 2014, 3:22:45 PM1/17/14
to igv-...@googlegroups.com
P.S. I am running IGV2.3 on windows.

Jacob Silterra

unread,
Jan 17, 2014, 4:47:53 PM1/17/14
to igv-...@googlegroups.com
Hello,

When you use File -> Load to select a file, select the .bam file, and not the .bam.bai index file.

-Jacob


--
 
---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/e917eb40-5abf-4752-a8e4-50c041d96412%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Jacob Silterra
Software Engineer
Broad Institute

Site on

unread,
Jan 17, 2014, 4:58:30 PM1/17/14
to igv-...@googlegroups.com, igv-...@googlegroups.com
Hi,
Of course I did.
When I tried loading BAM file, an error message said, "Could not load index file. An index file is required for SAM and BAM files."
You received this message because you are subscribed to a topic in the Google Groups "igv-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/igv-help/brB27M2kkpc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/CAFbhPKXhs3yocXov5wqjW9whPvB2pFytr8q9n23w3WB2WDCyjQ%40mail.gmail.com.

Jacob Silterra

unread,
Jan 17, 2014, 5:12:40 PM1/17/14
to igv-...@googlegroups.com
Hello,

Can you send your igv.log file? It should be in <home directory>/igv/igv.log

Thanks,
-Jacob



For more options, visit https://groups.google.com/groups/opt_out.

Soyeon Cha

unread,
Jan 21, 2014, 9:50:05 AM1/21/14
to igv-...@googlegroups.com
Hello,

Would you please see the attached file and give me a piece of advice?

Thank you so much!



igv.log

Jacob Silterra

unread,
Jan 21, 2014, 9:55:14 AM1/21/14
to igv-...@googlegroups.com
Hello,

It looks like there is an index for the unsorted BAM file, but not the sorted BAM file. So create an index for chwd3_abyss-map_sorted.bam and you should be all set.

-Jacob



For more options, visit https://groups.google.com/groups/opt_out.

sc...@ncsu.edu

unread,
Jan 21, 2014, 10:30:33 AM1/21/14
to igv-...@googlegroups.com
Hi,
The "bai" file is the one which was generated from the sorted "bam" file.
So when I just changed the file name from "chwd3_abyss-map.bai" to "chwd3_abyss-map_sorted.bai", it worked very well.

Thank you very much for prompt reply and your advice!!!

Cara Fiore

unread,
Mar 26, 2015, 12:33:31 PM3/26/15
to igv-...@googlegroups.com
Hello,

I have the same question as on this post - however, the answer here does not fix my problem. 

I have the bam file, the sorted bam file, and the indexed bam file all in the same directory and when I try to load the bam file I get

"Could not load index file. An index file is required for SAM and BAM files."

My files are named:
ALLtrinity.bam
ALLtrinity.sorted.bam
ALLtrinity.sorted.bam.bai

I also tried changing the .bai file name to remove the ".bam" but that did not help. 

I also tried using the sam file and indexing it with IGVtools but that gave me a file error too and would not work.

Any help is greatly appreciated.

Cara

Jim Robinson

unread,
Mar 26, 2015, 1:52:39 PM3/26/15
to igv-...@googlegroups.com
Hi,

Dumb question,  but I assume you are loading ALLtrinity.sorted.bam, as opposed to ALLtrinity.bam.   Could you confirm?  

I'll need your igv.log file to help further.

Jim

Cara Fiore

unread,
Mar 26, 2015, 2:41:13 PM3/26/15
to igv-...@googlegroups.com
Hi Jim,

Thanks for the quick response. So I am not sure if this was my error or just needing to reboot the program because I actually tried all three files before this just in case. Now I just tried again after closing down the program and yes loading the sorted file works! I apologize for my confusion on this I had just been trying so many things! Thank you for your time!

Cara


touta....@gmail.com

unread,
Apr 23, 2020, 6:21:36 PM4/23/20
to igv-help

Hi, I am having a problem here, can you help me please, I am getting this msg and I am unable to view my sequence

Error loading C:\Users\TOSHIBA\Desktop\Diabetes stuff\PAHRMACOGENOMICS_BAASAM_10_11_19\A1_R_2~1.BAM: An error occurred while accessing: C:\Users\TOSHIBA\Desktop\Diabetes stuff\PAHRMACOGENOMICS_BAASAM_10_11_19\A1_R_2~1.BAM
Error loading BAM file: org.broad.igv.exceptions.DataLoadException: An error occurred while accessing: C:\Users\TOSHIBA\Desktop\Diabetes stuff\PAHRMACOGENOMICS_BAASAM_10_11_19\A1_R_2~1.BAM.bai
Index file not found. Tried
C:\Users\TOSHIBA\Desktop\Diabetes stuff\PAHRMACOGENOMICS_BAASAM_10_11_19\A1_R

James Robinson

unread,
Apr 23, 2020, 6:23:26 PM4/23/20
to igv-help
Does this file exist?   C:\Users\TOSHIBA\Desktop\Diabetes stuff\PAHRMACOGENOMICS_BAASAM_10_11_19\A1_R_2~1.BAM.bai



Reply all
Reply to author
Forward
0 new messages