RDKit: Metal.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Metal.h
Go to the documentation of this file.
1//
2// Copyright (C) 2018-2021 Susan H. Leung 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/*! \file Metal.h
11
12 \brief Defines the MetalDisconnector class.
13
14*/
15#include <RDGeneral/export.h>
16#ifndef RD_METAL_H
17#define RD_METAL_H
18
19#include <GraphMol/ROMol.h>
20
21namespace RDKit {
22class RWMol;
23class ROMol;
24
25namespace MolStandardize {
26//! The MetalDisconnector class contains tools for disconnecting metal atoms
27//! that are defined as covalently bonded to non-metals.
28/*!
29
30 <b>Notes:</b>
31 -
32*/
33
34 struct RDKIT_MOLSTANDARDIZE_EXPORT MetalDisconnectorOptions {
35 bool splitGrignards = false; // Whether to split Grignard-type complexes.
36 bool splitAromaticC = false; // Whether to split metal-aromatic C bonds.
37 bool adjustCharges = true; // Whether to adjust charges on ligand atoms.
38 bool removeHapticDummies =
39 false; // Whether to remove the dummy atoms representing haptic bonds.
40 // Such dummies are bonded to the metal with a bond
41 // that has the _MolFileBondEndPts prop set.
42};
43
44 class RDKIT_MOLSTANDARDIZE_EXPORT MetalDisconnector {
45 public:
46 MetalDisconnector(
47 const MetalDisconnectorOptions &options = MetalDisconnectorOptions());
48 MetalDisconnector(const MetalDisconnector &other);
49 ~MetalDisconnector();
50
51 ROMol *getMetalNof(); // {return dp_metal_nof;}
52 ROMol *getMetalNon(); // {return dp_metal_non;}
53 void setMetalNof(const ROMol &mol);
54 void setMetalNon(const ROMol &mol);
55
56 //! Break covalent bonds between metals and organic atoms under certain
57 //! conditions.
58 /*!
59 <b>Notes:</b>
60 The algorithm works as follows:
61- Disconnect N, O, F from any metal.
62- Disconnect other non-metals from transition metals + Al (but not Hg, Ga, Ge,
63In, Sn, As, Tl, Pb, Bi, Po).
64 - For every bond broken, adjust the charges of the begin and end atoms
65accordingly.
66 */
67 ROMol *disconnect(const ROMol &mol);
68 //! overload
69 /// modifies the molecule in place
70 void disconnect(RWMol &mol);
71 void disconnectInPlace(RWMol &mol) { disconnect(mol); };
72
73 private:
74 struct NonMetal {
75 int cutBonds{0};
76 std::vector<int> boundMetalIndices;
77 };
78 int chargeAdjustment(const Atom *a, int order);
79 ROMOL_SPTR dp_metal_nof;
80 ROMOL_SPTR dp_metal_non;
81 ROMOL_SPTR dp_metalDummy;
82
83 const MetalDisconnectorOptions d_options;
84
85 void adjust_charges(RDKit::RWMol &mol, std::map<int, NonMetal> &nonMetals,
86 std::map<int, int> &metalChargeExcess);
87 // Remove any dummy atoms that are bonded to a metal and have the ENDPTS
88 // prop. These are assumed to marking a haptic bond from the aotms in
89 // ENDPTS to the metal, e.g. in ferrocene.
90 void remove_haptic_dummies(RDKit::RWMol &mol);
91
92}; // class Metal
93
94} // namespace MolStandardize
95} // namespace RDKit
96#endif
ROMol.h
Defines the primary molecule class ROMol as well as associated typedefs.
RDKit::MolStandardize::MetalDisconnector::MetalDisconnector
MetalDisconnector(const MetalDisconnectorOptions &options=MetalDisconnectorOptions())
RDKit::MolStandardize::MetalDisconnector::getMetalNof
ROMol * getMetalNof()
RDKit::MolStandardize::MetalDisconnector::disconnect
void disconnect(RWMol &mol)
RDKit::MolStandardize::MetalDisconnector::getMetalNon
ROMol * getMetalNon()
RDKit::MolStandardize::MetalDisconnector::setMetalNon
void setMetalNon(const ROMol &mol)
RDKit::MolStandardize::MetalDisconnector::MetalDisconnector
MetalDisconnector(const MetalDisconnector &other)
RDKit::MolStandardize::MetalDisconnector::disconnectInPlace
void disconnectInPlace(RWMol &mol)
Definition Metal.h:71
RDKit::MolStandardize::MetalDisconnector::~MetalDisconnector
~MetalDisconnector()
RDKit::MolStandardize::MetalDisconnector::setMetalNof
void setMetalNof(const ROMol &mol)
RDKit::MolStandardize::MetalDisconnector::disconnect
ROMol * disconnect(const ROMol &mol)
RDKit::ROMol
Definition ROMol.h:199
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
export.h
RDKIT_MOLSTANDARDIZE_EXPORT
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition export.h:369
RDKit::MolStandardize
Definition AcidBaseCatalogEntry.h:22
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::MolStandardize::MetalDisconnectorOptions
Definition Metal.h:34
RDKit::MolStandardize::MetalDisconnectorOptions::adjustCharges
bool adjustCharges
Definition Metal.h:37
RDKit::MolStandardize::MetalDisconnectorOptions::removeHapticDummies
bool removeHapticDummies
Definition Metal.h:38
RDKit::MolStandardize::MetalDisconnectorOptions::splitGrignards
bool splitGrignards
Definition Metal.h:35
RDKit::MolStandardize::MetalDisconnectorOptions::splitAromaticC
bool splitAromaticC
Definition Metal.h:36