Getting "Mismatch between read length and quals length" error in SortSam.
0
0
Entering edit mode
5.6 years ago

I am running Picard's SortSam (with VALIDATION_STRINGENCY = LENIENT) and I'm getting the following error. The SAM file was generated using BWA mem. I'm not familiar with this issue and haven't found much information on it. How can I resolve this?

Here is the stack trace:

Exception in thread "main" java.lang.RuntimeException: Mismatch between read length and quals length writing read E00170:444:HG3MJALXX:2:1210:10216:16059; read length: 151; quals length: 32 
      at htsjdk.samtools.BAMRecordCodec.encode(BAMRecordCodec.java:170) 
      at htsjdk.samtools.BAMRecordCodec.encode(BAMRecordCodec.java:40) 
      at htsjdk.samtools.util.SortingCollection.spillToDisk(SortingCollection.java:255) 
      at htsjdk.samtools.util.SortingCollection.doneAdding(SortingCollection.java:220) 
      at htsjdk.samtools.util.SortingCollection.iterator(SortingCollection.java:291) 
      at htsjdk.samtools.SAMFileWriterImpl.close(SAMFileWriterImpl.java:223) at picard.sam.SortSam.doWork(SortSam.java:167) 
      at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:282)
      at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103) 
      at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
genome picard sortsam • 1.3k views
ADD COMMENT
0
Entering edit mode

show us the output of

grep -F  'E00170:444:HG3MJALXX:2:1210:10216:16059' in.sam
ADD REPLY
0
Entering edit mode

The output is:

E00170:444:HG3MJALXX:2:1210:10216:16059 99      chr2    91792176        42      151M    =       91792243     218      AGCCCTTCTCAATAGCCATTTTGAAATATATCAAGGAAATATATTTAGGGGTAAAATATATTAGTTTCCCTCATACAGCTATAAAACATACAGGAATAATTTTTGTCAATGTCTACTACAAATCCAATATAGCAGTAATTATAAAACTCAC       ?<<==>><=<==<=====<====<==<=<=<<
ADD REPLY
2
Entering edit mode

you sam file is truncated. That's not a problem with picard but with your upstream process.

ADD REPLY

Login before adding your answer.

Traffic: 1748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6