OEParseSmilesOptions

class OEParseSmilesOptions

An class for handling options for the OEParseSmiles function.

Constructors

OEParseSmilesOptions(bool canon=false, bool strict=false, bool quiet=false, bool cxsmiles=false)

Initializes the object with the specified options.

GetCanon

bool GetCanon() const

A value of true specifies that the OEKekulize step can be skipped. Defaults to false.

GetCXSMILES

bool GetCXSMILES() const

A value of true specifies that a CXSMILES formatted appendix is allowed to be present in the parse string, and extra checking will be employed to capture any enhanced stereogroup information therein. A value of false results in a CXSMILES appendix being ignored and retained as part of the molecule title. Defaults to false.

Warning

Unparsed CXSMILES appendix information captured in the molecule title will generally be corrupt after regeneration of SMILES information.

GetStrict

bool GetStrict() const

A value of true specifies that the OEParseSmiles will apply more rigorous sanity checks on the parsed SMILES string. Defaults to false.

GetQuiet

bool GetQuiet() const

A value of true specifies that there will be no output written to OEThrow if OEParseSmiles fails to parse the string. Defaults to false.

SetCanon

void SetCanon(const bool)

This setting can be used to circumvent the post-processing kekulization test of OEParseSmiles. Passing a boolean true value to this argument indicates to the parser that the SMILES string should be assumed to be well-formed and the usual kekulization (by calling OEKekulize) step may be omitted. This can be used to speed-up parsing of a large database, but has the side-effect that bond orders are not correctly assigned for aromatic molecules.

SetCXSMILES

bool SetCXSMILES(const bool)

Setting a value of true specifies that a CXSMILES formatted appendix is allowed to be present in the parse string, and extra checking should be employed to capture any enhanced stereogroup information therein. Setting a value of false results in a CXSMILES appendix being ignored and captured as part of the molecule title.

SetStrict

void SetStrict(const bool)

This setting controls whether OEParseSmiles should operate in strict mode. By default, the SMILES parser attempts to process any reasonably formed SMILES string. If this setting is true, the parser applies more rigorous sanity checking. For example, the SMILES C==C is accepted by the default non-strict parser, but rejected by the strict parser.

SetQuiet

void SetQuiet(const bool)

This setting can be used to force OEParseSmiles to not write anything to OEThrow in the case of a failure. This can be useful for programs that want to determine if a string is a valid SMILES string without spewing unnecessary logging information to the terminal.