Bam File Average Coverage Depth Changes After Fixmate
0
0
Entering edit mode
2.5 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?

samtools bash coverage fixmate BAM • 599 views
ADD COMMENT
0
Entering edit mode

hum... after fixmate the bam is not sorted on coordinate.....

ADD REPLY

Login before adding your answer.

Traffic: 2550 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6