Strange RevertSam error

I recently came across this error using RevertSam, and haven't been able to find forums related to this issue. Any idea what might be causing this?

To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Cannot determine candidate qualities: no qualities found.
at htsjdk.samtools.util.QualityEncodingDetector.generateCandidateQualities(QualityEncodingDetector.java:228)
at htsjdk.samtools.util.QualityEncodingDetector.generateBestGuess(QualityEncodingDetector.java:379)
at htsjdk.samtools.util.QualityEncodingDetector.detect(QualityEncodingDetector.java:332)
at picard.sam.RevertSam.createReadGroupFormatMap(RevertSam.java:528)
at picard.sam.RevertSam.doWork(RevertSam.java:265)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:205)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:94)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:104)

Tagged:

Answers

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin

    @JakeC
    Hi,

    It looks like your base qualities are missing. How did you process the BAM file before inputting it in RevertSam? Can you try running ValidateSamFile on your BAM?

    Thanks,
    Sheila

  • amywilliamsamywilliams Ithaca, NYMember
    edited November 2017

    I'm getting this same error, but it only arises when I pipe input to RevertSam. That is,

    samtools view -h sample.bam chr1:11042000-11443000 | java -Xmx8G -jar $picard RevertSam I=/dev/stdin ...

    gives an error (see below) whereas

    samtools view -h sample.bam chr1:11042000-11443000 > tmp.sam
    java -Xmx8G -jar $picard RevertSam I=tmp.sam ...

    succeeds.

    The error from the first command is as follows:

    Exception in thread "main" htsjdk.samtools.SAMException: Cannot determine candidate qualities: no qualities found.
    at htsjdk.samtools.util.QualityEncodingDetector.generateCandidateQualities(QualityEncodingDetector.java:228)
    at htsjdk.samtools.util.QualityEncodingDetector.generateBestGuess(QualityEncodingDetector.java:382)
    at htsjdk.samtools.util.QualityEncodingDetector.detect(QualityEncodingDetector.java:335)
    at picard.sam.RevertSam.createReadGroupFormatMap(RevertSam.java:535)
    at picard.sam.RevertSam.doWork(RevertSam.java:272)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:268)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:98)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:108)

    I need to do a small amount of processing on the BAM before running RevertSam and would prefer not to have to write a temporary file for this. Is a written bam necessary?

    Issue · Github
    by Sheila

    Issue Number
    2714
    State
    closed
    Last Updated
    Assignee
    Array
    Milestone
    Array
    Closed By
    sooheelee
  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin

    @amywilliams
    Hi,

    It does seem like the written BAM is necessary, but I will check with the team and see if there is a workaround.

    -Sheila

  • shleeshlee CambridgeMember, Administrator, Broadie, Moderator admin

    Hi again @amywilliams,

    Please let me know which version of Picard you are using. If you are using the latest, v2.15.0, can you try your commands with v2.14.1? As you are aware, there is a bug in v2.15.0 has led to other inexplicable errors that you yourself have reported.

    Otherwise, I am aware of Picard FifoBuffer that may be helpful to you:

    Provides a large, configurable, FIFO buffer that can be used to buffer input and output streams between programs with a buffer size that is larger than that offered by native unix FIFOs (usually 64k).

  • amywilliamsamywilliams Ithaca, NYMember

    Hi @shlee, this is using v2.14.1. I'll see about using FifoBuffers and will try to follow up on how that goes.

Sign In or Register to comment.