 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef _RD_MOLPICKLE_H
12 #define _RD_MOLPICKLE_H
20 #include <boost/utility/binary.hpp>
40 const char *
what() const noexcept
override {
return _msg.c_str(); };
41 const char *
message() const noexcept {
return what(); };
48 namespace PicklerOps {
153 unsigned int propertyFlags);
158 unsigned int propertyFlags) {
165 unsigned int propertyFlags);
168 unsigned int propertyFlags) {
186 static std::int32_t _pickleAtomData(std::ostream &tss,
const Atom *atom);
188 static void _unpickleAtomData(std::istream &tss,
Atom *atom,
int version);
190 static void _pickleQueryAtomData(std::ostream &tss,
const Atom *atom);
193 template <
typename T>
194 static void _pickle(
const ROMol *mol, std::ostream &ss,
195 unsigned int propertyFlags);
198 template <
typename T>
199 static void _pickleAtom(std::ostream &ss,
const Atom *atom);
202 template <
typename T>
203 static void _pickleBond(std::ostream &ss,
const Bond *bond,
204 std::map<int, int> &atomIdxMap);
207 template <
typename T>
208 static void _pickleSSSR(std::ostream &ss,
const RingInfo *ringInfo,
209 std::map<int, int> &atomIdxMap);
212 template <
typename T>
213 static void _pickleSubstanceGroup(std::ostream &ss,
215 std::map<int, int> &atomIdxMap,
216 std::map<int, int> &bondIdxMap);
219 template <
typename T>
220 static void _pickleStereo(std::ostream &ss,
221 const std::vector<StereoGroup> &groups,
222 std::map<int, int> &atomIdxMap);
225 template <
typename T,
typename C>
226 static void _pickleConformer(std::ostream &ss,
const Conformer *conf);
229 template <
typename T>
230 static void _depickle(std::istream &ss,
ROMol *mol,
int version,
235 template <
typename T>
236 static Atom *_addAtomFromPickle(std::istream &ss,
ROMol *mol,
238 bool directMap =
false);
241 template <
typename T>
242 static Bond *_addBondFromPickle(std::istream &ss,
ROMol *mol,
int version,
243 bool directMap =
false);
247 template <
typename T>
248 static void _addRingInfoFromPickle(std::istream &ss,
ROMol *mol,
int version,
249 bool directMap =
false);
252 template <
typename T>
253 static SubstanceGroup _getSubstanceGroupFromPickle(std::istream &ss,
254 ROMol *mol,
int version);
256 template <
typename T>
257 static void _depickleStereo(std::istream &ss,
ROMol *mol,
int version);
260 template <
typename T,
typename C>
261 static Conformer *_conformerFromPickle(std::istream &ss,
int version);
264 static void _pickleProperties(std::ostream &ss,
const RDProps &props,
265 unsigned int pickleFlags);
267 static void _unpickleProperties(std::istream &ss,
RDProps &props);
270 static void _pickleV1(
const ROMol *mol, std::ostream &ss);
272 static void _depickleV1(std::istream &ss,
ROMol *mol);
274 static void _addAtomFromPickleV1(std::istream &ss,
ROMol *mol);
276 static void _addBondFromPickleV1(std::istream &ss,
ROMol *mol);
~MolPicklerException() noexcept
@ ATOM_PDB_RESIDUE_OCCUPANCY
@ ATOM_PDB_RESIDUE_INSERTIONCODE
RDKIT_CHEMREACTIONS_EXPORT void pickle(const boost::shared_ptr< EnumerationStrategyBase > &enumerator, std::ostream &ss)
pickles a EnumerationStrategy and adds the results to a stream ss
static void molFromPickle(std::istream &ss, ROMol *mol)
constructs a molecule from a pickle stored in a stream
MolPicklerException(const std::string msg)
@ ATOM_PDB_RESIDUE_TEMPFACTOR
The class for representing SubstanceGroups.
used to indicate exceptions whilst pickling (serializing) molecules
static void addCustomPropHandler(const CustomPropHandler &handler)
class for representing a bond
static const std::int32_t versionPatch
mark the pickle patch version
@ ATOM_PDB_RESIDUE_RESIDUENUMBER
static void setDefaultPickleProperties(unsigned int)
std::vector< std::shared_ptr< const CustomPropHandler > > CustomPropHandlerVec
const char * what() const noexcept override
static const CustomPropHandlerVec & getCustomPropHandlers()
static const std::int32_t endianId
The class for representing atoms.
static const std::int32_t versionMajor
mark the pickle major version
static void molFromPickle(const std::string &pickle, ROMol *mol)
constructs a molecule from a pickle stored in a string
Defines the Atom class and associated typedefs.
A class to store information about a molecule's rings.
static void pickleMol(const ROMol *mol, std::ostream &ss, unsigned int propertyFlags)
static void pickleMol(const ROMol &mol, std::string &res)
#define RDKIT_GRAPHMOL_EXPORT
static void pickleMol(const ROMol &mol, std::ostream &ss)
@ ATOM_PDB_RESIDUE_SERIALNUMBER
static unsigned int getDefaultPickleProperties()
static void pickleMol(const ROMol *mol, std::string &res, unsigned int propertyFlags)
static const std::int32_t versionMinor
mark the pickle minor version
static void molFromPickle(std::istream &ss, ROMol &mol)
static void pickleMol(const ROMol *mol, std::string &res)
pickles a molecule and adds the results to string res
@ ATOM_PDB_RESIDUE_RESIDUENAME
static void pickleMol(const ROMol &mol, std::ostream &ss, unsigned int propertyFlags)
static void pickleMol(const ROMol *mol, std::ostream &ss)
pickles a molecule and sends the results to stream ss
MolPicklerException(const char *msg)
@ ATOM_PDB_RESIDUE_CHAINID
static void pickleMol(const ROMol &mol, std::string &res, unsigned int propertyFlags)
@ ATOM_PDB_RESIDUE_ALTLOC
@ ATOM_PDB_RESIDUE_SEGMENTNUMBER
@ ATOM_PDB_RESIDUE_ISHETEROATOM
handles pickling (serializing) molecules
static void molFromPickle(const std::string &pickle, ROMol &mol)
const char * message() const noexcept
@ ATOM_PDB_RESIDUE_SECONDARYSTRUCTURE