From dcb39c1691c3d103a38fe5c83d26c2f6f0715c11 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Fri, 23 Aug 2024 11:35:28 +0200 Subject: [PATCH] improve checks --- sa-index/src/sa_searcher.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sa-index/src/sa_searcher.rs b/sa-index/src/sa_searcher.rs index add8b04..f11c1b9 100644 --- a/sa-index/src/sa_searcher.rs +++ b/sa-index/src/sa_searcher.rs @@ -345,11 +345,11 @@ impl Searcher { let checkable_suffix = suffix >= skip; // Check for trypticity if a tryptic search is performed - let is_tryptic = tryptic_search && ( + let is_tryptic = checkable_suffix && tryptic_search && ( self.proteins.input_string[suffix - skip - 1] == b'R' || self.proteins.input_string[suffix - skip - 1] == b'K' || self.proteins.input_string[suffix - skip - 1] == SEPARATION_CHARACTER - ) && self.proteins.input_string[suffix - skip + search_string.len()] != b'P'; + ) && self.proteins.input_string[suffix - skip + search_string.len() + 1] != b'P'; // If a tryptic search is performed and the suffix is not tryptic, we can skip if tryptic_search && !is_tryptic {