16#ifndef RD_MARVINDEFS_H
17#define RD_MARVINDEFS_H
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>
34using boost::property_tree::ptree;
46 "monovalent",
"divalent",
"divalent1",
"divalent3",
47 "trivalent",
"trivalent2",
"trivalent4",
"4"};
49 {
"monovalent", 1}, {
"divalent", 2}, {
"divalent1", 2}, {
"divalent3", 2},
50 {
"trivalent", 3}, {
"trivalent2", 3}, {
"trivalent4", 3}, {
"4", 4}};
53 {1,
"monovalent"}, {2,
"divalent"}, {3,
"trivalent4"}, {4,
"4"}};
64 : std::runtime_error(
message) {};
151 ptree
toPtree(
unsigned int coordinatePrecision = 6)
const;
220 std::vector<std ::unique_ptr<T>> &vector, T *
itemToFind) {
223 return uniquePtr.get() == itemToFind;
251 std::vector<std::unique_ptr<MarvinMolBase>>
sgroups;
254 virtual std::string
role()
const = 0;
294 std::map<std::string, std::string>
297 std::map<std::string, std::string>
300 std::map<std::string, std::string>
314 std::map<std::string, std::string> &
sgMap,
315 std::map<std::string, std::string> &
atomMap,
316 std::map<std::string, std::string> &
bondMap);
319 std::map<std::string, std::string> &
sgMap);
325 const std::vector<MarvinAtom *> &
setOfAtoms)
const;
341 std::unique_ptr<SubstanceGroup> &
sgroup,
356 std::string roleName;
370 std::string
role()
const override;
373 std::unique_ptr<SubstanceGroup> &
sgroup,
398 std::string
role()
const override;
401 std::unique_ptr<SubstanceGroup> &
sgroup,
421 std::string
role()
const override;
426 std::unique_ptr<SubstanceGroup> &
sgroup,
440 std::vector<MarvinBond *>
452 std::string
role()
const override;
459 std::unique_ptr<SubstanceGroup> &
sgroup,
478 std::string
role()
const override;
482 std::unique_ptr<SubstanceGroup> &
sgroup,
499 std::string
role()
const override;
502 std::unique_ptr<SubstanceGroup> &
sgroup,
521 std::string
role()
const override;
524 std::unique_ptr<SubstanceGroup> &
sgroup,
542 std::string
role()
const override;
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;
561 const std::vector<MarvinAtom *> &
setOfAtoms)
const override;
584 std::string
role()
const override;
598 std::vector<std::unique_ptr<MarvinMol>>
agents;
602 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