The frontline support team will be unavailable to answer questions on April 15th and 17th 2019. We will be back soon after. Thank you for your patience and we apologize for any inconvenience!

MarkDuplicates error Value was put into PairInfoMap more than once

henahena FinlandMember
edited April 2016 in Ask the GATK team

I get this error from a MarkDuplicates and all the questions I've found online comment on merging fastq file and ending up with read name from more than one original fastq files. I get this error without having merged fastq files and only having one pair of reads in bam file with same name with flags 129 and 81 (so read 2 and read 1). Is there any other reason why this message could come up?

I'm using an older version of the Picard (as a part of pipeline) though so if there has been bugs in this area then I'm likely hitting them.


Issue · Github
by Sheila

Issue Number
Last Updated
Closed By


  • henahena FinlandMember

    I also got the same message with picard version 1.141 which I think is not that old version.

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin


    I will ask our Picard expert to get back to you. However, in the meantime, you can try using the latest version of Picard (2.2.1).


  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin


    Can you also try validating your bam file with ValidateSamFile?


  • henahena FinlandMember
    edited April 2016

    2.2.1 seems to create same error same as running ValidateSamFile in summary mode. Here is the stacktrace from the ValidateSamFile

    Exception in thread "main" htsjdk.samtools.SAMException: Value was put into PairInfoMap more than once. 1: HWI-xxxxxxx:111:C8LG3ANXX:8:2209:18364:77568
    at htsjdk.samtools.CoordinateSortedPairInfoMap.ensureSequenceLoaded(
    at htsjdk.samtools.CoordinateSortedPairInfoMap.remove(
    at htsjdk.samtools.SamFileValidator$CoordinateSortedPairEndInfoMap.remove(
    at htsjdk.samtools.SamFileValidator.validateMateFields(
    at htsjdk.samtools.SamFileValidator.validateSamRecordsAndQualityFormat(
    at htsjdk.samtools.SamFileValidator.validateSamFile(
    at htsjdk.samtools.SamFileValidator.validateSamFileSummary(
    at picard.sam.ValidateSamFile.doWork(
    at picard.cmdline.CommandLineProgram.instanceMain(
    at picard.cmdline.PicardCommandLine.instanceMain(
    at picard.cmdline.PicardCommandLine.main(

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    We've seen this error pop up for several different reasons; the main two are the fastq merging problem, and secondary hits not marked appropriately due to not using -M with BWA MEM. Not sure what's happening in your case, but if I remember the SAM flag rules correctly, the reads in a mate pair would have 129 and 65 respectively, or 161 and 81 (if on reverse strand). I think the program may not be recognizing that your reads are part of a mate pair because of that, and is instead considering them as part of different pairs. This could be caused by a mistake made by the aligner.

    If you only have one affected read pair out of your entire bam file I would advise just throwing out that one read pair and proceeding with your analysis. I believe you should be able to eliminate improperly paired reads by using samtools view -f 0x2 -- but don't take my word for it, read this blog post about sam flags and be sure to check the samtools docs too.

  • henahena FinlandMember

    The data is aligned with bwa aln + sampe, so there should not be secondary alignments. There is however single reads included but that has been working before only in this one read pair this problem has appeared. After removing that pair, it failed again with pair with flags 97 and 145 and after removing them as well I have pair again with 81 and 129. I also noticed that the mate information seems to be wrong on these reads and that they seem match other reads for some reason. Could this have an effect? I'm going to do name sort -> samtools fixmate -> position sort in order to see if that would help.

  • deklingdekling Broad InstituteMember admin

    Forgive my naiveté, but did you have a look at the following link? and the embedded links within?

Sign In or Register to comment.