shaker.umh.es menu
CSS Drop Down Menu by PureCSSMenu.com


Research → Research tools → PyMOL Scripts

_dimer_H-H_model_Open-Close.pml script
#BEGIN PYMOL SCRIPT
#   http://people.mbi.ucla.edu/sawaya/tutorials/Graphics/pymol.html
#   antialias =1 smooths jagged edges, 0 turns it off
set antialias = 1

#   stick_radius -adjust thickness of atomic bonds
set stick_radius = 0.3

#   mesh_radius -to adjust thickness of electron
#   density contours
set mesh_radius = 0.02

#   bg_color --set the background color
bg_color white

#   ray_opaque_background --set the background opaque off
set ray_opaque_background, off

# turn off ray traced shadows
set ray_shadows, off

#  load pdb file (Close-to-Close) and give it an object name
load model.O-C.002.12.pdb, model 1
load model.O-C.002.14.pdb, model 2
load model.O-C.006.09.pdb, model 3
load model.O-C.002.02.pdb, model 4
load model.O-C.002.27.pdb, model 5
load model.O-C.000.09.pdb, model 6
load model.O-C.002.08.pdb, model 7
load model.O-C.006.01.pdb, model 8
load model.O-C.002.19.pdb, model 9
load model.O-C.002.26.pdb, model 10
load model.O-C.002.07.pdb, model 11
load model.O-C.006.07.pdb, model 12
load model.O-C.006.04.pdb, model 13
load model.O-C.006.10.pdb, model 14

#   hide nonbonded atoms (i.e. waters)
hide nonbonded

#   show cartoon ribbons
show cartoon

#   select resi 114 and chain A or resi 114-120 and chain B
select nterm, resi 114 and chain A

#   Hide the default line representation of atomic bonds
hide lines

#   Use standard helix, strand, and loop representations
#   other possibilities: cartoon loop, cartoon rect,
#   cartoon oval, and cartoon tube
cartoon automatic

#   If you dont have secondary structure assignments
#   in the PDB header then uncomment the following
#   line to detect secondary structure.
#   Warning, very coarse approximation.
#   Or get header from http://www.mbfys.lu.se/Services/SecStr/
#util.ss ocp

#   Make fancy helices with ridge on the edges like
#   molscript does
#   1 is on.  0 is off.
set cartoon_fancy_helices=1

#   Make the strands flat=1 or pass through CA positions=0
#   Set to 0 when showing side chains from a strand
set cartoon_flat_sheets = 1.0

#   Draw the loops smooth=1 or pass through CA positions=0
#   Set to 0 when showing side chains from a loop
set cartoon_smooth_loops = 0

#   Set the color of the residues
#   to find the names of the colors available
#   click on the rainbow colored square in the
#   upper right corner of the graphics window
color blue, (resid 1:188)
color blue, (resid 229:288)
color cyan, (resid 9:36)
color cyan, (resid 142:156)
color red, (resid 189:228)
color red, (resid 289:358)
color yellow, (resid 359:530)
color orange, (resid 442:454)
color green, (resid 531:566)
color magenta, (resid 114:114)
color yellow, (resid 502:502)
color magenta, (resid 318:319)
color magenta, (resid 220:220)
color red, (resid 437:437)
color red, (resid 440:440)

#   Show spheres for important residues
show spheres, resid 114:114
show spheres, resid 502:502
show spheres, resid 437:437
show spheres, resid 440:440

#   Show sticks for bonds
show sticks, (resid 220 or resid 318 or resid 319)

### cut below here and paste into script ###

Displaying a Molecular Surface
# Displaying a Molecular Surface
show surface, ocp

Displaying a Transparent Molecular Surface
# Displaying a Transparent Molecular Surface
show surface, ocp
set transparency=0.5

Making Labels
# Making Labels
# You can select the residue and atom where the label will be placed.
# But, these labels are pretty crude.
# I recommend that you use Illustrator for labeling figures for publication.
# Make label for carotenoid:
label ( resi 350 and name; c16), "carotenoid 1 "
label ( resi 351 and name; c16), "carotenoid 2"
label ( resi 401 and name; c1), "sucrose "
set label_color  =1

Color by Secondary Structure or Atom Type
# Color by Secondary Structure or  Atom Type
# You can select the residue and atom where the label will be placed.
color red, ss h
color marine, ss s
color yellow, ss l+''

# to color ligands by atom color use  util.cbag
# Other functions are cbag, cbac, cbas, cbap, cbak, cbaw and cbab
# (grey (carbon), cyan, salmon, purple, pink, white (hydrogen) and slate)
util.cbag ocp and (resid 350:351 or resid 401)

Color by restype
# Color by restype
# Copyright (c) 2004 Robert L. Campbell
import colorsys,sys
from pymol import cmd

aa_1_3 = {
  'A': 'ALA', 
  'C': 'CYS', 
  'D': 'ASP', 
  'E': 'GLU', 
  'F': 'PHE', 
  'G': 'GLY', 
  'H': 'HIS', 
  'I': 'ILE', 
  'K': 'LYS', 
  'L': 'LEU', 
  'M': 'MET', 
  'N': 'ASN', 
  'P': 'PRO', 
  'Q': 'GLN', 
  'R': 'ARG', 
  'S': 'SER', 
  'T': 'THR', 
  'V': 'VAL', 
  'W': 'TRP', 
  'Y': 'TYR', 
}

aa_3_1 = {
  'ALA' : 'A', 
  'CYS' : 'C', 
  'ASP' : 'D', 
  'GLU' : 'E', 
  'PHE' : 'F', 
  'GLY' : 'G', 
  'HIS' : 'H', 
  'ILE' : 'I', 
  'LYS' : 'K', 
  'LEU' : 'L', 
  'MET' : 'M', 
  'ASN' : 'N', 
  'PRO' : 'P', 
  'GLN' : 'Q', 
  'ARG' : 'R', 
  'SER' : 'S', 
  'THR' : 'T', 
  'VAL' : 'V', 
  'TRP' : 'W', 
  'TYR' : 'Y', 
}

aa_types = {
  'A': 'hydrophobic',
  'C': 'cysteine',
  'D': 'negative',
  'E': 'negative',
  'F': 'aromatic',
  'G': 'hydrophobic',
  'H': 'polar',
  'I': 'hydrophobic',
  'K': 'positive',
  'L': 'hydrophobic',
  'M': 'hydrophobic',
  'N': 'polar',
  'P': 'proline',
  'Q': 'polar',
  'R': 'positive',
  'S': 'polar',
  'T': 'polar',
  'V': 'hydrophobic',
  'W': 'aromatic',
  'Y': 'aromatic',
}


def color_by_restype(selection="all",
        hydrophobic='grey90',
        aromatic='lightpink',
        polar='palecyan',
        positive='blue',
        negative='red',
        cysteine='paleyellow',
        proline='palegreen',
        ):

  """
  usage: color_by_restype , 

  e.g. color_by_restype protein and chain A, hydrophobic=wheat

  Residue groups:               Default colours:
    hydrophobic: AGILMV           grey90
    aromatic: FWY                 lightpink
    polar: HNQST                  palecyan
    positive: KR                  blue
    negative: DE                  red
    cysteine: C                   paleyellow
    proline: P                    palegreen
  """
  colors = {
    'hydrophobic': hydrophobic,
    'aromatic': aromatic,
    'polar': polar,
    'positive': positive,
    'negative': negative,
    'cysteine': cysteine,
    'proline': proline,
  }

  for aa in aa_types:
    sel = selection + " and r. %s" % aa_1_3[aa]
#    print sel,"-->", colors[aa_types[aa]]
    cmd.color(colors[aa_types[aa]],sel)

cmd.extend("color_by_restype",color_by_restype)