RDKit
Open-source cheminformatics and machine learning.
TopologicalTorsionGenerator.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2018 Boran Adas, Google Summer of Code
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 
11 #include <RDGeneral/export.h>
12 #ifndef RD_TOPOLOGICALTORSIONGEN_H_2018_07
13 #define RD_TOPOLOGICALTORSIONGEN_H_2018_07
14 
17 
18 namespace RDKit {
19 namespace TopologicalTorsion {
20 
21 template <typename OutputType>
23  : public FingerprintArguments<OutputType> {
24  public:
25  const bool df_includeChirality;
26  const uint32_t d_torsionAtomCount;
27 
28  OutputType getResultSize() const;
29 
30  std::string infoString() const;
31 
32  /**
33  \brief Construct a new Topological Torsion Arguments object
34 
35  \param includeChirality if set, chirality will be used in sparse result
36  \param torsionAtomCount the number of atoms to include in the "torsions"
37  \param useCountSimulation if set, use count simulation while
38  generating the fingerprint
39  \param countBounds boundaries for count simulation, corresponding bit will
40  be set if the count is higher than the number provided for that spot
41  \param fpSize size of the generated fingerprint, does not affect the sparse
42  versions
43  */
44  TopologicalTorsionArguments(const bool includeChirality,
45  const uint32_t torsionAtomCount,
46  const bool countSimulation,
47  const std::vector<std::uint32_t> countBounds,
48  const std::uint32_t fpSize);
49 };
50 
51 template <typename OutputType>
53  : public AtomEnvironment<OutputType> {
54  const OutputType d_bitId;
55 
56  public:
57  OutputType getBitId(FingerprintArguments<OutputType> *arguments,
58  const std::vector<std::uint32_t> *atomInvariants,
59  const std::vector<std::uint32_t> *bondInvariants,
60  const AdditionalOutput *additionalOutput,
61  const bool hashResults = false) const;
62  /**
63  \brief Construct a new Topological Torsion Atom Env object
64 
65  \param bitId bitId generated for this environment
66  */
67  TopologicalTorsionAtomEnv(OutputType bitId);
68 };
69 
70 template <typename OutputType>
72  : public AtomEnvironmentGenerator<OutputType> {
73  public:
74  std::vector<AtomEnvironment<OutputType> *> getEnvironments(
75  const ROMol &mol, FingerprintArguments<OutputType> *arguments,
76  const std::vector<std::uint32_t> *fromAtoms,
77  const std::vector<std::uint32_t> *ignoreAtoms, const int confId,
78  const AdditionalOutput *additionalOutput,
79  const std::vector<std::uint32_t> *atomInvariants,
80  const std::vector<std::uint32_t> *bondInvariants,
81  const bool hashResults = false) const;
82 
83  std::string infoString() const;
84 };
85 
86 /**
87  \brief Get the Topological Torsion Generator object
88 
89  \tparam OutputType determines the size of the bitIds and the result, can only
90  be 64 bit unsigned integer for this type
91  \param includeChirality includeChirality argument for both the default atom
92  invariants generator and the fingerprint arguments
93  \param torsionAtomCount the number of atoms to include in the "torsions"
94  \param atomInvariantsGenerator custom atom invariants generator to use
95  \param useCountSimulation if set, use count simulation while
96  generating the fingerprint
97  \param countBounds boundaries for count simulation, corresponding bit will
98  be set if the count is higher than the number provided for that spot
99  \param fpSize size of the generated fingerprint, does not affect the sparse
100  versions
101  \param ownsAtomInvGen if set atom invariants generator is destroyed with the
102  fingerprint generator
103 
104  /return FingerprintGenerator<OutputType>* that generates topological-torsion
105  fingerprints
106  */
107 template <typename OutputType>
109  const bool includeChirality = false, const uint32_t torsionAtomCount = 4,
110  AtomInvariantsGenerator *atomInvariantsGenerator = nullptr,
111  const bool countSimulation = true,
112  const std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
113  const std::uint32_t fpSize = 2048, const bool ownsAtomInvGen = false);
114 } // namespace TopologicalTorsion
115 } // namespace RDKit
116 
117 #endif
abstract base class that holds atom-environments that will be hashed to generate the fingerprint ...
abstract base class for atom invariants generators
abstract base class that generates atom-environments from a molecule
Std stuff.
Definition: Atom.h:30
RDKIT_FINGERPRINTS_EXPORT FingerprintGenerator< OutputType > * getTopologicalTorsionGenerator(const bool includeChirality=false, const uint32_t torsionAtomCount=4, AtomInvariantsGenerator *atomInvariantsGenerator=nullptr, const bool countSimulation=true, const std::vector< std::uint32_t > countBounds={1, 2, 4, 8}, const std::uint32_t fpSize=2048, const bool ownsAtomInvGen=false)
Get the Topological Torsion Generator object.
#define RDKIT_FINGERPRINTS_EXPORT
Definition: export.h:229
class that generates same fingerprint style for different output formats
Abstract base class that holds molecule independent arguments that are common amongst all fingerprint...