RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
CIPLabeler.h
Go to the documentation of this file.
1//
2//
3// Copyright (C) 2020 Schrödinger, LLC
4//
5// @@ All Rights Reserved @@
6// This file is part of the RDKit.
7// The contents are covered by the terms of the BSD license
8// which is included in the file license.txt, found at the root
9// of the RDKit source tree.
10//
11#pragma once
12
14#include <boost/dynamic_bitset.hpp>
16
17#include <RDGeneral/export.h>
18
19namespace RDKit {
20
21class ROMol;
22
23namespace CIPLabeler_detail {
25}
26
27namespace CIPLabeler {
28
29/*
30 Some very symmetrical mols can cause pseudo infinite processing
31 (e.g. dodecahedrane)
32 To avoid this a maxinum number of iterations can be set by the caller as a
33 parameter to assignCIPLabels.
34 If that maximum value is exceeded, the following error is thrown
35*/
36
38 : public std::runtime_error {
39 public:
41 : std::runtime_error("Max Iterations Exceeded in CIP label calculation") {
42 };
43};
44
45/**
46 * Calculate Stereochemical labels based on an accurate implementation
47 * of the CIP rules.
48 *
49 * This is a C++ port of https://github.com/SiMolecule/centres, which was
50 * originally written by John Mayfield in Java. The original algorithm was
51 * described in:
52 *
53 * Hanson, R. M., Musacchio, S., Mayfield, J. W., Vainio, M. J., Yerin, A.,
54 * Redkin, D. Algorithmic Analysis of Cahn--Ingold--Prelog Rules of
55 * Stereochemistry: Proposals for Revised Rules and a Guide for Machine
56 * Implementation. J. Chem. Inf. Model. 2018, 58, 1755-1765.
57 *
58 * \param mol - the molecule to be labelled.
59 *
60 * \note only atoms with chiral tags and double bonds with proper
61 * bond directions will be labelled.
62 * \note Labels will be stored under the common_properties::_CIPCode
63 * property of the relevant atoms/bonds.
64 */
66 ROMol &mol, unsigned int maxRecursiveIterations = 0);
67
68/**
69 * Overload that allows selecting which atoms and/or bonds will be labeled.
70 *
71 * \param mol - the molecule to be labelled.
72 *
73 * \param atoms - bitset with the atom indexes to be labeled.
74 *
75 * \param bonds - bitset with the bond indexes to be labeled.
76 *
77 * \param maxRecursiveIterations - maximum number of iterations
78 * A value of 1,250,000 take about 1 second. Most structures requires
79 * less than 10,000 iterations. A peptide with MW~3000 took about
80 * 100 iterations, and a 20,000 mw protein took about 600 iterations.
81 *
82 */
84 ROMol &mol, const boost::dynamic_bitset<> &atoms,
85 const boost::dynamic_bitset<> &bonds,
86 unsigned int maxRecursiveIterations = 0);
87
88} // namespace CIPLabeler
89} // namespace RDKit
#define RDKIT_CIPLABELER_EXPORT
Definition export.h:33
RDKIT_CIPLABELER_EXPORT bool decrementRemainingCallCountAndCheck()
RDKIT_CIPLABELER_EXPORT void assignCIPLabels(ROMol &mol, unsigned int maxRecursiveIterations=0)
Std stuff.
bool rdvalue_is(const RDValue_cast_t)