schrodinger.application.matsci.clusterstructgui module¶
GUI elements to aid in pulling dimers or clusters of nearest neighbors from a larger structure.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.clusterstructgui.SpeciesCombo(label=None, **kwargs)¶
Bases:
schrodinger.ui.qt.swidgets.SLabeledComboBox
Combobox for showing species
- __init__(label=None, **kwargs)¶
Create a SpeciesCombo instance
- Parameters
label (str) – The label for the combobox
- setCurrentSpecies(species)¶
Fill the combo with the list of current species
- Parameters
species (dict) – Keys are unique SMILES strings, values are SpeciesData objects for the species with that SMILES string.
- currentSpecies()¶
Return the currently selected species
- Return type
- Returns
The currently selected species
- getSampleMolNumber()¶
Get a sample molecule number for the current species
- Return type
int
- Returns
a sample molecule number for the current species
- class schrodinger.application.matsci.clusterstructgui.MonomerSpeciesSelector(label='Limit active molecules to those of type:', command=None, find_species_fn=None, **kwargs)¶
Bases:
schrodinger.ui.qt.swidgets.SCheckBoxWithSubWidget
Checkbox and combo that allows the user to select a species. The enabled state of the combobox is controlled by the checkbox.
- species_changed¶
A
pyqtSignal
emitted by instances of the class.
- __init__(label='Limit active molecules to those of type:', command=None, find_species_fn=None, **kwargs)¶
Create a Monomer SpeciesSelector instance
- Parameters
label (str) – The text between the checkbox and combobox
command (callable) – The slot to connect to the species_changed signal
find_species_fn (function) – Function that is used to create species
All other keyword args are passed to the SCheckBoxWithSubWidget class
- createSubWidgets()¶
Create the subwidgets the checkbox controls
For this class, it is only the species type combobox
- currentSpecies()¶
Return the currently selected species
- Return type
- Returns
The currently selected species
- speciesChanged()¶
React to a new species being selected
- hasSpecies()¶
Check if any species have been loaded
- Return type
bool
- Returns
True of any species has been loaded, False if not
- clear()¶
Clear out the species combo
- loadSpecies(structs)¶
Find all the species in the given structures and load them into the species type combobox
- Parameters
structs (list(structure.Structure)) – The structures to find the species in
- Return type
- Returns
Each item of the list is the data for a species found
- setCurrentSpecies(species)¶
Fill the species combo with the list of current species
- Parameters
species (dict) – Keys are unique SMILES strings, values are SpeciesData objects for the species with that SMILES string.
- reset()¶
Reset the widget, including clearing the species type combo
- getNumberOfType()¶
Get the number of members of the current species
- Return type
int
- Returns
The number of members of the current species
- class schrodinger.application.matsci.clusterstructgui.DimerSpeciesSelector(label='Limit dimers to only those that contain:', command=None, **kwargs)¶
Bases:
schrodinger.application.matsci.clusterstructgui.MonomerSpeciesSelector
Checkbox and combo that allows the user to select a species for the purpose of selecting dimers with or without the given species. The enabled state of the combobox is controlled by the checkbox.
- criterion_changed¶
A
pyqtSignal
emitted by instances of the class.
- __init__(label='Limit dimers to only those that contain:', command=None, **kwargs)¶
Create a DimerSpeciesSelector instance
- Parameters
label (str) – The text between the checkbox and combobox
command (callable) – The slot to connect to the species_changed and criterion_changed signals
See parent class for additional documentation
- createSubWidgets()¶
Create the subwidgets the checkbox controls
For this class, it is an amount criterion combobox and the species type combobox
- currentCriterion()¶
Return the current amount criterion
- Return type
str
- Returns
The desired amount of the species. Will be one of the items from the CRITERIA list
- criterionChanged()¶
React to a change in the amount criterion
- reset()¶
Reset the widgets
- applyToDimers(dimers)¶
Apply the current settings to a list of dimers, marking them as meeting the criteria or not. If the controlling checkbox is unchecked, all dimers will be marked as meeting the criteria.
- Parameters
dimers (list) – A list of Dimer objects. Each dimer will have its meets_species_criterion property set based on the results of the Dimer.evaluateSpeciesCriterion method.
- schrodinger.application.matsci.clusterstructgui.count_species_in_cms(model, *, sanitize=True, include_stereo=True)¶
Enumerates and counts the species in a Desmond system.
- Parameters
model (cms.Cms) – The model you want to count the species for
sanitize (bool) – Whether RDKit sanitization should be performed when identifying unique species. This option is not applicable for coarsegrained structures.
include_stereo (bool) – Whether the stereochemistry of the structure should be considered when identifying unique species. Setting to
False
can speed this up substantially.
- Return type
dict
- Returns
Dictionary whose keys are the display formulae of the species and whose values are the number of molecules of that species present in the system.
- schrodinger.application.matsci.clusterstructgui.get_species_display_names_from_cms(model, *, sanitize=True, include_stereo=True)¶
Gets formatted chemical formulae for each species from a Desmond system. They are formatted for printing in a GUI.
- Parameters
model (cms.Cms) – The model you want to get the formulae for
sanitize (bool) – Whether RDKit sanitization should be performed when identifying unique species to get chemical formulae for. This option is not applicable for coarsegrained structures.
include_stereo (bool) – Whether the stereochemistry of the structure should be considered when identifying unique species to analyze. Setting to
False
can speed this up substantially.
- Return type
dict(str=clusterstruct.SpeciesData)
- Returns
Keys are the names of each species found in the system, and values are their corresponding
SpeciesData
objects.