OECXSMILESToMol¶
bool OECXSMILESToMol(OEMolBase &mol, const std::string &str)
Converts a CXSMILES string into a molecule. After constructing the molecule the following properties are perceived:
Rings are perceived by calling the
OEFindRingAtomsAndBonds
function.The aromaticity is assigned by calling the
OEAssignAromaticFlags
function using theOEChem_OEAroModelOpenEye
aromaticity model.The chirality is perceived by calling the
OEPerceiveChiral
function.
Note that since CXSMILES is a superset of the SMILES syntax, it is safe to use this function for either format. Using SMILES readers for known CXSMILES is discouraged since any appendix information will become a static addition to the molecule title and cannot be recovered.
The molecule object is cleared before parsing so the resulting molecule
object only contains atoms and bonds from the CXSMILES. If one
wishes to add atoms and bonds to an existing molecule, one can use
the lower-level OEParseSmiles
function (with an option argument
that enables CXSMILES parsing), which preserves
any existing atoms and bonds in the molecule.
See also
OEMolToCXSMILES
functionOEMolToSmiles
functionUnique Representation section