rdkit-headers 2022.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. rdkit_headers/__init__.py +13 -0
  2. rdkit_headers/include/rdkit/CIPLabeler/CIPLabeler.h +59 -0
  3. rdkit_headers/include/rdkit/CIPLabeler/TooManyNodesException.h +28 -0
  4. rdkit_headers/include/rdkit/Catalogs/Catalog.h +461 -0
  5. rdkit_headers/include/rdkit/Catalogs/CatalogEntry.h +48 -0
  6. rdkit_headers/include/rdkit/Catalogs/CatalogParams.h +42 -0
  7. rdkit_headers/include/rdkit/ChemicalFeatures/ChemicalFeature.h +38 -0
  8. rdkit_headers/include/rdkit/ChemicalFeatures/FreeChemicalFeature.h +97 -0
  9. rdkit_headers/include/rdkit/DataManip/MetricMatrixCalc/MetricFuncs.h +54 -0
  10. rdkit_headers/include/rdkit/DataManip/MetricMatrixCalc/MetricMatrixCalc.h +106 -0
  11. rdkit_headers/include/rdkit/DataStructs/BitOps.h +337 -0
  12. rdkit_headers/include/rdkit/DataStructs/BitVect.h +68 -0
  13. rdkit_headers/include/rdkit/DataStructs/BitVectUtils.h +35 -0
  14. rdkit_headers/include/rdkit/DataStructs/BitVects.h +25 -0
  15. rdkit_headers/include/rdkit/DataStructs/DatastructsException.h +31 -0
  16. rdkit_headers/include/rdkit/DataStructs/DatastructsStreamOps.h +72 -0
  17. rdkit_headers/include/rdkit/DataStructs/DiscreteDistMat.h +30 -0
  18. rdkit_headers/include/rdkit/DataStructs/DiscreteValueVect.h +146 -0
  19. rdkit_headers/include/rdkit/DataStructs/ExplicitBitVect.h +96 -0
  20. rdkit_headers/include/rdkit/DataStructs/FPBReader.h +281 -0
  21. rdkit_headers/include/rdkit/DataStructs/MultiFPBReader.h +213 -0
  22. rdkit_headers/include/rdkit/DataStructs/SparseBitVect.h +101 -0
  23. rdkit_headers/include/rdkit/DataStructs/SparseIntVect.h +571 -0
  24. rdkit_headers/include/rdkit/DataStructs/base64.h +41 -0
  25. rdkit_headers/include/rdkit/DistGeom/BoundsMatrix.h +121 -0
  26. rdkit_headers/include/rdkit/DistGeom/ChiralSet.h +58 -0
  27. rdkit_headers/include/rdkit/DistGeom/ChiralViolationContrib.h +96 -0
  28. rdkit_headers/include/rdkit/DistGeom/DistGeomUtils.h +195 -0
  29. rdkit_headers/include/rdkit/DistGeom/DistViolationContrib.h +54 -0
  30. rdkit_headers/include/rdkit/DistGeom/FourthDimContrib.h +65 -0
  31. rdkit_headers/include/rdkit/DistGeom/TriangleSmooth.h +36 -0
  32. rdkit_headers/include/rdkit/Features/Feature.h +96 -0
  33. rdkit_headers/include/rdkit/ForceField/Contrib.h +40 -0
  34. rdkit_headers/include/rdkit/ForceField/ForceField.h +253 -0
  35. rdkit_headers/include/rdkit/ForceField/MMFF/AngleBend.h +78 -0
  36. rdkit_headers/include/rdkit/ForceField/MMFF/AngleConstraint.h +64 -0
  37. rdkit_headers/include/rdkit/ForceField/MMFF/BondStretch.h +67 -0
  38. rdkit_headers/include/rdkit/ForceField/MMFF/Contribs.h +26 -0
  39. rdkit_headers/include/rdkit/ForceField/MMFF/DistanceConstraint.h +61 -0
  40. rdkit_headers/include/rdkit/ForceField/MMFF/Nonbonded.h +105 -0
  41. rdkit_headers/include/rdkit/ForceField/MMFF/OopBend.h +65 -0
  42. rdkit_headers/include/rdkit/ForceField/MMFF/Params.h +1134 -0
  43. rdkit_headers/include/rdkit/ForceField/MMFF/PositionConstraint.h +55 -0
  44. rdkit_headers/include/rdkit/ForceField/MMFF/StretchBend.h +70 -0
  45. rdkit_headers/include/rdkit/ForceField/MMFF/TorsionAngle.h +79 -0
  46. rdkit_headers/include/rdkit/ForceField/MMFF/TorsionConstraint.h +70 -0
  47. rdkit_headers/include/rdkit/ForceField/UFF/AngleBend.h +92 -0
  48. rdkit_headers/include/rdkit/ForceField/UFF/AngleConstraint.h +64 -0
  49. rdkit_headers/include/rdkit/ForceField/UFF/BondStretch.h +83 -0
  50. rdkit_headers/include/rdkit/ForceField/UFF/Contribs.h +23 -0
  51. rdkit_headers/include/rdkit/ForceField/UFF/DistanceConstraint.h +62 -0
  52. rdkit_headers/include/rdkit/ForceField/UFF/Inversion.h +81 -0
  53. rdkit_headers/include/rdkit/ForceField/UFF/Nonbonded.h +87 -0
  54. rdkit_headers/include/rdkit/ForceField/UFF/Params.h +153 -0
  55. rdkit_headers/include/rdkit/ForceField/UFF/PositionConstraint.h +55 -0
  56. rdkit_headers/include/rdkit/ForceField/UFF/TorsionAngle.h +115 -0
  57. rdkit_headers/include/rdkit/ForceField/UFF/TorsionConstraint.h +70 -0
  58. rdkit_headers/include/rdkit/Geometry/Grid3D.h +55 -0
  59. rdkit_headers/include/rdkit/Geometry/GridUtils.h +64 -0
  60. rdkit_headers/include/rdkit/Geometry/Transform.h +19 -0
  61. rdkit_headers/include/rdkit/Geometry/Transform2D.h +85 -0
  62. rdkit_headers/include/rdkit/Geometry/Transform3D.h +101 -0
  63. rdkit_headers/include/rdkit/Geometry/UniformGrid3D.h +217 -0
  64. rdkit_headers/include/rdkit/Geometry/Utils.h +97 -0
  65. rdkit_headers/include/rdkit/Geometry/point.h +585 -0
  66. rdkit_headers/include/rdkit/GraphMol/Abbreviations/Abbreviations.h +132 -0
  67. rdkit_headers/include/rdkit/GraphMol/Atom.h +449 -0
  68. rdkit_headers/include/rdkit/GraphMol/AtomIterators.h +212 -0
  69. rdkit_headers/include/rdkit/GraphMol/Bond.h +393 -0
  70. rdkit_headers/include/rdkit/GraphMol/BondIterators.h +75 -0
  71. rdkit_headers/include/rdkit/GraphMol/Canon.h +130 -0
  72. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/CartesianProduct.h +147 -0
  73. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/Enumerate.h +187 -0
  74. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerateBase.h +200 -0
  75. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerateTypes.h +59 -0
  76. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerationPickler.h +60 -0
  77. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h +227 -0
  78. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/RandomSample.h +163 -0
  79. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h +184 -0
  80. rdkit_headers/include/rdkit/GraphMol/ChemReactions/PreprocessRxn.h +64 -0
  81. rdkit_headers/include/rdkit/GraphMol/ChemReactions/Reaction.h +491 -0
  82. rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionFingerprints.h +147 -0
  83. rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionParser.h +274 -0
  84. rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionPickler.h +119 -0
  85. rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionRunner.h +116 -0
  86. rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionUtils.h +74 -0
  87. rdkit_headers/include/rdkit/GraphMol/ChemReactions/SanitizeRxn.h +169 -0
  88. rdkit_headers/include/rdkit/GraphMol/ChemTransforms/ChemTransforms.h +270 -0
  89. rdkit_headers/include/rdkit/GraphMol/ChemTransforms/MolFragmenter.h +120 -0
  90. rdkit_headers/include/rdkit/GraphMol/Chirality.h +137 -0
  91. rdkit_headers/include/rdkit/GraphMol/Conformer.h +183 -0
  92. rdkit_headers/include/rdkit/GraphMol/CoordGen.h +195 -0
  93. rdkit_headers/include/rdkit/GraphMol/Depictor/DepictUtils.h +366 -0
  94. rdkit_headers/include/rdkit/GraphMol/Depictor/EmbeddedFrag.h +544 -0
  95. rdkit_headers/include/rdkit/GraphMol/Depictor/RDDepictor.h +284 -0
  96. rdkit_headers/include/rdkit/GraphMol/Deprotect/Deprotect.h +105 -0
  97. rdkit_headers/include/rdkit/GraphMol/Descriptors/AUTOCORR2D.h +49 -0
  98. rdkit_headers/include/rdkit/GraphMol/Descriptors/AUTOCORR3D.h +51 -0
  99. rdkit_headers/include/rdkit/GraphMol/Descriptors/AtomFeat.h +39 -0
  100. rdkit_headers/include/rdkit/GraphMol/Descriptors/BCUT.h +66 -0
  101. rdkit_headers/include/rdkit/GraphMol/Descriptors/ConnectivityDescriptors.h +211 -0
  102. rdkit_headers/include/rdkit/GraphMol/Descriptors/CoulombMat.h +42 -0
  103. rdkit_headers/include/rdkit/GraphMol/Descriptors/Crippen.h +137 -0
  104. rdkit_headers/include/rdkit/GraphMol/Descriptors/Data3Ddescriptors.h +55 -0
  105. rdkit_headers/include/rdkit/GraphMol/Descriptors/EEM.h +59 -0
  106. rdkit_headers/include/rdkit/GraphMol/Descriptors/GETAWAY.h +51 -0
  107. rdkit_headers/include/rdkit/GraphMol/Descriptors/Lipinski.h +169 -0
  108. rdkit_headers/include/rdkit/GraphMol/Descriptors/MORSE.h +50 -0
  109. rdkit_headers/include/rdkit/GraphMol/Descriptors/MQN.h +47 -0
  110. rdkit_headers/include/rdkit/GraphMol/Descriptors/MolData3Ddescriptors.h +62 -0
  111. rdkit_headers/include/rdkit/GraphMol/Descriptors/MolDescriptors.h +86 -0
  112. rdkit_headers/include/rdkit/GraphMol/Descriptors/MolDescriptors3D.h +25 -0
  113. rdkit_headers/include/rdkit/GraphMol/Descriptors/MolSurf.h +120 -0
  114. rdkit_headers/include/rdkit/GraphMol/Descriptors/PBF.h +60 -0
  115. rdkit_headers/include/rdkit/GraphMol/Descriptors/PMI.h +128 -0
  116. rdkit_headers/include/rdkit/GraphMol/Descriptors/Property.h +123 -0
  117. rdkit_headers/include/rdkit/GraphMol/Descriptors/RDF.h +52 -0
  118. rdkit_headers/include/rdkit/GraphMol/Descriptors/RegisterDescriptor.h +84 -0
  119. rdkit_headers/include/rdkit/GraphMol/Descriptors/USRDescriptor.h +137 -0
  120. rdkit_headers/include/rdkit/GraphMol/Descriptors/WHIM.h +51 -0
  121. rdkit_headers/include/rdkit/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.h +77 -0
  122. rdkit_headers/include/rdkit/GraphMol/DistGeomHelpers/Embedder.h +437 -0
  123. rdkit_headers/include/rdkit/GraphMol/FMCS/FMCS.h +194 -0
  124. rdkit_headers/include/rdkit/GraphMol/FMCS/Graph.h +43 -0
  125. rdkit_headers/include/rdkit/GraphMol/FileParsers/FileParserUtils.h +231 -0
  126. rdkit_headers/include/rdkit/GraphMol/FileParsers/FileParsers.h +399 -0
  127. rdkit_headers/include/rdkit/GraphMol/FileParsers/GeneralFileReader.h +170 -0
  128. rdkit_headers/include/rdkit/GraphMol/FileParsers/MolFileStereochem.h +60 -0
  129. rdkit_headers/include/rdkit/GraphMol/FileParsers/MolSupplier.h +444 -0
  130. rdkit_headers/include/rdkit/GraphMol/FileParsers/MolWriters.h +338 -0
  131. rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedMolSupplier.h +102 -0
  132. rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedSDMolSupplier.h +65 -0
  133. rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h +66 -0
  134. rdkit_headers/include/rdkit/GraphMol/FileParsers/PNGParser.h +203 -0
  135. rdkit_headers/include/rdkit/GraphMol/FileParsers/SequenceParsers.h +117 -0
  136. rdkit_headers/include/rdkit/GraphMol/FileParsers/SequenceWriters.h +47 -0
  137. rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterCatalog.h +260 -0
  138. rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterCatalogEntry.h +276 -0
  139. rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterMatcherBase.h +152 -0
  140. rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterMatchers.h +576 -0
  141. rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FunctionalGroupHierarchy.h +52 -0
  142. rdkit_headers/include/rdkit/GraphMol/Fingerprints/AtomPairGenerator.h +188 -0
  143. rdkit_headers/include/rdkit/GraphMol/Fingerprints/AtomPairs.h +268 -0
  144. rdkit_headers/include/rdkit/GraphMol/Fingerprints/FingerprintGenerator.h +372 -0
  145. rdkit_headers/include/rdkit/GraphMol/Fingerprints/FingerprintUtil.h +160 -0
  146. rdkit_headers/include/rdkit/GraphMol/Fingerprints/Fingerprints.h +167 -0
  147. rdkit_headers/include/rdkit/GraphMol/Fingerprints/MACCS.h +32 -0
  148. rdkit_headers/include/rdkit/GraphMol/Fingerprints/MHFP.h +285 -0
  149. rdkit_headers/include/rdkit/GraphMol/Fingerprints/MorganFingerprints.h +210 -0
  150. rdkit_headers/include/rdkit/GraphMol/Fingerprints/MorganGenerator.h +251 -0
  151. rdkit_headers/include/rdkit/GraphMol/Fingerprints/RDKitFPGenerator.h +162 -0
  152. rdkit_headers/include/rdkit/GraphMol/Fingerprints/TopologicalTorsionGenerator.h +127 -0
  153. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h +72 -0
  154. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/CrystalFF/TorsionPreferences.h +41 -0
  155. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/FFConvenience.h +130 -0
  156. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.h +236 -0
  157. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/Builder.h +141 -0
  158. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/MMFF.h +105 -0
  159. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/AtomTyper.h +57 -0
  160. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/Builder.h +129 -0
  161. rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/UFF.h +82 -0
  162. rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatGenerator.h +33 -0
  163. rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatParams.h +94 -0
  164. rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatalogEntry.h +136 -0
  165. rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatalogUtils.h +62 -0
  166. rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragFPGenerator.h +38 -0
  167. rdkit_headers/include/rdkit/GraphMol/GenericGroups/GenericGroups.h +301 -0
  168. rdkit_headers/include/rdkit/GraphMol/GraphMol.h +22 -0
  169. rdkit_headers/include/rdkit/GraphMol/MMPA/MMPA.h +81 -0
  170. rdkit_headers/include/rdkit/GraphMol/MolAlign/AlignMolecules.h +183 -0
  171. rdkit_headers/include/rdkit/GraphMol/MolAlign/O3AAlignMolecules.h +354 -0
  172. rdkit_headers/include/rdkit/GraphMol/MolBundle.h +121 -0
  173. rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalog.h +20 -0
  174. rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalogEntry.h +109 -0
  175. rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalogParams.h +40 -0
  176. rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/FeatureParser.h +58 -0
  177. rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeature.h +98 -0
  178. rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeatureDef.h +68 -0
  179. rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeatureFactory.h +78 -0
  180. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2D.h +539 -0
  181. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DHelpers.h +284 -0
  182. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DJS.h +62 -0
  183. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DSVG.h +88 -0
  184. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DUtils.h +179 -0
  185. rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2Dwx.h +107 -0
  186. rdkit_headers/include/rdkit/GraphMol/MolEnumerator/LinkNode.h +159 -0
  187. rdkit_headers/include/rdkit/GraphMol/MolEnumerator/MolEnumerator.h +276 -0
  188. rdkit_headers/include/rdkit/GraphMol/MolHash/MolHash.h +12 -0
  189. rdkit_headers/include/rdkit/GraphMol/MolHash/nmmolhash.h +60 -0
  190. rdkit_headers/include/rdkit/GraphMol/MolInterchange/MolInterchange.h +93 -0
  191. rdkit_headers/include/rdkit/GraphMol/MolInterchange/details.h +49 -0
  192. rdkit_headers/include/rdkit/GraphMol/MolOps.h +1016 -0
  193. rdkit_headers/include/rdkit/GraphMol/MolPickler.h +314 -0
  194. rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogEntry.h +56 -0
  195. rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogParams.h +65 -0
  196. rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogUtils.h +37 -0
  197. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Charge.h +145 -0
  198. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Fragment.h +105 -0
  199. rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogEntry.h +60 -0
  200. rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogParams.h +63 -0
  201. rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogUtils.h +35 -0
  202. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Metal.h +73 -0
  203. rdkit_headers/include/rdkit/GraphMol/MolStandardize/MolStandardize.h +178 -0
  204. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Normalize.h +104 -0
  205. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Tautomer.h +428 -0
  206. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogEntry.h +59 -0
  207. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogParams.h +69 -0
  208. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogUtils.h +81 -0
  209. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogEntry.h +57 -0
  210. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogParams.h +66 -0
  211. rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogUtils.h +37 -0
  212. rdkit_headers/include/rdkit/GraphMol/MolStandardize/Validate.h +199 -0
  213. rdkit_headers/include/rdkit/GraphMol/MolTransforms/MolTransforms.h +222 -0
  214. rdkit_headers/include/rdkit/GraphMol/MonomerInfo.h +138 -0
  215. rdkit_headers/include/rdkit/GraphMol/PartialCharges/GasteigerCharges.h +27 -0
  216. rdkit_headers/include/rdkit/GraphMol/PartialCharges/GasteigerParams.h +86 -0
  217. rdkit_headers/include/rdkit/GraphMol/PeriodicTable.h +325 -0
  218. rdkit_headers/include/rdkit/GraphMol/QueryAtom.h +161 -0
  219. rdkit_headers/include/rdkit/GraphMol/QueryBond.h +146 -0
  220. rdkit_headers/include/rdkit/GraphMol/QueryOps.h +1110 -0
  221. rdkit_headers/include/rdkit/GraphMol/RDKitBase.h +35 -0
  222. rdkit_headers/include/rdkit/GraphMol/RDKitQueries.h +25 -0
  223. rdkit_headers/include/rdkit/GraphMol/RGroupDecomposition/RGroupDecomp.h +225 -0
  224. rdkit_headers/include/rdkit/GraphMol/ROMol.h +844 -0
  225. rdkit_headers/include/rdkit/GraphMol/RWMol.h +222 -0
  226. rdkit_headers/include/rdkit/GraphMol/ReducedGraphs/ReducedGraphs.h +85 -0
  227. rdkit_headers/include/rdkit/GraphMol/Resonance.h +236 -0
  228. rdkit_headers/include/rdkit/GraphMol/RingInfo.h +274 -0
  229. rdkit_headers/include/rdkit/GraphMol/Rings.h +90 -0
  230. rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNAttribs.h +93 -0
  231. rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNParse.h +70 -0
  232. rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNParseOps.h +328 -0
  233. rdkit_headers/include/rdkit/GraphMol/SanitException.h +120 -0
  234. rdkit_headers/include/rdkit/GraphMol/ScaffoldNetwork/ScaffoldNetwork.h +195 -0
  235. rdkit_headers/include/rdkit/GraphMol/ShapeHelpers/ShapeEncoder.h +73 -0
  236. rdkit_headers/include/rdkit/GraphMol/ShapeHelpers/ShapeUtils.h +279 -0
  237. rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmartsWrite.h +46 -0
  238. rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesParse.h +160 -0
  239. rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesParseOps.h +53 -0
  240. rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesWrite.h +288 -0
  241. rdkit_headers/include/rdkit/GraphMol/SmilesParse/primes.h +18 -0
  242. rdkit_headers/include/rdkit/GraphMol/StereoGroup.h +74 -0
  243. rdkit_headers/include/rdkit/GraphMol/Subgraphs/SubgraphUtils.h +57 -0
  244. rdkit_headers/include/rdkit/GraphMol/Subgraphs/Subgraphs.h +154 -0
  245. rdkit_headers/include/rdkit/GraphMol/SubstanceGroup.h +297 -0
  246. rdkit_headers/include/rdkit/GraphMol/Substruct/SubstructMatch.h +232 -0
  247. rdkit_headers/include/rdkit/GraphMol/Substruct/SubstructUtils.h +44 -0
  248. rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/PatternFactory.h +40 -0
  249. rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/SubstructLibrary.h +951 -0
  250. rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/SubstructLibrarySerialization.h +231 -0
  251. rdkit_headers/include/rdkit/GraphMol/TautomerQuery/TautomerQuery.h +104 -0
  252. rdkit_headers/include/rdkit/GraphMol/Trajectory/Snapshot.h +69 -0
  253. rdkit_headers/include/rdkit/GraphMol/Trajectory/Trajectory.h +105 -0
  254. rdkit_headers/include/rdkit/GraphMol/atomic_data.h +76 -0
  255. rdkit_headers/include/rdkit/GraphMol/details.h +15 -0
  256. rdkit_headers/include/rdkit/GraphMol/new_canon.h +772 -0
  257. rdkit_headers/include/rdkit/Numerics/Alignment/AlignPoints.h +49 -0
  258. rdkit_headers/include/rdkit/Numerics/Conrec.h +203 -0
  259. rdkit_headers/include/rdkit/Numerics/EigenSolvers/PowerEigenSolver.h +68 -0
  260. rdkit_headers/include/rdkit/Numerics/Matrix.h +347 -0
  261. rdkit_headers/include/rdkit/Numerics/Optimizer/BFGSOpt.h +397 -0
  262. rdkit_headers/include/rdkit/Numerics/SquareMatrix.h +89 -0
  263. rdkit_headers/include/rdkit/Numerics/SymmMatrix.h +361 -0
  264. rdkit_headers/include/rdkit/Numerics/Vector.h +327 -0
  265. rdkit_headers/include/rdkit/Query/AndQuery.h +57 -0
  266. rdkit_headers/include/rdkit/Query/EqualityQuery.h +88 -0
  267. rdkit_headers/include/rdkit/Query/GreaterEqualQuery.h +74 -0
  268. rdkit_headers/include/rdkit/Query/GreaterQuery.h +74 -0
  269. rdkit_headers/include/rdkit/Query/LessEqualQuery.h +75 -0
  270. rdkit_headers/include/rdkit/Query/LessQuery.h +74 -0
  271. rdkit_headers/include/rdkit/Query/NullQueryAlgebra.h +86 -0
  272. rdkit_headers/include/rdkit/Query/OrQuery.h +58 -0
  273. rdkit_headers/include/rdkit/Query/Query.h +210 -0
  274. rdkit_headers/include/rdkit/Query/QueryObjects.h +38 -0
  275. rdkit_headers/include/rdkit/Query/RangeQuery.h +116 -0
  276. rdkit_headers/include/rdkit/Query/SetQuery.h +87 -0
  277. rdkit_headers/include/rdkit/Query/XOrQuery.h +63 -0
  278. rdkit_headers/include/rdkit/RDGeneral/BadFileException.h +39 -0
  279. rdkit_headers/include/rdkit/RDGeneral/BoostEndInclude.h +69 -0
  280. rdkit_headers/include/rdkit/RDGeneral/BoostStartInclude.h +95 -0
  281. rdkit_headers/include/rdkit/RDGeneral/ConcurrentQueue.h +132 -0
  282. rdkit_headers/include/rdkit/RDGeneral/Dict.h +350 -0
  283. rdkit_headers/include/rdkit/RDGeneral/Exceptions.h +73 -0
  284. rdkit_headers/include/rdkit/RDGeneral/FileParseException.h +36 -0
  285. rdkit_headers/include/rdkit/RDGeneral/Invariant.h +198 -0
  286. rdkit_headers/include/rdkit/RDGeneral/LocaleSwitcher.h +54 -0
  287. rdkit_headers/include/rdkit/RDGeneral/RDAny.h +217 -0
  288. rdkit_headers/include/rdkit/RDGeneral/RDConfig.h +49 -0
  289. rdkit_headers/include/rdkit/RDGeneral/RDExportMacros.h +40 -0
  290. rdkit_headers/include/rdkit/RDGeneral/RDLog.h +142 -0
  291. rdkit_headers/include/rdkit/RDGeneral/RDProps.h +172 -0
  292. rdkit_headers/include/rdkit/RDGeneral/RDThreads.h +44 -0
  293. rdkit_headers/include/rdkit/RDGeneral/RDValue-doublemagic.h +478 -0
  294. rdkit_headers/include/rdkit/RDGeneral/RDValue-taggedunion.h +518 -0
  295. rdkit_headers/include/rdkit/RDGeneral/RDValue.h +285 -0
  296. rdkit_headers/include/rdkit/RDGeneral/Ranking.h +87 -0
  297. rdkit_headers/include/rdkit/RDGeneral/StreamOps.h +637 -0
  298. rdkit_headers/include/rdkit/RDGeneral/export.h +559 -0
  299. rdkit_headers/include/rdkit/RDGeneral/hanoiSort.h +167 -0
  300. rdkit_headers/include/rdkit/RDGeneral/hash/detail/float_functions.hpp +156 -0
  301. rdkit_headers/include/rdkit/RDGeneral/hash/detail/hash_float.hpp +179 -0
  302. rdkit_headers/include/rdkit/RDGeneral/hash/extensions.hpp +152 -0
  303. rdkit_headers/include/rdkit/RDGeneral/hash/hash.hpp +463 -0
  304. rdkit_headers/include/rdkit/RDGeneral/hash/hash_fwd.hpp +51 -0
  305. rdkit_headers/include/rdkit/RDGeneral/test.h +274 -0
  306. rdkit_headers/include/rdkit/RDGeneral/types.h +401 -0
  307. rdkit_headers/include/rdkit/RDGeneral/utils.h +106 -0
  308. rdkit_headers/include/rdkit/RDGeneral/versions.h +27 -0
  309. rdkit_headers/include/rdkit/RDStreams/streams.h +19 -0
  310. rdkit_headers/include/rdkit/RingDecomposerLib.h +751 -0
  311. rdkit_headers/include/rdkit/SimDivPickers/DistPicker.h +92 -0
  312. rdkit_headers/include/rdkit/SimDivPickers/HierarchicalClusterPicker.h +107 -0
  313. rdkit_headers/include/rdkit/SimDivPickers/LeaderPicker.h +470 -0
  314. rdkit_headers/include/rdkit/SimDivPickers/MaxMinPicker.h +303 -0
  315. rdkit_headers-2022.3.3.dist-info/METADATA +24 -0
  316. rdkit_headers-2022.3.3.dist-info/RECORD +320 -0
  317. rdkit_headers-2022.3.3.dist-info/WHEEL +4 -0
  318. rdkit_headers-2022.3.3.dist-info/entry_points.txt +4 -0
  319. rdkit_headers-2022.3.3.dist-info/licenses/LICENSE +29 -0
  320. rdkit_headers-2022.3.3.dist-info/licenses/NOTICE +5 -0
@@ -0,0 +1,25 @@
1
+ //
2
+ // Copyright (c) 2001-2006 greg Landrum and Rational Discovery LLC
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
+ /*! \file BitVects.h
11
+
12
+ \brief Pulls in all the BitVect classes
13
+
14
+ */
15
+ #include <RDGeneral/export.h>
16
+ #ifndef __BITVECTS_H__
17
+ #define __BITVECTS_H__
18
+
19
+ #include "BitVect.h"
20
+ #include "ExplicitBitVect.h"
21
+ #include "SparseBitVect.h"
22
+ typedef SparseBitVect SBV;
23
+ typedef ExplicitBitVect EBV;
24
+
25
+ #endif
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright (C) 2005-2006 Rational Discovery LLC
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 <utility>
12
+
13
+ #include <RDGeneral/export.h>
14
+ #ifndef _DATASTRUCTS_EXCEPTION_H_20050126
15
+ #define _DATASTRUCTS_EXCEPTION_H_20050126
16
+
17
+ class RDKIT_DATASTRUCTS_EXPORT DatastructsException : public std::exception {
18
+ public:
19
+ //! construct with an error message
20
+ DatastructsException(const char *msg) : _msg(msg) {}
21
+ //! construct with an error message
22
+ DatastructsException(std::string msg) : _msg(std::move(msg)) {}
23
+ //! get the error message
24
+ const char *what() const noexcept override { return _msg.c_str(); }
25
+ ~DatastructsException() noexcept override = default;
26
+
27
+ private:
28
+ std::string _msg;
29
+ };
30
+
31
+ #endif
@@ -0,0 +1,72 @@
1
+ // Copyright (c) 2019, Novartis Institutes for BioMedical Research Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following
12
+ // disclaimer in the documentation and/or other materials provided
13
+ // with the distribution.
14
+ // * Neither the name of Novartis Institutes for BioMedical Research Inc.
15
+ // nor the names of its contributors may be used to endorse or promote
16
+ // products derived from this software without specific prior written
17
+ // permission.
18
+ //
19
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ //
31
+ #ifndef RDKIT_DATASTRUCTS_STREAMOPS
32
+ #define RDKIT_DATASTRUCTS_STREAMOPS
33
+ #include <RDGeneral/StreamOps.h>
34
+ #include <DataStructs/ExplicitBitVect.h>
35
+ #include <typeinfo>
36
+ #include <boost/any.hpp>
37
+
38
+ namespace RDKit {
39
+ class DataStructsExplicitBitVecPropHandler : public CustomPropHandler {
40
+ public:
41
+ const char *getPropName() const override { return "ExplicitBVProp"; }
42
+ bool canSerialize(const RDValue &value) const override {
43
+ return rdvalue_is<ExplicitBitVect>(value);
44
+ }
45
+
46
+ bool read(std::istream &ss, RDValue &value) const override {
47
+ std::string v;
48
+ int version = 0;
49
+ streamRead(ss, v, version);
50
+ ExplicitBitVect bv(v);
51
+ value = bv;
52
+ return true;
53
+ }
54
+
55
+ bool write(std::ostream &ss, const RDValue &value) const override {
56
+ try {
57
+ std::string output =
58
+ rdvalue_cast<const ExplicitBitVect &>(value).toString();
59
+ streamWrite(ss, output);
60
+ return true;
61
+ } catch (boost::bad_any_cast &) {
62
+ return false;
63
+ }
64
+ }
65
+
66
+ CustomPropHandler *clone() const override {
67
+ return new DataStructsExplicitBitVecPropHandler;
68
+ }
69
+ };
70
+
71
+ } // namespace RDKit
72
+ #endif
@@ -0,0 +1,30 @@
1
+ //
2
+ // Copyright (C) 2004-2006 Rational Discovery LLC
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_DISCRETEDISTMAT_H__
12
+ #define __RD_DISCRETEDISTMAT_H__
13
+ #include "DiscreteValueVect.h"
14
+
15
+ namespace RDKit {
16
+ class RDKIT_DATASTRUCTS_EXPORT DiscreteDistMat {
17
+ public:
18
+ DiscreteDistMat();
19
+ ~DiscreteDistMat() = default;
20
+ unsigned int getDist(unsigned char v1, unsigned char v2,
21
+ DiscreteValueVect::DiscreteValueType type);
22
+
23
+ private:
24
+ unsigned int d_oneBitTab[256 * 256];
25
+ unsigned int d_twoBitTab[256 * 256];
26
+ unsigned int d_fourBitTab[256 * 256];
27
+ };
28
+ extern DiscreteDistMat *getDiscreteDistMat();
29
+ } // namespace RDKit
30
+ #endif
@@ -0,0 +1,146 @@
1
+ //
2
+ // Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
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_DISCRETE_VALUE_VECT_20050124__
12
+ #define __RD_DISCRETE_VALUE_VECT_20050124__
13
+
14
+ #include <boost/smart_ptr.hpp>
15
+ #include <string>
16
+ #include <cstring>
17
+ #include <cstdint>
18
+
19
+ namespace RDKit {
20
+ // we require 32bit unsigneds using the std::uint32_t type:
21
+ const unsigned int BITS_PER_INT = 32;
22
+
23
+ //! a class for efficiently storing vectors of discrete values
24
+ class RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect {
25
+ public:
26
+ typedef boost::shared_array<std::uint32_t> DATA_SPTR;
27
+
28
+ //! used to define the possible range of the values
29
+ typedef enum {
30
+ ONEBITVALUE = 0,
31
+ TWOBITVALUE,
32
+ FOURBITVALUE,
33
+ EIGHTBITVALUE,
34
+ SIXTEENBITVALUE,
35
+ } DiscreteValueType;
36
+
37
+ //! initialize with a particular type and size
38
+ DiscreteValueVect(DiscreteValueType valType, unsigned int length)
39
+ : d_type(valType), d_length(length) {
40
+ d_bitsPerVal = (1 << static_cast<unsigned int>(valType));
41
+ d_valsPerInt = BITS_PER_INT / d_bitsPerVal;
42
+ d_numInts = (length + d_valsPerInt - 1) / d_valsPerInt;
43
+ d_mask = ((1 << d_bitsPerVal) - 1);
44
+ std::uint32_t *data = new std::uint32_t[d_numInts];
45
+ memset(static_cast<void *>(data), 0, d_numInts * sizeof(std::uint32_t));
46
+ d_data.reset(data);
47
+ }
48
+
49
+ //! Copy constructor
50
+ DiscreteValueVect(const DiscreteValueVect &other);
51
+
52
+ DiscreteValueVect &operator=(const DiscreteValueVect &other);
53
+
54
+ //! constructor from a pickle
55
+ DiscreteValueVect(const std::string &pkl) {
56
+ initFromText(pkl.c_str(), static_cast<unsigned int>(pkl.size()));
57
+ }
58
+ //! constructor from a pickle
59
+ DiscreteValueVect(const char *pkl, const unsigned int len) {
60
+ initFromText(pkl, len);
61
+ }
62
+
63
+ ~DiscreteValueVect() = default;
64
+
65
+ //! return the value at an index
66
+ unsigned int getVal(unsigned int i) const;
67
+
68
+ //! support indexing using []
69
+ int operator[](unsigned int idx) const { return getVal(idx); }
70
+
71
+ //! set the value at an index
72
+ /*!
73
+ NOTE: it is an error to have val > the max value this
74
+ DiscreteValueVect can accommodate
75
+ */
76
+ void setVal(unsigned int i, unsigned int val);
77
+
78
+ //! returns the sum of all the elements in the vect
79
+ unsigned int getTotalVal() const;
80
+
81
+ //! returns the length
82
+ unsigned int getLength() const;
83
+ //! returns the length
84
+ unsigned int size() const { return getLength(); }
85
+
86
+ //! return a pointer to our raw data storage
87
+ const std::uint32_t *getData() const;
88
+
89
+ //! return the number of bits used to store each value
90
+ unsigned int getNumBitsPerVal() const { return d_bitsPerVal; }
91
+
92
+ //! return the type of value being stored
93
+ DiscreteValueType getValueType() const { return d_type; }
94
+
95
+ //! returns the size of our storage
96
+ unsigned int getNumInts() const { return d_numInts; }
97
+
98
+ //! support dvv3 = dvv1&dvv2
99
+ /*!
100
+
101
+ operator& returns the minimum value for each element.
102
+ e.g.:
103
+ [0,1,2,0] & [0,1,1,1] -> [0,1,1,0]
104
+
105
+ */
106
+ DiscreteValueVect operator&(const DiscreteValueVect &other) const;
107
+ //! support dvv3 = dvv1|dvv2
108
+ /*!
109
+
110
+ operator& returns the maximum value for each element.
111
+ e.g.:
112
+ [0,1,2,0] | [0,1,1,1] -> [0,1,2,1]
113
+
114
+ */
115
+ DiscreteValueVect operator|(const DiscreteValueVect &other) const;
116
+ // DiscreteValueVect operator^ (const DiscreteValueVect &other) const;
117
+ // DiscreteValueVect operator~ () const;
118
+
119
+ DiscreteValueVect &operator+=(const DiscreteValueVect &other);
120
+ DiscreteValueVect &operator-=(const DiscreteValueVect &other);
121
+
122
+ //! returns a binary string representation (pickle)
123
+ std::string toString() const;
124
+
125
+ private:
126
+ DiscreteValueType d_type;
127
+ unsigned int d_bitsPerVal;
128
+ unsigned int d_valsPerInt;
129
+ unsigned int d_numInts;
130
+ unsigned int d_length;
131
+ unsigned int d_mask;
132
+ DATA_SPTR d_data;
133
+
134
+ void initFromText(const char *pkl, const unsigned int len);
135
+ };
136
+
137
+ RDKIT_DATASTRUCTS_EXPORT unsigned int computeL1Norm(
138
+ const DiscreteValueVect &v1, const DiscreteValueVect &v2);
139
+
140
+ RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect
141
+ operator+(const DiscreteValueVect &p1, const DiscreteValueVect &p2);
142
+ RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect
143
+ operator-(const DiscreteValueVect &p1, const DiscreteValueVect &p2);
144
+ } // namespace RDKit
145
+
146
+ #endif
@@ -0,0 +1,96 @@
1
+ //
2
+ // Copyright (c) 2003-208 greg Landrum and Rational Discovery LLC
3
+ // Copyright (c) 2014, Novartis Institutes for BioMedical Research Inc.
4
+ //
5
+ // @@ All Rights Reserved @@
6
+ // This file is part of the RDKit.
7
+ // The contents are covered by the terms of the BSD license
8
+ // which is included in the file license.txt, found at the root
9
+ // of the RDKit source tree.
10
+ //
11
+ #include <RDGeneral/export.h>
12
+ #ifndef __RD_EXPLICITBITVECTS_H__
13
+ #define __RD_EXPLICITBITVECTS_H__
14
+
15
+ #include <RDGeneral/BoostStartInclude.h>
16
+ #include <boost/dynamic_bitset.hpp>
17
+ #include <RDGeneral/BoostEndInclude.h>
18
+ #include "BitVect.h"
19
+
20
+ //! a class for bit vectors that are densely occupied
21
+ /*!
22
+ ExplicitBitVect objects store all of their bits using
23
+ a boost::dynamic_bitset
24
+
25
+ These are very fast, but can require large amounts of memory for large,
26
+ sparsely occupied vectors.
27
+
28
+ */
29
+ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
30
+ public:
31
+ ExplicitBitVect() {}
32
+ //! initialize with a particular size;
33
+ explicit ExplicitBitVect(unsigned int size)
34
+ : dp_bits(nullptr), d_size(0), d_numOnBits(0) {
35
+ _initForSize(size);
36
+ }
37
+ //! initialize with a particular size and all bits set
38
+ ExplicitBitVect(unsigned int size, bool bitsSet);
39
+ ExplicitBitVect(const ExplicitBitVect &other);
40
+ //! construct from a string pickle
41
+ ExplicitBitVect(const std::string &);
42
+ //! construct from a text pickle
43
+ ExplicitBitVect(const char *, const unsigned int);
44
+ //! construct directly from a dynamic_bitset pointer
45
+ /// takes ownership of the pointer
46
+ ExplicitBitVect(boost::dynamic_bitset<> *bits)
47
+ : dp_bits(bits),
48
+ d_size(static_cast<unsigned int>(bits->size())),
49
+ d_numOnBits(static_cast<unsigned int>(bits->count())) {}
50
+
51
+ ~ExplicitBitVect() override;
52
+
53
+ ExplicitBitVect &operator=(const ExplicitBitVect &other);
54
+ bool operator[](const unsigned int which) const override;
55
+ bool setBit(const unsigned int which) override;
56
+ bool unsetBit(const unsigned int which) override;
57
+ bool getBit(const unsigned int which) const override;
58
+
59
+ ExplicitBitVect operator^(const ExplicitBitVect &other) const;
60
+ ExplicitBitVect operator&(const ExplicitBitVect &other) const;
61
+ ExplicitBitVect operator|(const ExplicitBitVect &other) const;
62
+ ExplicitBitVect operator~() const;
63
+ /* concatenate two ExplicitBitVects */
64
+ ExplicitBitVect operator+(const ExplicitBitVect &other) const;
65
+
66
+ ExplicitBitVect &operator^=(const ExplicitBitVect &other);
67
+ ExplicitBitVect &operator&=(const ExplicitBitVect &other);
68
+ ExplicitBitVect &operator|=(const ExplicitBitVect &other);
69
+ /* concatenate two ExplicitBitVects */
70
+ ExplicitBitVect &operator+=(const ExplicitBitVect &other);
71
+
72
+ unsigned int getNumBits() const override;
73
+ unsigned int getNumOnBits() const override;
74
+ unsigned int getNumOffBits() const override;
75
+
76
+ void getOnBits(IntVect &v) const override;
77
+
78
+ void clearBits() override { dp_bits->reset(); }
79
+ std::string toString() const override;
80
+
81
+ boost::dynamic_bitset<> *dp_bits{nullptr}; //!< our raw storage
82
+
83
+ bool operator==(const ExplicitBitVect &o) const {
84
+ return *dp_bits == *o.dp_bits;
85
+ }
86
+ bool operator!=(const ExplicitBitVect &o) const {
87
+ return *dp_bits != *o.dp_bits;
88
+ }
89
+
90
+ private:
91
+ unsigned int d_size{0};
92
+ unsigned int d_numOnBits{0};
93
+ void _initForSize(const unsigned int size) override;
94
+ };
95
+
96
+ #endif
@@ -0,0 +1,281 @@
1
+ //
2
+ // Copyright (c) 2016 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
+ #include <RDGeneral/export.h>
11
+ #ifndef RD_FPBREADER_H_DEC2015
12
+ #define RD_FPBREADER_H_DEC2015
13
+ /*! \file FPBReader.h
14
+
15
+ \brief contains a simple class for reading and searching FPB files
16
+
17
+ \b Note that this functionality is experimental and the API may change
18
+ in future releases.
19
+ */
20
+
21
+ #include <iostream>
22
+ #include <fstream>
23
+ #include <sstream>
24
+ #include <string>
25
+ #include <RDGeneral/BadFileException.h>
26
+ #include <DataStructs/ExplicitBitVect.h>
27
+
28
+ #include <cstdint>
29
+ #include <boost/shared_ptr.hpp>
30
+ #include <boost/shared_array.hpp>
31
+
32
+ namespace RDKit {
33
+ namespace detail {
34
+ struct FPBReader_impl;
35
+ }
36
+
37
+ //! class for reading and searching FPB files
38
+ /*!
39
+ basic usage:
40
+ \code
41
+ FPBReader reader("foo.fpb");
42
+ reader.init();
43
+ boost::shared_ptr<ExplicitBitVect> ebv = reader.getFP(95);
44
+ std::vector<std::pair<double, unsigned int> > nbrs =
45
+ reader.getTanimotoNeighbors(*ebv.get(), 0.70);
46
+ \endcode
47
+
48
+ \b Note: this functionality is experimental and the API may change
49
+ in future releases.
50
+
51
+ <b>Note on thread safety</b>
52
+ Operations that involve reading from the FPB file are not thread safe.
53
+ This means that the \c init() method is not thread safe and none of the
54
+ search operations are thread safe when an \c FPBReader is initialized in
55
+ \c lazyRead mode.
56
+
57
+ */
58
+ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
59
+ public:
60
+ FPBReader() {}
61
+
62
+ //! ctor for reading from a named file
63
+ /*!
64
+ \param fname the name of the file to reads
65
+ \param lazyRead if set to \c false all fingerprints from the file will be read
66
+ into memory when \c init() is called.
67
+ */
68
+ FPBReader(const char *fname, bool lazyRead = false) {
69
+ _initFromFilename(fname, lazyRead);
70
+ }
71
+ //! \overload
72
+ FPBReader(const std::string &fname, bool lazyRead = false) {
73
+ _initFromFilename(fname.c_str(), lazyRead);
74
+ }
75
+ //! ctor for reading from an open istream
76
+ /*!
77
+ \param inStream the stream to read from
78
+ \param takeOwnership if set, we will take over ownership of the stream pointer
79
+ \param lazyRead if set to \c false all fingerprints from the file will be read
80
+ into memory when \c init() is called.
81
+
82
+ Some additional notes:
83
+ - if \c lazyRead is set, \c inStream must support the \c seekg() and \c
84
+ tellg() operations.
85
+
86
+ */
87
+ FPBReader(std::istream *inStream, bool takeOwnership = true,
88
+ bool lazyRead = false)
89
+ : dp_istrm(inStream),
90
+ dp_impl(nullptr),
91
+ df_owner(takeOwnership),
92
+ df_init(false),
93
+ df_lazyRead(lazyRead) {}
94
+ ~FPBReader() {
95
+ destroy();
96
+ if (df_owner) {
97
+ delete dp_istrm;
98
+ }
99
+ dp_istrm = nullptr;
100
+ df_init = false;
101
+ }
102
+
103
+ //! Read the data from the file and initialize internal data structures
104
+ /*!
105
+ This must be called before most of the other methods of this class.
106
+
107
+ Some notes:
108
+ \li if \c lazyRead is not set, all fingerprints will be read into memory. This
109
+ can require substantial amounts of memory for large files.
110
+ \li For large files, this can take a long time.
111
+ \li If \c lazyRead and \c takeOwnership are both \c false it is safe to close
112
+ and delete inStream after calling \c init()
113
+ */
114
+ void init();
115
+ //! cleanup
116
+ /*!
117
+ Cleans up whatever memory was allocated during init()
118
+ */
119
+ void cleanup() {
120
+ if (!df_init) {
121
+ return;
122
+ }
123
+ destroy();
124
+ df_init = false;
125
+ }
126
+ //! returns the requested fingerprint as an \c ExplicitBitVect
127
+ boost::shared_ptr<ExplicitBitVect> getFP(unsigned int idx) const;
128
+ //! returns the requested fingerprint as an array of bytes
129
+ boost::shared_array<std::uint8_t> getBytes(unsigned int idx) const;
130
+
131
+ //! returns the id of the requested fingerprint
132
+ std::string getId(unsigned int idx) const;
133
+ //! returns the fingerprint and id of the requested fingerprint
134
+ std::pair<boost::shared_ptr<ExplicitBitVect>, std::string> operator[](
135
+ unsigned int idx) const {
136
+ return std::make_pair(getFP(idx), getId(idx));
137
+ }
138
+
139
+ //! returns beginning and end indices of fingerprints having on-bit counts
140
+ //! within the range (including end points)
141
+ std::pair<unsigned int, unsigned int> getFPIdsInCountRange(
142
+ unsigned int minCount, unsigned int maxCount);
143
+
144
+ //! returns the number of fingerprints
145
+ unsigned int length() const;
146
+ //! returns the number of bits in our fingerprints
147
+ unsigned int nBits() const;
148
+
149
+ //! returns the tanimoto similarity between the specified fingerprint and the
150
+ //! provided fingerprint
151
+ double getTanimoto(unsigned int idx, const std::uint8_t *bv) const;
152
+ //! \overload
153
+ double getTanimoto(unsigned int idx,
154
+ boost::shared_array<std::uint8_t> bv) const {
155
+ return getTanimoto(idx, bv.get());
156
+ }
157
+ //! \overload
158
+ double getTanimoto(unsigned int idx, const ExplicitBitVect &ebv) const;
159
+
160
+ //! returns tanimoto neighbors that are within a similarity threshold
161
+ /*!
162
+ The result vector of (similarity,index) pairs is sorted in order
163
+ of decreasing similarity
164
+
165
+ \param bv the query fingerprint
166
+ \param threshold the minimum similarity to return
167
+ \param usePopcountScreen if this is true (the default) the popcount of the
168
+ neighbors will be used to reduce the number of calculations that need
169
+ to be done
170
+
171
+ */
172
+ std::vector<std::pair<double, unsigned int>> getTanimotoNeighbors(
173
+ const std::uint8_t *bv, double threshold = 0.7,
174
+ bool usePopcountScreen = true) const;
175
+ //! \overload
176
+ std::vector<std::pair<double, unsigned int>> getTanimotoNeighbors(
177
+ boost::shared_array<std::uint8_t> bv, double threshold = 0.7,
178
+ bool usePopcountScreen = true) const {
179
+ return getTanimotoNeighbors(bv.get(), threshold, usePopcountScreen);
180
+ }
181
+ //! \overload
182
+ std::vector<std::pair<double, unsigned int>> getTanimotoNeighbors(
183
+ const ExplicitBitVect &ebv, double threshold = 0.7,
184
+ bool usePopcountScreen = true) const;
185
+
186
+ //! returns the Tversky similarity between the specified fingerprint and the
187
+ //! provided fingerprint
188
+ /*!
189
+
190
+ \param idx the fingerprint to compare to
191
+ \param bv the query fingerprint
192
+ \param ca the Tversky a coefficient
193
+ \param cb the Tversky a coefficient
194
+
195
+ */
196
+ double getTversky(unsigned int idx, const std::uint8_t *bv, double ca,
197
+ double cb) const;
198
+ //! \overload
199
+ double getTversky(unsigned int idx, boost::shared_array<std::uint8_t> bv,
200
+ double ca, double cb) const {
201
+ return getTversky(idx, bv.get(), ca, cb);
202
+ }
203
+ //! \overload
204
+ double getTversky(unsigned int idx, const ExplicitBitVect &ebv, double ca,
205
+ double cb) const;
206
+
207
+ //! returns Tversky neighbors that are within a similarity threshold
208
+ /*!
209
+ The result vector of (similarity,index) pairs is sorted in order
210
+ of decreasing similarity
211
+
212
+ \param bv the query fingerprint
213
+ \param ca the Tversky a coefficient
214
+ \param cb the Tversky a coefficient
215
+ \param threshold the minimum similarity to return
216
+ \param usePopcountScreen if this is true (the default) the popcount of the
217
+ neighbors will be used to reduce the number of calculations that need
218
+ to be done
219
+
220
+ */
221
+ std::vector<std::pair<double, unsigned int>> getTverskyNeighbors(
222
+ const std::uint8_t *bv, double ca, double cb, double threshold = 0.7,
223
+ bool usePopcountScreen = true) const;
224
+ //! \overload
225
+ std::vector<std::pair<double, unsigned int>> getTverskyNeighbors(
226
+ boost::shared_array<std::uint8_t> bv, double ca, double cb,
227
+ double threshold = 0.7, bool usePopcountScreen = true) const {
228
+ return getTverskyNeighbors(bv.get(), ca, cb, threshold, usePopcountScreen);
229
+ }
230
+ //! \overload
231
+ std::vector<std::pair<double, unsigned int>> getTverskyNeighbors(
232
+ const ExplicitBitVect &ebv, double ca, double cb, double threshold = 0.7,
233
+ bool usePopcountScreen = true) const;
234
+
235
+ //! returns indices of all fingerprints that completely contain this one
236
+ /*! (i.e. where all the bits set in the query are also set in the db
237
+ molecule)
238
+ */
239
+ std::vector<unsigned int> getContainingNeighbors(
240
+ const std::uint8_t *bv) const;
241
+ //! \overload
242
+ std::vector<unsigned int> getContainingNeighbors(
243
+ boost::shared_array<std::uint8_t> bv) const {
244
+ return getContainingNeighbors(bv.get());
245
+ }
246
+ //! \overload
247
+ std::vector<unsigned int> getContainingNeighbors(
248
+ const ExplicitBitVect &ebv) const;
249
+
250
+ private:
251
+ std::istream *dp_istrm{nullptr};
252
+ detail::FPBReader_impl *dp_impl{nullptr}; // implementation details
253
+ bool df_owner{false};
254
+ bool df_init{false};
255
+ bool df_lazyRead{false};
256
+
257
+ // disable automatic copy constructors and assignment operators
258
+ // for this class and its subclasses. They will likely be
259
+ // carrying around stream pointers and copying those is a recipe
260
+ // for disaster.
261
+ FPBReader(const FPBReader &);
262
+ FPBReader &operator=(const FPBReader &);
263
+ void destroy();
264
+ void _initFromFilename(const char *fname, bool lazyRead) {
265
+ std::istream *tmpStream = static_cast<std::istream *>(
266
+ new std::ifstream(fname, std::ios_base::binary));
267
+ if (!(*tmpStream) || (tmpStream->bad())) {
268
+ std::ostringstream errout;
269
+ errout << "Bad input file " << fname;
270
+ delete tmpStream;
271
+ throw BadFileException(errout.str());
272
+ }
273
+ dp_istrm = tmpStream;
274
+ dp_impl = nullptr;
275
+ df_owner = true;
276
+ df_init = false;
277
+ df_lazyRead = lazyRead;
278
+ }
279
+ };
280
+ } // namespace RDKit
281
+ #endif