5
$\begingroup$

I have a RNA-seq bam file and there are few reads that are puzzling me.

According to the bam header, this bam file is sorted by coordinate, created using tophat and markduplicate step is not done. But some reads are marked for being duplicate in the samflag. What is worse is when I run picard markduplicate, these reads' pcr duplicate flag is toggled, marking them not a duplicate. Also I manually found the duplicate of this read (identical reads with same start positions and mates start position) so initial marking looks true.

So my questions are:

Any idea why would this happen?

Does Tophat mark reads for being duplicate? ( I don't think so) And does picard markduplicate toggle the duplicate flag if the reads are already marked as being duplicates?

Here is how the read looks before and after mark duplicate step.

Before:

C0RTF 1187 17 7579880 255 61M10754N40M = 7579927 10902 CTC... 
0UNP1 163 17 7579880 255 61M10754N40M = 7579927 10902 CTC... 

After Markduplicate:

C0RTF 163 17 7579880 255 61M10754N40M = 7579927 10902 CTC... 
0UNP1 163 17 7579880 255 61M10754N40M = 7579927 10902 CTC... 
$\endgroup$
4
  • $\begingroup$ > And does picard markduplicate toggle the duplicate flag if the reads are already marked as being duplicates? yes: github.com/broadinstitute/picard/blob/master/src/main/java/… $\endgroup$
    – Pierre
    Commented Oct 30, 2017 at 14:21
  • 1
    $\begingroup$ @Pierre I know no Java, but that looks like it will unset the duplicate flag if isDuplicate is false. Not if it is already true. Am I missing something? $\endgroup$
    – terdon
    Commented Oct 30, 2017 at 16:00
  • $\begingroup$ @terdon: if it's duplicate the flag is set github.com/broadinstitute/picard/blob/master/src/main/java/… , else it is unset github.com/broadinstitute/picard/blob/master/src/main/java/… $\endgroup$
    – Pierre
    Commented Oct 30, 2017 at 16:18
  • 1
    $\begingroup$ @Pierre yes, exactly. If I understand correctly, the OP has a file with the duplicate flags already set but, when passed through markDuplicates, the flags that were set are now toggled: they're unset, so they are no longer marked as duplicates. The code you show would suggest that if the flag is already set, nothing will be changed. Unless picard doesn't read the flags and only does its own calculations to determine the dupes and, in this case, disagreed with whatever produced the original markings. $\endgroup$
    – terdon
    Commented Oct 30, 2017 at 16:33

1 Answer 1

6
$\begingroup$

Yes, if MarkDuplicates encounters a pair that's marked as a duplicate that it considers (for whatever reason) to not be a duplicate then it will unset the duplicate mark. You can test this yourself by making a small BAM file either with or without duplicate entries but some marked regardless. In the case of actual duplicates, the duplicate flag will be maintained. In the case where there are no actual duplicates then the flag will be removed. At least that's the case in version 2.14.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.