RGroupDecomp.h
Go to the documentation of this file.
//
// Copyright (C) 2017 Novartis Institutes for BioMedical Research
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef RDKIT_RGROUPDECOMP_H
#define RDKIT_RGROUPDECOMP_H
#include "../RDKitBase.h"
#include <GraphMol/Substruct/SubstructMatch.h>
namespace RDKit {
//! Compute the isomporphic degenerative points in the
//! molecule. These are points that are symmetrically
//! equivalent.
/*!
\param mol Molecule to compute the degenerative points
\return the set of degenerative points (set<unsigned int>)
*/
typedef enum {
IsotopeLabels = 0x01,
AtomMapLabels = 0x02,
AtomIndexLabels = 0x04,
RelabelDuplicateLabels = 0x08,
MDLRGroupLabels = 0x10,
DummyAtomLabels = 0x20, // These are rgroups but will get relabelled
AutoDetect = 0xFF,
} RGroupLabels;
typedef enum {
Greedy = 0x01,
GreedyChunks = 0x02,
Exhaustive = 0x04, // not really useful for large sets
} RGroupMatching;
typedef enum {
AtomMap = 0x01,
Isotope = 0x02,
MDLRGroup = 0x04,
} RGroupLabelling;
typedef enum {
None = 0x0,
MCS = 0x01,
} RGroupCoreAlignment;
struct RDKIT_RGROUPDECOMPOSITION_EXPORT RGroupDecompositionParameters {
unsigned int labels;
unsigned int matchingStrategy;
unsigned int rgroupLabelling;
unsigned int alignment;
unsigned int chunkSize;
bool onlyMatchAtRGroups;
bool removeAllHydrogenRGroups;
bool removeHydrogensPostMatch;
RGroupDecompositionParameters(unsigned int labels = AutoDetect,
unsigned int strategy = GreedyChunks,
unsigned int labelling = AtomMap | MDLRGroup,
unsigned int alignment = MCS,
unsigned int chunkSize = 5,
bool matchOnlyAtRGroups = false,
bool removeHydrogenOnlyGroups = true,
bool removeHydrogensPostMatch = true)
: labels(labels),
matchingStrategy(strategy),
rgroupLabelling(labelling),
alignment(alignment),
chunkSize(chunkSize),
onlyMatchAtRGroups(matchOnlyAtRGroups),
removeAllHydrogenRGroups(removeHydrogenOnlyGroups),
removeHydrogensPostMatch(removeHydrogensPostMatch),
indexOffset(-1) {}
// Determine how to assign the rgroup labels from the given core
unsigned int autoGetLabels(const RWMol &);
// Prepare the core for substructure searching and rgroup assignment
bool prepareCore(RWMol &, const RWMol *alignCore);
private:
int indexOffset;
};
typedef std::map<std::string, boost::shared_ptr<ROMol>> RGroupRow;
typedef std::vector<boost::shared_ptr<ROMol>> RGroupColumn;
typedef std::vector<RGroupRow> RGroupRows;
typedef std::map<std::string, RGroupColumn> RGroupColumns;
struct RGroupDecompData;
class RDKIT_RGROUPDECOMPOSITION_EXPORT RGroupDecomposition {
RGroupDecompData *data; // implementation details
RGroupDecomposition(const RGroupDecomposition &); // no copy construct
RGroupDecomposition &operator=(
const RGroupDecomposition &); // Prevent assignment
public:
RGroupDecomposition(const ROMol &core,
const RGroupDecompositionParameters &params =
RGroupDecompositionParameters());
RGroupDecomposition(const std::vector<ROMOL_SPTR> &cores,
const RGroupDecompositionParameters &params =
RGroupDecompositionParameters());
~RGroupDecomposition();
int add(const ROMol &mol);
bool process();
//! return the current group labels
std::vector<std::string> getRGroupLabels() const;
//! return rgroups in row order group[row][attachment_point] = ROMol
RGroupRows getRGroupsAsRows() const;
//! return rgroups in column order group[attachment_point][row] = ROMol
RGroupColumns getRGroupsAsColumns() const;
};
RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(
const std::vector<ROMOL_SPTR> &cores, const std::vector<ROMOL_SPTR> &mols,
RGroupRows &rows, std::vector<unsigned int> *unmatched = nullptr,
const RGroupDecompositionParameters &options =
RGroupDecompositionParameters());
RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(
const std::vector<ROMOL_SPTR> &cores, const std::vector<ROMOL_SPTR> &mols,
RGroupColumns &columns, std::vector<unsigned int> *unmatched = nullptr,
const RGroupDecompositionParameters &options =
RGroupDecompositionParameters());
} // namespace RDKit
#endif
RDKit::RGroupCoreAlignment
RGroupCoreAlignment
Definition: RGroupDecomp.h:50
RDKit::RGroupDecompositionParameters::removeHydrogensPostMatch
bool removeHydrogensPostMatch
Definition: RGroupDecomp.h:64
RDKit::RGroupLabels
RGroupLabels
Definition: RGroupDecomp.h:28
RDKit::IsotopeLabels
Definition: RGroupDecomp.h:29
RDKit::RGroupDecomposition
Definition: RGroupDecomp.h:101
RDKit::AtomMap
Definition: RGroupDecomp.h:45
RDKit::RGroupDecompositionParameters::chunkSize
unsigned int chunkSize
Definition: RGroupDecomp.h:61
RDKit::RGroupDecompositionParameters
Definition: RGroupDecomp.h:55
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
RDKit::DummyAtomLabels
Definition: RGroupDecomp.h:34
RDKit::Exhaustive
Definition: RGroupDecomp.h:41
RDKit::AtomMapLabels
Definition: RGroupDecomp.h:30
RDKit::RGroupRows
std::vector< RGroupRow > RGroupRows
Definition: RGroupDecomp.h:97
RDKit::RGroupDecompositionParameters::alignment
unsigned int alignment
Definition: RGroupDecomp.h:59
RDKit::ROMol
Definition: ROMol.h:171
RDKit::RGroupDecompositionParameters::RGroupDecompositionParameters
RGroupDecompositionParameters(unsigned int labels=AutoDetect, unsigned int strategy=GreedyChunks, unsigned int labelling=AtomMap|MDLRGroup, unsigned int alignment=MCS, unsigned int chunkSize=5, bool matchOnlyAtRGroups=false, bool removeHydrogenOnlyGroups=true, bool removeHydrogensPostMatch=true)
Definition: RGroupDecomp.h:66
RDKit::RelabelDuplicateLabels
Definition: RGroupDecomp.h:32
RDKit::RGroupColumns
std::map< std::string, RGroupColumn > RGroupColumns
Definition: RGroupDecomp.h:98
RDKit::RGroupDecompose
RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(const std::vector< ROMOL_SPTR > &cores, const std::vector< ROMOL_SPTR > &mols, RGroupRows &rows, std::vector< unsigned int > *unmatched=nullptr, const RGroupDecompositionParameters &options=RGroupDecompositionParameters())
RDKit::MCS
Definition: RGroupDecomp.h:52
RDKit::None
Definition: RGroupDecomp.h:51
RDKit::RGroupColumn
std::vector< boost::shared_ptr< ROMol > > RGroupColumn
Definition: RGroupDecomp.h:95
RDKit::RGroupDecompositionParameters::onlyMatchAtRGroups
bool onlyMatchAtRGroups
Definition: RGroupDecomp.h:62
RDKit::RGroupLabelling
RGroupLabelling
Definition: RGroupDecomp.h:44
RDKit::RGroupDecompositionParameters::removeAllHydrogenRGroups
bool removeAllHydrogenRGroups
Definition: RGroupDecomp.h:63
RDKit::AutoDetect
Definition: RGroupDecomp.h:35
RDKit::RGroupDecompositionParameters::rgroupLabelling
unsigned int rgroupLabelling
Definition: RGroupDecomp.h:58
RDKit::RGroupMatching
RGroupMatching
Definition: RGroupDecomp.h:38
RDKit::RGroupRow
std::map< std::string, boost::shared_ptr< ROMol > > RGroupRow
Definition: RGroupDecomp.h:94
RDKit::Isotope
Definition: RGroupDecomp.h:46
RDKit::Greedy
Definition: RGroupDecomp.h:39
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::MDLRGroupLabels
Definition: RGroupDecomp.h:33
RDKIT_RGROUPDECOMPOSITION_EXPORT
#define RDKIT_RGROUPDECOMPOSITION_EXPORT
Definition: export.h:554
RDKit::RGroupDecompositionParameters::labels
unsigned int labels
Definition: RGroupDecomp.h:56
RDKit::MDLRGroup
Definition: RGroupDecomp.h:47
RDKit::AtomIndexLabels
Definition: RGroupDecomp.h:31
RDKit::RGroupDecompositionParameters::matchingStrategy
unsigned int matchingStrategy
Definition: RGroupDecomp.h:57
SubstructMatch.h
RDKit::GreedyChunks
Definition: RGroupDecomp.h:40
export.h