I am trying to run bamqc from QualiMap v.1.0 on quite a big BAM (WGS data with 1.5 billion reads) and I am getting the following java.lang.ArrayIndexOutOfBoundsException error:
Java memory size is set to 128G
Launching application...
QualiMap v.1.0
Built on 2014-05-29 11:34
Selected tool: bamqc
Available memory (Mb): 32
Max memory (Mb): 122168
Fri Dec 05 09:31:04 EST 2014 WARNING output folder already exists
Starting bam qc....
Loading sam header...
Loading locator...
Loading reference...
Number of windows: 400, effective number of windows: 483
Chunk of reads size: 1000
Number of threads: 40
Processed 50 out of 483 windows...
Processed 100 out of 483 windows...
Processed 150 out of 483 windows...
Processed 200 out of 483 windows...
Processed 250 out of 483 windows...
Processed 300 out of 483 windows...
Processed 350 out of 483 windows...
Processed 400 out of 483 windows...
Processed 450 out of 483 windows...
Total processed windows:483
Number of reads: 1477874142
Number of valid reads: 1477874142
Number of duplicated reads: 0
Number of correct strand reads:0
Inside of regions...
Num mapped reads: 1477874142
Num mapped first of pair: 734603929
Num mapped second of pair: 743270213
Num singletons: 40751869
Time taken to analyze reads: 11492
Computing descriptors...
numberOfMappedBases: 134388071242
referenceSize: 3101804741
numberOfSequencedBases: 133657463976
numberOfAs: 40136063368
Computing per chromosome statistics...
Computing histograms...
java.lang.ArrayIndexOutOfBoundsException: -432634231
at java.util.ArrayList.elementData(ArrayList.java:371)
at java.util.ArrayList.get(ArrayList.java:384)
at org.bioinfo.ngs.qc.qualimap.beans.BamStats.computeInsertSizeHistogram(BamStats.java:975)
at org.bioinfo.ngs.qc.qualimap.beans.BamStats.computeHistograms(BamStats.java:793)
at org.bioinfo.ngs.qc.qualimap.process.BamStatsAnalysis.run(BamStatsAnalysis.java:488)
at org.bioinfo.ngs.qc.qualimap.main.BamQcTool.execute(BamQcTool.java:211)
at org.bioinfo.ngs.qc.qualimap.main.NgsSmartTool.run(NgsSmartTool.java:177)
at org.bioinfo.ngs.qc.qualimap.main.NgsSmartMain.main(NgsSmartMain.java:102)
I randomly sampled this BAM file and Qualimap run fine on small sampled file. I also was able to run bamqc on each chromosome by splitting BAM file into chromosome-based bam files.
Looks like Qualimap has problem with big BAM file. I was researching the web for this qualimap error but wasn't able to find anything related to my issue.