scm.reactmap.Map

class scm.reactmap.Map(reaction, settings=None, mapping=None)

The class that solves the mapping problem on a Reaction instance.

This is the main class that handles feasibility checking, pre-processing, running heuristics, and setting up and running mixed-integer linear programming (MILP) problems to solve the reaction mapping problem. This class interfaces with Reaction instances and writes relevant mapping data to those instances. Optionally, a Settings object can be provided to specify problem settings.

Keyword Arguments
  • reaction (reactmap.Reaction) – the reaction class that contains the reactant(s) and product(s). This can be a single Reaction object or a list of Reaction objects.

  • settings (reactmap.Settings) – the Settings class that contains user-specified problem options. If no Settings class is supplied, default values for all settings will be used.

Example

Let’s calculate the mapping cost between CCCCO and CCOCC:

>>> import scm.reactmap as rm
>>> reac = rm.Molecule(smiles='CCCCO')
>>> prod = rm.Molecule(smiles='CCOCC')
>>> reaction = rm.Reaction(reactant = reac, product = prod)
>>> rm.Map(reaction)
>>> print(reaction.cost)
4

We can also use a Settings object to turn off heuristics:

>>> settings = rm.Settings(use_heuristics = False)
>>> rm.Map(reaction, settings = settings)
>>> print(reaction.cost)
4

Methods