Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
pemsley committed Nov 30, 2024
2 parents b864864 + 16c06cf commit 97b36c5
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions coords/Bond_lines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4845,24 +4845,43 @@ Bond_lines_container::do_Ca_loop(int imod, int ires, int nres,

// Are C of previous and N of next close as in a peptide bond?
// Then we don't want to draw a loop
{
if (loop_is_possible) {
bool C_and_N_are_close = false;
mmdb::Atom *C_prev = residue_prev->GetAtom(" C ");
mmdb::Atom *N_this = residue_this->GetAtom(" N ");
if (C_prev) {
mmdb::Atom *N_this = residue_this->GetAtom(" N ");
if (N_this) {
float dist_sqrd =
(C_prev->x - N_this->x) * (C_prev->x - N_this->x) +
(C_prev->y - N_this->y) * (C_prev->y - N_this->y) +
(C_prev->z - N_this->z) * (C_prev->z - N_this->z);
if (dist_sqrd < 2.5)
if (dist_sqrd < 2.5 * 2.5)
C_and_N_are_close = true;
}
}
if (C_and_N_are_close)
loop_is_possible = false;
}

// Are P of previous and O3' of prev close as in a phosphodiester?
// Then we don't want to draw a loop
if (loop_is_possible) {
bool P_and_O3prime_are_close = false;
mmdb::Atom *O3prime_prev = residue_prev->GetAtom(" O3'");
if (O3prime_prev) {
mmdb::Atom *P_this = residue_this->GetAtom(" P ");
if (P_this) {
float dist_sqrd =
(O3prime_prev->x - P_this->x) * (O3prime_prev->x - P_this->x) +
(O3prime_prev->y - P_this->y) * (O3prime_prev->y - P_this->y) +
(O3prime_prev->z - P_this->z) * (O3prime_prev->z - P_this->z);
if (dist_sqrd < 2.5 * 2.5) // c.f 1.6 * 1.6
P_and_O3prime_are_close = true;
}
}
if (P_and_O3prime_are_close)
loop_is_possible = false;
}

if (loop_is_possible) {

Expand Down

0 comments on commit 97b36c5

Please sign in to comment.