I can remember where I read it but, I recall that I have read some where that if you have a bam sorted, you can unsorted it and some programs don't change the header (was samtools? picard?) so the SO:coordinate still is there. Is that true? Could I be sure that a file is sorted only looking to the bam header SO tag? or should I need always double check sorting them with samtools sort?.
Which is your preferred way of checking that the bam files passed to you are really sorted?
Did you see this post?
@pierre I saw it after asking the question, but it does not answer directly to the question: can I trust the SO label? , never the less was very useful and your program from your blog seems a nice option.
@tony, this is the program I was mentioning from his blog.
http://plindenbaum.blogspot.com/2011/02/testing-if-bam-file-is-sorted-using.html
Pierre, if you write your comment as an answer I will choose it and you will obtain extra points ;-).
you could also use a C program that Pierre wrote using samtools API some time ago (bamsorted.c) to check if it's sorted. Merci Pierre by the way !