broadinstitute / picard

A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) data and formats such as SAM/BAM/CRAM and VCF.
https://broadinstitute.github.io/picard/
MIT License
975 stars 369 forks source link

FixMateInformation crash #161

Closed biogberg closed 9 years ago

biogberg commented 9 years ago

Hi, There seems to be a problems with FixMateInformation crashing with

Exception in thread "main" java.lang.NullPointerException at htsjdk.samtools.SamPairUtil.setMateInformationOnSupplementalAlignment(SamPairUtil.java:300) at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.advance(SamPairUtil.java:442) at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.next(SamPairUtil.java:454) at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.next(SamPairUtil.java:360) at picard.sam.FixMateInformation.doWork(FixMateInformation.java:194) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:185) at picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:125) at picard.sam.FixMateInformation.main(FixMateInformation.java:93)

The problem first appeared in version 1.121. It is present in version 1.128. Versions prior to 1.120 worked and continue to work fine. I am currently using Java 1.7.0_75, but I observed the same problem with earlier version of Java. The problem occurs under several different version of Fedora.

The command lines I am using are:

java -jar picard-1.128/picard.jar FixMateInformation INPUT=test.bam OUTPUT=fixed.bam VALIDATION_STRINGENCY=SILENT (fails)

java -jar picard-1.121/FixMateInformation.jar INPUT=test.bam OUTPUT=fixed.bam VALIDATION_STRINGENCY=SILENT (fails)

java -jar picard-1.120/FixMateInformation.jar INPUT=test.bam OUTPUT=fixed.bam VALIDATION_STRINGENCY=SILENT (succeeds)

I have observed the problem with various BAM files. This one is (a small subset of) the output of an indel realignment with GATK.

Best regards,

Bernt

nh13 commented 9 years ago

Hey Bernt, is there any reason to have VALIDATION_STRINGENCY=SILENT there? Can you put it to LENIENT or STRICT? Alternatively, you could run the ValidateSamFile tool on the input BAM. In both cases, could you post any warnings or errors here? Finally, could you provide the input BAM file for us to verify if there is a bug? @vdauwera

biogberg commented 9 years ago

Hi,

Thank you for taking an interest! I tried to reply via Github, but it does not accept .bam attachments. I had chosen STRINGENT as it has become my "mental default" setting for Picard. Omitting STRINGENT does not change the output - I will not reproduce the output here.

ValidateSam produces:

java -jar /opt/ghpc/picard-1.121/ValidateSamFile.jar INPUT=test.bam OUTPUT=out.bam [Wed Feb 18 08:48:40 CET 2015] picard.sam.ValidateSamFile INPUT=test.bam OUTPUT=out.bam MODE=VERBOSE MAX_OUTPUT=100 IGNORE_WARNINGS=false VALIDATE_INDEX=true IS_BISULFITE_SEQUENCED=false MAX_OPEN_TEMP_FILES=8000 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false [Wed Feb 18 08:48:40 CET 2015] Executing as bernt@interactive.ghpc.dk on Linux 2.6.35.14-106.fc14.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_75-b13; Picard version: 1.121(da291b4d265f877808b216dce96eaeffd2f30bd3_1411396652) IntelDeflater [Wed Feb 18 08:48:41 CET 2015] picard.sam.ValidateSamFile done. Elapsed time: 0.01 minutes. Runtime.totalMemory()=505937920 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp

A tiny BAM test file ( ~6700 reads, 450kb) that produces the problem is attached.

Best regards,

Bernt

From: Nils Homer [mailto:notifications@github.com] Sent: 17. februar 2015 20:58 To: broadinstitute/picard Cc: Bernt Guldbrandtsen Subject: Re: [picard] FixMateInformation crash (#161)

Hey Bernt, is there any reason to have VALIDATION_STRINGENCY=SILENT there? Can you put it to LENIENT or STRICT? Alternatively, you could run the ValidateSamFile tool on the input BAM. In both cases, could you post any warnings or errors here? Finally, could you provide the input BAM file for us to verify if there is a bug? @vdauwerahttps://github.com/vdauwera

— Reply to this email directly or view it on GitHubhttps://github.com/broadinstitute/picard/issues/161#issuecomment-74740573.

biogberg commented 9 years ago

Hi,

The problem also exists in the new version, 1.129.

Bernt

vdauwera commented 9 years ago

Hi @biogberg,

We are moving Picard support to the GATK forum, so if you post your question there we'll be able to help you further. When you do, please let us know if your bam file pass ValidateSAMFile successfully, or if not, what are the errors.

If necessary we'll be able to take in your bam file through the GATK's GSA FTP for incoming files.

vdauwera commented 9 years ago

Following up in http://gatkforums.broadinstitute.org/discussion/5371/picard-fixmateinformation-crash