Why My Sorted Bam File Doesn'T Have 'So:Coordinate' Flag?
1
0
Entering edit mode
12.9 years ago
Bioscientist ★ 1.7k

Trying to use GATK which requires sorted bam file(according to coordinate), and also need a 'SO:coordinate' flag appearing in the head.

I check the header of my sorted bam files, however there's no such flag. Why?

btw, I read some posts about the confusion of the header of sorted bam, and how to check if the file is sorted or not. People have lots of discussion. But to me, I just check the very first couple of lines of bam files using /samtools view in.bam|head -10; if the coordinate is sorted, I'll think well it's good in shape. Isn't it that easy as I suggested?

sort bam • 3.1k views
ADD COMMENT
0
Entering edit mode

Have you sorted the file? If so, how?

ADD REPLY
0
Entering edit mode

Sorry for my late. I just use samtools sort .bam

ADD REPLY
2
Entering edit mode
12.9 years ago
Peter 6.0k

Probably because 'samtools sort' doesn't touch the header. This is an annoying 'feature'. One way to check recommended on the samtools mailing list is to try 'samtools index' (if it works your file was co-ordinate sorted, if it fails, it wasn't and needs sorting).

ADD COMMENT

Login before adding your answer.

Traffic: 1469 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