dieterich-lab / JACUSA2

New version of JACUSA -> 2.0
GNU General Public License v3.0
23 stars 3 forks source link

java.nio.BufferUnderflowException #49

Closed YibiChen closed 3 years ago

YibiChen commented 3 years ago

Hi,

I got a java.nio.BufferUnderflowException exception after running JACUSA2 for about 30 mins with the following command: java -Xmx50g -jar ~/programs/JACUSA/JACUSA_v2.0.0-RC22.jar call-2 -p $NCPUS -F 1024 -P2 RF-FIRSTSTRAND -r $condition.out -s -a D,Y,H:condition=1 Dedup_genome.bam Dedup_${condition}_rep1_hisat2.sorted.bam,Dedup_${condition}_rep2_hisat2.sorted.bam,Dedup_${condition}_rep3_hisat2.sorted.bam,Dedup_${condition}_rep4_hisat2.sorted.bam

I am wondering why did I get this error and how can I get through it? I suspect it might be caused by the large size of my bam files. My genome bam is 120G and each RNA-seq bam is about 4G.

The full error message is attached here: java.nio.BufferUnderflowException at java.nio.Buffer.nextGetIndex(Buffer.java:506) at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:681) at htsjdk.samtools.AbstractBAMFileIndex$MemoryMappedFileBuffer.readInteger(AbstractBAMFileIndex.java:498) at htsjdk.samtools.AbstractBAMFileIndex.readInteger(AbstractBAMFileIndex.java:442) at htsjdk.samtools.AbstractBAMFileIndex.query(AbstractBAMFileIndex.java:279) at htsjdk.samtools.CachingBAMFileIndex.getQueryResults(CachingBAMFileIndex.java:163) at htsjdk.samtools.CachingBAMFileIndex.getSpanOverlapping(CachingBAMFileIndex.java:66) at htsjdk.samtools.BAMFileReader.getFileSpan(BAMFileReader.java:898) at htsjdk.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:915) at htsjdk.samtools.BAMFileReader.query(BAMFileReader.java:575) at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:528) at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:533) at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.queryOverlapping(SamReader.java:395) at lib.util.coordinate.provider.SAMCoordinateAdvancedProvider.getNextCoveredPosition(SAMCoordinateAdvancedProvider.java:161) at lib.util.coordinate.provider.SAMCoordinateAdvancedProvider.searchNext(SAMCoordinateAdvancedProvider.java:134) at lib.util.coordinate.provider.SAMCoordinateAdvancedProvider.hasNext(SAMCoordinateAdvancedProvider.java:92) at lib.worker.WorkerDispatcher.hasNext(WorkerDispatcher.java:60) at lib.worker.AbstractWorker.processInit(AbstractWorker.java:177) at lib.worker.AbstractWorker.run(AbstractWorker.java:218)

I tried to re-run the sam command with more memory, but it always stoped at the same scaffold.

YibiChen commented 3 years ago

I confirmed that this is caused by the large size of my bam files. After I performed a radnom sampling on the bam file genome reads, it runs smoothly.