schrodinger.application.matsci.cgmappinggui module¶
GUI elements for coarse-grained automated mapping panels.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.cgmappinggui.CommonOptionsFrame(parent, layout, driver, command=None, add_ff_cb=True, add_antifreeze_cb=True, unique_default=False)¶
Bases:
SFrameFrame that holds checkboxes for automated mapping options that are common to DPD and Martini.
- __init__(parent, layout, driver, command=None, add_ff_cb=True, add_antifreeze_cb=True, unique_default=False)¶
Create the common options frame.
- Parameters:
parent (
swidgets.SFrame) – The parent framelayout (
QtWidgets.QBoxLayout) – The layout to place the frame indriver (coarse_grain_mapping_gui_dir.coarse_grain_mapping_driver or coarse_grain_ff_builder_gui_dir.coarse_grain_ff_builder_driver) – Driver module for the GUI being used
add_ff_cb (bool) – Whether to add the ‘Use particle names from FF’ checkbox
add_antifreeze_cb (bool) – Whether to add the ‘Add antifreeze water molecules’ checkbox
unique_default (bool) – The default state of the unique bonds checkbox
command (callable) – The command to call on checkbox change
- isUnique()¶
Returns whether checkbox checked, needed for whether to pass -unique to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- isAntifreeze()¶
Returns whether checkbox checked, needed for whether to pass -antifreeze to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- isStabilizeRing()¶
Returns whether stabilize rings is selected, needed for whether to pass -stabilize to driver. False for common options.
- Return type:
bool
- Returns:
False
- getCmdFlags(cmd)¶
Add command line flags for common options. For use in CG Mapping GUI.
- Parameters:
cmd (list(str)) – The list of command line flags
- Return type:
list(str)
- Returns:
The list of updated command line flags
- updateDriverInput(driver_input)¶
Update the DriverInputJson with widget parameters. For use in CGFF Builder GUI.
- Parameters:
driver_input (coarse_grain_ff_builder_gui.DriverInputJson) – The driver input
- setState(is_auto)¶
Set the state of the frame’s checkboxes according to whether automated mapping is selected.
- Parameters:
is_auto (bool) – Whether automated mapping is selected.
- reset()¶
Reset the frame.
- class schrodinger.application.matsci.cgmappinggui.DpdOptionsFrame(parent, layout, driver, command=None, add_ff_cb=True, add_antifreeze_cb=True, unique_default=False)¶
Bases:
CommonOptionsFrameFrame that holds common checkboxes plus automated DPD-specific checkboxes.
- isImplicitIons()¶
Returns whether checkbox checked, needed for whether to pass -impl_ions to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- isResidueOverlap()¶
Returns whether checkbox checked, needed for whether to pass -res_overlap to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- isStabilizeRing()¶
Returns whether stabilize rings is checked, needed for whether to pass -stabilize to driver. False for DPD.
- Return type:
bool
- Returns:
False
- getCmdFlags(cmd)¶
Add command line flags for Martini options
- Parameters:
cmd (list(str)) – The list of command line flags
- Return type:
list(str)
- Returns:
The list of updated command line flags
- updateDriverInput(driver_input)¶
Update the DriverInputJson with widget parameters. For use in CGFF Builder GUI.
- Parameters:
driver_input (coarse_grain_ff_builder_gui.DriverInputJson) – The driver input
- reset()¶
Reset the frame.
- class schrodinger.application.matsci.cgmappinggui.MartiniOptionsFrame(parent, layout, driver, command=None, add_ff_cb=True, unique_default=False, additional_opts=False)¶
Bases:
CommonOptionsFrameFrame that holds checkboxes for Martini-specific automated mapping options.
- __init__(parent, layout, driver, command=None, add_ff_cb=True, unique_default=False, additional_opts=False)¶
Create the Martini options frame
- Parameters:
parent (
AutoMappingFrame) – The auto mapping framelayout (
QtWidgets.QBoxLayout) – The layout to place the frame indriver (coarse_grain_mapping_gui_dir.coarse_grain_mapping_driver or coarse_grain_ff_builder_gui_dir.coarse_grain_ff_builder_driver) – Driver module for the GUI being used
add_ff_cb (bool) – Whether to add the ‘Use particle names from FF’ checkbox
unique_default (bool) – The default state of the unique bonds checkbox
additional_opts (bool) – Whether to add additional Martini-specific options (e.g. protein restraints)
- isImplicitIons()¶
Returns whether implicit treatment of ions is selected, needed for whether to pass -impl_ions to driver. False for Martini.
- Return type:
bool
- Returns:
False
- isResidueOverlap()¶
Returns whether residue overlap is selected, needed for whether to pass -res_overlap to driver. False for Martini.
- Return type:
bool
- Returns:
False
- isStabilizeRing()¶
Returns whether checkbox checked, needed for whether to pass -stabilize to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- isProteinRestraints()¶
Returns whether checkbox checked, needed for whether to pass -prot_restraints to driver
- Return type:
bool
- Returns:
Whether the checkbox is checked
- getCmdFlags(cmd)¶
Add command line flags for Martini options
- Parameters:
cmd (str) – The list of command line flags
- Return type:
str
- Returns:
The list of updated command line flags
- updateDriverInput(driver_input)¶
Update the DriverInputJson with widget parameters. For use in CGFF Builder GUI.
- Parameters:
driver_input (coarse_grain_ff_builder_gui.DriverInputJson) – The driver input
- reset()¶
Reset the frame.
- class schrodinger.application.matsci.cgmappinggui.CGTypeRadioButtonGroup(parent=None, layout=None, command=None)¶
Bases:
SLabeledRadioButtonGroupRadio button group for coarse-graining type.
- __init__(parent=None, layout=None, command=None)¶
Initialize the radio button group. See parent class for details.
- class schrodinger.application.matsci.cgmappinggui.MappingScaleSpinBox(layout=None, command=None)¶
Bases:
SLabeledSpinBoxSpinbox for the target mapping scale. See parent class for details.
- TOOLTIP = 'The target number of heavy atoms per coarse-grained particle to use when mapping atomistic structure to coarse-grained.'¶
- __init__(layout=None, command=None)¶
Initialize the mapping scale spinbox.
- class schrodinger.application.matsci.cgmappinggui.CGForceFieldMixin¶
Bases:
objectMixin to allow force field import widgets and related functionality to be shared with the CG Mapping GUI.
- addFFWidgetsToLayout(layout, spacing=None)¶
Add CG force field import widgets to the given layout.
- Parameters:
layout (
swidgets.SVBoxLayoutorswidgets.SHBoxLayout) – The layout to add widgets to
- loadFFCombo()¶
Find all available force fields and load them into the combobox
- loadFF()¶
Load the selected force field
- importFF()¶
Import a force field from local location and add it to force field selection combos
- useFFChanged()¶
React to change in force field usage selection
- class schrodinger.application.matsci.cgmappinggui.MappingViewerMixin¶
Bases:
object- getGroups()¶
Get atom indices associated with each coarse-grained particle
- Return type:
dict
- Returns:
Dictionary with key as the tuple of particle name and the particle number and value as the list of atom indices associated
- colorChanged()¶
React to color changing in the color widget
- updateCGColors()¶
Update the color of the particles in the coarse-grained structure based on the color widget values
- viewTypeChanged(*args)¶
React to view type change in the radio button group. Note it is similar to updateStructure but with different arguments
- updateStructure(update_color=False)¶
Update the structure based on the color widget values
- Parameters:
update_color (bool) – Whether to update the color of the coarse-grained particles
- showCGStructure()¶
Show the coarse-grained structure in the workspace
- drawSphere(s_color, atom_index)¶
Draw a sphere for the coarse-grained particle using the all atom particle
- Parameters:
s_color (Color) – The color for the sphere
atom_index (int) – The index of the atom in the all atom structure
- Return type:
- Returns:
The sphere graphic object representing the coarse-grained particle
- drawEllipsoids(e_color, atom_indices)¶
Draw ellipsoids for the coarse-grained particles using the constituent all atom particles
- Parameters:
e_color (Color) – The color for the ellipsoid
atom_indices (list) – The list of atom indices associated with the coarse-grained particle
- addParticlesAsGraphics()¶
Add spheres/ellipsoid graphics to the workspace representing the coarse-grained particles over the atomistic structure
- showMappedStructure()¶
Show the all atom structure with ellipsoids representing the coarse- grained particles
- removeGraphics()¶
Remove the graphics from the workspace
- class schrodinger.application.matsci.cgmappinggui.WorkspaceSignal(maestro, *args, **kwargs)¶
Bases:
QObjectRelays the workspace changed signal into a signal that can easily be suppressed. For resetting mapping viewer tab/dialog when the workspace is changed outside of the dialog/tab functionality (otherwise the functionality can break).
- signal¶
A
pyqtSignalemitted by instances of the class.
- __init__(maestro, *args, **kwargs)¶
Initialize the WorkspaceSignal
- Parameters:
maestro (schrodinger.maestro.maestro) – The maestro module
- emitSignal(what_changed)¶
Relay the workspace changed signal into the reset tab signal, if what_changed is WORKSPACE_CHANGED_EVERYTHING
- Parameters:
what_changed (str) – The type of workspace change
- connect(func)¶
Connect the signal to the given function
- Parameters:
func (callable) – The function to connect to the signal