]> git.donarmstrong.com Git - rsem.git/blobdiff - samValidator.cpp
Added a user-friendly error message for rsem-sam-validator
[rsem.git] / samValidator.cpp
index e1a2cc8c8aefee07e6c747f5391e5b369063d4ec..6e602107090f1d795341f9c08ee3b7d27689ae22 100644 (file)
@@ -9,6 +9,7 @@
 #include "sam/bam.h"
 #include "sam/sam.h"
 
+#include "utils.h"
 #include "my_assert.h"
 
 using namespace std;
@@ -45,7 +46,7 @@ int main(int argc, char* argv[]) {
 
        isValid = true;
 
-       long cnt = 0;
+       HIT_INT_TYPE cnt = 0;
        string cqname(""), qname;
        uint64_t creadlen = 0, readlen;
        bool cispaired = false, ispaired;
@@ -73,7 +74,7 @@ int main(int argc, char* argv[]) {
                        // both mates are mapped
                        if (!(b->core.flag & 0x0004) && !(b2->core.flag & 0x0004)) {
                                isValid = (b->core.tid == b2->core.tid) && (b->core.pos == b2->core.mpos) && (b2->core.pos == b->core.mpos);
-                               if (!isValid) { printf("\nOne of paired-end read %s's alignment does not have two mates adjacent to each other!\n", qname.c_str()); continue; }
+                               if (!isValid) { printf("\nOne of paired-end read %s's alignment does not have two mates adjacent to each other! If you're running covert-sam-for-rsem now, this might mean the read contains duplicate alignments.\n", qname.c_str()); continue; }
                        }
 
                        readlen = ((b->core.flag & 0x0040) ? (uint64_t(b->core.l_qseq) << 32) + b2->core.l_qseq : (uint64_t(b2->core.l_qseq) << 32) + b->core.l_qseq);