schrodinger.application.canvas.clustergui module¶
Canvas clustering functionality that uses GUI libraries
There are classes to perform custering and to support graphical interfaces to the clustering options.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.canvas.clustergui.
CanvasFingerprintClusterGUI
(logger)¶ Bases:
schrodinger.application.canvas.cluster.CanvasFingerprintCluster
A subclass of the canvas fingerprint clusterer which is to be used from a program with a TKInter interface. This class has methods for creating a component which displays the clustering linkage options
-
CREATE_RADIOBUTTON_NAMES
= ['Duplicate entries to a new group for each cluster', 'Move entries to a new group for each cluster', 'A group containing the structures nearest the centroid in each cluster', 'Cluster index and size properties for each entry']¶
-
DUPLICATE
= 0¶
-
MOVE
= 1¶
-
REPRESENTATIVE
= 2¶
-
ENTRY
= 3¶
-
getTab
(command=None, linkage=True, cluster=True, results=True, apply=True, msg=None)¶ Creates a tab that can be used in a QTabWidget for calculating clustering. The tab has the following sections: Linkage, Cluster, Clustering Results, Apply Clustering
Parameters: - command (callable object) – function to be called when the Calculate Clustering button is pressed.
- linkage (bool) – True if this section should be included (default)
- cluster (bool) – True if this section should be included (default)
- results (bool) – True if this section should be included (default)
- apply (bool) – True if this section should be included (default)
- msg (str) – The message that appears right above the Calculate Clustering button.
Return type: QWidget
Returns: widget containing the clustering gui
Usage: QTabWidget.addTab(fp_sim.getTab(doClustering))
-
getClusterGUI
(command, msg=None)¶ Returns a GUI Group Box which displays the Cluster Calculation button
Parameters: - msg (str) – The message that appears right above the Calculate Clustering button.
- command (callable object) – function to be called when the Calculate Clustering button is pressed.
Return type: swidgets.SGroupBox (QGroupBox)
Returns: groupbox containing the cluster widgets
-
getLinkageGUI
()¶ Returns a GUI component which displays the cluster linkage options
Return type: swidgets.SGroupBox (QGroupBox) Returns: groupbox containing the linkage widgets
-
getResultsGUI
()¶ Returns a GUI which displays the clustering results in terms of the strain and best number of clusters and provides access to plots for the dendrogram and cluster statistics. This will be deactivated until the update() method is called at which time it will be activated and refreshed with the results from the most recent clustering
-
setNumClusters
(num)¶ Set the number of clusters in the Apply Clustering Section
-
getApplyGUI
()¶ Return the controls used to apply the clustering to selected entries in the project table
-
doApplyClustering
()¶ Once the clustering has been performed for the selected entries this method will apply it
-
updateResults
()¶ Once clustering has been performed this method should be called to update the clustering results GUI:
-
close
()¶ Perform the tasks necessary when closing the panel. This will include closing all the open plot windows
-
showStatisticsPlot
()¶ Display a plot of clustering statistics
-
showDendrogramPlot
()¶ Display the clustering dendgoram
-
showDistanceMatrixPlot
()¶ Display the distance matrix
-
setDistanceMatrixCallback
(cb)¶ Set a callback to be called when the mouse is clicked in the distance matrix plot. This should expect to receive two entry IDs
-
getClusteringStatistics
(id)¶
-
-
class
schrodinger.application.canvas.clustergui.
ClusterStatisticsPlotDialog
(canvas_cluster)¶ Bases:
schrodinger.ui.qt.appframework.AppFramework
A class which displays a dialog with a plot of the statistics for the most recent clustering
-
num_clusters_selected
¶
-
PLOT_TYPES
= ['Kelley Penalty', 'R-Squared', 'Semipartial R-Squared', 'Merge Distance', 'Separation Ratio']¶
-
redraw
()¶ Redraw the plot with the current settings
-
setPlotType
(plot_type)¶ Called when the plot type option menu is changed
-
show
()¶ Show the plot dialog
-
close
()¶ Dismiss the window
-
click
(event)¶ Click in plot handler
-
-
class
schrodinger.application.canvas.clustergui.
DendrogramPlotDialog
(canvas_cluster=None)¶ Bases:
schrodinger.ui.qt.appframework.AppFramework
A class which displays a dialog with a plot of the dendrogram from the most recent clustering
-
num_clusters_selected
¶
-
show
()¶ Show the plot dialog
-
close
()¶ Dismiss the window
-
redraw
()¶ Redraw the plot
-
click
(event)¶ Click in plot handler
-
-
class
schrodinger.application.canvas.clustergui.
DistanceMatrixPlotDialog
(canvas_cluster, num_clusters_edit=None, distance_matrix_callback=None, structures=True, num_clusters=None)¶ Bases:
schrodinger.ui.qt.appframework.AppFramework
A class which displays a dialog with a plot of the distance matrix associated with the most recent clustering
-
PLOT_TYPES
= ['Cluster Order', 'Original Order']¶
-
setPlotType
(plot_type)¶ Called when the plot type combobox is changed
Parameters: plot_type (string) – the new plot type
-
setColormap
(color_map)¶ Called when the color map combobox is changed
Parameters: color_map (string) – the new color map
-
redraw
()¶ Force a redraw with refetching of the distance map data
-
draw
()¶ Called when the plot type option menu is changed
-
show
()¶ Show the plot dialog
-
close
()¶ Dismiss the window
-
click
(event)¶ Click in plot handler
-
drawStructure
(canv, eid, title_label)¶ Draw the structure from the project with entry id ‘eid’ in the Canvas ‘canv’
-