| 1 | /* lbg/residue-circles.cc |
| 2 | * |
| 3 | * Author: Paul Emsley |
| 4 | * Copyright 2010 by The University of Oxford |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or (at |
| 9 | * your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 19 | * 02110-1301, USA |
| 20 | */ |
| 21 | |
| 22 | #ifdef MAKE_ENHANCED_LIGAND_TOOLScxx . . $ `<built-in>:517:9`! |
| 23 | |
| 24 | #ifdef USE_PYTHON |
| 25 | #include <Python.h> |
| 26 | #endif |
| 27 | |
| 28 | #include "flev.hh"cxx . . $ `<file>/pli/flev.hh`/ |
| 29 | #include "optimise-residue-circles.hh"cxx . . $ `<file>/pli/optimise-residue-circles.hh`/ |
| 30 | #include "flev-scale-factor.hh"cxx . . $ `<file>/pli/flev-scale-factor.hh`/ |
| 31 | |
| 32 | |
| 33 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> |
| 34 | flev_tcxx . . $ flev_t#::get_primary_indicescxx . . $ flev_t#get_primary_indices(256841a891ab7d95).() const { |
| 35 | |
| 36 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> primary_indicescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; // this primary_indices needs to |
| 37 | // get passed to the |
| 38 | // primary_indices used in |
| 39 | // residue cirlce optimization. |
| 40 | |
| 41 | for(unsigned int ic=0; ic<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); ic++) { |
| 42 | if (residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).ic].is_a_primary_residuecxx . . $ residue_circle_t#is_a_primary_residue(50ce9a9e25b4a850).()) { |
| 43 | primary_indices.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(ic); |
| 44 | } |
| 45 | } |
| 46 | return primary_indicescxx . . $ std/vector#vector(6f559d22b039ccdb).; |
| 47 | } |
| 48 | |
| 49 | void |
| 50 | flev_tcxx . . $ flev_t#::initial_residues_circles_layoutcxx . . $ flev_t#initial_residues_circles_layout(49f6e7a06ebc5aa8).() { |
| 51 | |
| 52 | if (false) { |
| 53 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "------------------- flev_t::initial_residues_circles_layout() residue circles ------------" |
| 54 | <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 55 | |
| 56 | for (unsigned int i=0; i<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 57 | const auto &rc = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 58 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(2) <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). i <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " : " |
| 59 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " |
| 60 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y. <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | |
| 65 | // when we move a primary, we want to know its index in |
| 66 | // residue_circles, because that's what we really want to move. |
| 67 | // |
| 68 | // std::vector<std::pair<int, lbg_info_t::residue_circle_t> > primaries; |
| 69 | |
| 70 | // now a class data member because it is used in the layout penalty |
| 71 | // function (we want to have nice bond lengths for residues bonded |
| 72 | // to the ligand). |
| 73 | // |
| 74 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> primary_indicescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; // this primary_indices needs to |
| 75 | // get passed to the |
| 76 | // primary_indices used in |
| 77 | // residue circle optimization. |
| 78 | |
| 79 | for(unsigned int ic=0; ic<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); ic++) { |
| 80 | if (residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).ic].is_a_primary_residuecxx . . $ residue_circle_t#is_a_primary_residue(50ce9a9e25b4a850).()) { |
| 81 | primary_indices.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(ic); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // primaries get placed first and are checked for non-crossing |
| 86 | // ligand interaction bonds (they have penalty scored added if they |
| 87 | // cross). |
| 88 | // |
| 89 | try { |
| 90 | stdcxx . . $ std/::paircxx . . $ std/pair#<lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t#, lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t#> l_e_pair = molcxx . . $ flev_t#mol..ligand_extentscxx . . $ lig_build/molecule_t#ligand_extents(3b029e31c8645795).(); |
| 91 | if (false) |
| 92 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "initial_residues_circles_layout(): creating ligand grid with extents " |
| 93 | <<cxx . . $ lig_build/`operator<<`(da34eac00b121205). l_e_pair.firstcxx . . $ std/pair#first. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ lig_build/`operator<<`(da34eac00b121205). l_e_pair.secondcxx . . $ std/pair#second. <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 94 | ligand_gridcxx . . $ flev_t#ligand_grid# gridcxx . . $ flev_t#ligand_grid#ligand_grid(5c4946efcc0900a1).(l_e_pair.firstcxx . . $ std/pair#first., l_e_pair.secondcxx . . $ std/pair#second.); |
| 95 | grid.fillcxx . . $ flev_t#ligand_grid#fill(65c215dd374f8742).(molcxx . . $ flev_t#mol.); |
| 96 | |
| 97 | if (false) { // debug |
| 98 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "HHHHHHHHHHHHHere B with residue_circles.size() " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 99 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "------------------- flev_t::initial_residues_circles_layout() post B residue circles ------------" |
| 100 | <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 101 | for (unsigned int i=0; i<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 102 | const auto &rc = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 103 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(2) <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). i <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " : " |
| 104 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " |
| 105 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y. <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | for (unsigned int iprimary=0; iprimary<primary_indices.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); iprimary++) { |
| 110 | int idx = primary_indices[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).iprimary]; |
| 111 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t#, double> > attachment_points = |
| 112 | residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).idx].get_attachment_pointscxx . . $ residue_circle_t#get_attachment_points(3ac3e1f0f5dca024).(molcxx . . $ flev_t#mol.); |
| 113 | |
| 114 | if (false) { // debug |
| 115 | for (unsigned int iattach=0; iattach<attachment_points.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); iattach++) { |
| 116 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "debug:: in initial_residues_circles_layout()" |
| 117 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " iprimary " <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). iprimary <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " iattach " <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). iattach |
| 118 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " pos " <<cxx . . $ lig_build/`operator<<`(da34eac00b121205). attachment_points[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).iattach].firstcxx . . $ std/pair#first. |
| 119 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " target-dist " <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). attachment_points[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).iattach].secondcxx . . $ std/pair#second. |
| 120 | <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | initial_primary_residue_circles_layoutcxx . . $ flev_t#initial_primary_residue_circles_layout(59fda9a2bc390b65).(grid, idx, attachment_points); |
| 125 | } |
| 126 | |
| 127 | if (false) { |
| 128 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "------------------- flev_t::initial_residues_circles_layout() post C residue circles ------------" |
| 129 | <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 130 | for (unsigned int i=0; i<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 131 | const auto &rc = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 132 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(2) <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). i <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " : " |
| 133 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " |
| 134 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y. <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 135 | } |
| 136 | } |
| 137 | // show_mol_ring_centres(); |
| 138 | |
| 139 | // position_non_primaries(grid, primary_indices); // untrap residues as needed. |
| 140 | |
| 141 | if (false) { |
| 142 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "------------------- flev_t::initial_residues_circles_layout() post D residue circles ------------" |
| 143 | <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 144 | for (unsigned int i=0; i<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 145 | const auto &rc = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 146 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(2) <<cxx . . $ std/basic_ostream#`operator<<`(b4c055c363850233). i <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " : " |
| 147 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " |
| 148 | <<cxx . . $ std/`operator<<`(fe9a269018418773). stdcxx . . $ std/::setwcxx . . $ std/setw(f06ce2e9220601fb).(10) <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(5) <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::rightcxx . . $ std/right(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). rc.poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y. <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | } |
| 153 | catch (const stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error# &rte) { |
| 154 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). rte.whatcxx . . $ std/runtime_error#what(ba32b354807b2b81).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | |
| 159 | void |
| 160 | flev_tcxx . . $ flev_t#::refine_residue_circle_positionscxx . . $ flev_t#refine_residue_circle_positions(49f6e7a06ebc5aa8).() { // changes the positions of residue_circles |
| 161 | |
| 162 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "--------------- refine_residue_circle_positions() --- start --- " |
| 163 | <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 164 | |
| 165 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> primary_indices = get_primary_indicescxx . . $ flev_t#get_primary_indices(256841a891ab7d95).(); |
| 166 | initial_residues_circles_layoutcxx . . $ flev_t#initial_residues_circles_layout(49f6e7a06ebc5aa8).(); // twiddle residue_circles |
| 167 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<residue_circle_tcxx . . $ residue_circle_t#> current_circles = residue_circlescxx . . $ std/vector#vector(a1201200cf0efa42).; |
| 168 | |
| 169 | for (int iround=0; iround<30; iround++) { |
| 170 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "flev_t::refine_residue_circle_positions(): iround " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). iround <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 171 | stdcxx . . $ std/::paircxx . . $ std/pair#<int, stdcxx . . $ std/::vectorcxx . . $ std/vector#<residue_circle_tcxx . . $ residue_circle_t#> > new_c = |
| 172 | optimise_residue_circle_positionscxx . . $ flev_t#optimise_residue_circle_positions(ac7ea7304c0757f4).(residue_circlescxx . . $ flev_t#residue_circles., current_circles, primary_indices); |
| 173 | current_circles =cxx . . $ std/vector#`operator=`(e6b68e61becad66f). new_c.secondcxx . . $ std/pair#second.; |
| 174 | if (new_c.firstcxx . . $ std/pair#first. == GSL_ENOPROG) |
| 175 | break; |
| 176 | if (new_c.firstcxx . . $ std/pair#first. == GSL_SUCCESS) { |
| 177 | break; |
| 178 | } |
| 179 | } |
| 180 | residue_circlescxx . . $ flev_t#residue_circles. =cxx . . $ std/vector#`operator=`(e6b68e61becad66f). current_circles; |
| 181 | } |
| 182 | |
| 183 | stdcxx . . $ std/::paircxx . . $ std/pair#<bool,lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t#> |
| 184 | flev_tcxx . . $ flev_t#::get_residue_circles_top_leftcxx . . $ flev_t#get_residue_circles_top_left(ceb34328d74b7f03).() const { |
| 185 | |
| 186 | bool status = false; |
| 187 | lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t# pcxx . . $ lig_build/pos_t#pos_t(bc12c9ec15586e6a).(999999,999999); |
| 188 | |
| 189 | if (residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()) { |
| 190 | status = true; |
| 191 | for (unsigned int i=0; i<residue_circlescxx . . $ flev_t#residue_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 192 | if (residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i].poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x. < p.xcxx . . $ lig_build/pos_t#x.) p.xcxx . . $ lig_build/pos_t#x. = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i].poscxx . . $ residue_circle_t#pos..xcxx . . $ lig_build/pos_t#x.; |
| 193 | if (residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i].poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y. < p.ycxx . . $ lig_build/pos_t#y.) p.ycxx . . $ lig_build/pos_t#y. = residue_circlescxx . . $ flev_t#residue_circles.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i].poscxx . . $ residue_circle_t#pos..ycxx . . $ lig_build/pos_t#y.; |
| 194 | } |
| 195 | } |
| 196 | return stdcxx . . $ std/pair#pair(62e1774a2dc03c82).::paircxx . . $ std/pair#<bool, lig_buildcxx . . $ lig_build/::pos_tcxx . . $ lig_build/pos_t#> (status, p); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | // Return the status and updated positions. |
| 203 | // |
| 204 | stdcxx . . $ std/::paircxx . . $ std/pair#<int, stdcxx . . $ std/::vectorcxx . . $ std/vector#<residue_circle_tcxx . . $ residue_circle_t#> > |
| 205 | plicxx . . $ pli/::optimise_residue_circlescxx . . $ pli/optimise_residue_circles#::solutioncxx . . $ pli/optimise_residue_circles#solution(4f1cdeb9c5357f10).() const { |
| 206 | return stdcxx . . $ std/pair#pair(f3676cfe6d3aa9fc).::paircxx . . $ std/pair#<int, stdcxx . . $ std/::vectorcxx . . $ std/vector#<residue_circle_tcxx . . $ residue_circle_t#> > (statuscxx . . $ pli/optimise_residue_circles#status., current_circlescxx . . $ pli/optimise_residue_circles#current_circles.); |
| 207 | } |
| 208 | |
| 209 | |
| 210 | void |
| 211 | plicxx . . $ pli/::optimise_residue_circlescxx . . $ pli/optimise_residue_circles#::setup_anglescxx . . $ pli/optimise_residue_circles#setup_angles(49f6e7a06ebc5aa8).() { |
| 212 | |
| 213 | for (unsigned int iat=0; iat<molcxx . . $ pli/optimise_residue_circles#mol..atomscxx . . $ lig_build/molecule_t#atoms..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); iat++) { |
| 214 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> residue_indexescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 215 | for (unsigned int ires=0; ires<current_circlescxx . . $ pli/optimise_residue_circles#current_circles..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); ires++) { |
| 216 | for (unsigned int ibond=0; |
| 217 | ibond<current_circlescxx . . $ pli/optimise_residue_circles#current_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).ires].bonds_to_ligandcxx . . $ residue_circle_t#bonds_to_ligand..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 218 | ibond++) { |
| 219 | if (current_circlescxx . . $ pli/optimise_residue_circles#current_circles.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).ires].bonds_to_ligandcxx . . $ residue_circle_t#bonds_to_ligand.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).ibond].ligand_atom_namecxx . . $ bond_to_ligand_t#ligand_atom_name. ==cxx . . $ std/`operator==`(5ea818b58063a774). molcxx . . $ pli/optimise_residue_circles#mol..atomscxx . . $ lig_build/molecule_t#atoms.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).iat].get_atom_namecxx . . $ lig_build/atom_t#get_atom_name(219584694fe2b248).()) { |
| 220 | residue_indexes.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(ires); |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | if (residue_indexes.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() > 1) { |
| 225 | // a bit complicated. |
| 226 | anglecxx . . $ pli/optimise_residue_circles#angle# a1cxx . . $ pli/optimise_residue_circles#angle#angle(b1146eedae1e1d0b).(iat, residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0], residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1]); |
| 227 | anglescxx . . $ pli/optimise_residue_circles#angles..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(a1); |
| 228 | if (residue_indexes.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() > 2) { |
| 229 | anglecxx . . $ pli/optimise_residue_circles#angle# a2cxx . . $ pli/optimise_residue_circles#angle#angle(b1146eedae1e1d0b).(iat, residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1], residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2]); |
| 230 | anglescxx . . $ pli/optimise_residue_circles#angles..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(a2); |
| 231 | anglecxx . . $ pli/optimise_residue_circles#angle# a3cxx . . $ pli/optimise_residue_circles#angle#angle(b1146eedae1e1d0b).(iat, residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0], residue_indexes[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2]); |
| 232 | anglescxx . . $ pli/optimise_residue_circles#angles..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(a3); |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | } |
| 238 | |
| 239 | |
| 240 | #endif // MAKE_ENHANCED_LIGAND_TOOLS |
| 241 |