RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MarvinDefs.h
Go to the documentation of this file.
1//
2// Copyright (C) 2022-2023 Tad Hurst, 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
11// This software is based on the Chemaxon documentation for the MRV format:P
12// https://docs.chemaxon.com/display/docs/marvin-documents-mrv.md
13// and this implmentation is tested against the parsing and generation in the
14// Marvin JS sketcher: https://marvinjs-demo.chemaxon.com/latest/demo.html
15
16#ifndef RD_MARVINDEFS_H
17#define RD_MARVINDEFS_H
18
19#include <GraphMol/RDKitBase.h>
24
26#include <boost/property_tree/ptree.hpp>
27#include <boost/property_tree/xml_parser.hpp>
28#include <boost/foreach.hpp>
29#include <boost/algorithm/string.hpp>
31
32#include <float.h> // Needed for DBL_MAX on Clang
33
34using boost::property_tree::ptree;
35
36namespace RDKit {
37
38const std::vector<std::string> sruSgroupConnectChoices{"hh", "ht", "eu"};
39const std::vector<std::string> marvinBondOrders{"1", "2", "3", "A"};
40const std::vector<std::string> marvinQueryBondsTypes{"SD", "SA", "DA", "Any"};
41const std::vector<std::string> marvinConventionTypes{"cxn:coord"};
42const std::vector<std::string> marvinStereoDictRefTypes{"cml:W", "cml:H"};
43const std::vector<std::string> marvinStereoConventionTypes{"1", "3", "4", "6"};
44
45const std::vector<std::string> marvinRadicalVals{
46 "monovalent", "divalent", "divalent1", "divalent3",
47 "trivalent", "trivalent2", "trivalent4", "4"};
48const std::map<std::string, int> marvinRadicalToRadicalElectrons{
49 {"monovalent", 1}, {"divalent", 2}, {"divalent1", 2}, {"divalent3", 2},
50 {"trivalent", 3}, {"trivalent2", 3}, {"trivalent4", 3}, {"4", 4}};
51
52const std::map<int, std::string> radicalElectronsToMarvinRadical{
53 {1, "monovalent"}, {2, "divalent"}, {3, "trivalent4"}, {4, "4"}};
54
60
61class MarvinWriterException : public std::runtime_error {
62 public:
63 explicit MarvinWriterException(std::string message)
64 : std::runtime_error(message) {};
65};
66
68 public:
69 std::string type;
70 double x1;
71 double y1;
72 double x2;
73 double y2;
74
75 std::string toString() const;
76 ptree toPtree() const;
77};
78
80 public:
81 std::string id;
82 double x1;
83 double y1;
84 double x2;
85 double y2;
86
87 std::string toString() const;
88 ptree toPtree() const;
89};
90
92 public:
93 std::string id;
94 std::string text;
95 double x;
96 double y;
97 double fontScale = 0.0;
98
99 std::string halign;
100 std::string valign;
101
102 std::string toString() const;
103 ptree toPtree() const;
104};
105
107 public:
108 // <attachmentPoint atom="a7" order="1" bond="b6"/>
109 std::string atom;
110 std::string bond;
111 std::string order;
112
113 std::string toString() const;
114 ptree toPtree() const;
115};
116
118 public:
119 std::string id;
120 std::string elementType;
121 double x2;
122 double y2;
123 double x3;
124 double y3;
125 double z3;
126
128 std::string radical;
132 std::string mrvAlias;
133 std::string mrvStereoGroup;
135 std::string sgroupRef;
136 bool sGroupRefIsSuperatom; // if set, we will not change the sgroupRef - the
137 // superatom really needs it
140
142 MarvinAtom(const MarvinAtom &atomToCopy, std::string newId);
143
144 bool operator==(const MarvinAtom &rhs) const;
145
146 bool operator==(const MarvinAtom *rhs) const;
147
148 bool isElement() const;
149
150 std::string toString() const;
151 ptree toPtree(unsigned int coordinatePrecision = 6) const;
152};
153
155 public:
156 std::string value;
157 std::string convention;
158 std::string conventionValue;
159 std::string dictRef;
160
161 std::string toString() const;
162 ptree toPtree() const;
163};
164
166 public:
167 std::string id;
168 std::string atomRefs2[2];
169 std::string order;
171 std::string queryType;
172 std::string convention;
173
175
177 std::string atomRef1, std::string atomRef2);
178
179 bool isEqual(const MarvinAtom &other) const;
180
181 bool operator==(const MarvinAtom &rhs) const;
182
183 const std::string getBondType() const;
184
185 std::string toString() const;
186 ptree toPtree() const;
187};
188
217
218template <typename T>
219typename std::vector<std::unique_ptr<T>>::iterator findUniquePtr(
220 std::vector<std ::unique_ptr<T>> &vector, T *itemToFind) {
221 auto foundUniqIter = find_if(vector.begin(), vector.end(),
222 [itemToFind](std::unique_ptr<T> &uniquePtr) {
223 return uniquePtr.get() == itemToFind;
224 });
225
226 if (foundUniqIter == vector.end()) {
227 throw FileParseException("Unexpected error - item to find not found");
228 }
229
230 return foundUniqIter;
231}
232
233template <typename T>
234void eraseUniquePtr(std::vector<std ::unique_ptr<T>> &vector, T *itemToErase) {
236
237 if (removeUniqIter == vector.end()) {
238 throw FileParseException("Unexpected error - item to remove not found");
239 }
240
241 vector.erase(removeUniqIter);
242}
243
245 public:
246 std::string molID;
247 std::string id; // used in all sGroups
248 unsigned int coordinatePrecision = 6;
249 std::vector<MarvinAtom *> atoms; // owned by parent MarvinMol
250 std::vector<MarvinBond *> bonds; // owned by parent MarvinMol
251 std::vector<std::unique_ptr<MarvinMolBase>> sgroups;
253
254 virtual std::string role() const = 0;
255 virtual bool hasAtomBondBlocks() const = 0;
256 virtual std::string toString() const = 0;
257 virtual ptree toPtree() const;
258 void addSgroupsToPtree(ptree &pt) const;
259
260 virtual MarvinMolBase *copyMol(const std::string &idAppend) const = 0;
261 virtual void pushOwnedAtom(MarvinAtom *atom);
262 virtual void pushOwnedBond(MarvinBond *bond);
263
264 virtual void removeOwnedAtom(MarvinAtom *atom);
265 virtual void removeOwnedBond(MarvinBond *bond);
266
267 void setPrecision(unsigned int precision);
268
270
272
273 virtual ~MarvinMolBase();
274
275 int getAtomIndex(std::string id) const;
276 int getBondIndex(std::string id) const;
277
278 const std::vector<std::string> getBondList() const;
279 const std::vector<std::string> getAtomList() const;
281
283 int &molCount // this is the starting mol count, and receives the ending
284 // mol count - THis is used when
285 // MarvinMol->convertToSuperAtoms is called multiple times
286 // from a RXN
287 ,
288 int &atomCount // starting and ending atom count
289 ,
290 int &bondCount // starting and ending bond count
291 ,
292 int &sgCount // starting and ending sq count
293 ,
294 std::map<std::string, std::string>
295 &sgMap // map from old sg number to new sg number
296 ,
297 std::map<std::string, std::string>
298 &atomMap // map from old atom number to new atom number
299 ,
300 std::map<std::string, std::string>
301 &bondMap // map from old bond number to new bond number
302 );
303
304 // the following is virtual because some derived classes need to do more than
305 // just call the base class. Currently, only MarvinSuperatomSgroup does this
306 public:
308 int &molCount, // this is the starting mol count, and receives the ending
309 // mol count - THis is used when
310 // MarvinMol->convertToSuperAtoms is called multiple
311 // times from a RXN
312 int &atomCount, // starting and ending atom count
313 int &bondCount, // starting and ending bond count
314 std::map<std::string, std::string> &sgMap,
315 std::map<std::string, std::string> &atomMap,
316 std::map<std::string, std::string> &bondMap);
317
319 std::map<std::string, std::string> &sgMap);
320
321 // the following is virtual because some derived classes need to do more than
322 // just call the base class. Currently, only MarvinSuperatomSgroup does this
323
325 const std::vector<MarvinAtom *> &setOfAtoms) const;
326
327 public:
328 static bool atomRefInAtoms(MarvinAtom *a, std::string b);
329 static bool bondRefInBonds(MarvinBond *a, std::string b);
330 static bool molIDInSgroups(std::string a, std::string b);
333
336
337 virtual bool isPassiveRoleForExpansion() const;
338 virtual bool isPassiveRoleForContraction() const;
339 virtual void processSpecialSgroups();
341 std::unique_ptr<SubstanceGroup> &sgroup,
342 int sequenceId);
343
344 bool has2dCoords() const;
345 bool has3dCoords() const;
346 bool hasAny3dCoords() const;
347 bool hasAny2dCoords() const;
348 bool hasCoords() const;
350
352};
353
355 private:
356 std::string roleName; // could be MarvinSruSgroup, MarvinCopolymerSgroup or
357 // MarvinModificationSgroup
358 public:
359 MarvinMolBase *copyMol(const std::string &idAppend) const override;
362
363 std::string title;
364 std::string connect;
365 std::string correspondence;
366
367 std::string toString() const override;
368 ptree toPtree() const override;
369
370 std::string role() const override;
371 bool hasAtomBondBlocks() const override;
373 std::unique_ptr<SubstanceGroup> &sgroup,
374 int sequenceId) override;
375};
376
378 public:
381
382 MarvinMolBase *copyMol(const std::string &idAppend) const override;
383
384 std::string context;
385 std::string fieldName;
386 std::string placement;
387 std::string unitsDisplayed;
388 std::string queryType;
389 std::string queryOp;
390 std::string fieldData;
391 std::string units;
392 double x;
393 double y;
394
395 std::string toString() const override;
396 ptree toPtree() const override;
397
398 std::string role() const override;
399 bool hasAtomBondBlocks() const override;
401 std::unique_ptr<SubstanceGroup> &sgroup,
402 int sequenceId) override;
403};
404
406 public:
407 std::string title;
408
411
412 MarvinMolBase *copyMol(const std::string &idAppend) const override;
413
415
417
418 std::string toString() const override;
419 ptree toPtree() const override;
420
421 std::string role() const override;
422 bool hasAtomBondBlocks() const override;
423 bool isPassiveRoleForContraction() const override;
424
426 std::unique_ptr<SubstanceGroup> &sgroup,
427 int sequenceId) override;
428};
429
431 public:
434
435 MarvinMolBase *copyMol(const std::string &idAppend) const override;
436
437 std::string title;
438 bool isExpanded = false;
439 std::vector<MarvinAtom *> parentAtoms;
440 std::vector<MarvinBond *>
441 bondsToAtomsNotInExpandedGroup; // only when expanded
442
446 std::vector<MarvinBond *> &bondsToTry,
447 std::vector<MarvinBond *> &orphanedBonds) const;
448
449 std::string toString() const override;
450 ptree toPtree() const override;
451
452 std::string role() const override;
453 bool hasAtomBondBlocks() const override;
454 bool isPassiveRoleForExpansion() const override;
455 bool isPassiveRoleForContraction() const override;
456 void processSpecialSgroups() override;
457
459 std::unique_ptr<SubstanceGroup> &sgroup,
460 int sequenceId) override;
461};
462
464 // <molecule molID="m2" id="sg1" role="MulticenterSgroup" atomRefs="a2 a6 a5
465 // a4 a3" center="a18"/>sgroup->
466 public:
469
470 MarvinMolBase *copyMol(const std::string &idAppend) const override;
471
473
474 std::string toString() const override;
475 ptree toPtree() const override;
476
478 std::string role() const override;
479 bool hasAtomBondBlocks() const override;
480 void processSpecialSgroups() override;
482 std::unique_ptr<SubstanceGroup> &sgroup,
483 int sequenceId) override;
484};
485
487 // <molecule molID="m2" id="sg1" role="GenericSgroup" atomRefs="a1 a2 a3 a4 a5
488 // a6 a7 a8 a9 a13 a10 a11 a12" charge="onAtoms"/></molecule>
489 public:
492
493 MarvinMolBase *copyMol(const std::string &idAppend) const override;
494
495 std::string charge; // onAtoms or onBrackets
496 std::string toString() const override;
497 ptree toPtree() const override;
498
499 std::string role() const override;
500 bool hasAtomBondBlocks() const override;
502 std::unique_ptr<SubstanceGroup> &sgroup,
503 int sequenceId) override;
504};
505
507 // <molecule id="sg1" role="MonomerSgroup" title="mon" charge="onAtoms"
508 // molID="m2" atomRefs="a2 a1 a3 a4">
509 // </molecule>
510 public:
513
514 MarvinMolBase *copyMol(const std::string &idAppend) const override;
515
516 std::string title;
517 std::string charge; // onAtoms or onBrackets
518 std::string toString() const override;
519 ptree toPtree() const override;
520
521 std::string role() const override;
522 bool hasAtomBondBlocks() const override;
524 std::unique_ptr<SubstanceGroup> &sgroup,
525 int sequenceId) override;
526};
527
529 public:
530 std::string title;
531 std::vector<std::unique_ptr<MarvinAttachmentPoint>> attachmentPoints;
532
535
536 MarvinMolBase *copyMol(const std::string &idAppend) const override;
537
539
541
542 std::string role() const override;
543 bool hasAtomBondBlocks() const override;
544 bool isPassiveRoleForExpansion() const override;
545
546 std::string toString() const override;
547 ptree toPtree() const override;
548
550 int &molCount, // this is the starting mol count, and receives the ending
551 // mol count - THis is used when
552 // MarvinMol->convertToSuperAtoms is called multiple
553 // times from a RXN
554 int &atomCount, // starting and ending atom count
555 int &bondCount, // starting and ending bond count
556 std::map<std::string, std::string> &sgMap,
557 std::map<std::string, std::string> &atomMap,
558 std::map<std::string, std::string> &bondMap) override;
559
561 const std::vector<MarvinAtom *> &setOfAtoms) const override;
562
563 void processSpecialSgroups() override;
564};
565
566class MarvinMol : public MarvinMolBase {
567 public:
570
571 MarvinMolBase *copyMol(const std::string &idAppend) const override;
572
573 ~MarvinMol() override;
574
575 std::vector<std::unique_ptr<MarvinAtom>> ownedAtoms;
576 std::vector<std::unique_ptr<MarvinBond>> ownedBonds;
577
578 void pushOwnedAtom(MarvinAtom *atom) override;
579 void pushOwnedBond(MarvinBond *bond) override;
580
581 void removeOwnedAtom(MarvinAtom *atom) override;
582 void removeOwnedBond(MarvinBond *bond) override;
583
584 std::string role() const override;
585 bool hasAtomBondBlocks() const override;
586 bool isPassiveRoleForContraction() const override;
587
588 std::string toString() const override;
589 ptree toPtree() const override;
590
591 std::string generateMolString();
592 ptree toMolPtree() const;
593};
594
596 public:
597 std::vector<std::unique_ptr<MarvinMol>> reactants;
598 std::vector<std::unique_ptr<MarvinMol>> agents;
599 std::vector<std::unique_ptr<MarvinMol>> products;
600
602 std::vector<std::unique_ptr<MarvinPlus>> pluses;
603 std::vector<std::unique_ptr<MarvinCondition>> conditions;
604
606
608
609 std::string toString();
610 ptree toPtree() const;
611};
612
614 public:
615 StereoGroupType groupType; // one of ABS AND OR
617 std::vector<unsigned int> atoms;
618
620};
621
622template <typename T>
623bool getCleanNumber(std::string strToParse, T &outInt);
624} // namespace RDKit
625
626#endif // RD_MARVINDEFS_H
pulls in the core RDKit functionality
used by various file parsing classes to indicate a parse error
ptree toPtree() const
std::string toString() const
std::string type
Definition MarvinDefs.h:69
std::string mrvStereoGroup
Definition MarvinDefs.h:133
bool isElement() const
std::string id
Definition MarvinDefs.h:119
std::string elementType
Definition MarvinDefs.h:120
std::string toString() const
ptree toPtree(unsigned int coordinatePrecision=6) const
std::string sgroupRef
Definition MarvinDefs.h:135
std::string radical
Definition MarvinDefs.h:128
std::string sgroupAttachmentPoint
Definition MarvinDefs.h:138
MarvinAtom(const MarvinAtom &atomToCopy, std::string newId)
bool operator==(const MarvinAtom &rhs) const
bool operator==(const MarvinAtom *rhs) const
std::string mrvAlias
Definition MarvinDefs.h:132
std::string toString() const
std::string conventionValue
Definition MarvinDefs.h:158
std::string toString() const
std::string convention
Definition MarvinDefs.h:172
ptree toPtree() const
std::string queryType
Definition MarvinDefs.h:171
MarvinBond(const MarvinBond &bondToCopy, std::string newId, std::string atomRef1, std::string atomRef2)
std::string atomRefs2[2]
Definition MarvinDefs.h:168
std::string id
Definition MarvinDefs.h:167
std::string order
Definition MarvinDefs.h:169
MarvinBondStereo bondStereo
Definition MarvinDefs.h:170
bool operator==(const MarvinAtom &rhs) const
const std::string getBondType() const
bool isEqual(const MarvinAtom &other) const
std::string toString() const
std::string toString() const
ptree toPtree() const
bool hasAtomBondBlocks() const override
MarvinDataSgroup(MarvinMolBase *parent)
std::string unitsDisplayed
Definition MarvinDefs.h:387
MarvinDataSgroup(MarvinMolBase *parent, ptree &molTree)
MarvinMolBase * copyMol(const std::string &idAppend) const override
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
std::string role() const override
ptree toPtree() const override
std::string toString() const override
bool hasAtomBondBlocks() const override
ptree toPtree() const override
MarvinGenericSgroup(MarvinMolBase *parent, ptree &molTree)
std::string toString() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::string role() const override
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
MarvinGenericSgroup(MarvinMolBase *parent)
unsigned int coordinatePrecision
Definition MarvinDefs.h:248
bool AnyOverLappingAtoms(const MarvinMolBase *otherMol) const
void cleanUpNumbering(int &molCount, int &atomCount, int &bondCount, int &sgCount, std::map< std::string, std::string > &sgMap, std::map< std::string, std::string > &atomMap, std::map< std::string, std::string > &bondMap)
void cleanUpSgNumbering(int &sgCount, std::map< std::string, std::string > &sgMap)
void setPrecision(unsigned int precision)
virtual std::string role() const =0
const std::vector< std::string > getAtomList() const
virtual MarvinMolBase * copyMol(const std::string &idAppend) const =0
virtual void processSpecialSgroups()
virtual ~MarvinMolBase()
const std::vector< std::string > getBondList() const
static bool atomRefInAtoms(MarvinAtom *a, std::string b)
int getBondIndex(std::string id) const
std::vector< MarvinBond * > bonds
Definition MarvinDefs.h:250
bool hasAny2dCoords() const
virtual std::string toString() const =0
virtual void pushOwnedBond(MarvinBond *bond)
virtual bool isPassiveRoleForExpansion() const
bool has3dCoords() const
virtual bool hasAtomBondBlocks() const =0
virtual void removeOwnedBond(MarvinBond *bond)
void addSgroupsToPtree(ptree &pt) const
virtual void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId)
std::vector< std::unique_ptr< MarvinMolBase > > sgroups
Definition MarvinDefs.h:251
virtual ptree toPtree() const
virtual bool isPassiveRoleForContraction() const
int getAtomIndex(std::string id) const
MarvinAtom * findAtomByRef(std::string atomId)
virtual IsSgroupInAtomSetResult isSgroupInSetOfAtoms(const std::vector< MarvinAtom * > &setOfAtoms) const
void parseAtomsAndBonds(ptree &molTree)
MarvinBond * findBondByRef(std::string atomId)
MarvinMolBase * parent
Definition MarvinDefs.h:252
virtual void pushOwnedAtom(MarvinAtom *atom)
static bool molIDInSgroups(std::string a, std::string b)
std::vector< MarvinAtom * > atoms
Definition MarvinDefs.h:249
bool hasAny3dCoords() const
void processSgroupsFromRDKit()
static bool bondRefInBonds(MarvinBond *a, std::string b)
int getExplicitValence(const MarvinAtom &marvinAtom) const
virtual void removeOwnedAtom(MarvinAtom *atom)
bool has2dCoords() const
virtual void cleanUpNumberingMolsAtomsBonds(int &molCount, int &atomCount, int &bondCount, std::map< std::string, std::string > &sgMap, std::map< std::string, std::string > &atomMap, std::map< std::string, std::string > &bondMap)
bool hasCoords() const
bool isPassiveRoleForContraction() const override
bool hasAtomBondBlocks() const override
std::vector< std::unique_ptr< MarvinAtom > > ownedAtoms
Definition MarvinDefs.h:575
void removeOwnedBond(MarvinBond *bond) override
MarvinMol(ptree &molTree)
std::string generateMolString()
void pushOwnedBond(MarvinBond *bond) override
std::string role() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
ptree toPtree() const override
ptree toMolPtree() const
void pushOwnedAtom(MarvinAtom *atom) override
std::vector< std::unique_ptr< MarvinBond > > ownedBonds
Definition MarvinDefs.h:576
~MarvinMol() override
void removeOwnedAtom(MarvinAtom *atom) override
std::string toString() const override
bool hasAtomBondBlocks() const override
ptree toPtree() const override
std::string toString() const override
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
MarvinMonomerSgroup(MarvinMolBase *parent, ptree &molTree)
MarvinMonomerSgroup(MarvinMolBase *parent)
std::string role() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::string role() const override
void processSpecialSgroups() override
bool hasAtomBondBlocks() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::string toString() const override
MarvinMulticenterSgroup(MarvinMolBase *parent, ptree &molTree)
MarvinMulticenterSgroup(MarvinMolBase *parent)
ptree toPtree() const override
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
int getMatchedOrphanBondIndex(std::string atomIdToCheck, std::vector< MarvinBond * > &bondsToTry, std::vector< MarvinBond * > &orphanedBonds) const
MarvinMultipleSgroup(MarvinMolBase *parent)
std::string role() const override
std::string toString() const override
bool isPassiveRoleForContraction() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::vector< MarvinAtom * > parentAtoms
Definition MarvinDefs.h:439
ptree toPtree() const override
void processSpecialSgroups() override
MarvinMultipleSgroup(MarvinMolBase *parent, ptree &molTree)
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
bool hasAtomBondBlocks() const override
bool isPassiveRoleForExpansion() const override
std::vector< MarvinBond * > bondsToAtomsNotInExpandedGroup
Definition MarvinDefs.h:441
std::string toString() const
ptree toPtree() const
std::string id
Definition MarvinDefs.h:81
std::vector< std::unique_ptr< MarvinMol > > products
Definition MarvinDefs.h:599
ptree toPtree() const
std::vector< std::unique_ptr< MarvinCondition > > conditions
Definition MarvinDefs.h:603
std::string toString()
std::vector< std::unique_ptr< MarvinPlus > > pluses
Definition MarvinDefs.h:602
std::vector< std::unique_ptr< MarvinMol > > reactants
Definition MarvinDefs.h:597
std::vector< std::unique_ptr< MarvinMol > > agents
Definition MarvinDefs.h:598
MarvinRectangle(const std::vector< MarvinAtom * > &atoms)
bool overlapsVertically(const MarvinRectangle &otherRectangle) const
static bool compareRectanglesByYReverse(MarvinRectangle &r1, MarvinRectangle &r2)
MarvinRectangle(const RDGeom::Point3D &upperLeftInit, const RDGeom::Point3D &lowerRightInit)
RDGeom::Point3D & getCenter()
bool overlapsVHorizontally(const MarvinRectangle &otherRectangle) const
RDGeom::Point3D center
Definition MarvinDefs.h:191
static bool compareRectanglesByX(MarvinRectangle &r1, MarvinRectangle &r2)
RDGeom::Point3D upperLeft
Definition MarvinDefs.h:195
RDGeom::Point3D lowerRight
Definition MarvinDefs.h:196
MarvinRectangle(double left, double right, double top, double bottom)
MarvinRectangle(const std::vector< MarvinRectangle > &rects)
void extend(const MarvinRectangle &otherRectangle)
std::string role() const override
ptree toPtree() const override
bool hasAtomBondBlocks() const override
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
MarvinSruCoModSgroup(std::string type, MarvinMolBase *parent)
std::string toString() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
MarvinSruCoModSgroup(MarvinMolBase *parent, std::string role, ptree &molTree)
StereoGroupType groupType
Definition MarvinDefs.h:615
std::vector< unsigned int > atoms
Definition MarvinDefs.h:617
MarvinStereoGroup(StereoGroupType grouptypeInit, int groupNumberInit)
bool isPassiveRoleForContraction() const override
std::string toString() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
MarvinSuperatomSgroupExpanded(MarvinMolBase *parent, ptree &molTree)
ptree toPtree() const override
MarvinSuperatomSgroupExpanded(MarvinMolBase *parent)
void parseMoleculeSpecific(RDKit::RWMol *mol, std::unique_ptr< SubstanceGroup > &sgroup, int sequenceId) override
bool hasAtomBondBlocks() const override
std::string role() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::string toString() const override
bool isPassiveRoleForExpansion() const override
void cleanUpNumberingMolsAtomsBonds(int &molCount, int &atomCount, int &bondCount, std::map< std::string, std::string > &sgMap, std::map< std::string, std::string > &atomMap, std::map< std::string, std::string > &bondMap) override
void processSpecialSgroups() override
ptree toPtree() const override
MarvinSuperatomSgroup(MarvinMolBase *parent, ptree &molTree)
std::string role() const override
MarvinSuperatomSgroup(MarvinMolBase *parent)
std::vector< std::unique_ptr< MarvinAttachmentPoint > > attachmentPoints
Definition MarvinDefs.h:531
bool hasAtomBondBlocks() const override
IsSgroupInAtomSetResult isSgroupInSetOfAtoms(const std::vector< MarvinAtom * > &setOfAtoms) const override
MarvinWriterException(std::string message)
Definition MarvinDefs.h:63
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
Std stuff.
const std::vector< std::string > marvinStereoConventionTypes
Definition MarvinDefs.h:43
const std::vector< std::string > marvinBondOrders
Definition MarvinDefs.h:39
StereoGroupType
Definition StereoGroup.h:31
bool rdvalue_is(const RDValue_cast_t)
const std::vector< std::string > sruSgroupConnectChoices
Definition MarvinDefs.h:38
const std::vector< std::string > marvinConventionTypes
Definition MarvinDefs.h:41
IsSgroupInAtomSetResult
Definition MarvinDefs.h:55
@ SgroupInAtomSet
Definition MarvinDefs.h:56
@ SgroupNotInAtomSet
Definition MarvinDefs.h:57
@ SgroupBothInAndNotInAtomSet
Definition MarvinDefs.h:58
void eraseUniquePtr(std::vector< std ::unique_ptr< T > > &vector, T *itemToErase)
Definition MarvinDefs.h:234
const std::map< int, std::string > radicalElectronsToMarvinRadical
Definition MarvinDefs.h:52
bool getCleanNumber(std::string strToParse, T &outInt)
const std::vector< std::string > marvinRadicalVals
Definition MarvinDefs.h:45
const std::vector< std::string > marvinStereoDictRefTypes
Definition MarvinDefs.h:42
const std::vector< std::string > marvinQueryBondsTypes
Definition MarvinDefs.h:40
std::vector< std::unique_ptr< T > >::iterator findUniquePtr(std::vector< std ::unique_ptr< T > > &vector, T *itemToFind)
Definition MarvinDefs.h:219
const std::map< std::string, int > marvinRadicalToRadicalElectrons
Definition MarvinDefs.h:48