schrodinger.application.canvas.similaritygui module

Support for Canvas fingerprint similarity operations that use GUI components.

There are classes to perform similarity calculations and to support graphical interfaces for similarity options.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.canvas.similaritygui.CanvasFingerprintSimilarityGUI(logger)

Bases: CanvasFingerprintSimilarity

A subclass of the canvas fingerprint similarity manager which is to be used from a program with a TKInter interface. This class has methods for creating a component which displays all the similarity metrics options and takes care of managing the internal state

getGUI()

Returns a GUI component which displays the similarity options

setMetricCB(metric)

A callback for setting the similarity metric - takes care of enabling the alpha and beta boxes. Also makes sure that the program is ready to calculate similarity via the chosen metric.

Parameters:

metric (str) – the name of the similarity metric to use

update()

Update the internal state to reflect the GUI (used mainly for alpha and beta values

getCalculationGUI(command, msg=None)

Create the GUI section that has the calculate button

Parameters:
  • command (callable object) – function to be called when the Calculate Similarity button is pressed.

  • msg (str) – The message that appears right above the button

Return type:

swidgets.SGroupBox (QGroupBox object)

Returns:

a groupbox with the calculation widgets

getTab(command=None, settings=True, calculation=True, msg=None)

Creates a tab that can be used in a QTabWidget for calculating similarity. The tab has a CanvasFingerprintSimilarityGUI section and a Similarity Calculation section (set up here).

Parameters:
  • command (callable object) – function to be called when the Calculate Similarity button is pressed.

  • settings (bool) – True if the settings section is included, False if not

  • calculation (bool) – True if the calculation section is included, False if not

  • msg (str) – The message that appears right above the button in the Calculation section

Return type:

QWidget

Returns:

widget containing the clustering gui

Usage: QTabWidget.addTab(fp_sim.getTab(doSimilarity))

sortEntryCheck()

Check if entries should be sorted or not (based on the toggle state of the Sort selected entries checkbox on the Similarity Tab.

Return type:

bool

Returns:

True if the Sort checkbox is checked, False if it is not or it doesn’t exist