abra2 icon indicating copy to clipboard operation
abra2 copied to clipboard

java.lang.IllegalArgumentException: Invalid reference index -1

Open ThanosPAS opened this issue 2 years ago • 1 comments

This my command:

java -Xmx1000g -jar /.../abra2-2.24-0/abra2.jar --sa --cons --amq 32 --in in.bam --out out.bam --ref ~/.../XENLA_9.2_genome.fa --threads 50 --targets /.../X9.2_opt_SORTED.bed --tmpdir /.../tmp > abra_s10.log

After running for 30min to an hour (Depending on the settings), it stop with the below message. Any idea why this is happening?

java.lang.IllegalArgumentException: Invalid reference index -1 at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24) at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:528) at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.queryOverlapping(SamReader.java:390) at abra.MultiSamReader.<init>(MultiSamReader.java:40) at abra.ReAligner.processChromosomeChunk(ReAligner.java:262) at abra.ReAlignerRunnable.go(ReAlignerRunnable.java:21) at abra.AbraRunnable.run(AbraRunnable.java:20) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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)

ThanosPAS avatar Oct 14 '21 21:10 ThanosPAS

I just stumbled across this having the same issue.

In my case I was just evaluating abra2 on a small section of GIAB data aligned against GRCh38. Producing a new ref.fa file for the single chromosome I was interested in cured it. It shouldn't have made any difference, as the other references don't appear in my small file snippet, but the fact it did implies there's something in the reference rather than the BAM file which is triggering this bug.

My guess (I haven't tested) is it's related to the spectacularly daft reference names added to GRCh38, such as "HLA-A*01:01:01:01". If you still have this error, it may be worth bisecting your reference to work out which ref sequences are triggering the bug.

jkbonfield avatar Dec 07 '21 12:12 jkbonfield