1.1.1.3.1.1.1.5.5. FilterMorphsOper

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

Bases: molpher.swig_wrappers.core.TreeOperation

Parameters:
  • *args – constructor takes either no arguments at all or the following positional arguments (in that order):
  • tree – the tree to operate on (optional)
  • filters – the union of filtering options to use (optional, see the descriptions below for more information)
  • verbose – toggles if a verbose output is required (optional, defaults to False)

This operation can filter the candidate morphs in an exploration tree according to a given set of filtering options that it implements. The current set of available filters is in the table below. For more detailed information on each filter see the member descriptions of this class.

Table 1.12 Filtering options and their descriptions.
Option Description
PROBABILITY Filter the candidate morphs according to probability based on their position in ExplorationTree.candidates.
WEIGHT Remove molecules that do not satisfy the weight constraints.
SYNTHESIS The inbuilt synthetic feasibility filter.
MAX_DERIVATIONS Maximum number of morphs derived from one molecule.
DUPLICATES Remove candidates that are already in the tree (always on).
HISTORIC_DESCENDENTS Remove candidates that have already been tried by their parents.
ALL Use all of the above filters.
PROBABILITY = 1

If the number of derived morphs for a molecule exceeds ExplorationData.accept_min, then the probability of accepting every extra molecule is determined according to the following formula: \(\frac{0.25 - (idx - morphs_{min})}{4(morphs_{all} - morphs_{min})}\), where \(morphs_{min}\) is the ExplorationData.accept_min parameter, \(morphs_{all}\) is the current number of molecules in the exploration tree and \(idx\) is the position of the given morph in ExplorationTree.candidates.

WEIGHT = 2

Uses the ExplorationData.weight_min and ExplorationData.weight_max options to remove candidate morphs that do not satisfy the weight constraints.

SYNTHESIS = 4
MAX_DERIVATIONS = 8

Each ExplorationTree instance keeps track of the number of morphs generated from each molecule in the tree. If there are candidate morphs in ExplorationTree.candidates such that more than ExplorationData.max_morphs_total number of morphs would be derived from the given molecule, then these candidate morphs will be filtered out.

DUPLICATES = 16

Remove all duplicate morphs (same canonical SMILES representation as a molecule already present in the tree).

Note

This filter is always turned on and can’t be disabled at the moment.

HISTORIC_DESCENDENTS = 32

The tree also keeps track of all molecules previously derived from any molecule in the tree. This filter removes candidate morphs that have already been previously derived from their parent molecule.

ALL = 63

Use all of the filters mentioned above.