FRC_align icon indicating copy to clipboard operation
FRC_align copied to clipboard

Samtools sort does not add a @HD SO:<Sort Order> attribute

Open olekto opened this issue 11 years ago • 2 comments

Hi, I'm trying to run FindTranslocations, but I get this error/warning: "BAM file has no @HD SO:<SortOrder> attribute: it is not possible to determine the sort order" However, samtools sort does not add this attribute. Could you determine whether or not the file is sorted by some other means? Maybe you could use Lindenbaum's approach: http://plindenbaum.blogspot.no/2011/02/testing-if-bam-file-is-sorted-using.html?

I'd rather not use something else than BWA and samtools to get this tool working.

Thank you.

Ole

olekto avatar Jul 06 '14 13:07 olekto

Dear Ole, this sounds really strange to me, maybe you are using an old samtools version. What happens if you run "samtools view -H your_bam_file.bam"?

The HD attribute is used by picard tools and many other tools to check the order ot the bam file. What I can do is to add a "--force-sorted" option that overwrites the HD attribute.

I will add this feature before the end of this week

vezzi avatar Jul 07 '14 05:07 vezzi

Forgot to say: I always use bwa+samtools recipe to align/sort bam files.

vezzi avatar Jul 07 '14 05:07 vezzi