vadimzalunin/crammer — Issue #7: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 18436
Author: ghuls
Created: 2012-01-02 15:57:29+00:00
State: open

When trying to convert a BAM file to CRAM, I get:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 18436

Also "N" isn't supported:

/software/samtools/current/samtools view /media/datastore6/lcb/NGS_cancer/cell_lines/PEER/RNA/PEER-rg.bam|mawk '{ if ($6 ~ /N/) { print $0} }' |head -n 10
HWI-ST571:101:C05TJACXX:5:1104:4705:185891	147	chr1	14732	3	98M140N3M	=	14708	-265	TGGCTGCTGCGGTGGCGGCAGAGGAGGGATGGAGTCTGACACGCGGGCAAAGGCTCCTCCGGGCCCCTCACAAGCCCCAGGTCTTTTCCCAGAGATGCCCT	@DDDB<@<95:>CCC???@8A>>:@4C>>:483;;;/86663@?7?;1CA/@/B@:7?B:*??1:)FHE@;EFHEFE@EGGFB<ACCA?<9?73;=DAB>??BAA?C((:@BBCACCCC@<	RG:Z:1	NH:i:1	NM:i:5	XS:A:-
HWI-ST571:101:C05TJACXX:5:1202:20020:127456	147	chr1	14733	255	97M140N4M	=	14519	-455	GGCTGCTGCGGTGGCGGCAGAGGAGGGATGGAGTCTGACACGCGGGCAAAGGCTCCTCCGGGCCCCTCACCAGCCCCAGGTCCTTTCCCAGAGATGCCCTT	@DDDBDDDDDDBB@DDDCCCCDCADACCDDDDCCCDBB@8?@BCCCCCCCAEB?EA6>IFIIHIIGGGBHEGJGHGF;EIGGJJIIIHF?DDHD;DDF@@B	RG:Z:1	NH:i:1	NM:i:0	XS:A:-
HWI-ST571:101:C05TJACXX:5:1304:8517:3384	145	chr1	14733	3	97M140N4M	=	14453	-521	GGCTGCTGCGGTGGCGGCAGAGGAGGGATGGAGTCTGACACGCGGGCAAAGGCTCCTCCGGGCCCCTCACCAGCCCCAGGTCCTTTCCCAGAGATGCCCTT	DC?BDDDDDDDDDDADCDA@DBDDDDCACCCA?BFBHEGHGIIGHGGHDBBGFJIIGFGAIIIIGJJJIGFGHGHFDD@DC@@	RG:Z:1	NH:i:1	NM:i:0	XS:A:-
HWI-ST571:101:C05TJACXX:5:2206:13704:35405	403	chr1	14733	3	97M140N4M	=	14722	-252	GGCTGCTGCGGTGGCGGCAGAGGAGGGATGGAGTCTGACACGCGAGCAAAGGCTCCTCCGGGCCCCTCACCAGCCCCAGGTCCTTTCCCAGAGATGCCCTT	ABB?BDBDDDBDDBDCDCDDDB?CDBCCC@>@3CDCBD@=DDDCDEEECAA?FFHHJJJIHBFCIHGGBJJJIGGGGHJHFHDJJJIGGHFFHFDFFFCCC	CC:Z:chr15	RG:Z:1	NH:i:2	HI:i:0	NM:i:1	CP:i:102516192	XS:A:-
HWI-ST571:101:C05TJACXX:5:1101:21075:48382	345	chr1	14734	1	96M140N5M	*	0	0	GCTGCTGCGTTGGCGGCAGAGGAGGTATGGAGTCTGACACGCGGGCAAAGGCTCCTCCGGGCCCCTCACCAGCCCCAGGTCCTTTCCCAGAGATGCCCACG	#####B@??595&54((:9<8A><9(DC@>A>>A>?5;;B?BCC>@;3C=;(?EEEEGGHEGGHD@BBIIIEGGGCGDGHGEGGBIJIHFFDDDDDA=:@?	CC:Z:chr12	RG:Z:1	NH:i:3	HI:i:0	NM:i:4	CP:i:90651	XS:A:-
HWI-ST571:101:C05TJACXX:5:1101:10593:112092	153	chr1	14734	1	96M140N5M	*	0	0	GCTGCTGCGGTGGCGGCAGAGGAGGGATGGAGTCTGACACGCGGGCAAAGGCTCCTCCGGGCCCCTCGCCAGCCCCAGGTCCTTTCCCAGAGATGCCCTTG	3:>3@::+((A;<753@>55(C>552;533/=9/4/;;F??6)??8?C?8298C3;;;G@>BA:DAA2+1:A+?;?	CC:Z:chr12	RG:Z:1	NH:i:3	HI:i:0	NM:i:1	CP:i:90651	XS:A:-

$ java -jar cramtools.jar cram --input-bam-file ./PEER-rg.bam --output-cram-file ./PEER.cram --reference-fasta-file ./Homo_sapiens_assembly19_sorted.fasta
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
java.lang.IllegalArgumentException: Unsupported cigar operator: N
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createVariations(Sam2CramRecordFactory.java:210)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.checkedCreateVariations(Sam2CramRecordFactory.java:147)
at uk.ac.ebi.ena.sra.cram.bam.Sam2CramRecordFactory.createCramRecord(Sam2CramRecordFactory.java:116)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.buildCramRecord(Bam2Cram.java:402)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.writeSAMRecord(Bam2Cram.java:368)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.addSAMRecord(Bam2Cram.java:357)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressRecord(Bam2Cram.java:285)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:249)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 18436
at net.sf.samtools.AbstractBAMFileIndex.query(AbstractBAMFileIndex.java:313)
at net.sf.samtools.DiskBasedBAMFileIndex.getSpanOverlapping(DiskBasedBAMFileIndex.java:55)
at net.sf.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:549)
at net.sf.samtools.BAMFileReader.query(BAMFileReader.java:315)
at net.sf.samtools.SAMFileReader.query(SAMFileReader.java:512)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.compressAllRecordsForSequence2(Bam2Cram.java:205)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.run(Bam2Cram.java:168)
at uk.ac.ebi.ena.sra.cram.Bam2Cram.main(Bam2Cram.java:446)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:55)