Rosetta
Public Member Functions | Public Attributes | List of all members
pyrosetta.distributed.viewer.modules.setStyle Class Reference

Public Member Functions

def __init__ (self, residue_selector=None, cartoon=True, cartoon_color="spectrum", style="stick", colorscheme="blackCarbon", radius="0.1", label=True, label_fontsize=12, label_background=False, label_fontcolor="black", command=None)
 
def apply (self, viewer, pose, pdbstring)
 

Public Attributes

 residue_selector
 
 cartoon
 
 cartoon_color
 
 style
 
 colorscheme
 
 radius
 
 label
 
 label_fontsize
 
 label_background
 
 label_fontcolor
 
 command
 

Detailed Description

Show and color cartoon, and/or show heavy atoms with provided style, color and radius for each initialized
`.pdb` file, `Pose` or `PackedPose` object. If the `residue_selector` argument is provided, apply styles
only to the selected residues. If the `command` argument is provided, override all other arguments and pass
`py3Dmol.view.setStyle()` commands to the Viewer.

Parameters
----------
first : optional
    `residue_selector`
    
    An instance of `pyrosetta.rosetta.core.select.residue_selector.ResidueSelector` on which to apply the style(s).
    Default: None

second : optional
    `cartoon`
    
    `True` or `False` to show cartoon representation.
    Default: True

third : optional
    `cartoon_color`
    
    Hexcode literal (e.g. 0xAF10AB) or `str` indicating a standard color (e.g. "grey") for the cartoon representation.
    If "spectrum", apply reversed color gradient based on residue numbers. The option `cartoon` must also be set to `True`.
    Default: "spectrum"
    Reference: https://3dmol.csb.pitt.edu/doc/types.html#ColorSpec

fourth : optional
    `style`

    `str` indicating a representation style of heavy atoms, choosing from either "line", "cross", "stick", or "sphere".
    Default: "stick"

fifth : optional
    `colorscheme`
    
    `str` indicating the color scheme for heavy atoms represented by the `style` option. Options include:
        A lower-case standard color followed by "Carbon" (e.g. "orangeCarbon")
        "ssPyMOL": PyMol secondary colorscheme
        "ssJmol": Jmol secondary colorscheme
        "Jmol": Jmol primary colorscheme
        "default": default colorscheme
        "amino": amino acid colorscheme
        "shapely": shapely protien colorscheme
        "nucleic": nucleic acid colorscheme
        "chain": standard chain colorscheme
        "chainHetatm": chain Hetatm colorscheme
    Default: "blackCarbon"
    Reference: https://3dmol.csb.pitt.edu/doc/types.html#ColorschemeSpec
    
sixth : optional
    `radius`

    `float` or `int` indicating the radius of the heavy atoms represented by the `style` option.
    Default: 0.1

seventh : optional
    `label`

    `True` or `False` to show labels next to residues selected by the `residue_selector` option. 
    Default: True

eighth : optional
    `label_fontsize`

    `int` or `float` indicating the font size of labels next to residues selected by the `residue_selector` option,
    only if `label` is `True`.
    Default: 12

ninth : optional
    `label_background`

    `True` or `False` to show the background of labels next to residues selected by the `residue_selector` option,
    only if `label` is `True`.
    Default: False

tenth : optional
    `label_fontcolor`

    `str` indicating a standard font color (e.g. "grey") for label text next to residues selected by the `residue_selector` option,
    only if `label` is `True`.
    Default: "black"

eleventh : optional
    `command`
    
    `dict` or `tuple` of `dict`s of `py3Dmol.view.setStyle()` commands. If specified, this option overrides all other options.
    Default: None
    Example:
        command = {"hetflag": True}, {"stick": {"singleBond": False, "colorscheme": "greyCarbon", "radius": 0.15}}
        view = viewer.init(poses) + viewer.setStyle(command=command)
        view.show()

Returns
-------
A Viewer instance.

Constructor & Destructor Documentation

◆ __init__()

def pyrosetta.distributed.viewer.modules.setStyle.__init__ (   self,
  residue_selector = None,
  cartoon = True,
  cartoon_color = "spectrum",
  style = "stick",
  colorscheme = "blackCarbon",
  radius = "0.1",
  label = True,
  label_fontsize = 12,
  label_background = False,
  label_fontcolor = "black",
  command = None 
)

Member Function Documentation

◆ apply()

def pyrosetta.distributed.viewer.modules.setStyle.apply (   self,
  viewer,
  pose,
  pdbstring 
)

References pyrosetta.distributed.viewer.modules._pdbstring_to_pose(), pyrosetta.distributed.viewer.modules._pose_to_residue_chain_tuples(), pyrosetta.distributed.viewer.modules.setStyle.cartoon, pyrosetta.distributed.viewer.modules.setStyle.cartoon_color, pyrosetta.distributed.viewer.modules.setStyle.colorscheme, pyrosetta.distributed.viewer.modules.setSurface.colorscheme, job_manager.CommandRunner.command, job_manager.CommandLauncher.command, job_manager.DeleteJob.command, job_manager.WipeCache.command, job_manager.ScoreVsRmsd.command, job_manager.ScoreVsTime.command, job_manager.TorsionVsTime.command, job_manager.CorrelationTime.command, schema.Job.command, pyrosetta.distributed.viewer.modules.setStyle.command, numeric::MultiDimensionalHistogram.label(), pyrosetta.distributed.viewer.modules.setStyle.label, svm_model.label, pyrosetta.distributed.viewer.modules.setStyle.label_background, pyrosetta.distributed.viewer.modules.setStyle.label_fontcolor, pyrosetta.distributed.viewer.modules.setStyle.label_fontsize, LMAX.radius, basic::sampling::orientations::QuatDBMetadata.radius, numeric::geometry::hashing::xyzStripeHash::const_iterator.radius(), numeric::geometry::hashing::Ball.radius(), numeric::sphericalVector< T >.radius(), pyrosetta.distributed.viewer.modules.setDisulfides.radius, pyrosetta.distributed.viewer.modules.setHydrogenBonds.radius, pyrosetta.distributed.viewer.modules.setHydrogens.radius, pyrosetta.distributed.viewer.modules.setStyle.radius, test.Workshop9_my_shapes.MyCircle.radius, pyrosetta.distributed.viewer.modules.setStyle.residue_selector, pyrosetta.distributed.viewer.modules.setSurface.residue_selector, pyrosetta.distributed.viewer.modules.setZoomTo.residue_selector, and pyrosetta.distributed.viewer.modules.setStyle.style.

Referenced by pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessorBase.__setitem__(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase._maybe_delete_keys_from_sm_data(), and pyrosetta.distributed.tasks.rosetta_scripts.BaseRosettaScriptsTask.execute().

Member Data Documentation

◆ cartoon

pyrosetta.distributed.viewer.modules.setStyle.cartoon

◆ cartoon_color

pyrosetta.distributed.viewer.modules.setStyle.cartoon_color

◆ colorscheme

pyrosetta.distributed.viewer.modules.setStyle.colorscheme

◆ command

pyrosetta.distributed.viewer.modules.setStyle.command

◆ label

pyrosetta.distributed.viewer.modules.setStyle.label

◆ label_background

pyrosetta.distributed.viewer.modules.setStyle.label_background

◆ label_fontcolor

pyrosetta.distributed.viewer.modules.setStyle.label_fontcolor

◆ label_fontsize

pyrosetta.distributed.viewer.modules.setStyle.label_fontsize

◆ radius

pyrosetta.distributed.viewer.modules.setStyle.radius

◆ residue_selector

pyrosetta.distributed.viewer.modules.setStyle.residue_selector

◆ style

pyrosetta.distributed.viewer.modules.setStyle.style

The documentation for this class was generated from the following file: