Re: bamtools merge not sorting properly?

244 views
Skip to first unread message

Derek

unread,
Jun 28, 2012, 5:17:21 PM6/28/12
to bamtoo...@googlegroups.com
If the input BAMs are sorted, then the merged file should be sorted as well.

What are the errors you see?

  - Derek 

On Thursday, June 28, 2012 4:58:03 PM UTC-4, lancep...@gmail.com wrote:
Using the latest version of bamtools, when doing a merge of sorted bam files, the output is not sorted properly.  Running samtools index (and other things) on the resulting output results in sorting errors. Is there a flag or something I am missing?  Or is this not a supported feature of bamtools merge?  I can't really find much documentation on this.

Michael Siebauer

unread,
Jul 2, 2012, 4:39:48 AM7/2/12
to bamtoo...@googlegroups.com
Can you try to use the BamTools API indexing function instead of "samtools index".

bam_reader.SetSortOrder(BamMultiReader::SortedByPosition);
bam_reader.CreateIndexes();

I often observe problems when I try to load indexes with BamTools if they were created by samtools. :-/

 

On 06/28/2012 10:58 PM, lancep...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages