This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Getting "Mismatch between read length and quals length" error in SortSam.

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

show us the output of

grep -F  'E00170:444:HG3MJALXX:2:1210:10216:16059' in.sam

The output is:

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

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

0 answers

No answers yet.

Log in to answer this question.