Skip to content

Commit 9366d33

Browse files
committed
Fix bug with bamtools reporting incorrect tags
1 parent b4b2280 commit 9366d33

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,13 @@ string convertToSam(const BamAlignment& a, RefVector m_references) {
241241

242242
case (Constants::BAM_TAG_TYPE_INT8):
243243
// force value into integer-type (instead of char value)
244-
m_out << "i:" << static_cast<int16_t>(tagData[index]);
244+
m_out << "i:" << int(static_cast<int8_t>(tagData[index]));
245245
++index;
246246
break;
247247

248248
case (Constants::BAM_TAG_TYPE_UINT8):
249249
// force value into integer-type (instead of char value)
250-
m_out << "i:" << static_cast<uint16_t>(tagData[index]);
250+
m_out << "i:" << int(static_cast<uint8_t>(tagData[index]));
251251
++index;
252252
break;
253253

0 commit comments

Comments
 (0)