From dbcc9d2fd587914947663c158bc57c70a14b1d38 Mon Sep 17 00:00:00 2001 From: Mathieu Giraud Date: Sun, 28 Feb 2016 13:06:29 +0100 Subject: [PATCH] core.segment.cpp: sequences may be too short to extract their CDR3 --- algo/core/segment.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/algo/core/segment.cpp b/algo/core/segment.cpp index ab19c75e0..b766f3b26 100644 --- a/algo/core/segment.cpp +++ b/algo/core/segment.cpp @@ -1058,6 +1058,10 @@ void FineSegmenter::findCDR3(){ JUNCTIONstart = (box_V->end + 1 + 1) - V_104_offset; JUNCTIONend = (box_J->start + 1 - 1) + J_118_offset; + // Sequence may be too short + if (JUNCTIONstart < 1 || JUNCTIONend > getSequence().sequence.length()) + return ; + // IMGT-CDR3 is, on each side, 3 nucleotides shorter than IMGT-JUNCTION CDR3start = JUNCTIONstart + 3; CDR3end = JUNCTIONend - 3; -- GitLab