What is difference between samtools mark duplicates and remove duplicates ? Is it necessary to mark duplicates before removing duplicates with samtools?
samtools rmdup and
samtools markdup -r do the same thing. Without the
samtools markdup only flags the duplicates.
You'll have to run
samtools fixmate -m and sort the output to add ms and MC tags to prepare the file for
According to the current documentation,
rmdup is obsolete. Please do not use
TL;DR: just use
rmdup removes duplicates from BAM, while
markdup, like Picard's
MarkDuplicates, marks duplicates by default without hard removal – the latter is usually the desired behavior. In addition,
markdup implements a better algorithm that takes care of more corner cases and gives more consistent results.
PS: to emphasize – I see no point to use
samtools rmdup nowadays. It has been declared obsolete as @kohlkopf said.