From fd7becfcdfd54bbf6f0c15461e8b525b10cec4f7 Mon Sep 17 00:00:00 2001
From: lindenb <plindenbaum@yahoo.fr>
Date: Tue, 22 Apr 2014 11:27:44 +0200
Subject: [PATCH] support for operators 'X' and '=' in method
 BlockedIntervals.cpp/GetBamBlocks

---
 src/utils/BlockedIntervals/BlockedIntervals.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/utils/BlockedIntervals/BlockedIntervals.cpp b/src/utils/BlockedIntervals/BlockedIntervals.cpp
index c653881e..ad88543b 100644
--- a/src/utils/BlockedIntervals/BlockedIntervals.cpp
+++ b/src/utils/BlockedIntervals/BlockedIntervals.cpp
@@ -33,7 +33,7 @@ void GetBamBlocks(const BamAlignment &bam,
     vector<CigarOp>::const_iterator cigEnd = bam.CigarData.end();
     for (; cigItr != cigEnd; ++cigItr) {
         switch (cigItr->Type) {
-            case ('M') :
+            case ('M') :case ('X'): case ('='):
                 blockLength += cigItr->Length;
             case ('I') : break;
             case ('S') : break;
@@ -58,7 +58,7 @@ void GetBamBlocks(const BamAlignment &bam,
                 }
             case ('H') : break;                             // for 'H' - do nothing, move to next op
             default    :
-                printf("ERROR: Invalid Cigar op type\n");   // shouldn't get here
+                fprintf(stderr,"ERROR: Invalid Cigar op type \'%c\'.\n",cigItr->Type);   // shouldn't get here
                 exit(1);
         }
     }
@@ -119,4 +119,4 @@ int GetTotalBlockLength(const bedVector &bedBlocks) {
         total_size += blockItr->end - blockItr->start;
     }
     return total_size;
-}
\ No newline at end of file
+}
-- 
GitLab