RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
EmbeddedFrag.h
Go to the documentation of this file.
1//
2// Copyright (C) 2003-2022 Greg Landrum and other RDKit contributors
3//
4// @@ All Rights Reserved @@
5// This file is part of the RDKit.
6// The contents are covered by the terms of the BSD license
7// which is included in the file license.txt, found at the root
8// of the RDKit source tree.
9//
10#include <RDGeneral/export.h>
11#ifndef RD_EMBEDDED_FRAG_H
12#define RD_EMBEDDED_FRAG_H
13
14#include <RDGeneral/types.h>
16#include <Geometry/point.h>
17#include "DepictUtils.h"
18#include <boost/smart_ptr.hpp>
19#include <boost/dynamic_bitset.hpp>
20
21namespace RDKit {
22class ROMol;
23class Bond;
24} // namespace RDKit
25
26namespace RDDepict {
27typedef boost::shared_array<double> DOUBLE_SMART_PTR;
28
29//! Class that contains the data for an atoms that has already been embedded
31 public:
32 typedef enum {
36 } EAtomType;
37
38 EmbeddedAtom() { neighs.clear(); }
39
40 EmbeddedAtom(const EmbeddedAtom &other) = default;
41
42 EmbeddedAtom(unsigned int aid, const RDGeom::Point2D &pos)
43 : aid(aid),
44 angle(-1.0),
45 nbr1(-1),
46 nbr2(-1),
47 CisTransNbr(-1),
48 ccw(true),
49 rotDir(0),
50 d_density(-1.0),
51 df_fixed(false) {
52 loc = pos;
53 }
54
56 if (this == &other) {
57 return *this;
58 }
59
60 aid = other.aid;
61 loc = other.loc;
62 angle = other.angle;
63 nbr1 = other.nbr1;
64 nbr2 = other.nbr2;
66 rotDir = other.rotDir;
67 normal = other.normal;
68 ccw = other.ccw;
69 neighs = other.neighs;
70 d_density = other.d_density;
71 df_fixed = other.df_fixed;
72 return *this;
73 }
74
75 void Transform(const RDGeom::Transform2D &trans) {
76 RDGeom::Point2D temp = loc + normal;
77 trans.TransformPoint(loc);
78 trans.TransformPoint(temp);
79 normal = temp - loc;
80 }
81
82 void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2) {
83 RDGeom::Point2D temp = loc + normal;
84 loc = reflectPoint(loc, loc1, loc2);
85 temp = reflectPoint(temp, loc1, loc2);
86 normal = temp - loc;
87 ccw = (!ccw);
88 }
89
90 unsigned int aid{0}; // the id of the atom
91
92 //! the angle that is already takes at this atom, so any new atom attaching to
93 /// this atom with have to fall in the available part
94 double angle{-1.0};
95
96 //! the first neighbor of this atom that form the 'angle'
97 int nbr1{-1};
98
99 //! the second neighbor of atom that from the 'angle'
100 int nbr2{-1};
101
102 //! is this is a cis/trans atom the neighbor of this atom that is involved in
103 /// the cis/trans system - defaults to -1
104 int CisTransNbr{-1};
105
106 //! which direction do we rotate this normal to add the next bond
107 //! if ccw is true we rotate counter clockwise, otherwise rotate clock wise,
108 /// by an angle that is <= PI/2
109 bool ccw{true};
110
111 //! rotation direction around this atom when adding new atoms,
112 /// we determine this for the first neighbor and stick to this direction
113 /// after that
114 //! useful only on atoms that are degree >= 4
115 int rotDir{0};
116
117 RDGeom::Point2D loc; // the current location of this atom
118 //! this is a normal vector to one of the bonds that added this atom
119 //! it provides the side on which we want to add a new bond to this atom
120 //! this is only relevant when we are dealing with non ring atoms. We would
121 /// like to draw chains in a zig-zag manner
123
124 //! and these are the atom IDs of the neighbors that still need to be embedded
126
127 // density of the atoms around this atoms
128 // - this is sum of inverse of the square of distances to other atoms from
129 // this atom. Used in the collision removal code
130 // - initialized to -1.0
131 double d_density{-1.0};
132
133 //! if set this atom is fixed: further operations on the fragment may not
134 //! move it.
135 bool df_fixed{false};
136};
137
138typedef std::map<unsigned int, EmbeddedAtom> INT_EATOM_MAP;
139typedef INT_EATOM_MAP::iterator INT_EATOM_MAP_I;
140typedef INT_EATOM_MAP::const_iterator INT_EATOM_MAP_CI;
141
142//! Class containing a fragment of a molecule that has already been embedded
143/*
144 Here is how this class is designed to be used
145 - find a set of fused rings and compute the coordinates for the atoms in those
146 ring
147 - them grow this system either by adding non ring neighbors
148 - or by adding other embedded fragment
149 - so at the end of the process the whole molecule end up being one these
150 embedded frag objects
151*/
153 // REVIEW: think about moving member functions up to global level and just
154 // using
155 // this class as a container
156
157 public:
158 //! Default constructor
160 d_eatoms.clear();
161 d_attachPts.clear();
162 }
163
164 //! Initializer from a single atom id
165 /*!
166 A single Embedded Atom with this atom ID is added and placed at the origin
167 */
168 EmbeddedFrag(unsigned int aid, const RDKit::ROMol *mol);
169
170 //! Constructor when the coordinates have been specified for a set of atoms
171 /*!
172 This simply initialized a set of EmbeddedAtom to have the same coordinates
173 as the one's specified. No testing is done to verify any kind of
174 correctness. Also this fragment is less ready (to expand and add new
175 neighbors) than when using other constructors. This is because:
176 - the user may have specified coords for only a part of the atoms in a
177 fused ring systems in which case we need to find these atoms and merge
178 these ring systems to this fragment
179 - The atoms are not yet aware of their neighbor (what is left to add etc.)
180 this again depends on atoms properly so that new neighbors can be added
181 to them
182 */
184 const RDGeom::INT_POINT2D_MAP &coordMap);
185
186 //! Initializer from a set of fused rings
187 /*!
188 ARGUMENTS:
189 \param mol the molecule of interest
190 \param fusedRings a vector of rings, each ring is a list of atom ids
191 \param useRingTemplates whether to use ring system templates for generating
192 initial coordinates
193 */
194 EmbeddedFrag(const RDKit::ROMol *mol, const RDKit::VECT_INT_VECT &fusedRings,
195 bool useRingTemplates);
196
197 //! Initializer for a cis/trans system using the double bond
198 /*!
199 ARGUMENTS:
200 \param dblBond the double bond that is involved in the cis/trans
201 configuration
202 */
203 explicit EmbeddedFrag(const RDKit::Bond *dblBond);
204
205 //! Expand this embedded system by adding neighboring atoms or other embedded
206 /// systems
207 /*!
208
209 Note that both nratms and efrags are modified in this function
210 as we start merging them with the current fragment
211
212 */
213 void expandEfrag(RDKit::INT_LIST &nratms, std::list<EmbeddedFrag> &efrags);
214
215 //! Add a new non-ring atom to this object
216 /*
217 ARGUMENTS:
218 \param aid ID of the atom to be added
219 \param toAid ID of the atom that is already in this object to which this
220 atom is added
221 */
222 void addNonRingAtom(unsigned int aid, unsigned int toAid);
223
224 //! Merge this embedded object with another embedded fragment
225 /*!
226
227 The transformation (rotation + translation required to attached
228 the passed in object will be computed and applied. The
229 coordinates of the atoms in this object will remain fixed We
230 will assume that there are no common atoms between the two
231 fragments to start with
232
233 ARGUMENTS:
234 \param embObj another EmbeddedFrag object to be merged with this object
235 \param toAid the atom in this embedded fragment to which the new object
236 will be attached
237 \param nbrAid the atom in the other fragment to attach to
238 */
239 void mergeNoCommon(EmbeddedFrag &embObj, unsigned int toAid,
240 unsigned int nbrAid);
241
242 //! Merge this embedded object with another embedded fragment
243 /*!
244
245 The transformation (rotation + translation required to attached
246 the passed in object will be computed and applied. The
247 coordinates of the atoms in this object will remain fixed This
248 already know there are a atoms in common and we will use them to
249 merge things
250
251 ARGUMENTS:
252 \param embObj another EmbeddedFrag object to be merged with this object
253 \param commAtms a vector of ids of the common atoms
254
255 */
257
258 void mergeFragsWithComm(std::list<EmbeddedFrag> &efrags);
259
260 //! Mark this fragment to be done for final embedding
261 void markDone() { d_done = true; }
262
263 //! If this fragment done for the final embedding
264 bool isDone() { return d_done; }
265
266 //! Get the molecule that this embedded fragment belongs to
267 const RDKit::ROMol *getMol() const { return dp_mol; }
268
269 //! Find the common atom ids between this fragment and a second one
271
272 //! Find a neighbor to a non-ring atom among the already embedded atoms
273 /*!
274 ARGUMENTS:
275 \param aid the atom id of interest
276
277 RETURNS:
278 \return the id of the atom if we found a neighbor
279 -1 otherwise
280
281 NOTE: by definition we can have only one neighbor in the embedded system.
282 */
283 int findNeighbor(unsigned int aid);
284
285 //! Transform this object to a new coordinates system
286 /*!
287 ARGUMENTS:
288 \param trans : the transformation that need to be applied to the atoms in
289 this object
290 */
291 void Transform(const RDGeom::Transform2D &trans);
292
293 void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2);
294
295 const INT_EATOM_MAP &GetEmbeddedAtoms() const { return d_eatoms; }
296
297 void Translate(const RDGeom::Point2D &shift) {
298 INT_EATOM_MAP_I eari;
299 for (eari = d_eatoms.begin(); eari != d_eatoms.end(); eari++) {
300 eari->second.loc += shift;
301 }
302 }
303
304 EmbeddedAtom GetEmbeddedAtom(unsigned int aid) const {
305 INT_EATOM_MAP_CI posi = d_eatoms.find(aid);
306 if (posi == d_eatoms.end()) {
307 PRECONDITION(0, "Embedded atom does not contain embedded atom specified");
308 }
309 return posi->second;
310 }
311
312 //! the number of atoms in the embedded system
313 int Size() const { return d_eatoms.size(); }
314
315 //! \brief compute a box that encloses the fragment
317
318 //! \brief Flip atoms on one side of a bond - used in removing collisions
319 /*!
320 ARGUMENTS:
321 \param bondId - the bond used as the mirror to flip
322 \param flipEnd - flip the atoms at the end of the bond
323
324 */
325 void flipAboutBond(unsigned int bondId, bool flipEnd = true);
326
327 //! \brief flip one ring of a spiro compound to resolve collisions
328 /*!
329 \param spiroAid - the spiro center atom index
330 */
331 void flipAboutSpiroCenter(unsigned int spiroAid);
332
333 void openAngles(const double *dmat, unsigned int aid1, unsigned int aid2);
334
335 //! Find atom clashes and, optionally, non-adjacent bond intersections.
336 //! Bonded atom pairs can be excluded when shortened bonds are expected.
337 std::vector<PAIR_I_I> findCollisions(const double *dmat,
338 bool includeBonds = true,
339 bool includeBondedAtoms = true);
340
342
344 double mimicDmatWt);
345
346 void permuteBonds(unsigned int aid, unsigned int aid1, unsigned int aid2);
347
348 void randomSampleFlipsAndPermutations(unsigned int nBondsPerSample = 3,
349 unsigned int nSamples = 100,
350 int seed = 100,
351 const DOUBLE_SMART_PTR *dmat = nullptr,
352 double mimicDmatWt = 0.0,
353 bool permuteDeg4Nodes = false);
354
355 //! Remove collisions in a structure by flipping rotatable bonds and spiro centers
356 //! along the shortest path between two colliding atoms
358
359 [[deprecated("please use removeCollisionsBondAndSpiroFlip()")]] void removeCollisionsBondFlip() { removeCollisionsBondAndSpiroFlip(); };
360
361 //! Remove collision by opening angles at the offending atoms
363
364 //! Remove collisions by shortening bonds along the shortest path between the
365 /// atoms
367
368 //! Remove collisions by expanding angles along the path between colliding atoms
369 //! Runs after bond flipping, angle opening, and bond shortening.
370 //! Only expands angles where the three atoms (prev-center-next) are NOT all
371 //! in the same ring, preserving ring geometry while allowing ring-chain expansion.
373
374 //! helpers functions to
375
376 //! \brief make list of neighbors for each atom in the embedded system that
377 //! still need to be embedded
379
380 //! update the unembedded neighbor atom list for a specified atom
381 void updateNewNeighs(unsigned int aid);
382
383 //! \brief Find all atoms in this embedded system that are
384 //! within a specified distant of a point
385 int findNumNeigh(const RDGeom::Point2D &pt, double radius);
386
387 inline double getBoxPx() { return d_px; }
388 inline double getBoxNx() { return d_nx; }
389 inline double getBoxPy() { return d_py; }
390 inline double getBoxNy() { return d_ny; }
391
393
394 private:
395 double totalDensity();
396
397 // Helper methods for collision resolution
398 bool tryResolvingCollisionWithBondFlip(
399 const std::pair<unsigned int, unsigned int> &cAids,
400 unsigned int ncols,
401 double prevDensity,
402 std::map<int, unsigned int> &doneBonds,
403 const double *dmat);
404
405 bool tryResolvingCollisionWithSpiroFlip(
406 const std::pair<unsigned int, unsigned int> &cAids,
407 unsigned int ncols,
408 double prevDensity,
409 std::map<int, unsigned int> &doneSpiros,
410 const boost::dynamic_bitset<> &spiroCenters,
411 const double *dmat);
412
413 // Helper methods for path angle expansion collision resolution
414
415 //! Get all atoms on one side of a bond/angle, using BFS traversal
416 //! \param center - the center atom (pivot point)
417 //! \param sideStart - starting atom on the side to collect
418 //! \param exclude - atom on the opposite side (don't cross to this side)
419 //! \return vector of atom indices on the sideStart side
420 std::vector<unsigned int> getAtomsOnSide(unsigned int center,
421 unsigned int sideStart,
422 unsigned int exclude);
423
424 //! Open an angle by rotating one side around the center atom
425 //! Makes the angle LARGER (closer to 180°) to expand the chain
426 //! \param prevAtom - first atom forming the angle
427 //! \param centerAtom - center atom (pivot point for rotation)
428 //! \param nextAtom - second atom forming the angle
429 //! \param angleIncrement - amount to open the angle (radians)
430 //! \param dmat - distance matrix (for reference)
431 //! \return true if a side could be rotated without moving fixed atoms or
432 //! distorting a cycle
433 bool openAngleByIncrement(unsigned int prevAtom,
434 unsigned int centerAtom,
435 unsigned int nextAtom,
436 double angleIncrement,
437 const double *dmat);
438
439 // returns true if fused rings found a template
440 bool matchToTemplate(const RDKit::INT_VECT &ringSystemAtoms);
441
442 void embedFusedRings(const RDKit::VECT_INT_VECT &fusedRings,
443 bool useRingTemplates);
444
445 void setupAttachmentPoints();
446
447 //! \brief Find a transform to join a ring to the current embedded frag when
448 /// we
449 //! have only on common atom
450 /*!
451 So this is the state of affairs assumed here:
452 - we already have some rings in the fused system embedded and the
453 coordinates for the atoms
454 - the coordinates for the atoms in the new ring (with the center
455 of rings at the origin) are available nringCors. we want to
456 translate and rotate this ring to join with the already
457 embeded rings.
458 - only one atom is common between this new ring and the atoms
459 that are already embedded
460 - so we need to compute a transform that includes a translation
461 so that the common atom overlaps and the rotation to minimize
462 overlap with other atoms.
463
464 Here's what is done:
465 - we bisect the remaining sweep angle at the common atom and
466 attach the new ring such that the center of the new ring falls
467 on this bisecting line
468
469 NOTE: It is assumed here that the original coordinates for the
470 new ring are such that the center is at the origin (this is the
471 way rings come out of embedRing)
472 */
473 RDGeom::Transform2D computeOneAtomTrans(unsigned int commAid,
474 const EmbeddedFrag &other);
475
476 RDGeom::Transform2D computeTwoAtomTrans(
477 unsigned int aid1, unsigned int aid2,
478 const RDGeom::INT_POINT2D_MAP &nringCor);
479
480 //! Merge a ring with already embedded atoms
481 /*!
482 It is assumed that the new rings has already been oriented
483 correctly etc. This function just update all the relevant data,
484 like the neighbor information and the sweep angle
485 */
486 void mergeRing(const EmbeddedFrag &embRing, unsigned int nCommon,
487 const RDKit::INT_VECT &pinAtoms);
488
489 //! Reflect a fragment if necessary through a line connecting two atoms
490 /*!
491
492 We want add the new fragment such that, most of its atoms fall
493 on the side opposite to where the atoms already embedded are aid1
494 and aid2 give the atoms that were used to align the new ring to
495 the embedded atoms and we will assume that that process has
496 already taken place (i.e. transformRing has been called)
497
498 */
499 void reflectIfNecessaryDensity(EmbeddedFrag &embFrag, unsigned int aid1,
500 unsigned int aid2);
501
502 //! Reflect a fragment if necessary based on the cis/trans specification
503 /*!
504
505 we want to add the new fragment such that the cis/trans
506 specification on bond between aid1 and aid2 is not violated. We
507 will assume that aid1 and aid2 from this fragments as well as
508 embFrag are already aligned to each other.
509
510 \param embFrag the fragment that will be reflected if necessary
511 \param ctCase which fragment if the cis/trans dbl bond
512 - 1 means embFrag is the cis/trans fragment
513 - 2 mean "this" is the cis/trans fragment
514 \param aid1 first atom that forms the plane (line) of reflection
515 \param aid2 second atom that forms the plane of reflection
516 */
517 void reflectIfNecessaryCisTrans(EmbeddedFrag &embFrag, unsigned int ctCase,
518 unsigned int aid1, unsigned int aid2);
519
520 //! Reflect a fragment if necessary based on a third common point
521 /*!
522
523 we want add the new fragment such that the third point falls on
524 the same side of aid1 and aid2. We will assume that aid1 and
525 aid2 from this fragments as well as embFrag are already aligned
526 to each other.
527
528 */
529 void reflectIfNecessaryThirdPt(EmbeddedFrag &embFrag, unsigned int aid1,
530 unsigned int aid2, unsigned int aid3);
531
532 //! \brief Initialize this fragment from a ring and coordinates for its atoms
533 /*!
534 ARGUMENTS:
535 /param ring a vector of atom ids in the ring; it is assumed that there
536 in
537 clockwise or anti-clockwise order
538 /param nringMap a map of atomId to coordinate map for the atoms in the ring
539 */
540 void initFromRingCoords(const RDKit::INT_VECT &ring,
541 const RDGeom::INT_POINT2D_MAP &nringMap);
542
543 //! Helper function to addNonRingAtom to a specified atoms in the fragment
544 /*
545 Add an atom to this embedded fragment when the fragment already
546 has at least two neighbors previously added to 'toAid'. In this
547 case we have to choose where the new neighbor goes based on
548 the angle that is already taken around the atom.
549
550 ARGUMENTS:
551 \param aid ID of the atom to be added
552 \param toAid ID of the atom that is already in this object to which this
553 atom is added
554 */
555 void addAtomToAtomWithAng(unsigned int aid, unsigned int toAid);
556
557 //! Helper function to addNonRingAtom to a specified atoms in the fragment
558 /*!
559
560 Add an atom (aid) to an atom (toAid) in this embedded fragment
561 when 'toAid' has one or no neighbors previously added. In this
562 case where the new atom should fall is determined by the degree
563 of 'toAid' and the congestion around it.
564
565 ARGUMENTS:
566 \param aid ID of the atom to be added
567 \param toAid ID of the atom that is already in this object to which this
568 atom is added
569 \param mol the molecule we are dealing with
570 */
571 void addAtomToAtomWithNoAng(
572 unsigned int aid,
573 unsigned int toAid); //, const RDKit::ROMol *mol);
574
575 //! Helper function to constructor that takes predefined coordinates
576 /*!
577
578 Given an atom with more than 2 neighbors all embedded in this
579 fragment this function tries to determine
580
581 - how much of an angle if left for any new neighbors yet to be
582 added
583 - which atom should we rotate when we add a new neighbor and in
584 which direction (clockwise or anticlockwise
585
586 This is how it works
587 - find the pair of nbrs that have the largest angle
588 - this will most likely be the angle that is available - unless
589 we have fused rings and we found on of the ring angle !!!! -
590 in this case we find the next best
591 - find the smallest angle that contains one of these nbrs -
592 this determined which
593 - way we want to rotate
594
595 ARGUMENTS:
596 \param aid the atom id where we are centered right now
597 \param doneNbrs list of neighbors that are already embedded around aid
598 */
599 void computeNbrsAndAng(unsigned int aid, const RDKit::INT_VECT &doneNbrs);
600 // const RDKit::ROMol *mol);
601
602 //! are we embedded with the final (molecule) coordinates
603 bool d_done = false;
604 double d_px = 0.0, d_nx = 0.0, d_py = 0.0, d_ny = 0.0;
605
606 //! a map that takes one from the atom id to the embeddedatom object for that
607 /// atom.
608 INT_EATOM_MAP d_eatoms;
609
610 // RDKit::INT_DEQUE d_attachPts;
611 RDKit::INT_LIST d_attachPts;
612
613 // pointer to the owning molecule
614 const RDKit::ROMol *dp_mol = nullptr;
615};
616} // namespace RDDepict
617
618#endif
#define PRECONDITION(expr, mess)
Definition Invariant.h:108
Class that contains the data for an atoms that has already been embedded.
EmbeddedAtom(const EmbeddedAtom &other)=default
int nbr1
the first neighbor of this atom that form the 'angle'
RDKit::INT_VECT neighs
and these are the atom IDs of the neighbors that still need to be embedded
RDGeom::Point2D normal
int nbr2
the second neighbor of atom that from the 'angle'
RDGeom::Point2D loc
EmbeddedAtom & operator=(const EmbeddedAtom &other)
EmbeddedAtom(unsigned int aid, const RDGeom::Point2D &pos)
void Transform(const RDGeom::Transform2D &trans)
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
std::vector< PAIR_I_I > findCollisions(const double *dmat, bool includeBonds=true, bool includeBondedAtoms=true)
void removeCollisionsPathAngleExpansion()
EmbeddedAtom GetEmbeddedAtom(unsigned int aid) const
void Transform(const RDGeom::Transform2D &trans)
Transform this object to a new coordinates system.
void flipAboutSpiroCenter(unsigned int spiroAid)
flip one ring of a spiro compound to resolve collisions
void updateNewNeighs(unsigned int aid)
update the unembedded neighbor atom list for a specified atom
void markDone()
Mark this fragment to be done for final embedding.
EmbeddedFrag(const RDKit::ROMol *mol, const RDKit::VECT_INT_VECT &fusedRings, bool useRingTemplates)
Initializer from a set of fused rings.
void flipAboutBond(unsigned int bondId, bool flipEnd=true)
Flip atoms on one side of a bond - used in removing collisions.
int Size() const
the number of atoms in the embedded system
void mergeNoCommon(EmbeddedFrag &embObj, unsigned int toAid, unsigned int nbrAid)
Merge this embedded object with another embedded fragment.
EmbeddedFrag(const RDKit::ROMol *mol, const RDGeom::INT_POINT2D_MAP &coordMap)
Constructor when the coordinates have been specified for a set of atoms.
EmbeddedFrag()
Default constructor.
EmbeddedFrag(const RDKit::Bond *dblBond)
Initializer for a cis/trans system using the double bond.
RDKit::INT_VECT findCommonAtoms(const EmbeddedFrag &efrag2)
Find the common atom ids between this fragment and a second one.
void expandEfrag(RDKit::INT_LIST &nratms, std::list< EmbeddedFrag > &efrags)
int findNumNeigh(const RDGeom::Point2D &pt, double radius)
Find all atoms in this embedded system that are within a specified distant of a point.
void removeCollisionsOpenAngles()
Remove collision by opening angles at the offending atoms.
EmbeddedFrag(unsigned int aid, const RDKit::ROMol *mol)
Initializer from a single atom id.
double mimicDistMatAndDensityCostFunc(const DOUBLE_SMART_PTR *dmat, double mimicDmatWt)
void removeCollisionsBondAndSpiroFlip()
void Translate(const RDGeom::Point2D &shift)
void addNonRingAtom(unsigned int aid, unsigned int toAid)
Add a new non-ring atom to this object.
void permuteBonds(unsigned int aid, unsigned int aid1, unsigned int aid2)
const RDKit::ROMol * getMol() const
Get the molecule that this embedded fragment belongs to.
void removeCollisionsShortenBonds()
void setupNewNeighs()
helpers functions to
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
void computeBox()
compute a box that encloses the fragment
void openAngles(const double *dmat, unsigned int aid1, unsigned int aid2)
const INT_EATOM_MAP & GetEmbeddedAtoms() const
void mergeWithCommon(EmbeddedFrag &embObj, RDKit::INT_VECT &commAtms)
Merge this embedded object with another embedded fragment.
void randomSampleFlipsAndPermutations(unsigned int nBondsPerSample=3, unsigned int nSamples=100, int seed=100, const DOUBLE_SMART_PTR *dmat=nullptr, double mimicDmatWt=0.0, bool permuteDeg4Nodes=false)
bool isDone()
If this fragment done for the final embedding.
void mergeFragsWithComm(std::list< EmbeddedFrag > &efrags)
int findNeighbor(unsigned int aid)
Find a neighbor to a non-ring atom among the already embedded atoms.
void computeDistMat(DOUBLE_SMART_PTR &dmat)
void TransformPoint(Point2D &pt) const
class for representing a bond
Definition Bond.h:48
#define RDKIT_DEPICTOR_EXPORT
Definition export.h:121
boost::shared_array< double > DOUBLE_SMART_PTR
INT_EATOM_MAP::iterator INT_EATOM_MAP_I
RDKIT_DEPICTOR_EXPORT RDGeom::Point2D reflectPoint(const RDGeom::Point2D &point, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
std::map< unsigned int, EmbeddedAtom > INT_EATOM_MAP
INT_EATOM_MAP::const_iterator INT_EATOM_MAP_CI
std::map< int, Point2D > INT_POINT2D_MAP
Definition point.h:566
Std stuff.
std::list< int > INT_LIST
Definition types.h:229
std::vector< int > INT_VECT
Definition types.h:223
std::vector< INT_VECT > VECT_INT_VECT
Definition types.h:237