RDKit: MolFragmenter.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MolFragmenter.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2013 Greg Landrum
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef _RD_MOLFRAGMENTER_H__
11 #define _RD_MOLFRAGMENTER_H__
12
13 #include <istream>
14 #include <GraphMol/ROMol.h>
15
16 namespace RDKit {
17 namespace MolFragmenter {
18 struct FragmenterBondType {
19 unsigned int atom1Label, atom2Label;
20 unsigned int atom1Type, atom2Type;
21 Bond::BondType bondType;
22 ROMOL_SPTR query;
23 };
24
25 //! \brief Fragments a molecule by breaking a set of bonds
26 //!
27 /*!
28
29 \param mol - the molecule to be modified
30 \param bondIndices - indices of the bonds to be broken
31
32 optional:
33 \param addDummies - toggles addition of dummy atoms to indicate where
34 bonds were broken
35 \param dummyLabels - used to provide the labels to be used for the dummies.
36 the first element in each pair is the label for the dummy
37 that replaces the bond's beginAtom, the second is for the
38 dummy that replaces the bond's endAtom. If not provided, the
39 dummies are labeled with atom indices.
40 \param bondTypes - used to provide the bond type to use between the
41 fragments and the dummy atoms. If not provided, defaults to single.
42 \param nCutsPerAtom - used to return the number of bonds that were
43 cut at each atom. Should be nAtoms long.
44
45 \return a new ROMol with the modifications
46 The client is responsible for deleting this molecule.
47
48 */
49 ROMol *fragmentOnBonds(
50 const ROMol &mol, const std::vector<unsigned int> &bondIndices,
51 bool addDummies = true,
52 const std::vector<std::pair<unsigned int, unsigned int> > *dummyLabels = 0,
53 const std::vector<Bond::BondType> *bondTypes = 0,
54 std::vector<unsigned int> *nCutsPerAtom = 0);
55 //! \overload
56 ROMol *fragmentOnBonds(
57 const ROMol &mol, const std::vector<FragmenterBondType> &bondPatterns,
58 const std::map<unsigned int, ROMOL_SPTR> *atomEnvirons = 0,
59 std::vector<unsigned int> *nCutsPerAtom = 0);
60 void fragmentOnSomeBonds(
61 const ROMol &mol, const std::vector<unsigned int> &bondIndices,
62 std::vector<ROMOL_SPTR> &resMols, unsigned int maxToCut = 1,
63 bool addDummies = true,
64 const std::vector<std::pair<unsigned int, unsigned int> > *dummyLabels = 0,
65 const std::vector<Bond::BondType> *bondTypes = 0,
66 std::vector<std::vector<unsigned int> > *nCutsPerAtom = 0);
67
68 //! \brief Fragments a molecule by breaking all BRICS bonds
69 /*!
70 \return a new ROMol with the modifications
71 The client is responsible for deleting this molecule.
72
73 */
74 ROMol *fragmentOnBRICSBonds(const ROMol &mol);
75
76 void constructFragmenterAtomTypes(
77 std::istream *inStream, std::map<unsigned int, std::string> &defs,
78 const std::string &comment = "//", bool validate = true,
79 std::map<unsigned int, ROMOL_SPTR> *environs = 0);
80 void constructFragmenterAtomTypes(
81 const std::string &str, std::map<unsigned int, std::string> &defs,
82 const std::string &comment = "//", bool validate = true,
83 std::map<unsigned int, ROMOL_SPTR> *environs = 0);
84 void constructBRICSAtomTypes(std::map<unsigned int, std::string> &defs,
85 std::map<unsigned int, ROMOL_SPTR> *environs = 0);
86 void constructFragmenterBondTypes(
87 std::istream *inStream,
88 const std::map<unsigned int, std::string> &atomTypes,
89 std::vector<FragmenterBondType> &defs, const std::string &comment = "//",
90 bool validate = true, bool labelByConnector = true);
91 void constructFragmenterBondTypes(
92 const std::string &str,
93 const std::map<unsigned int, std::string> &atomTypes,
94 std::vector<FragmenterBondType> &defs, const std::string &comment = "//",
95 bool validate = true, bool labelByConnector = true);
96 void constructBRICSBondTypes(std::vector<FragmenterBondType> &defs);
97 }
98 }
99 #endif
RDKit::MolFragmenter::FragmenterBondType::query
ROMOL_SPTR query
Definition: MolFragmenter.h:22
RDKit::MolFragmenter::FragmenterBondType::atom1Label
unsigned int atom1Label
Definition: MolFragmenter.h:19
RDKit::MolFragmenter::FragmenterBondType::atom2Type
unsigned int atom2Type
Definition: MolFragmenter.h:20
RDKit::MolFragmenter::fragmentOnBRICSBonds
ROMol * fragmentOnBRICSBonds(const ROMol &mol)
Fragments a molecule by breaking all BRICS bonds.
RDKit::MolFragmenter::fragmentOnSomeBonds
void fragmentOnSomeBonds(const ROMol &mol, const std::vector< unsigned int > &bondIndices, std::vector< ROMOL_SPTR > &resMols, unsigned int maxToCut=1, bool addDummies=true, const std::vector< std::pair< unsigned int, unsigned int > > *dummyLabels=0, const std::vector< Bond::BondType > *bondTypes=0, std::vector< std::vector< unsigned int > > *nCutsPerAtom=0)
ROMol.h
Defines the primary molecule class ROMol as well as associated typedefs.
RDKit::MolFragmenter::FragmenterBondType
Definition: MolFragmenter.h:18
RDKit::Bond::BondType
BondType
the type of Bond
Definition: Bond.h:56
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:102
RDKit::MolFragmenter::constructBRICSBondTypes
void constructBRICSBondTypes(std::vector< FragmenterBondType > &defs)
RDKit::MolFragmenter::fragmentOnBonds
ROMol * fragmentOnBonds(const ROMol &mol, const std::vector< unsigned int > &bondIndices, bool addDummies=true, const std::vector< std::pair< unsigned int, unsigned int > > *dummyLabels=0, const std::vector< Bond::BondType > *bondTypes=0, std::vector< unsigned int > *nCutsPerAtom=0)
Fragments a molecule by breaking a set of bonds.
RDKit::MolFragmenter::constructFragmenterAtomTypes
void constructFragmenterAtomTypes(std::istream *inStream, std::map< unsigned int, std::string > &defs, const std::string &comment="//", bool validate=true, std::map< unsigned int, ROMOL_SPTR > *environs=0)
RDKit::MolFragmenter::constructBRICSAtomTypes
void constructBRICSAtomTypes(std::map< unsigned int, std::string > &defs, std::map< unsigned int, ROMOL_SPTR > *environs=0)
RDKit::ROMOL_SPTR
boost::shared_ptr< ROMol > ROMOL_SPTR
Definition: ChemTransforms.h:20
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDKit::MolFragmenter::FragmenterBondType::atom1Type
unsigned int atom1Type
Definition: MolFragmenter.h:20
RDKit::MolFragmenter::FragmenterBondType::bondType
Bond::BondType bondType
Definition: MolFragmenter.h:21
RDKit::MolFragmenter::FragmenterBondType::atom2Label
unsigned int atom2Label
Definition: MolFragmenter.h:19
RDKit::MolFragmenter::constructFragmenterBondTypes
void constructFragmenterBondTypes(std::istream *inStream, const std::map< unsigned int, std::string > &atomTypes, std::vector< FragmenterBondType > &defs, const std::string &comment="//", bool validate=true, bool labelByConnector=true)