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
13
#include <boost/dynamic_bitset.hpp>
14
15
#include <
RDGeneral/export.h
>
16
17
namespace
RDKit
{
18
19
class
ROMol;
20
21
namespace
CIPLabeler_detail {
22
RDKIT_CIPLABELER_EXPORT
bool
decrementRemainingCallCountAndCheck
();
23
}
24
25
namespace
CIPLabeler {
26
27
/*
28
Some very symmetrical mols can cause pseudo infinite processing
29
(e.g. dodecahedrane)
30
To avoid this a maxinum number of iterations can be set by the caller as a
31
parameter to assignCIPLabels.
32
If that maximum value is exceeded, the following error is thrown
33
*/
34
35
class
RDKIT_CIPLABELER_EXPORT
MaxIterationsExceeded
36
:
public
std::runtime_error {
37
public
:
38
explicit
MaxIterationsExceeded
()
39
: std::runtime_error(
"Max Iterations Exceeded in CIP label calculation"
) {
40
};
41
};
42
43
/**
44
* Calculate Stereochemical labels based on an accurate implementation
45
* of the CIP rules.
46
*
47
* This is a C++ port of https://github.com/SiMolecule/centres, which was
48
* originally written by John Mayfield in Java. The original algorithm was
49
* described in:
50
*
51
* Hanson, R. M., Musacchio, S., Mayfield, J. W., Vainio, M. J., Yerin, A.,
52
* Redkin, D. Algorithmic Analysis of Cahn--Ingold--Prelog Rules of
53
* Stereochemistry: Proposals for Revised Rules and a Guide for Machine
54
* Implementation. J. Chem. Inf. Model. 2018, 58, 1755-1765.
55
*
56
* \param mol - the molecule to be labelled.
57
*
58
* \note only atoms with chiral tags and double bonds with proper
59
* bond directions will be labelled.
60
* \note Labels will be stored under the common_properties::_CIPCode
61
* property of the relevant atoms/bonds.
62
*/
63
RDKIT_CIPLABELER_EXPORT
void
assignCIPLabels
(
64
ROMol
&mol,
unsigned
int
maxRecursiveIterations
= 0);
65
66
/**
67
* Overload that allows selecting which atoms and/or bonds will be labeled.
68
*
69
* \param mol - the molecule to be labelled.
70
*
71
* \param atoms - bitset with the atom indexes to be labeled.
72
*
73
* \param bonds - bitset with the bond indexes to be labeled.
74
*
75
* \param maxRecursiveIterations - maximum number of iterations
76
* A value of 1,250,000 take about 1 second. Most structures requires
77
* less than 10,000 iterations. A peptide with MW~3000 took about
78
* 100 iterations, and a 20,000 mw protein took about 600 iterations.
79
*
80
*/
81
RDKIT_CIPLABELER_EXPORT
void
assignCIPLabels
(
82
ROMol
&mol,
const
boost::dynamic_bitset<> &atoms,
83
const
boost::dynamic_bitset<> &bonds,
84
unsigned
int
maxRecursiveIterations
= 0);
85
86
}
// namespace CIPLabeler
87
}
// namespace RDKit
RDKit::CIPLabeler::MaxIterationsExceeded
Definition
CIPLabeler.h:36
RDKit::CIPLabeler::MaxIterationsExceeded::MaxIterationsExceeded
MaxIterationsExceeded()
Definition
CIPLabeler.h:38
RDKit::ROMol
Definition
ROMol.h:199
export.h
RDKIT_CIPLABELER_EXPORT
#define RDKIT_CIPLABELER_EXPORT
Definition
export.h:33
RDKit::CIPLabeler_detail::decrementRemainingCallCountAndCheck
RDKIT_CIPLABELER_EXPORT bool decrementRemainingCallCountAndCheck()
RDKit::CIPLabeler::assignCIPLabels
RDKIT_CIPLABELER_EXPORT void assignCIPLabels(ROMol &mol, unsigned int maxRecursiveIterations=0)
RDKit
Std stuff.
Definition
Abbreviations.h:19
RDKit::rdvalue_is
bool rdvalue_is(const RDValue_cast_t)
Definition
RDValue-doublemagic.h:372
GraphMol
CIPLabeler
CIPLabeler.h
Generated on Mon Sep 30 2024 05:19:34 for RDKit by
1.9.8