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(str: str = None, type: int) -> OELingoSim

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(mol: Union[OEGraphMol,OEMol,OEQMol], type: int) -> OELingoSim

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(rhs: OELingoSim) -> OELingoSim

Copy constructor.

GetType

GetType() -> int

Init

Init(mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

(Re)initialize the OELingoSim object with a molecule.

Init(str: str) -> bool

(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

IsValid() -> bool

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.

Similarity

Similarity(str: str) -> float
Similarity(mol: Union[OEGraphMol,OEMol,OEQMol]) -> float

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