Quickdisplays

From PyMOLWiki
Revision as of 07:18, 10 June 2014 by Andwar (talk | contribs) (created script page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Type Python Module
Download quickdisplays.py
Author(s) Andreas Warnecke
License BSD-2-Clause
This code has been put under version control in the project Pymol-script-repo

The module quickdisplays is a package containing several functions for quick standard displays:

List of functions
Function What it does Usage
disp_list prints a list of functions disp_list
disp_ss secondary structure disp_ss [ selection [, colors [, only ]]]
disp_ball_stick balls and sticks disp_ball_stick [ selection [, hydrogens [, only ]]]
disp_mesh surface mesh disp_mesh [ selection [, color_m [, hydrogens [, only [, limits ]]]]]
disp_surf surface disp_surf [ selection [, color_s [, transparency [, hydrogens [, solvent [, ramp_above [, only [, limits ]]]]]]]]
disp_putty putty b-factor sausage disp_putty [ selection [, limits [, only ]]]
  • Note that each function has an individual help destription, callable by entering, e.g.:
help disp_surf


Examples
Quickdisplays disp surf.png
disp_surf
surface
Quickdisplays disp ss.png
disp_ss
secondary structure
Quickdisplays disp putty.png
disp_putty
putty b-factor sausage

The combined displays example was produced like this:

import quickdisplays
fetch 1hpv, async=0

disp_putty all, limits=10
disp_surf color_s=lightblue, transparency=0.8
disp_ss chain B
disp_ball_stick hetatm
util.cbao hetatm
set mesh_mode, 1 # make sure hetams are meshed
set mesh_cutoff, 4.5
disp_mesh resn 478, color_m=green
Quickdisplays disp mesh.png
disp_mesh
mesh
Quickdisplays disp ball stick.png
disp_ball_stick
balls and sticks
Quickdisplays combo.png
combined displays
see example

Some notes on the arguments

  • selection can be used to restrict the display to certain objects or selections, the default is 'all'
  • only can be True or False and will toggle whether the display will be added (show) or replace others (show_as)
  • disp_mesh and disp_surf support the color putty, which will color the object/selection by b-factor
  • limits defines the b-factor color range:
    • a list entry will define absolute values [min;max]
    • a float value will calculate the corresponding percentiles ±value%, default=5
  • setting hydrogens will add hydrogen to the model; if set to =False, hydrogens are removed, if omitted the state of hydogens will be 'as is'
  • colors in disp_ss is flexible:
    • set e.g. three colors, e.g. 'red green blue' for sheets, helices and loops, respectively (cf. example)
    • alternatively certain 'util.' functions can be used (cf. example)
    • setting False once or for individual colors will suppress coloring


Applied example

Enter the following lines one-by-one and observe how the display will be affected

# import function to PyMOL
import quickdisplays

# prep
fetch 1hpv, async=0
bg black
orient
disp_list # list of functions

help disp_ss # check out help
disp_ss
disp_ss only=T
disp_ss colors=smudge orange grey
disp_ss colors=chartreuse False False # False suppresses coloring
disp_ss colors=util.chainbow # You can use util.cbc, util.rainbow, ...

help disp_ball_stick # check out help
disp_ball_stick hetatm
disp_ball_stick all, only=T
util.cbaw
disp_ball_stick hydrogens=1
disp_ball_stick hydrogens=-1
disp_stick_ball # will this work?

help disp_mesh # check out help
disp_mesh
disp_mesh color_m=green, only=False
disp_mesh color_m=green, only=T
disp_ball_stick hetatm
set mesh_skip, 2 # omits lines in mesh
disp_mesh color_m=default, hydrogens=1, only=T
disp_mesh color_m=putty, hydrogens=0, limits=20
disp_mesh color_m=putty, limits=30
disp_mesh color_m=putty, limits=[15,50]

help disp_putty # check out help
disp_putty chain A, only=False, limits=[15,50] #only default is True
disp_putty all, limits=0
disp_putty all, limits=10

help disp_surf # check out help
disp_surf color_s=white, solvent=1
disp_surf color_s=white# solvent=0
disp_surf color_s=lightblue, transparency=0.8


SEE ALSO

Git intro, Displaying Biochemical Properties