Entering edit mode
3.1 years ago
jdru
▴
10
I am sure this is a silly question.
I have a BAM file and when I compute average coverage using
samtools depth -a *BAM file* | awk '{sum+=$3} END { print "Average = ",sum/NR}'
I get 13.4499
Then I sort by read name and use fixmate:
samtools sort -n *BAM file* | samtools fixmate - *New BAM file*
But when I compute the new depth:
samtools depth -a *New BAM file* | awk '{sum+=$3} END { print "Average = ",sum/NR}'
I get 0.0231303
Why does average coverage change?
hum... after fixmate the bam is not sorted on coordinate.....