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
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
45 public:
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
Defines the primary molecule class ROMol as well as associated typedefs.
MetalDisconnector(const MetalDisconnectorOptions &options=MetalDisconnectorOptions())
MetalDisconnector(const MetalDisconnector &other)
ROMol * disconnect(const ROMol &mol)
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition export.h:353
Std stuff.