When I read in BAM files with readGAlignments, I usually set isDuplicate = FALSE in the scanBamParam argument to remove duplicates. I was just wondering exactly how duplicates are determined--is this based on just chromosome and the start and end of each read, or are all the fields in the BAM file taken into account? In addition, would this flag act differently for readGAlignmentPairs than it does for readGAligments? I apologize if this question has been asked before, but I couldn't find any (direct) answers online.
This is great to know, thanks!