This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bam File Average Coverage Depth Changes After Fixmate

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

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

0 answers

No answers yet.

Log in to answer this question.