Core for all ReactionNetwork classes
Of particular note are the alternative constructors for ReactionNetwork, ReactionNetwork.from_file(), ReactionNetwork.from_filename() and ReactionNetwork.from_string().
Classes
ReactionNetwork(rates) | A dictionary of reactions where each key is a reaction composed of (tuple(sorted(reactants)), sorted(tuple(products))) and each value is the rate. |
SimpleDot([name, digraph, strict]) | Repsents a graphviz .dot file (also known as .gv). |
Bases: object
A dictionary of reactions where each key is a reaction composed of (tuple(sorted(reactants)), sorted(tuple(products))) and each value is the rate.
ReactionNetwork objects are immutable and hashable.
ReactionNetwork objects support __eq__ and __ne__, but none of the other rich comparison operators (__lt__, __le__, __gt__, __ge__).
Different subclassess should be implemented to generate reaction networks on demand (artificial chemistries, etc) and provide additional functionallity, such as visualization or metrics.
Can be cast to string to get a .chem representation.
Alternative constructor that accepts a file object (or equivalent).
Source must be formatted as a .chem file, see .chem Format.
Wrapper around from_file() that opens the provided filename as a file to read.
Wrapper around from_file() that uses StringIO.
Sorted tuple of all reactions in the network
Sorted tuple of all molecular species in the network
Return a .dot format string constructed using a AChemKit.utils.simpledot.SimpleDot view of this reaction network.
Molecular species are shown as either full names, identifier numbers, or as blank circles. This is determined by the names parameter, which is a string indicating which to use:
A sub-set of the reaction network can be drawn using the shown and hidden parameters.
Reactions involving only molecular species on the hidden list are not shown. Molecular species on the hidden list are not shown unless they are involved in a reaction with molecular species not on the hidden list, in which case the molecular species on the hidden list is unlabeled and shown as a point.
The shown list in the inverse of the hidden list. If it is used, any molecular species not on the shown list is treated as being on the hidden list. If a molecular species is on both shown and hidden lists, the hidden lists wins.
Catalysts (defined as molecules that are required for but unchanged by a reaction) are indicated with a grey line.
Reversible reactions (defined as a pair of reactions where reactants of one are the products of the other and visa versa) are combined and indicated with double arrows resembling a diamond shape.