OELingoSim

class OELingoSim

This class represents OELingoSim.

The OELingoSim class provides a fast 2D molecular similarity method. The construction of an OELingoSim object based on a single molecule or canonical string describing the molecule. Similarity between this original molecule and any subsequent molecule can then be rapidly calculated using another molecule or its canonical string.

Constructors

OELingoSim(const char *str=0, unsigned type=OELingoType::Default)
OELingoSim(const std::string &str, unsigned type=OELingoType::Default)

Constructs a OELingoSim object with a canonical string. The string API of OELingoSim class allows use of any string in both construction and similarity testing (OELingoSim.Similarity). While canonical SMILES or canonical isomeric SMILES are the most common string to be used, there is absolutely no requirement to use these strings in generating lingos comparisons. Care must be taken, however, to make sure consistent string types are passed to the constructors and similarity functions! The set of valid types are defined in the OELingoType namespace.

OELingoSim(const OEMolBase &mol, unsigned type=OELingoType::Default)

Constructs a OELingoSim object with a query molecule (OEMolBase). Constructing an OELingoSim object with a molecule provides less flexibility because the strings are generated inside the object and thus limited to a specific string type. The set of valid types are defined in the OELingoType namespace.

OELingoSim(const OELingoSim &rhs)

Copy constructor.

operator=

OELingoSim &operator=(const OELingoSim &rhs)

Assignment operator that copies the data of the ‘rhs’ OELingoSim object into the right-hand side OELingoSim object.

GetType

unsigned GetType() const

Init

bool Init(const OEMolBase &mol)

(Re)initialize the OELingoSim object with a molecule.

bool Init(const char *str)
bool Init(const std::string &str)

(Re)initialize the OELingoSim object with a string.

Note

The implementation type (OELingoType), set in the constructor, is unchanged by the OELingoSim.Init methods.

IsValid

bool IsValid() const

Tests for successful initialization of the OELingoSim object. If initialization was attempted with an invalid molecule, a string shorter than four characters, or was default constructed it will not be valid. Similarity of any object to an invalid OELingoSim will always be 0.0.

SetImpl

void SetImpl(const OELingoSimImpl &impl)

Similarity

float Similarity(const char *str) const
float Similarity(const OEMolBase &mol) const
float Similarity(const std::string &cansmi) const

Calculates the lingos similarity between the molecule or string used to create the OELingoSim object and the molecule or string passed into the OELingoSim.Similarity function.

The OEMolBase version is provided for convenience, and is suitable for most uses, but is somewhat less efficient than comparing strings directly.

Note

In the string API of the OELingoSim.Similarity method, any string can be used (canonical SMILES, canonical isomeric SMILES, IUPAC name), but care must be taken to make sure consistent string types are passed to