Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort BAM with incorrect bin #163

Closed
tylo42 opened this issue Aug 27, 2015 · 2 comments
Closed

Sort BAM with incorrect bin #163

tylo42 opened this issue Aug 27, 2015 · 2 comments

Comments

@tylo42
Copy link

tylo42 commented Aug 27, 2015

I have a BAM where the bin was set incorrectly. When running sambamba sort the following error message is printed and sorting is aborted:

sambamba-sort: Bin in read with name 'XXX' is set incorrectly (5784 instead of expected 90)

This corresponds to https://github.com/biod/BioD/blob/master/bio/bam/bai/indexing.d#L251.

On the same BAM file (once sorted with samtools) an index can be built with sambamba index since --check-bins is off by default. Would it be possible to add an argument similar to --check-bins for sambamba sort?

For comparison, samtools sorts the same BAM file by leaving the bin incorrect.

@lomereiter
Copy link
Contributor

The tools that write BAM now set the bin correctly prior to writing the records. The option like --check-bins doesn't make much sense when one can simply fix the records (index doesn't write BAM, so it can only check).

@tylo42
Copy link
Author

tylo42 commented Aug 27, 2015

Good point about fixing the records. I tested it out and it works beautifully. Thank you so much for your quick response and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants