Skip to content

Commit

Permalink
remove tryptic check for testing purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Aug 23, 2024
1 parent 8fca836 commit 1791652
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
29 changes: 14 additions & 15 deletions sa-index/src/sa_searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,10 @@ impl Searcher {
equate_il: bool,
tryptic_search: bool
) -> SearchAllSuffixesResult {
eprintln!("trypic_search: {}", tryptic_search);

// If we perform a tryptic search, the last character of the search string should be R or K
// if tryptic_search && search_string[search_string.len() - 1] != b'R' && search_string[search_string.len() - 1] != b'K' {
// return SearchAllSuffixesResult::NoMatches;
// }
if tryptic_search && search_string[search_string.len() - 1] != b'R' && search_string[search_string.len() - 1] != b'K' {
return SearchAllSuffixesResult::NoMatches;
}

let mut matching_suffixes: Vec<i64> = vec![];
let mut il_locations = vec![];
Expand Down Expand Up @@ -345,16 +343,17 @@ impl Searcher {

// If the suffix is smaller than the skip factor, we can't check the prefix
if suffix >= skip
// && (
// // Skip this check if we are not performing a tryptic search
// !tryptic_search
// // Check if the match is tryptic
// || ((
// 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() + 1] != b'P')
// )
&& (
// Skip this check if we are not performing a tryptic search
!tryptic_search
// Check if the match is tryptic
|| ((
(suffix == skip) ||
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() + 1] != b'P')
)
&& ((
// If the skip factor is 0, the entire search string should match.
skip == 0
Expand Down
2 changes: 0 additions & 2 deletions sa-mappings/src/proteins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ impl Proteins {
// because of the encoded functional annotations
let mut lines = ByteLines::new(BufReader::new(file));

input_string.push(SEPARATION_CHARACTER.into());

while let Some(Ok(line)) = lines.next() {
let mut fields = line.split(|b| *b == b'\t');

Expand Down

0 comments on commit 1791652

Please sign in to comment.