MergeBamAlignment Error: ArrayIndexOutOfBoundsException
Using PicardTools 2.18.7
java -jar picard.jar MergeBamAlignment \
12 ALIGNED=mapped_RG.bam \
13 UNMAPPED=unmapped_RG.bam \
14 O=merged.bam \
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 147 out of bounds for length 147
Both BAM files have been validated using ValidateSamFile in summary mode, no warnings or errors.
Have tried OpenJDK 1.8.0_152 and OpenJDK Version "11" 2018-09-25, received the same error both times
Have also run with Oracle 1.8, same error
This is most likely an issue related to formatting or mismatches in read length between files.
In Java, the ArrayIndexOutOfBoundsException is usually outputted when an index is passed to an array that doesn’t contain an element at that particular index location. In other words, the code is trying to put something into a set when there is no room for it, and Java identifies that as being "out of bounds".
Please see this post for more information.
I don't know the specifics of your files, but it is possible that you have a mismatch in read lengths, possibly from when you trimmed them. Alternately, one of your mapped BAM files may be formatted differently than your unmapped BAM file.
You might want to run your files through ValidateSamFile beforehand.
My original BAM file had some messed up alignments in it. I made a new BAM file and solved the issue. Thank you
Please sign in to leave a comment.