-
Notifications
You must be signed in to change notification settings - Fork 27
samtools tips
Thomas Cokelaer edited this page Apr 28, 2023
·
1 revision
first, sort the BAM by query name (-n)
samtools sort -@ 4 -n data.sorted.bam -o data.sorted.byquery.bam
and fixmate to add MC tag::
samtools fixmate -m -r data.sorted.byquery.bam fixmate.bam
sort by coordinate for markdup::
samtools sort -@ 4 fixmate.bam -o data.sorted.bycoord.bam
and finally remove duplicates::
samtools markdup -s -r data.sorted.bycoord.bam markdup.bam
~
~
~
~