pele.utils.disconnectivity_graph.DisconnectivityGraph#
- class pele.utils.disconnectivity_graph.DisconnectivityGraph(graph, minima=None, nlevels=20, Emax=None, subgraph_size=None, order_by_energy=False, order_by_basin_size=True, node_offset=1.0, center_gmin=True, include_gmin=True, energy_attribute='energy', order_by_value=None)[source]#
make a disconnectivity graph
- Parameters:
- grapha networkx graph
a graph with Minimum objects as nodes and transition states defining the edges. You can use the function database2graph() defined in this module to create this from a database.
>>> from pele.utils.disconnectivity_graph import database2graph >>> graph = database2graph(database) >>> dg = DisconnectivityGraph(graph)
- nlevelsint
how many levels at which to bin the transition states
- Emaxfloat
maximum energy for transition state cutoff. Default is the maximum energy of all transition states.
- minimalist of Minima
a list of minima to ensure are displayed in the graph. e.g. they will be displayed even if they’re in a connected cluster smaller than smaller than subgraph_size
- subgraph_sizeint
if subgraph_size is not None then all disconnected graphs of size greater than subraph_size will be included.
- order_by_energybool
order the subtrees by placing ones with lower energy closer to the center
- order_by_basin_sizebool
order the subtrees by placing larger basins closer to the center
- center_gminbool
when a node splits into its daughter nodes, the one containing the global minimum is always placed centrally (even if other nodes carry more minima). This does not guarantee that the global minimum is central in the overall diagram because other nodes may push the one containing the global minimum over to one side
- include_gminbool
make sure to include the global minimum, even if it is not part of the main connected region
- node_offsetfloat
offset between 0 and 1 for how to draw the angled lines. 0 for no angle, draw horizontally out then vertically down. 1 for angled lines all the way to the next energy level
- energy_attributestring, optional
attribute which contains energy. default is energy. This attribute can be used to generate free energy disconnectivity graphs
- order_by_valuecallable, optional, v = order_by_value(m)
If this function is passed the minima at each level will be sorted by this value with small values to the left. A group of minima will be sorted according to the smallest value in the group.
See also
pele.storage.DatabaseThe database format in which minima and transition states are stored in pele
Examples
The
scripts/make_disconnectivity_graph.pyscript makes a disconnectivity graph from the command line.These examples assume a Database with minima already exists
>>> import matplotlib.pyplot as plt >>> graph = database2graph(database) >>> dg = DisconnectivityGraph(graph) >>> dg.calculate() >>> dg.plot() >>> plt.show()
Methods
do the calculations necessary to draw the diconnectivity graph |
|
|
color the graph based on specified grouping of minima |
|
color the graph by values associated with minima (e.g. order parameter). |
|
draw a specified list of minima as points |
return the x position of the minima |
|
Returns the x position of the trees |
|
|
label the specified minima |
|
draw the disconnectivity graph using matplotlib |
|
simple wrapper for matplotlib.pyplot.savefig() |
|
manually set the energy levels |
|
simple wrapper for matplotlib.pyplot.show() |
Attributes