RDKit::FileParserUtils Namespace Reference

## Functions

template<typename T >
T | stripSpacesAndCast (const std::string &input, bool acceptSpaces=false)
RDKIT_FILEPARSERS_EXPORT int | toInt (const std::string &input, bool acceptSpaces=false)
RDKIT_FILEPARSERS_EXPORT double | toDouble (const std::string &input, bool acceptSpaces=true)
RDKIT_FILEPARSERS_EXPORT std::string | getV3000Line (std::istream *inStream, unsigned int &line)
RDKIT_FILEPARSERS_EXPORT bool | ParseV3000CTAB (std::istream *inStream, unsigned int &line, RWMol *mol, Conformer *&conf, bool &chiralityPossible, unsigned int &nAtoms, unsigned int &nBonds, bool strictParsing=true, bool expectMEND=true)
RDKIT_FILEPARSERS_EXPORT bool | ParseV2000CTAB (std::istream *inStream, unsigned int &line, RWMol *mol, Conformer *&conf, bool &chiralityPossible, unsigned int &nAtoms, unsigned int &nBonds, bool strictParsing=true)
RDKIT_FILEPARSERS_EXPORT void | finishMolProcessing (RWMol *res, bool chiralityPossible, bool sanitize, bool removeHs)
| finishes up the processing (sanitization, etc.) of a molecule read from CTAB More...
RDKIT_FILEPARSERS_EXPORT Atom * | replaceAtomWithQueryAtom (RWMol *mol, Atom *atom)
template<typename T >
void | applyMolListPropToAtoms (ROMol &mol, const std::string &pn, const std::string &prefix, const std::string &missingValueMarker="n/a")
| applies a particular property to the atoms as an atom property list More...
template<typename T >
void | applyMolListPropsToAtoms (ROMol &mol, const std::string &prefix, const std::string missingValueMarker="n/a")
| applies all properties matching a particular prefix as an atom property list More...
void | processMolPropertyList (ROMol &mol, const std::string pn, const std::string &missingValueMarker="n/a")
void | processMolPropertyLists (ROMol &mol, const std::string &missingValueMarker="n/a")
template<typename T >
std::string | getAtomPropertyList (ROMol &mol, const std::string &atomPropName, std::string missingValueMarker="", unsigned int lineSize=190)
void | createAtomIntPropertyList (ROMol &mol, const std::string &atomPropName, const std::string &missingValueMarker="", unsigned int lineSize=190)
void | createAtomDoublePropertyList (ROMol &mol, const std::string &atomPropName, const std::string &missingValueMarker="", unsigned int lineSize=190)
void | createAtomBoolPropertyList (ROMol &mol, const std::string &atomPropName, const std::string &missingValueMarker="", unsigned int lineSize=190)
void | createAtomStringPropertyList (ROMol &mol, const std::string &atomPropName, const std::string &missingValueMarker="", unsigned int lineSize=190)

## Variables

static const std::string | atomPropPrefix = "atom."

## Function Documentation

## applyMolListPropsToAtoms()

template<typename T >

void RDKit::FileParserUtils::applyMolListPropsToAtoms | ( | ROMol & | mol,
|  | const std::string & | prefix,
|  | const std::string | missingValueMarker = `"n/a"`
| ) |  |

applies all properties matching a particular prefix as an atom property list

Definition at line 107 of file FileParserUtils.h.

References RDKit::RDProps::getPropList().

## applyMolListPropToAtoms()

template<typename T >

void RDKit::FileParserUtils::applyMolListPropToAtoms | ( | ROMol & | mol,
|  | const std::string & | pn,
|  | const std::string & | prefix,
|  | const std::string & | missingValueMarker = `"n/a"`
| ) |  |

applies a particular property to the atoms as an atom property list

Definition at line 65 of file FileParserUtils.h.

References BOOST_LOG, RDKit::ROMol::getAtomWithIdx(), RDKit::ROMol::getNumAtoms(), RDKit::RDProps::getProp(), rdWarningLog, and RDKit::RDProps::setProp().

## createAtomBoolPropertyList()

void RDKit::FileParserUtils::createAtomBoolPropertyList | ( | ROMol & | mol,
|  | const std::string & | atomPropName,
|  | const std::string & | missingValueMarker = `""`,
|  | unsigned int | lineSize = `190`
| ) |  |

inline

Definition at line 202 of file FileParserUtils.h.

References RDKit::RDProps::setProp().

## createAtomDoublePropertyList()

void RDKit::FileParserUtils::createAtomDoublePropertyList | ( | ROMol & | mol,
|  | const std::string & | atomPropName,
|  | const std::string & | missingValueMarker = `""`,
|  | unsigned int | lineSize = `190`
| ) |  |

inline

Definition at line 194 of file FileParserUtils.h.

References RDKit::RDProps::setProp().

## createAtomIntPropertyList()

void RDKit::FileParserUtils::createAtomIntPropertyList | ( | ROMol & | mol,
|  | const std::string & | atomPropName,
|  | const std::string & | missingValueMarker = `""`,
|  | unsigned int | lineSize = `190`
| ) |  |

inline

Definition at line 186 of file FileParserUtils.h.

References RDKit::RDProps::setProp().

## createAtomStringPropertyList()

void RDKit::FileParserUtils::createAtomStringPropertyList | ( | ROMol & | mol,
|  | const std::string & | atomPropName,
|  | const std::string & | missingValueMarker = `""`,
|  | unsigned int | lineSize = `190`
| ) |  |

inline

Definition at line 210 of file FileParserUtils.h.

References RDKit::RDProps::setProp().

## finishMolProcessing()

RDKIT_FILEPARSERS_EXPORT void RDKit::FileParserUtils::finishMolProcessing | ( | RWMol * | res,
|  | bool | chiralityPossible,
|  | bool | sanitize,
|  | bool | removeHs
| ) |  |

finishes up the processing (sanitization, etc.) of a molecule read from CTAB

## getAtomPropertyList()

template<typename T >

std::string RDKit::FileParserUtils::getAtomPropertyList | ( | ROMol & | mol,
|  | const std::string & | atomPropName,
|  | std::string | missingValueMarker = `""`,
|  | unsigned int | lineSize = `190`
| ) |  |

Definition at line 153 of file FileParserUtils.h.

References RDKit::ROMol::atoms().

## getV3000Line()

RDKIT_FILEPARSERS_EXPORT std::string RDKit::FileParserUtils::getV3000Line | ( | std::istream * | inStream,
|  | unsigned int & | line
| ) |  |

## ParseV2000CTAB()

RDKIT_FILEPARSERS_EXPORT bool RDKit::FileParserUtils::ParseV2000CTAB | ( | std::istream * | inStream,
|  | unsigned int & | line,
|  | RWMol * | mol,
|  | Conformer *& | conf,
|  | bool & | chiralityPossible,
|  | unsigned int & | nAtoms,
|  | unsigned int & | nBonds,
|  | bool | strictParsing = `true`
| ) |  |

## ParseV3000CTAB()

RDKIT_FILEPARSERS_EXPORT bool RDKit::FileParserUtils::ParseV3000CTAB | ( | std::istream * | inStream,
|  | unsigned int & | line,
|  | RWMol * | mol,
|  | Conformer *& | conf,
|  | bool & | chiralityPossible,
|  | unsigned int & | nAtoms,
|  | unsigned int & | nBonds,
|  | bool | strictParsing = `true`,
|  | bool | expectMEND = `true`
| ) |  |

## processMolPropertyList()

void RDKit::FileParserUtils::processMolPropertyList | ( | ROMol & | mol,
|  | const std::string | pn,
|  | const std::string & | missingValueMarker = `"n/a"`
| ) |  |

inline

if the property name matches our rules for atom property lists, we'll apply it to the atoms

Definition at line 118 of file FileParserUtils.h.

References atomPropPrefix.

Referenced by processMolPropertyLists().

## processMolPropertyLists()

void RDKit::FileParserUtils::processMolPropertyLists | ( | ROMol & | mol,
|  | const std::string & | missingValueMarker = `"n/a"`
| ) |  |

inline

loops over all properties and applies the ones that match the rules for atom property lists to the atoms

Definition at line 146 of file FileParserUtils.h.

References RDKit::RDProps::getPropList(), and processMolPropertyList().

## replaceAtomWithQueryAtom()

RDKIT_FILEPARSERS_EXPORT Atom* RDKit::FileParserUtils::replaceAtomWithQueryAtom | ( | RWMol * | mol,
|  | Atom * | atom
| ) |  |

## stripSpacesAndCast()

template<typename T >

T RDKit::FileParserUtils::stripSpacesAndCast | ( | const std::string & | input,
|  | bool | acceptSpaces = `false`
| ) |  |

Definition at line 28 of file FileParserUtils.h.

## toDouble()

RDKIT_FILEPARSERS_EXPORT double RDKit::FileParserUtils::toDouble | ( | const std::string & | input,
|  | bool | acceptSpaces = `true`
| ) |  |

## toInt()

RDKIT_FILEPARSERS_EXPORT int RDKit::FileParserUtils::toInt | ( | const std::string & | input,
|  | bool | acceptSpaces = `false`
| ) |  |

## Variable Documentation

## atomPropPrefix

const std::string RDKit::FileParserUtils::atomPropPrefix = "atom."

static

Definition at line 115 of file FileParserUtils.h.

Referenced by processMolPropertyList().