1.1.1.3.1.1.1.1. MolpherMol

class molpher.swig_wrappers.core.MolpherMol(*args)[source]
Parameters

other (MolpherMol or str) – another instance of MolpherMol or a SMILES string

Note

If another MolpherMol instance is specified, the tree ownership is not preserved in the new instance. It just acts as a place holder for the data and these are not updated if the original instance changes.

Represents a molecule (usually attached to an exploration tree). It allows the user of the library to read data about the molecule as well as modify it.

copy()[source]

Creates a new MolpherMol instance, which is not bound to any tree. It has the same effect as calling the constructor with another instance as its argument.

Attention

Any modifications to the returned molecule will have no effect on the original instance.

Returns

new instance

Return type

MolpherMol

getSMILES()[source]

Returns canonical SMILES of the molecule.

Returns

canonical SMILES representation of the molecule

Return type

str

getDistToTarget()[source]

Returns the distance of this molecule to the target molecule.

By default computed as \(1 - similarity\), where \(similarity\) is the similarity computed using the specified molecular fingerprint and similarity measure (see molpher.core.selectors for more information on the available selectors).

Note

Distance to the target can be easily modified, if needed (see setDistToTarget).

Returns

distance to target molecule

Return type

float

getParentSMILES()[source]

Canonical SMILES of the direct parent molecule in the respective exploration tree.

Returns

canonical SMILES of parent

Return type

str

getDescendants()[source]

Returns all direct descendants of this molecule in the respective exploration tree as canonical SMILES. Therefore, all molecules returned by this method should be present in the tree at the time of the call.

Returns

an iterable of descendants

Return type

tuple of str objects

getHistoricDescendants()[source]

Returns the historic descendants (all morphs created from this molecule) of this molecule in the respective exploration tree as canonical SMILES. Some of the molecules might have been removed from the tree before the call so some of them might be missing from the tree already.

Returns

an iterable of historic descendants

Return type

tuple of str objects

getItersWithoutDistImprovement()[source]

Returns the number of morph generations derived from this molecule that did not contain any morphs with an improvement in structural distance from the target molecule.

Returns

number of generations without distance improvement

Return type

int

getSAScore()[source]

The synthesis feasibility score.

Returns

synthesis feasibility score

Return type

float

getMolecularWeight()[source]

Returns the molecular weight of this compound.

Returns

molecular weight

Return type

float

setSAScore(score)[source]

Set the synthesis feasibility score as computed using SAScore.dat.

Parameters

score (float) – new synthesis feasibility score

setDistToTarget(dist)[source]

Set the distance to the target molecule.

Parameters

dist (float) – new distance to target

getTree()[source]

Return the exploration tree associated with this molecule.

Parameters

dist (ExplorationTree or None) – new distance to target

setItersWithoutDistImprovement(count)[source]

Sets the number of morph generations derived from this molecule that did not contain any morphs with an improvement in structural distance from the target molecule.

lockAtoms(*args)[source]

Locks atoms using SMARTS or a list of atom indices.