Skip to content

Commit

Permalink
improve checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Aug 23, 2024
1 parent 681bfbd commit dcb39c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sa-index/src/sa_searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dcb39c1

Please sign in to comment.