vadimzalunin/crammer — Issue #4: illegal argument exception v0.5
Author: calkan
Created: 2011-11-02 21:09:07+00:00
State: open

Hi

Using v 0.5, I first converted BAM->CRAM (with the read quality mask):

java -d64 -jar cramtools.jar cram --input-bam-file SRR034940.sort.bam --output-cram-file SRR034940.sortv05.cram --reference-fasta-file hg19.fasta --read-quality-mask-file readmask.pos --capture-unmapped-quality-scores. Question here: I *had to* read the java code to find the --read-quality-mask and --capture-unmapped-quality-scores parameters. Are these sufficient to keep the unmapped reads? Another question here: I used the readmask.pos file that came in with the package, is this an "officially recommended" RQM file? The documentation on RQM is not comprehensive and clear. My data is 100bp PE human WGS.

When reconverting to BAM from CRAM:
java -d64 -jar cramtools.jar bam --output-bam-file SRR034940.sortv05.bam --input-cram-file SRR034940.sortv05.cram --reference-fasta-file ~hg19.fasta

I get:

ERROR Cram2Bam - Offensive SAM record: 32840312 100b unmapped read.
ERROR Cram2Bam - SAM record al start=59033765
Exception in thread "main" java.lang.IllegalArgumentException: Alignments added out of order in SAMFileWriterImpl.addAlignment for SRR034940.sortv05.bam. Sort order is coordinate. Offending records are at [*:0] and [chrY:59033765]
at net.sf.samtools.SAMFileWriterImpl.assertPresorted(SAMFileWriterImpl.java:164)
at net.sf.samtools.SAMFileWriterImpl.addAlignment(SAMFileWriterImpl.java:154)
at uk.ac.ebi.ena.sra.cram.Cram2Bam.writeSAMRecord(Cram2Bam.java:342)
at uk.ac.ebi.ena.sra.cram.Cram2Bam.convert(Cram2Bam.java:308)
at uk.ac.ebi.ena.sra.cram.Cram2Bam.main(Cram2Bam.java:89)
at uk.ac.ebi.ena.sra.cram.CramTools.main(CramTools.java:53)