Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When browsing bam file: "Error: java.util.concurrent.CompletionException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1" #506

Closed
winni2k opened this issue Jan 14, 2018 · 6 comments

Comments

@winni2k
Copy link

winni2k commented Jan 14, 2018

I have previously mentioned this error in #499 and #277, but here is a complete report with a small test case: igv_test_case.tar.gz

This bam file was created by mapping all the contigs in one percent of the P. abies coding sequence to itself.

When I open igv 2.4.5 (installed using homebrew) on my mac running MacOS 10.11.6, and when I load the genome Pabies1.0-all-cds.1pc.fna, and I load the file Pabies1.0-all-cds.1pc.bam, and I navigate to the first contig, and then I navigate to the second contig, and then I navigate to the third contig, then my mouse turns into a blue ball that sort of turns, and I never see any data, and the following error appears in my console:

WARN [2018-01-17 22:59:00,731]  [Globals.java:138] [AWT-EventQueue-0]  Development mode is enabled
INFO [2018-01-17 22:59:00,769]  [DirectoryManager.java:171] [AWT-EventQueue-0]  IGV Directory: /Users/winni/igv
INFO [2018-01-17 22:59:00,769] [DirectoryManager.java:171]  IGV Directory: /Users/winni/igv
INFO [2018-01-17 22:59:00,773]  [Main.java:154] [AWT-EventQueue-0]  Startup  IGV Version 2.4.5 12/14/2017 01:18 AM
INFO [2018-01-17 22:59:00,774]  [Main.java:155] [AWT-EventQueue-0]  Java 1.8.0_31
INFO [2018-01-17 22:59:00,774]  [DirectoryManager.java:76] [AWT-EventQueue-0]  Fetching user directory... 
INFO [2018-01-17 22:59:00,971]  [Main.java:156] [AWT-EventQueue-0]  Default User Directory: /Users/winni
INFO [2018-01-17 22:59:00,972]  [Main.java:157] [AWT-EventQueue-0]  OS: Mac OS X


INFO [2018-01-17 22:59:15,868]  [GenomeManager.java:182] [pool-2-thread-1]  Loading genome: /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/olof/spruce/data/DAL19_sequences.fa
INFO [2018-01-17 22:59:15,887]  [GenomeComboBox.java:79] [AWT-EventQueue-0]  Enter genome combo box
INFO [2018-01-17 22:59:16,751]  [GenomeComboBox.java:79] [AWT-EventQueue-0]  Enter genome combo box
INFO [2018-01-17 22:59:16,764]  [GenomeManager.java:271] [pool-2-thread-1]  Genome loaded.  id= /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/olof/spruce/data/DAL19_sequences.fa
INFO [2018-01-17 22:59:16,902]  [CommandListener.java:120] [Thread-7]  Listening on port 60151
INFO [2018-01-17 22:59:33,870]  [GenomeComboBox.java:79] [AWT-EventQueue-0]  Enter genome combo box
INFO [2018-01-17 22:59:33,871]  [GenomeComboBox.java:85] [AWT-EventQueue-0]  Loading Pabies1.0-all-cds.fna
INFO [2018-01-17 22:59:33,873]  [GenomeComboBox.java:96] [pool-2-thread-2]  Loading /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/igv_test_case/Pabies1.0-all-cds.fna
INFO [2018-01-17 22:59:34,011]  [GenomeManager.java:182] [pool-2-thread-2]  Loading genome: /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/igv_test_case/Pabies1.0-all-cds.fna
INFO [2018-01-17 22:59:34,864]  [GenomeComboBox.java:79] [AWT-EventQueue-0]  Enter genome combo box
INFO [2018-01-17 22:59:36,235]  [GenomeComboBox.java:79] [AWT-EventQueue-0]  Enter genome combo box
INFO [2018-01-17 22:59:36,322]  [GenomeManager.java:271] [pool-2-thread-2]  Genome loaded.  id= /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/igv_test_case/Pabies1.0-all-cds.fna
INFO [2018-01-17 22:59:53,700]  [IGV.java:1383] [pool-2-thread-3]  Loading 1 resources.
INFO [2018-01-17 22:59:53,703]  [TrackLoader.java:126] [pool-2-thread-3]  Loading resource, path /Volumes/mac-3/home/to_be_backupped_unsensitive/Projects/igv_test_case/Pabies1.0-all-cds.1pc.bam
ERROR [2018-01-17 22:59:54,274]  [BAMReader.java:172] [pool-1-thread-3]  Error querying for sequence: MA_9553451g0010
java.lang.IllegalArgumentException: Invalid reference index -1
	at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
	at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:533)
	at org.broad.igv.sam.reader.BAMReader.query(BAMReader.java:169)
	at org.broad.igv.sam.AlignmentTileLoader.loadTile(AlignmentTileLoader.java:161)
	at org.broad.igv.sam.AlignmentDataManager.loadInterval(AlignmentDataManager.java:351)
	at org.broad.igv.sam.AlignmentDataManager.load(AlignmentDataManager.java:295)
	at org.broad.igv.sam.CoverageTrack.load(CoverageTrack.java:184)
	at org.broad.igv.ui.panel.DataPanel.lambda$load$3(DataPanel.java:225)
	at org.broad.igv.ui.panel.DataPanel$$Lambda$47/1847216415.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:454)
	at java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
ERROR [2018-01-17 22:59:57,842]  [BAMReader.java:172] [pool-1-thread-1]  Error querying for sequence: MA_934111g0010
java.lang.IllegalArgumentException: Invalid reference index -1
	at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
	at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:533)
	at org.broad.igv.sam.reader.BAMReader.query(BAMReader.java:169)
	at org.broad.igv.sam.AlignmentTileLoader.loadTile(AlignmentTileLoader.java:161)
	at org.broad.igv.sam.AlignmentDataManager.loadInterval(AlignmentDataManager.java:351)
	at org.broad.igv.sam.AlignmentDataManager.load(AlignmentDataManager.java:295)
	at org.broad.igv.sam.CoverageTrack.load(CoverageTrack.java:184)
	at org.broad.igv.ui.panel.DataPanel.lambda$load$3(DataPanel.java:225)
	at org.broad.igv.ui.panel.DataPanel$$Lambda$47/1847216415.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:454)
	at java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
ERROR [2018-01-17 22:59:57,878]  [BAMReader.java:172] [pool-1-thread-2]  Error querying for sequence: MA_934111g0010
java.lang.IllegalArgumentException: Invalid reference index -1
	at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
	at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:533)
	at org.broad.igv.sam.reader.BAMReader.query(BAMReader.java:169)
	at org.broad.igv.sam.AlignmentTileLoader.loadTile(AlignmentTileLoader.java:161)
	at org.broad.igv.sam.AlignmentDataManager.loadInterval(AlignmentDataManager.java:351)
	at org.broad.igv.sam.AlignmentDataManager.load(AlignmentDataManager.java:295)
	at org.broad.igv.sam.AlignmentTrack.load(AlignmentTrack.java:426)
	at org.broad.igv.ui.panel.DataPanel.lambda$load$3(DataPanel.java:225)
	at org.broad.igv.ui.panel.DataPanel$$Lambda$47/1847216415.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:454)
	at java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
ERROR [2018-01-17 23:00:02,451]  [BAMReader.java:172] [pool-1-thread-3]  Error querying for sequence: MA_10027g0010
java.lang.IllegalArgumentException: Invalid reference index -1
	at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
	at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:533)
	at org.broad.igv.sam.reader.BAMReader.query(BAMReader.java:169)
	at org.broad.igv.sam.AlignmentTileLoader.loadTile(AlignmentTileLoader.java:161)
	at org.broad.igv.sam.AlignmentDataManager.loadInterval(AlignmentDataManager.java:351)
	at org.broad.igv.sam.AlignmentDataManager.load(AlignmentDataManager.java:295)
	at org.broad.igv.sam.CoverageTrack.load(CoverageTrack.java:184)
	at org.broad.igv.ui.panel.DataPanel.lambda$load$3(DataPanel.java:225)
	at org.broad.igv.ui.panel.DataPanel$$Lambda$47/1847216415.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:454)
	at java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
ERROR [2018-01-17 23:00:02,466]  [DataPanel.java:252] [pool-1-thread-3]  Error: 
java.util.concurrent.CompletionException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.concurrent.CompletableFuture.internalComplete(CompletableFuture.java:205)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:459)
	at java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.remove(ArrayList.java:492)
	at java.util.Collections$SynchronizedList.remove(Collections.java:2426)
	at org.broad.igv.sam.AlignmentDataManager.trimCache(AlignmentDataManager.java:333)
	at org.broad.igv.sam.AlignmentDataManager.load(AlignmentDataManager.java:297)
	at org.broad.igv.sam.CoverageTrack.load(CoverageTrack.java:184)
	at org.broad.igv.ui.panel.DataPanel.lambda$load$3(DataPanel.java:225)
	at org.broad.igv.ui.panel.DataPanel$$Lambda$47/1847216415.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:454)
	... 4 more

Further observations:

  • If I then try to load another file, then igv does nothing and remains on the blue ball.
  • I can reset everything by sending a SIGKILL to igv and starting igv from scratch.
  • if I navigate to the problem contig first, then it loads ok, but after a few navigations it tends to stop working
@winni2k winni2k changed the title When browsing bam file: Error: java.util.concurrent.CompletionException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 When browsing bam file: "Error: java.util.concurrent.CompletionException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1" Jan 14, 2018
@jrobinso
Copy link
Contributor

Thanks for the test case. I will try to reproduce ASAP.

@jrobinso
Copy link
Contributor

Could you elaborate on what you mean by "first contig, second, etc"? I loaded the bam and hit the first 3 in the list from the pulldown menu. They all had a single read, and no issues. Then I hit a number of others at random. Same result, single read and no issues.

I might be able to address the problem from the stack trace you provided but would like to reproduce it if possible. Should I expect different coverage (more than 1 read per contig)?

@winni2k
Copy link
Author

winni2k commented Jan 17, 2018

This bam is just a bunch of contigs mapped back to themselves, so you should expect 1 read per contig.

The issue does not always happen on the third contig (MA_10027g0010). Sometimes I have to navigate to a few more before returning to the third contig before the error happens.

I have gone through the steps above again and I am updating the original post with the full igv run log.

@jrobinso
Copy link
Contributor

jrobinso commented Jan 17, 2018

I just can't get it to happen. Could you share your prefs.properties file? Its possible some non-default preference is needed to set this off. Otherwise I can work with the stack trace, try to address or protect agains those errors, then ask you to try again.

@jrobinso
Copy link
Contributor

jrobinso commented Jan 18, 2018

Studying your stacktrace, it looks like this bug could be fixed with release 2.4.6. Could you try that version and let me know? You can download it from http://software.broadinstitute.org/software/igv/download

We do not create the homebrew installation, I'm not sure where that comes from or how its updated.

@winni2k
Copy link
Author

winni2k commented Jan 18, 2018

I can confirm that igv 2.4.6 appears to work on the test case data. I'll reopen this issue if I the problem persists.

@winni2k winni2k closed this as completed Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants