From 0df23e96bbd5583ec9804fd1473b9b4a491e4c75 Mon Sep 17 00:00:00 2001 From: Ohad Rodeh Date: Wed, 29 Nov 2023 09:27:50 +0200 Subject: [PATCH] support vector tags in SAM. These are marked 'B'. --- source/BAMfunctions.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/BAMfunctions.cpp b/source/BAMfunctions.cpp index af6ce237..fd419ef2 100644 --- a/source/BAMfunctions.cpp +++ b/source/BAMfunctions.cpp @@ -154,12 +154,12 @@ int bamAttrArrayWriteSAMtags(string &attrStr, char *attrArray, Parameters &P) {/ if (attr1.empty()) continue; //extra tab at the beginning, or consecutive tabs - + uint16_t tagn = * ( (uint16_t*) attr1.c_str() ); if ( !P.readFiles.samAttrKeepAll && P.readFiles.samAttrKeep.count(tagn)==0 ) - continue; //skip tags not contained the list + continue; //skip tags not contained the list - switch (attr1.at(3)) {//TODO: support other tag types (vector tags) + switch (attr1.at(3)) {//TODO: support other tag types case 'i': { int32 a1=stol(attr1.substr(5)); @@ -174,6 +174,7 @@ int bamAttrArrayWriteSAMtags(string &attrStr, char *attrArray, Parameters &P) {/ }; break; case 'Z': + case 'B': { string a1=attr1.substr(5); nattr += bamAttrArrayWrite(a1,attr1.c_str(),attrArray+nattr); @@ -190,5 +191,3 @@ int bamAttrArrayWriteSAMtags(string &attrStr, char *attrArray, Parameters &P) {/ return nattr; }; - -