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

Class RouteNode

object --+    
         |    
      Node --+
             |
            RouteNode
Known Subclasses:

A node in a synthetic route. Similar to RetroSynthesisNode, except that it can have one reaction instance at most. Also, RouteNode provides additional methods that only make sense for a synthetic route.

Instance Methods [hide private]
 
__str__(self)
str(x)
 
isStartingMaterial(self)
Return True if the node represents a starting material (i.e., has no reaction instance).
list of Node-derived objects
getStartingNodes(self)
Search recursively and return the Node objects for all the starting materials in the route.
 
setReactionInstance(self, reaction, precursors)
Set the reaction instance to the current node.
 
steps(self)
Return the total number of steps in the route.
int
depth(self, _depth=0)
Return the maximum depth of the route.
 
write(self, filename, specific=False)
Write a route file.
 
getTreeData(self, specific=False)
Return a simple data structure, suitable for dumping to JSON, representing the route.
 
_getNodeData(self, specific)
 
getReactionSet(self)
Return the set of reactions used by the route.
bool
checkReactions(self, reqs)
Check that the route meets all requirements.

Inherited from Node: __init__, treeAsString

Inherited from Node (private): _asStringList

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

Properties [hide private]
  precursors
The list of precursors of this node (may be empty).
  reaction_instance
The reaction instance associated with this node.
  reaction
The reaction associated with this node.

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

setReactionInstance(self, reaction, precursors)

 

Set the reaction instance to the current node. This represents a one-step synthesis of the node from a list of precursor nodes.

Parameters:
  • reaction (Reaction)
  • precursors (list of Node-derived objects)

steps(self)

 

Return the total number of steps in the route. For example, the
following synthesis has 3 steps but depth 2.

    Target => A + B
    A => AA
    B => BB

@rtype: int

depth(self, _depth=0)

 

Return the maximum depth of the route. See example under steps().

Returns: int

write(self, filename, specific=False)

 

Write a route file. Normally, reagents are identified by reagent class, but if 'specific' is True, the actual SMILES of the precursor is used instead.

getTreeData(self, specific=False)

 

Return a simple data structure, suitable for dumping to JSON, representing the route. See write() for more details.

checkReactions(self, reqs)

 

Check that the route meets all requirements. Every element of 'reqs' must match a tag or reaction name for at least one of the reactions used by the route. Tag matching is exact; name matching uses shell-like globbing (*, ?, []).

Parameters:
  • reqs (set of str)
Returns: bool
True if route meets requirements.

Property Details [hide private]

precursors

The list of precursors of this node (may be empty).

Get Method:
unreachable.precursors(self) - The list of precursors of this node (may be empty).

reaction_instance

The reaction instance associated with this node. If the node has no reaction instance, raises KeyError.

Get Method:
unreachable.reaction_instance(self) - The reaction instance associated with this node.

reaction

The reaction associated with this node. If the node has no reaction instance, raises KeyError.

Get Method:
unreachable.reaction(self) - The reaction associated with this node.