Skip to content

Commit

Permalink
Fix incorrect CIP values for some aromatic atropisomers (rdkit#7957)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadhurst-cdd authored Nov 9, 2024
1 parent 75e8858 commit 57a9d29
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 70 deletions.
2 changes: 2 additions & 0 deletions Code/GraphMol/CIPLabeler/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ bool Node::isSet(int mask) const { return mask & d_flags; }

bool Node::isDuplicate() const { return d_flags & DUPLICATE; }

bool Node::isDuplicateOrH() const { return d_flags & DUPLICATE_OR_H; }

bool Node::isTerminal() const {
return d_visit.empty() || (isExpanded() && d_edges.size() == 1);
}
Expand Down
12 changes: 11 additions & 1 deletion Code/GraphMol/CIPLabeler/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ class Node {
/**
* Mask to check if a node is duplicated.
*/
static const int DUPLICATE = 0x6;

static const int DUPLICATE = RING_DUPLICATE | BOND_DUPLICATE;

/**
* Node was created for an implicit hydrogen,
* the 'atom' value will be null.
*/
static const int IMPL_HYDROGEN = 0x8;

/**
* Mask to check if a node is duplicated or created for an implicit H (not a
* primary node).
*/
static const int DUPLICATE_OR_H =
RING_DUPLICATE | BOND_DUPLICATE | IMPL_HYDROGEN;

Node() = delete;
Node(const Node &) = delete;
Node &operator=(const Node &) = delete;
Expand Down Expand Up @@ -81,6 +89,8 @@ class Node {

bool isDuplicate() const;

bool isDuplicateOrH() const;

bool isTerminal() const;

bool isExpanded() const;
Expand Down
Loading

0 comments on commit 57a9d29

Please sign in to comment.