16#ifndef RD_MARVINDEFS_H
17#define RD_MARVINDEFS_H
22#include <boost/property_tree/xml_parser.hpp>
27using boost::property_tree::ptree;
39 "monovalent",
"divalent",
"divalent1",
"divalent3",
40 "trivalent",
"trivalent2",
"trivalent4",
"4"};
42 {
"monovalent", 1}, {
"divalent", 2}, {
"divalent1", 2}, {
"divalent3", 2},
43 {
"trivalent", 3}, {
"trivalent2", 3}, {
"trivalent4", 3}, {
"4", 4}};
46 {1,
"monovalent"}, {2,
"divalent"}, {3,
"trivalent4"}, {4,
"4"}};
57 : std::runtime_error(
message) {};
144 ptree
toPtree(
unsigned int coordinatePrecision = 6)
const;
213 std::vector<std ::unique_ptr<T>> &vector, T *
itemToFind) {
216 return uniquePtr.get() == itemToFind;
244 std::vector<std::unique_ptr<MarvinMolBase>>
sgroups;
247 virtual std::string
role()
const = 0;
287 std::map<std::string, std::string>
290 std::map<std::string, std::string>
293 std::map<std::string, std::string>
307 std::map<std::string, std::string> &
sgMap,
308 std::map<std::string, std::string> &
atomMap,
309 std::map<std::string, std::string> &
bondMap);
312 std::map<std::string, std::string> &
sgMap);
318 const std::vector<MarvinAtom *> &
setOfAtoms)
const;
334 std::unique_ptr<SubstanceGroup> &
sgroup,
349 std::string roleName;
363 std::string
role()
const override;
366 std::unique_ptr<SubstanceGroup> &
sgroup,
391 std::string
role()
const override;
394 std::unique_ptr<SubstanceGroup> &
sgroup,
414 std::string
role()
const override;
419 std::unique_ptr<SubstanceGroup> &
sgroup,
433 std::vector<MarvinBond *>
445 std::string
role()
const override;
452 std::unique_ptr<SubstanceGroup> &
sgroup,
471 std::string
role()
const override;
475 std::unique_ptr<SubstanceGroup> &
sgroup,
492 std::string
role()
const override;
495 std::unique_ptr<SubstanceGroup> &
sgroup,
514 std::string
role()
const override;
517 std::unique_ptr<SubstanceGroup> &
sgroup,
535 std::string
role()
const override;
549 std::map<std::string, std::string> &
sgMap,
550 std::map<std::string, std::string> &
atomMap,
551 std::map<std::string, std::string> &
bondMap)
override;
554 const std::vector<MarvinAtom *> &
setOfAtoms)
const override;
577 std::string
role()
const override;
591 std::vector<std::unique_ptr<MarvinMol>>
agents;
595 std::vector<std::unique_ptr<MarvinPlus>>
pluses;
pulls in the core RDKit functionality
used by various file parsing classes to indicate a parse error
std::string toString() const
std::string mrvStereoGroup
std::string toString() const
ptree toPtree(unsigned int coordinatePrecision=6) const
std::string sgroupAttachmentPoint
MarvinAtom(const MarvinAtom &atomToCopy, std::string newId)
bool operator==(const MarvinAtom &rhs) const
bool operator==(const MarvinAtom *rhs) const
bool sGroupRefIsSuperatom
std::string toString() const
std::string conventionValue
std::string toString() const
MarvinBond(const MarvinBond &bondToCopy, std::string newId, std::string atomRef1, std::string atomRef2)
MarvinBondStereo bondStereo
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
bool hasAtomBondBlocks() const override
MarvinDataSgroup(MarvinMolBase *parent)
std::string unitsDisplayed
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
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()
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
bool hasAny2dCoords() const
virtual std::string toString() const =0
void prepSgroupsForRDKit()
virtual void pushOwnedBond(MarvinBond *bond)
virtual bool isPassiveRoleForExpansion() 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
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)
virtual void pushOwnedAtom(MarvinAtom *atom)
static bool molIDInSgroups(std::string a, std::string b)
std::vector< MarvinAtom * > atoms
bool hasAny3dCoords() const
void processSgroupsFromRDKit()
static bool bondRefInBonds(MarvinBond *a, std::string b)
int getExplicitValence(const MarvinAtom &marvinAtom) const
virtual void removeOwnedAtom(MarvinAtom *atom)
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 isPassiveRoleForContraction() const override
bool hasAtomBondBlocks() const override
std::vector< std::unique_ptr< MarvinAtom > > ownedAtoms
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
void pushOwnedAtom(MarvinAtom *atom) override
std::vector< std::unique_ptr< MarvinBond > > ownedBonds
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)
void processOneMulticenterSgroup()
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
void expandOneMultipleSgroup()
MarvinMultipleSgroup(MarvinMolBase *parent)
std::string role() const override
std::string toString() const override
void contractOneMultipleSgroup()
bool isPassiveRoleForContraction() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::vector< MarvinAtom * > parentAtoms
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
std::string toString() const
std::vector< std::unique_ptr< MarvinMol > > products
std::vector< std::unique_ptr< MarvinCondition > > conditions
std::vector< std::unique_ptr< MarvinPlus > > pluses
std::vector< std::unique_ptr< MarvinMol > > reactants
void prepSgroupsForRDKit()
std::vector< std::unique_ptr< MarvinMol > > agents
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
static bool compareRectanglesByX(MarvinRectangle &r1, MarvinRectangle &r2)
RDGeom::Point3D upperLeft
RDGeom::Point3D lowerRight
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
std::string correspondence
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
std::vector< unsigned int > atoms
MarvinStereoGroup(StereoGroupType grouptypeInit, int groupNumberInit)
bool isPassiveRoleForContraction() const override
std::string toString() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
~MarvinSuperatomSgroupExpanded() 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
MarvinMolBase * convertToOneSuperAtom()
std::string role() const override
MarvinMolBase * copyMol(const std::string &idAppend) const override
std::string toString() const override
void convertFromOneSuperAtom()
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
bool hasAtomBondBlocks() const override
IsSgroupInAtomSetResult isSgroupInSetOfAtoms(const std::vector< MarvinAtom * > &setOfAtoms) const override
~MarvinSuperatomSgroup() override
MarvinWriterException(std::string message)
RWMol is a molecule class that is intended to be edited.
const std::vector< std::string > marvinStereoConventionTypes
const std::vector< std::string > marvinBondOrders
bool rdvalue_is(const RDValue_cast_t)
const std::vector< std::string > sruSgroupConnectChoices
const std::vector< std::string > marvinConventionTypes
@ SgroupBothInAndNotInAtomSet
void eraseUniquePtr(std::vector< std ::unique_ptr< T > > &vector, T *itemToErase)
const std::map< int, std::string > radicalElectronsToMarvinRadical
bool getCleanNumber(std::string strToParse, T &outInt)
const std::vector< std::string > marvinRadicalVals
const std::vector< std::string > marvinStereoDictRefTypes
const std::vector< std::string > marvinQueryBondsTypes
std::vector< std::unique_ptr< T > >::iterator findUniquePtr(std::vector< std ::unique_ptr< T > > &vector, T *itemToFind)
const std::map< std::string, int > marvinRadicalToRadicalElectrons