Package schrodinger :: Package analysis :: Module reaction :: Class Synthesizer
[hide private]
[frames] | no frames]

Class Synthesizer

object --+
         |
        Synthesizer

A Synthesizer is a "machine" that given a RouteNode, knows how to apply all the reactions in the RouteNode in the right order to a list of starting materials to give the final product.

Instance Methods [hide private]
 
__init__(self, route, id_property='s_m_title')
Create a synthesizer from a route.
 
_compile(self, route)
Turn the route tree into a list of instructions for the stack-based machine implemented in the run() method.
Mol, or None if the synthesis failed
run(self, starting_materials)
Return the final product of the RouteNode given a list of starting materials.
 
_popReactants(self, reaction, stack)
 
_applyReaction(self, reaction, reactants)
generator of Mol
synthesizeCombinations(self, reagent_sources)
A generator of all combinations of products that can be synthesized by the route using the given sets of starting materials.
 
_gotMultipleProducts(self, products)
 
_setProductProperties(self, product, starting_materials)
 
_clearProductProperties(self, mol)
 
_getReagentId(self, mol)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, route, id_property='s_m_title')
(Constructor)

 

Create a synthesizer from a route. The value of id_property is propagated from the starting materials to the product, to make it possible to keep track of where a product came from.

Parameters:
  • route (RouteNode)
  • id_property (str)
Overrides: object.__init__

run(self, starting_materials)

 

Return the final product of the RouteNode given a list of starting materials.

Parameters:
  • starting_materials (iterable of Mol)
Returns: Mol, or None if the synthesis failed

synthesizeCombinations(self, reagent_sources)

 

A generator of all combinations of products that can be synthesized by the route using the given sets of starting materials.

Parameters:
  • reagent_sources (iterable of iterables of Mol.) - List of reagent sources.
Returns: generator of Mol
Generator of synthesis products.