pezmaster31 / bamtools

C++ API & command-line toolkit for working with BAM data
MIT License
418 stars 153 forks source link

Sam and JSON conversion B-type tag support and bug fixes #171

Closed daviesrob closed 3 years ago

daviesrob commented 7 years ago

This makes bamtools convert able to correctly output (in SAM format) auxf#values.bam (derived from auxf#values.sam) in the attached zip file:

testbams.zip

It adds support for B array tags, and fixes a casting bug which caused C (unsigned byte) tags to be written incorrectly on platforms where char is signed. x86 and x86-64 both have signed char by default.

It also fixes buffer overrun bugs in the tag printing code that could be triggered by broken BAM files (see broken1.bam in the zip file), and adds checks to catch invalid tag types (broken2.bam and broken3.bam).

SoapZA commented 3 years ago

could you rebase your branch (don't forget to reformat as well)?

daviesrob commented 3 years ago

I've pushed a squashed and rebased version for you. Let me know if you need anything else.

daviesrob commented 3 years ago

Updated. Hopefully I got everything.

daviesrob commented 3 years ago

Should be fixed now.