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 :

graph : a 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)

nlevels : int

how many levels at which to bin the transition states

Emax : float

maximum energy for transition state cutoff. Default is the maximum energy of all transition states.

minima : list 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_size : int

if subgraph_size is not None then all disconnected graphs of size greater than subraph_size will be included.

order_by_energy : bool

order the subtrees by placing ones with lower energy closer to the center

order_by_basin_size : bool

order the subtrees by placing larger basins closer to the center

center_gmin : bool

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_gmin : bool

make sure to include the global minimum, even if it is not part of the main connected region

node_offset : float

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_attribute : string, optional

attribute which contains energy. default is energy. This attribute can be used to generate free energy disconnectivity graphs

order_by_value : callable, 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

make_disconnectivity_graph.py
a script (in pele/scripts) to make the disconnectivity graph from the command line
pele.storage.Database
The database format in which minima and transition states are stored in pele

Examples

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

calculate() do the calculations necessary to draw the diconnectivity graph
color_by_group(groups[, colors]) color the graph based on specified grouping of minima
color_by_value(minimum_to_value[, colormap, ...]) color the graph by values associated with minima (e.g. order parameter)
draw_minima(minima[, axes]) draw a specified list of minima as points
get_minima_layout() return the x position of the minima
get_tree_layout() Returns the x position of the trees
label_minima(minima_labels[, axes, rotation]) label the specified minima
plot([show_minima, show_trees, linewidth, ...]) draw the disconnectivity graph using matplotlib
savefig(*args, **kwargs) simple wrapper for matplotlib.pyplot.savefig()
set_energy_levels(elevels) manually set the energy levels
show() simple wrapper for matplotlib.pyplot.show()

Previous topic

pele.utils.disconnectivity_graph.DisconnectivityGraph.show

Next topic

pele.utils.disconnectivity_graph.DisconnectivityGraph.calculate