RDKit
Open-source cheminformatics and machine learning.
RDKit::Canon Namespace Reference

Classes

class  AtomCompareFunctor
 
struct  bondholder
 
struct  canon_atom
 
class  ChiralAtomCompareFunctor
 
class  MolStackElem
 these are the actual elements in the molecular stack More...
 
union  MolStackUnion
 used to store components in the molecular stack More...
 
class  SpecialChiralityAtomCompareFunctor
 
class  SpecialSymmetryAtomCompareFunctor
 

Typedefs

typedef std::vector< MolStackElemMolStack
 
typedef boost::tuple< int, int, Bond * > PossibleType
 used to represent possible branches from an atom More...
 

Enumerations

enum  AtomColors { WHITE_NODE = 0, GREY_NODE, BLACK_NODE }
 used in traversals of the molecule More...
 
enum  MolStackTypes {
  MOL_STACK_ATOM = 0, MOL_STACK_BOND, MOL_STACK_RING, MOL_STACK_BRANCH_OPEN,
  MOL_STACK_BRANCH_CLOSE
}
 used to indicate types of entries in the molecular stack: More...
 

Functions

void canonicalizeFragment (ROMol &mol, int atomIdx, std::vector< AtomColors > &colors, const std::vector< unsigned int > &ranks, MolStack &molStack, const boost::dynamic_bitset<> *bondsInPlay=0, const std::vector< std::string > *bondSymbols=0, bool doIsomericSmiles=false)
 constructs the canonical traversal order for a molecular fragment More...
 
void updateAtomNeighborIndex (canon_atom *atoms, std::vector< bondholder > &nbrs)
 
void updateAtomNeighborNumSwaps (canon_atom *atoms, std::vector< bondholder > &nbrs, unsigned int atomIdx, std::vector< std::pair< unsigned int, unsigned int > > &result)
 
template<typename CompareFunc >
void RefinePartitions (const ROMol &mol, canon_atom *atoms, CompareFunc compar, int mode, int *order, int *count, int &activeset, int *next, int *changed, char *touchedPartitions)
 
template<typename CompareFunc >
void BreakTies (const ROMol &mol, canon_atom *atoms, CompareFunc compar, int mode, int *order, int *count, int &activeset, int *next, int *changed, char *touchedPartitions)
 
void CreateSinglePartition (unsigned int nAtoms, int *order, int *count, canon_atom *atoms)
 
void ActivatePartitions (unsigned int nAtoms, int *order, int *count, int &activeset, int *next, int *changed)
 
void rankMolAtoms (const ROMol &mol, std::vector< unsigned int > &res, bool breakTies=true, bool includeChirality=true, bool includeIsotopes=true)
 
void rankFragmentAtoms (const ROMol &mol, std::vector< unsigned int > &res, const boost::dynamic_bitset<> &atomsInPlay, const boost::dynamic_bitset<> &bondsInPlay, const std::vector< std::string > *atomSymbols=NULL, bool breakTies=true, bool includeChirality=true, bool includeIsotopes=true)
 
void chiralRankMolAtoms (const ROMol &mol, std::vector< unsigned int > &res)
 
void initCanonAtoms (const ROMol &mol, std::vector< Canon::canon_atom > &atoms, bool includeChirality=true)
 

Variables

const int MAX_NATOMS = 5000
 used in the canonical traversal code More...
 
const int MAX_CYCLES = 1000
 used in the canonical traversal code More...
 
const int MAX_BONDTYPE = 32
 used in the canonical traversal code More...
 
const unsigned int ATNUM_CLASS_OFFSET = 10000
 

Typedef Documentation

typedef std::vector<MolStackElem> RDKit::Canon::MolStack

Definition at line 91 of file Canon.h.

typedef boost::tuple<int, int, Bond *> RDKit::Canon::PossibleType

used to represent possible branches from an atom

Definition at line 94 of file Canon.h.

Enumeration Type Documentation

used in traversals of the molecule

Enumerator
WHITE_NODE 
GREY_NODE 

not visited

BLACK_NODE 

visited, but not finished

Definition at line 27 of file Canon.h.

used to indicate types of entries in the molecular stack:

Enumerator
MOL_STACK_ATOM 

an Atom

MOL_STACK_BOND 

a Bond

MOL_STACK_RING 

a ring closure

MOL_STACK_BRANCH_OPEN 

beginning of a branch

MOL_STACK_BRANCH_CLOSE 

end of a branch

Definition at line 34 of file Canon.h.

Function Documentation

void RDKit::Canon::ActivatePartitions ( unsigned int  nAtoms,
int *  order,
int *  count,
int &  activeset,
int *  next,
int *  changed 
)

Referenced by BreakTies().

template<typename CompareFunc >
void RDKit::Canon::BreakTies ( const ROMol mol,
canon_atom atoms,
CompareFunc  compar,
int  mode,
int *  order,
int *  count,
int &  activeset,
int *  next,
int *  changed,
char *  touchedPartitions 
)
void RDKit::Canon::canonicalizeFragment ( ROMol mol,
int  atomIdx,
std::vector< AtomColors > &  colors,
const std::vector< unsigned int > &  ranks,
MolStack molStack,
const boost::dynamic_bitset<> *  bondsInPlay = 0,
const std::vector< std::string > *  bondSymbols = 0,
bool  doIsomericSmiles = false 
)

constructs the canonical traversal order for a molecular fragment

Parameters
molthe ROMol we're working on
atomIdxthe index of the atom to start the traversal from
colorsthe traversal status of each atom in mol
ranksthe assigned rank of each atom in mol
molStackthe current traversal stack (used to return the results)

Notes

  • mol will, in general, be modified by this operation as bond directions and the like are changed to fit the canonical traversal order
void RDKit::Canon::chiralRankMolAtoms ( const ROMol mol,
std::vector< unsigned int > &  res 
)

Referenced by BreakTies().

void RDKit::Canon::CreateSinglePartition ( unsigned int  nAtoms,
int *  order,
int *  count,
canon_atom atoms 
)

Referenced by BreakTies().

void RDKit::Canon::initCanonAtoms ( const ROMol mol,
std::vector< Canon::canon_atom > &  atoms,
bool  includeChirality = true 
)

Referenced by BreakTies().

void RDKit::Canon::rankFragmentAtoms ( const ROMol mol,
std::vector< unsigned int > &  res,
const boost::dynamic_bitset<> &  atomsInPlay,
const boost::dynamic_bitset<> &  bondsInPlay,
const std::vector< std::string > *  atomSymbols = NULL,
bool  breakTies = true,
bool  includeChirality = true,
bool  includeIsotopes = true 
)

Referenced by BreakTies().

void RDKit::Canon::rankMolAtoms ( const ROMol mol,
std::vector< unsigned int > &  res,
bool  breakTies = true,
bool  includeChirality = true,
bool  includeIsotopes = true 
)

Referenced by BreakTies().

template<typename CompareFunc >
void RDKit::Canon::RefinePartitions ( const ROMol mol,
canon_atom atoms,
CompareFunc  compar,
int  mode,
int *  order,
int *  count,
int &  activeset,
int *  next,
int *  changed,
char *  touchedPartitions 
)
void RDKit::Canon::updateAtomNeighborNumSwaps ( canon_atom atoms,
std::vector< bondholder > &  nbrs,
unsigned int  atomIdx,
std::vector< std::pair< unsigned int, unsigned int > > &  result 
)

Variable Documentation

const unsigned int RDKit::Canon::ATNUM_CLASS_OFFSET = 10000

Definition at line 437 of file new_canon.h.

const int RDKit::Canon::MAX_BONDTYPE = 32

used in the canonical traversal code

Definition at line 24 of file Canon.h.

const int RDKit::Canon::MAX_CYCLES = 1000

used in the canonical traversal code

Definition at line 23 of file Canon.h.

const int RDKit::Canon::MAX_NATOMS = 5000

used in the canonical traversal code

Definition at line 22 of file Canon.h.