This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools duplicate reads removing

I used samtools to remove duplicate reads. First I used fixmate, it requires the reads sorted according to their name. I used the following command

samtools sort -n -@ 32 in.bam | samtools fixmate -r -@ 32 - sort.fx.bam

then I try samtools markdup

samtools markdup -r -@ 32 sort.fx.bam out.uq.bam

but it gave me an error

error: queryname sorted, must be sorted by coordinate.

Then I used following command

samtools sort  -@ 32 sort.fx.bam | samtools markdup -r -@ 32 - out.uq.bam

but again it gives me the following error message.

error: no ms score tag. Please run samtools fixmate on file first.

Anyone, please guide me.

samtools duplicate reads

1 answer

add option m to samtools fixmate:

-m           Add mate score tag

Log in to answer this question.