Skip to content

Commit

Permalink
update to find same pam index
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelecancellieri committed Aug 24, 2021
1 parent 75b3ae8 commit 8800e89
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sourceCode/CRISPR-Cas-Tree/pamGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,17 @@ vector<int> searchPAMonGenome(string pam_sequence, int pam_len, string genome_se
}
if (found_positive)
{
// if ((nt - (pam_len - pam_limit - 1 + max_bulges)) >= 0) //save the pam position only if possible for a guide to attach that position(avoid out of bound)
// {
indices.push_back((nt - (pam_len - pam_limit - 1 + max_bulges)));
// }
if (((nt + pam_limit - 1) - (pam_len - 1 + max_bulges)) >= 0) //save the pam position only if possible for a guide to attach that position(avoid out of bound)
{
indices.push_back(((nt + pam_limit - 1) - (pam_len - 1 + max_bulges)));
}
}
if (found_negative)
{
// if ((nt <= (genome_sequence.length() - (pam_len + max_bulges)))) //same as for positive pam(out of bound problem)
// {
indices.push_back(-nt);
// }
if ((nt <= (genome_sequence.length() - (pam_len + max_bulges)))) //same as for positive pam(out of bound problem)
{
indices.push_back(-nt);
}
}
}
}
Expand Down Expand Up @@ -397,9 +397,9 @@ vector<int> searchPAMonGenome(string pam_sequence, int pam_len, string genome_se
}
if (found_negative)
{
if ((nt - (pam_len - pam_limit - 1 + max_bulges)) >= 0)
if (((nt + pam_limit - 1) - (pam_len - 1 + max_bulges)) >= 0) //save the pam position only if possible for a guide to attach that position(avoid out of bound)
{
indices.push_back((nt - (pam_len - pam_limit - 1 + max_bulges)));
indices.push_back(((nt + pam_limit - 1) - (pam_len - 1 + max_bulges)));
}
}
}
Expand Down

0 comments on commit 8800e89

Please sign in to comment.