Package schrodinger :: Package ui :: Module residueselector :: Class MutationSelectorFrame
[hide private]
[frames] | no frames]

Class MutationSelectorFrame

PyQt4.QtGui.QFrame --+
                     |
                    MutationSelectorFrame

This frame contains widgets for selecting one or more residue type (e.g. ALA, VAL, and GLY). The editor has a checkbox for each residue, along with convenience checkboxes that allow the user to toggle multiple residues that match a description (e.g., polar).

This frame is intended to be embedded in a layout. For using as a pop-up, see MutationSelectorPopUp.

Instance Methods [hide private]
 
getResidueGroups(self)
 
__init__(self, parent=None)
 
setupCheckboxes(self)
Populate the std residues, custom residues, and groups layouts with checkboxes based on the current residue groups.
 
_addResiduesToLayout(self, res_names, layout)
Add checkboxes with the given names to the specified QGridLayout, hook up their toggled signals to self.updateSelections(), and add them to the self._checkboxes dict.
 
getResidueCheckbox(self, residue_name)
Return the checkbox for the residue or residue group.
 
updateSelections(self)
Collect checked residues and then add any residues selected via the group checkboxes.
 
setSelectedMutations(self, residues)
 
selectResidueCheckbox(self, residue_name, check=True)
Selects (or deselects, if False) a single residue checkbox
 
selectAll(self)
Selects every enabled residue checkbox in the pop up
 
applyGroupSelections(self)
Examines the relevant group checkboxes to determine which residues should be selected and selects them.
 
deselectAll(self)
Deselects all the residue checkboxes if the None convenience checkbox has been selected
 
disableResidue(self, res_name, tooltip=None)
Disable the given residue checkbox in the pop-up dialog.
 
clear(self)
De-select all residues.
 
disableResidues(self, disable_residues)
Class Variables [hide private]
  dataChanged = QtCore.pyqtSignal(set)
Method Details [hide private]

setupCheckboxes(self)

 

Populate the std residues, custom residues, and groups layouts with checkboxes based on the current residue groups. Can be called to re-populate the pop-up widget if the return value of getResidueGroups() of the subclass has changed.

getResidueCheckbox(self, residue_name)

 

Return the checkbox for the residue or residue group.

Parameters:
  • residue_name (str) - The name of the residue

updateSelections(self)

 

Collect checked residues and then add any residues selected via the group checkboxes. Emits a set of selected residues.

setSelectedMutations(self, residues)

 
Parameters:
  • residues (set of str

    Checks the checkboxes corresponding to the given set of residue strings, and unchecks the other checkboxes. Connect to the dataChanged signal to get updates on the selected mutations.

    ) - The residues selected by the user

selectResidueCheckbox(self, residue_name, check=True)

 

Selects (or deselects, if False) a single residue checkbox

Parameters:
  • residue_name (str) - The name of the residue corresponding to the checkbox
  • check (bool) - Whether to check or uncheck the checkbox

applyGroupSelections(self)

 

Examines the relevant group checkboxes to determine which residues should be selected and selects them.

Our groups obey the following rules:

* no residues in a group selected -> group deselected * some but not all residues in a group selected -> group partially selected * all residues in a group selected -> group selected * a user selects a group -> group selected * a user deselects a group -> group deselected

In other words, for users, the groups function as dual state, but in terms of display, the groups are tristate.

Note that this function can only be called as a signal, because it needs to call self.sender()

deselectAll(self)

 

Deselects all the residue checkboxes if the None convenience checkbox has been selected

Parameters:
  • checked (bool) - Whether the None checkbox is checked

disableResidues(self, disable_residues)

 
Parameters:
  • disable_residues (List of (str, str) tuples.) - List of residues to disable. Each item is a tuple of (res_name, tooltip).