RDKit
Open-source cheminformatics and machine learning.
SubgraphUtils.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2003-2022 Greg Landrum and other RDKit contributors
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 #include <RDGeneral/export.h>
11 #ifndef RD_SUBGRAPHUTILS_H
12 #define RD_SUBGRAPHUTILS_H
13 
14 #include "Subgraphs.h"
16 #include <tuple>
18 
19 #include <cstdint>
20 
21 namespace RDKit {
22 class ROMol;
23 
24 namespace Subgraphs {
25 //! used to return path discriminators (three unsigned ints):
26 typedef std::tuple<std::uint32_t, std::uint32_t, std::uint32_t> DiscrimTuple;
27 
29  const ROMol &mol, const PATH_TYPE &path, bool useBO = true,
30  std::vector<std::uint32_t> *extraInvars = nullptr);
32  const PATH_LIST &allPathsb,
33  bool useBO = true);
34 
35 // Return the list of bond that connect a list of atoms
36 // ASSUMPTION: the atoms specified in the list are connected
38  const PATH_TYPE &atomIds);
39 
40 // create a new molecule object from a part of molecule "mol". The part of
41 // of the molecule is specified as a list of bonds in "path".
42 // the optional argument "useQuery" will set all the bond and atoms in the
43 // the new molecule to "QueryAtoms" and "QueryBonds" instead of regular Atoms
44 // and Bonds
45 // atomIdxMap provides a mapping between the atomsIds in mol to the atomIds in
46 // the newly created sub-molecule (the molecule that is returned)
48  const PATH_TYPE &path, bool useQuery,
49  std::map<int, int> &atomIdxMap);
51  const PATH_TYPE &path,
52  bool useQuery = false);
53 } // end of namespace Subgraphs
54 } // namespace RDKit
55 
56 #endif
functionality for finding subgraphs and paths in molecules
#define RDKIT_SUBGRAPHS_EXPORT
Definition: export.h:473
std::tuple< std::uint32_t, std::uint32_t, std::uint32_t > DiscrimTuple
used to return path discriminators (three unsigned ints):
Definition: SubgraphUtils.h:26
RDKIT_SUBGRAPHS_EXPORT PATH_LIST uniquifyPaths(const ROMol &mol, const PATH_LIST &allPathsb, bool useBO=true)
RDKIT_SUBGRAPHS_EXPORT DiscrimTuple calcPathDiscriminators(const ROMol &mol, const PATH_TYPE &path, bool useBO=true, std::vector< std::uint32_t > *extraInvars=nullptr)
RDKIT_SUBGRAPHS_EXPORT ROMol * pathToSubmol(const ROMol &mol, const PATH_TYPE &path, bool useQuery, std::map< int, int > &atomIdxMap)
RDKIT_SUBGRAPHS_EXPORT PATH_TYPE bondListFromAtomList(const ROMol &mol, const PATH_TYPE &atomIds)
Std stuff.
Definition: Abbreviations.h:19
std::list< PATH_TYPE > PATH_LIST
Definition: Subgraphs.h:43
std::vector< int > PATH_TYPE
Definition: Subgraphs.h:38