RDKit: SubgraphUtils.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
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"
15#include <RDGeneral/BoostStartInclude.h>
16#include <tuple>
17#include <RDGeneral/BoostEndInclude.h>
18
19#include <cstdint>
20
21namespace RDKit {
22class 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
28 RDKIT_SUBGRAPHS_EXPORT DiscrimTuple calcPathDiscriminators(
29 const ROMol &mol, const PATH_TYPE &path, bool useBO = true,
30 std::vector<std::uint32_t> *extraInvars = nullptr);
31 RDKIT_SUBGRAPHS_EXPORT PATH_LIST uniquifyPaths(const ROMol &mol,
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
37 RDKIT_SUBGRAPHS_EXPORT PATH_TYPE bondListFromAtomList(const ROMol &mol,
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)
47 RDKIT_SUBGRAPHS_EXPORT ROMol *pathToSubmol(const ROMol &mol,
48 const PATH_TYPE &path, bool useQuery,
49 std::map<int, int> &atomIdxMap);
50 RDKIT_SUBGRAPHS_EXPORT ROMol *pathToSubmol(const ROMol &mol,
51 const PATH_TYPE &path,
52 bool useQuery = false);
53} // end of namespace Subgraphs
54} // namespace RDKit
55
56#endif
BoostEndInclude.h
BoostStartInclude.h
Subgraphs.h
functionality for finding subgraphs and paths in molecules
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKIT_SUBGRAPHS_EXPORT
#define RDKIT_SUBGRAPHS_EXPORT
Definition export.h:553
RDKit::Subgraphs
Definition SubgraphUtils.h:24
RDKit::Subgraphs::DiscrimTuple
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::uniquifyPaths
RDKIT_SUBGRAPHS_EXPORT PATH_LIST uniquifyPaths(const ROMol &mol, const PATH_LIST &allPathsb, bool useBO=true)
RDKit::Subgraphs::calcPathDiscriminators
RDKIT_SUBGRAPHS_EXPORT DiscrimTuple calcPathDiscriminators(const ROMol &mol, const PATH_TYPE &path, bool useBO=true, std::vector< std::uint32_t > *extraInvars=nullptr)
RDKit::Subgraphs::pathToSubmol
RDKIT_SUBGRAPHS_EXPORT ROMol * pathToSubmol(const ROMol &mol, const PATH_TYPE &path, bool useQuery, std::map< int, int > &atomIdxMap)
RDKit::Subgraphs::bondListFromAtomList
RDKIT_SUBGRAPHS_EXPORT PATH_TYPE bondListFromAtomList(const ROMol &mol, const PATH_TYPE &atomIds)
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::PATH_LIST
std::list< PATH_TYPE > PATH_LIST
Definition Subgraphs.h:43
RDKit::PATH_TYPE
std::vector< int > PATH_TYPE
Definition Subgraphs.h:42