https://pymolwiki.org/api.php?action=feedcontributions&user=James&feedformat=atomPyMOLWiki - User contributions [en]2024-03-19T11:58:21ZUser contributionsMediaWiki 1.35.7https://pymolwiki.org/index.php?title=PLoS&diff=10886PLoS2012-11-14T00:47:19Z<p>James: updated link in comments of example code</p>
<hr />
<div><!-- <span style="font-family:Myriad; font-weight:bold; font-size:x-large;">''Biomolecular Graphics: In Principle and in Practice''</span> --><br />
<span style="font-family:Myriad; font-weight:bold; font-size:x-large;">''An Introduction to Biomolecular Graphics''</span><br />
<br />
= '''Overview, general notes''' =<br />
<!-- :: NB. Hey guys, instead of using <nowiki><PRE>code here</PRE></nowiki> use <nowiki><source lang="python">python code</source></nowiki> or <nowiki><source lang="language-name-here">some code</source></nowiki> for syntax highlighting on the wiki. --><br />
<br />
* This is the online supplemental wiki for "[http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1000918 An Introduction to Biomolecular Graphics]" ''PLoS Comput Biol'' (2010) ''6(8)'': e1000918. doi:10.1371/journal.pcbi.1000918.<br />
<br />
* '''Update''' (01nov2011) &mdash; An erratum is [[Media:MuraEtAl_PLoS_BiomolGraphics_SuppFigS3_01nov2011_erratum.pdf|now available]] for Supplementary Figure S3 (and the associated legend, pg S13) of the ''PLoS Comp Bio'' paper. Special thanks to Steve Bottomley (Curtin Univ) for pointing-out that the relative orientation between panels B and C of Fig S3 is not clearly described; the revised figure and caption attempt to clarify this point.<br />
<br />
{{div15}}<br />
<br />
='''Figures'''=<br />
This section illustrates the figure-creation process, from initial conception &rarr; final multi-panel figure ready for publication. Organized as various "case studies" that are representative of the tasks typically faced by structural or computational biologists, this section provides several step-by-step examples. These examples are entirely self-contained, and the materials include everything from ''(i)'' raw, starting data (''e.g.'', PDB files) to ''(ii)'' actual, working PyMOL or Python scripts and ''(iii)'' final output image files.<br />
<br />
{{div10}}<br />
==<div style="background-color:#efeddf; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 1:''' Overall fold / domain level (&ge; novice/intermediate)</div>==<br />
[[File:Csos3-stereo01.png|300px|thumb|left|Stereo view of a protein fold]]<br />
Illustration of the overall fold of carbonic anhydrase, CsoS3, from Halothiobacillus neapolitanus.(PDB ID 2G13). The three domains that compose this enzyme are distinguished by coloring each domain separately (blue, yellow, red). The orientation was chosen to feature the location of the active site (outlined by side chains and zinc ion), and to show the two-fold symmetry relationship between the active domain (yellow) and homologous but defunct domain (red). SSEs are labeled directly on the individual SSEs. Domain labels are colored to correspond to the domains they are labeling. Labels in the active site are given an “outer glow” to make them legible in a region of the figure that is dense in detail. Depth is conveyed by use of fog, veiling less important structural features in the back of the enzyme. <br />
<br />
Ingredients for this figure:<br />
<br />
1) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3_18o_nobreak.pdb coordinates ]. <br />
<br />
2) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3-left.pml Pymol script for left half of stereo image]. The script can be modified to produce the right half of the stereo image by changing the line "turn y, 3.5" to "turn y, -3.5"<br />
<br />
3) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3-stereo01.psd labeled figure in photoshop format].<br />
<br />
Tips:<br />
1) If you are modifying this script to illustrate a different set of coordinates, it is best to have the secondary structure assignments in the header. Otherwise, the secondary structure assignment made by pymol may be inaccurate.<br />
<br />
<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Overall Fold -left half of stereo image<br />
<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
<br />
# Larger values of ambient make the image brighter<br />
set ambient=0.3<br />
<br />
# Larger values of direct eliminates shadows<br />
set direct=1.0<br />
set ribbon_radius =0.2<br />
<br />
# cartoon_highlight_color will give a separate color to edges of secondary structural elements.<br />
set cartoon_highlight_color =grey50<br />
<br />
# ray_trace_mode=1 makes a black outline around the secondary structural elements<br />
set ray_trace_mode=1<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.2<br />
<br />
# mesh_radius -to adjust thickness of electron density contours<br />
set mesh_radius = 0.02<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load csos3_18o_nobreak.pdb, csos3<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
# show cartoon ribbons<br />
show cartoon<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
set cartoon_tube_radius, 0.2<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then get secondary structure assignments <br />
# from dssp http://swift.cmbi.kun.nl/gv/dssp/<br />
# Then convert assignments into a PDB header<br />
# http://dssp2pdb.bravais.net/<br />
# If you want to define secondary structure manually, <br />
# Use the following syntax 'S'=strand 'H'=helix<br />
# alter B/753:758/, ss='S'<br />
<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
set cartoon_cylindrical_helices=0<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
# Here I make some customized colors as mixtures of red,green,blue<br />
set_color maarine= [0.3, 0.8, 1.0]<br />
set_color graay=[0.8,0.8,0.8]<br />
set_color greeen=[0.0,0.5,0.0]<br />
<br />
color gray50, elem C<br />
color greeen, elem ZN<br />
color blue, resid 38:147 and name ca<br />
color yellow, resid 148:397 and name ca<br />
color red, resid 398:514 and name ca<br />
<br />
# Show spheres for chloride ions<br />
show spheres, elem ZN<br />
<br />
# Show sticks for bonds<br />
show sticks, (resid 173 or resid 175 or resid 177 or resid 242 or resid 253) and not (name n or name c or name o)<br />
<br />
set_view (\<br />
0.091340274, -0.606698275, 0.789650559,\<br />
-0.991202235, -0.131515890, 0.013612081,\<br />
0.095602803, -0.783963323, -0.613382638,\<br />
0.001799395, 0.001679182, -246.492980957,\<br />
12.976243019, 41.245639801, 62.928291321,\<br />
187.538497925, 249.492980957, 0.000000000 )<br />
<br />
turn y, 3.5<br />
viewport 1200,1500<br />
#ray<br />
#png csos3-left.png<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 2:''' Ligand-binding sites (&ge; novice/intermediate)</div>==<br />
[[File:Dutpase active02-labeled.png|200px|thumb|left|Active Site Figure]]Illustration of the active site of dUTPase from Mycobacterium tuberculosis (PDB ID 1SIX). The orientation of the active site was chosen to feature the geometry of the chemical reaction catalyzed by this enzyme, specifically the in-line nucleophilic attack of water 212 on the alpha-phosphate of dUTP. Fine tuning of the orientation was made to eliminate overlap of side chains and to make all hydrogen bonds (dashed lines) visible. Only side chains directly involved in catalysis are depicted. Carbons are colored according to five conserved motifs of the dUTPase family. Non-conserved residues are given an undistracting gray color and are veiled in fog. Labels were colored to correspond to the side chains they are labeling.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Active Site<br />
<br />
set mesh_radius = 0.01 <br />
set antialias = 1 <br />
set stick_radius = 0.22<br />
set dash_radius=0.07<br />
set sphere_scale= 0.22<br />
set ribbon_radius =0.1 <br />
set direct =0.0<br />
set cartoon_fancy_helices=1<br />
bg_color white<br />
set gamma=1.5<br />
util.ray_shadows('none')<br />
set ray_trace_mode=1<br />
<br />
# load pdb and map file <br />
load dumpnpp_10t.pdb, mtb <br />
<br />
cartoon automatic<br />
show cartoon<br />
hide nonbonded<br />
hide lines <br />
<br />
color white, (chain A or chain B or chain C) and (n;ca)<br />
color yellow, (resid 171) or (n;PA) or (n;PB) or (n;PG)<br />
color white, (elem C)<br />
#magnesium<br />
show sphere, (resid 171)<br />
color green, (resid 171)<br />
#waters<br />
show sphere, (resid 173:175 or resid 212)<br />
show sticks, (chain C and resid 170)<br />
<br />
<br />
color marine, (resid 22:32 and elem C) and chain C<br />
color green, (resid 57:76 and elem C) and chain C<br />
color yellow, (resid 77:93 and elem C) and chain A<br />
color orange, (resid 102:115 and elem C) and chain C<br />
color red, (resid 134:145 and elem C ) and chain B<br />
<br />
<br />
show sticks, (chain A and resid 83 and not n;n,c,o )<br />
show sticks, (chain A and resid 86 and not n;n,c,o )<br />
show sticks, (chain A and resid 77 and not n;n,c,o )<br />
show sticks, (chain C and resid 24 and not n;n,c,o)<br />
show sticks, (chain C and resid 28 and not n;n,c,o)<br />
show sticks, (chain B and resid 140 and not n;n,c,o)<br />
show sticks, (chain C and resid 64 and not n;n,c,o)<br />
show sticks, (chain C and resid 113 and not n;n,c,o)<br />
show sticks, (chain C and resid 64:66 )<br />
hide sticks, (chain C and resid 64 and n;n,c,o)<br />
show sticks, (chain A and resid 91 and n;n,c,o,ca)<br />
<br />
<br />
distance (resid 171 and chain C), (resid 173 and chain C)<br />
color green, dist01<br />
distance (resid 171 and chain C), (resid 174 and chain C)<br />
color green , dist02<br />
distance (resid 171 and chain C), (resid 175 and chain C)<br />
color green , dist03<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1A)<br />
color green , dist04<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1B)<br />
color green , dist05<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1G)<br />
color green , dist06<br />
distance (resid 173 and chain C), (resid 28 and chain C and n;OD2)<br />
color marine, dist07<br />
distance (resid 174 and chain C), (resid 28 and chain C and n;OD1)<br />
color marine, dist08<br />
distance (resid 175 and chain C), (resid 24 and chain C and n;OD2)<br />
color marine, dist09<br />
distance (resid 212 and chain A), (resid 170 and chain C and n;PA)<br />
color red, dist10<br />
distance (resid 212 and chain A), (resid 113 and chain C and n;OE1)<br />
color orange, dist11<br />
distance (resid 212 and chain A), (resid 83 and chain A and n;OD2)<br />
color yellow, dist12<br />
distance (resid 113 and chain C and n;ne2), (resid 170 and chain C and n;O3A)<br />
color orange, dist13<br />
distance (resid 65 and chain C and n;N), (resid 170 and chain C and n;O3A)<br />
color green, dist14<br />
distance (resid 65 and chain C and n;OG), (resid 170 and chain C and n;N2A)<br />
color green, dist15<br />
distance (resid 66 and chain C and n;N), (resid 170 and chain C and n;O3B)<br />
color green, dist16<br />
distance (resid 64 and chain C and n;NH2), (resid 170 and chain C and n;O1B)<br />
color green, dist17<br />
distance (resid 64 and chain C and n;NE), (resid 170 and chain C and n;O1B)<br />
color green, dist18<br />
distance (resid 83 and chain A and n;OD2), (resid 170 and chain C and n;O3')<br />
color yellow, dist19<br />
distance (resid 140 and chain B and n;NH1), (resid 170 and chain C and n;O2G)<br />
color red, dist20<br />
distance (resid 140 and chain B and n;NH2), (resid 170 and chain C and n;O1G)<br />
color red, dist21<br />
distance (resid 140 and chain B and n;NE), (resid 24 and chain C and n;OD1)<br />
color red, dist22<br />
distance (resid 140 and chain B and n;NH2), (resid 24 and chain C and n;OD2)<br />
color red, dist23<br />
distance (resid 170 and chain C and n;O4), (resid 77 and chain A and n;ND2)<br />
color yellow, dist24<br />
distance (resid 170 and chain C and n;N3), (resid 91 and chain A and n;O)<br />
color yellow, dist24<br />
distance (resid 170 and chain C and n;O2), (resid 91 and chain A and n;N)<br />
color yellow, dist24<br />
<br />
hide labels<br />
<br />
set cartoon_flat_sheets = 1.0<br />
set cartoon_smooth_loops = 0<br />
<br />
set_view (\<br />
0.045321193, 0.677332938, -0.734195530,\<br />
0.631984174, -0.588606596, -0.504004478,\<br />
-0.773574233, -0.441189915, -0.454773396,\<br />
0.000917640, 0.000133177, -65.177696228,\<br />
14.812702179, 8.131608009, 17.861175537,\<br />
54.978454590, 79.653022766, 0.000000000 )<br />
<br />
<br />
# ray 1500,1500<br />
viewport 700,800<br />
</source><br />
<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 3:''' Structure alignment (&ge; novice/intermediate)</div>==<br />
<br />
[[File:Overlay03.png|200px|thumb|left|Overlay of aligned alpha-carbon traces]]<br />
An overlay of five simvastatin synthetase crystal structures illustrating degrees of hinge closing imparted by ligand binding (PDB IDs 3HLB, 3HLC, 3HLE, 3HLF, and 3HLG). Hinge motion in this two-domain enzyme is highlighted by superimposing only atoms in one of the domains (depicted in gray in this figure). The range of motion is highlighted by the rainbow colors assigned to the upper domain. The orientation of the molecule is chosen to make the range of motion evident (hinge axis is normal to the plane of the page). Each of the structures is labeled explicitly in the figure, rather than burying the information in the figure legend. Color coding the labels makes it easier to comprehend how each ligand affects the hinge motion. The structures are represented as a alpha-carbon trace rather than a cartoon ribbon because the motion is relatively small and the alpha carbon trace allows a more exact representation of the position of the atoms.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Overlay of Aligned Molecules<br />
<br />
#Load the individual, superimposed molecules<br />
load lovd_c2_refmac10-b_lsq.pdb, G0-Se<br />
load lovd-gx27_refmac11_lsq.pdb, G5<br />
load lovd_gx27-s76a-mja_aps-refmac3_lsq.pdb, G5-S76-MJA<br />
load lovd-gx27-s76a-sim-aps_refmac6_lsq.pdb, G5-S76-Sim<br />
load lovd-gx27-s76a-lov-aps_refmac6.pdb, G5-S76-Lov<br />
<br />
hide everything<br />
show ribbon<br />
set ray_trace_mode=0<br />
<br />
color red, G0-Se<br />
color orange, G5<br />
color yellow, G5-S76-MJA<br />
color limegreen, G5-S76-Sim<br />
color blue, G5-S76-Lov<br />
color gray, resid 1:92 or resid 204:413<br />
<br />
set ribbon_radius=0.3<br />
<br />
<br />
show sticks, resid 134 and not (name C or name N or name O)<br />
show sticks, resid 86 and not (name C or name N or name O)<br />
show sticks, resn 803<br />
show sticks, G5-MJA and resid 501<br />
show sticks, resid 320 and not (name C or name N or name O) and ( G5-S76-Sim or G5-S76-Lov)<br />
show sticks, resid 334 and not (name C or name N or name O) and ( G5-S76-Sim or G5-S76-Lov)<br />
show spheres, resid 320 and (name od1 or name od2) and G5-S76-Sim<br />
show spheres, resid 334 and (name cg1 or name cg2) and G5-S76-Sim<br />
color red, elem o<br />
<br />
<br />
set sphere_transparency=0.5<br />
set ray_shadow=off<br />
<br />
bg_color white<br />
<br />
viewport 1071,1051<br />
<br />
set_view (\<br />
0.836338997, 0.441327691, -0.325210959,\<br />
0.390257686, -0.062672906, 0.918569088,\<br />
0.385009199, -0.895153403, -0.224648848,\<br />
-0.000003189, 0.000000304, -189.126144409,\<br />
1.563406944, 17.993612289, -24.687477112,\<br />
171.387252808, 203.264083862, 0.000000000 )<br />
~ <br />
</source><br />
<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 4:''' Volumetric data (&ge; intermediate)</div>==<br />
<br />
[[File:Density-stereo.png|300px|thumb|left|Electron density map]] <br />
Illustration of an electron density map (omit map) from the enzyme, dUTPase from Mycobacterium tuberulosis (PDB ID [http://www.rcsb.org/pdb/explore.do?structureId=1six 1SIX]).<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT Electron Density Map -Left half of stereo image<br />
<br />
# general settings<br />
set mesh_radius = 0.015 <br />
set antialias = 1 <br />
set stick_radius = 0.22<br />
set sphere_scale= 0.22<br />
set ribbon_radius =0.1 <br />
# higher values of direct will lighten the image<br />
set direct =0.5<br />
# make the dash lines visible by increasing the thicknes of the dash_radius<br />
set dash_radius = 0.1<br />
#turn of shadows because they complicate the image<br />
util.ray_shadows('none')<br />
bg_color white<br />
<br />
<br />
# load pdb and map file <br />
load dumpnpp_10t.pdb, mtb <br />
load omit_twin_out.xplor, 1fofc<br />
<br />
# show e-density nearby<br />
# show positive contours of the map 4.2 sigma or higher within 18 angstroms of residue 170 of chain C<br />
isomesh pos, 1fofc, 4.2, (resid 170 and chain C ), 18.0<br />
color marine, pos<br />
# show negative contours of the map -4.2 sigma or lower within 18 angstroms of residue 170 of chain C<br />
isomesh neg, 1fofc, -4.2, (resid 170 and chain C ), 18.0<br />
color red, neg<br />
<br />
cartoon automatic<br />
hide nonbonded<br />
hide lines <br />
<br />
color white, (chain A or chain B or chain C) and (n;ca)<br />
color yellow, (resid 171) or (n;PA) or (n;PB) or (n;PG)<br />
color white, (elem C)<br />
#magnesium<br />
show sphere, (resid 171)<br />
color green, (resid 171)<br />
#waters<br />
show sphere, (resid 173:175 or resid 212)<br />
show sticks, (chain C and resid 170)<br />
show sticks, (chain A and resid 83 and not n;n,c,o )<br />
show sticks, (chain C and resid 24 and not n;n,c,o)<br />
show sticks, (chain C and resid 28 and not n;n,c,o)<br />
show sticks, (chain C and resid 64 and not n;n,c,o)<br />
show sticks, (chain C and resid 113 and not n;n,c,o)<br />
show sticks, (chain C and resid 64:66 )<br />
<br />
distance (resid 171 and chain C), (resid 173 and chain C)<br />
distance (resid 171 and chain C), (resid 174 and chain C)<br />
distance (resid 171 and chain C), (resid 175 and chain C)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1A)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1B)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1G)<br />
distance (resid 173 and chain C), (resid 28 and chain C and n;OD2)<br />
distance (resid 174 and chain C), (resid 28 and chain C and n;OD1)<br />
distance (resid 175 and chain C), (resid 24 and chain C and n;OD2)<br />
distance (resid 212 and chain A), (resid 170 and chain C and n;PA)<br />
distance (resid 212 and chain A), (resid 113 and chain C and n;OE1)<br />
distance (resid 212 and chain A), (resid 83 and chain A and n;OD2)<br />
distance (resid 113 and chain C and n;ne2), (resid 170 and chain C and n;O3A)<br />
distance (resid 65 and chain C and n;N), (resid 170 and chain C and n;O3A)<br />
distance (resid 65 and chain C and n;OG), (resid 170 and chain C and n;N2A)<br />
distance (resid 66 and chain C and n;N), (resid 170 and chain C and n;O3B)<br />
distance (resid 64 and chain C and n;NH2), (resid 170 and chain C and n;O1B)<br />
distance (resid 64 and chain C and n;NE), (resid 170 and chain C and n;O1B)<br />
distance (resid 83 and chain A and n;OD2), (resid 170 and chain C and n;O3')<br />
color yellow, dist*<br />
color red, dist10<br />
<br />
hide labels<br />
<br />
set_view (\<br />
-0.350610733, 0.599414885, -0.719504118,\<br />
-0.160659447, -0.795388758, -0.584337831,\<br />
-0.922586679, -0.089291766, 0.375185639,\<br />
0.002084959, 0.000028796, -51.327602386,\<br />
14.307765961, 9.915379524, 17.268175125,\<br />
42.648197174, 61.923065186, 0.000000000 )<br />
<br />
turn y, 3.5<br />
viewport 1000, 1000<br />
<br />
#ray<br />
#png density-left.png<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 5:''' Interfaces (&ge; intermediate)</div>==<br />
<br />
[[File:Interface02 labeled.png|250px|thumb|left|alt text]]<br />
<br />
Illustration of an intermolecular interface from the PE-PPE protein complex from Mycobacterium tuberulosis (PDB ID 2G38). The left panel illustrates the complex between PE and PPE proteins as a cartoon ribbon. The two proteins are colored separately to make the interface evident. Hydrophobic side chains involved in the interface are labeled. The right panel illustrates the complementary surfaces of the interface by splitting the complex apart like a clamshell. The smaller protein is the PE protein, the larger protein is the PPE protein. Warm colors indicate strong hydrophobicity; cool colors depict weak hydrophobicity. The left and right panels are depicted on the same scale so the viewer can see how residues labeled on the left correspond to red patches in the surface on the right.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT -for Intermolecular Interface<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
set direct =0.3<br />
set transparency=0.0<br />
set ray_trace_mode=0<br />
set sphere_transparency=0.0<br />
set light_count=2<br />
set ray_shadow=on<br />
set ray_shadows=on<br />
set orthoscopic = on<br />
set opaque_background,0<br />
# control the position of the light so shadows are cast<br />
# in cavities of the molecular surface<br />
set light =[ -0.50000, -0.70000, -0.750000 ]<br />
<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.8<br />
set line_radius = 0.01<br />
set sphere_scale = 0.35<br />
set cartoon_rect_width=0.5<br />
set cartoon_rect_length=2.2<br />
set cartoon_loop_radius=0.4<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load pe-trans-hydrofob.pdb, pe<br />
load ppe-trans-hydrofob.pdb, ppe<br />
load pe-rot-hydrofob.pdb, pe-hydrofob<br />
load ppe-rot-hydrofob.pdb, ppe-hydrofob<br />
<br />
# show cartoon ribbons<br />
show cartoon, pe or ppe<br />
show surface, pe-hydrofob or ppe-hydrofob<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
cartoon automatic<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then uncomment the following<br />
# line to detect secondary structure.<br />
# util.ss 1a2w<br />
# Warning, very coarse approximation.<br />
# Or get secondary structure assignments from dssp<br />
# http://swift.cmbi.kun.nl/gv/dssp/<br />
# Then convert assignments into a PDB header<br />
# http://dssp2pdb.bravais.net/<br />
#If you want to define secondary structure manually, <br />
#Use the following syntax<br />
#alter B/753:758/, ss='S'<br />
<br />
<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
<br />
<br />
# hydrophobicity values are printed in the B-factor column<br />
# of the pdb file. So, color by B-factor.<br />
cmd.spectrum("b",selection=("pe-hydrofob"),quiet=0)<br />
cmd.spectrum("b",selection=("ppe-hydrofob"),quiet=0)<br />
cmd.spectrum("b",selection=("pe"),quiet=0)<br />
cmd.spectrum("b",selection=("ppe"),quiet=0)<br />
<br />
color white, ppe <br />
color gray, pe <br />
<br />
# Show spheres for cysteine sulfurs<br />
show spheres, name sg <br />
<br />
# Show sticks for bonds<br />
show sticks, (resn cys) and not (name n,c,o)<br />
<br />
show sticks, chain B and (resid 31 or resid 167 or resid 74 or resid 78 or resid 71 or resid 45 or resid 173) and not (name n or name c or name o)<br />
show sticks, chain A and (resid 58 or resid 54 or resid 76 or resid 73) and not (name n or name c or name o)<br />
<br />
hide labels<br />
<br />
set_view (\<br />
-0.881387651, -0.417317063, 0.221362144,\<br />
0.171217963, 0.154523358, 0.973037899,\<br />
-0.440271527, 0.895526111, -0.064742655,\<br />
0.000100300, -0.000183796, -328.588287354,\<br />
4.581910610, 13.162490845, 90.285400391,\<br />
270.283447266, 386.892944336, 1.000000000 )<br />
<br />
<br />
viewport 600, 700<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 6:''' Large-scale structures, best-fit planes (&ge; intermediate/advanced)</div>==<br />
<br />
[[File:SvdEm.jpg|250px|thumb|left|Fig. 6: svdPLoS &ndash; Compute and display the best-fit plane to a membrane bilayer.]]<br />
<br />
As an advanced biomolecular graphics example, this figure illustrates the results from computing and rendering the best-fit plane to a set of atoms. Such a problem arises in many contexts, including membrane proteins and the lipid bilayers in which they are embedded. As described in the article, the plane was calculated via SVD on the phosphate atoms (orange spheres) of one leaflet of this POPC bilayer, and is rendered as a semi-transparent orange surface. To represent this plane, we chose the minimal-area rectangle that contained all projections of the points onto the plane. The two leaflets are shown as wireframes, with a single lipid shown as CPK spheres; carbons are colored wheat in one leaflet and light grey in the other. The three singular vectors from SVD correspond to the bilayer normal (z-direction) and the two vectors which span the subspace defining the 2D plane of best fit (‘best’ in the sense of linear least-squares minimization of the deviation of z-coordinates of all atoms from the plane).<br />
<br />
<br />
<source lang="python"><br />
# --- BEGIN PYTHON SCRIPT - Higher-order structures and plane-fitting --- #<br />
# using the array module for efficient arrays of numeric values<br />
from array import *<br />
<br />
# system stuff<br />
import os, sys, string<br />
import copy<br />
<br />
# pretty printing<br />
import pprint<br />
<br />
# for importing as a plugin into PyMol<br />
from pymol import cmd<br />
from pymol import stored<br />
from pymol import selector<br />
from pymol.cgo import *<br />
<br />
# using numpy for linear algebra<br />
import numpy<br />
<br />
def svdEm(sel1, zsize=0.75, width=10):<br />
cmd.reset()<br />
# make the lists for holding coordinates<br />
# partial lists (subset of atoms selected for calculation)<br />
stored.sel1 = []<br />
# full lists (the whole molecular entity)<br />
stored.mol1 = []<br />
<br />
# Get the selected coordinates for the best-fit plane<br />
cmd.iterate_state(1, selector.process(sel1), "stored.sel1.append([x,y,z])")<br />
<br />
# Get molecule name<br />
mol1 = cmd.identify(sel1,1)[0][0]<br />
<br />
# Get all molecule coords. We do this because we have to transform the whole<br />
# molcule, not just the selected subset, and then make sure that at least 3<br />
# atoms are selected (3 pts, assuming non-colinearity, are required to form a plane):<br />
cmd.iterate_state(1, mol1, "stored.mol1.append([x,y,z])")<br />
assert( len(stored.sel1) >= 3 )<br />
<br />
# Center the atom selection to avoid affine transformations;<br />
# in particular, center to the selection of interest:<br />
COM1 = numpy.sum(stored.sel1,axis=0) / float(len(stored.sel1))<br />
stored.sel1 = stored.sel1 - COM1<br />
sele = map(None, stored.sel1)<br />
<br />
# V and M are the orthonormal bases, and S provides the singular values.<br />
V, S, M = numpy.linalg.svd( numpy.dot( numpy.transpose(stored.sel1), stored.sel1))<br />
<br />
# We already have our solution, in the results from SVD.<br />
# We just need to check for reflections and then produce<br />
# the rotation. V and M are orthonormal, so their det's<br />
# are +/-1.<br />
reflect = float(str(float(numpy.linalg.det(V) * numpy.linalg.det(M))))<br />
if reflect == -1.0:<br />
S[-1] = -S[-1]<br />
V[:,-1] = -V[:,-1]<br />
<br />
# center the molecule<br />
stored.sel1 = stored.mol1 - COM1<br />
stored.sel1 = stored.sel1.tolist()<br />
<br />
# update the coordinates with the new ones in the PyMOL molecular object<br />
cmd.alter_state(1,mol1,"(x,y,z)=stored.sel1.pop(0)")<br />
cmd.center('visible')<br />
cmd.orient()<br />
<br />
# find the convex hull of the projections of the selected points on the plane<br />
hull = (numpy.transpose(numpy.matrix(numpy.delete(V,2,1))*numpy.transpose(convexHull(numpy.transpose(numpy.matrix(numpy.transpose(numpy.delete(V,2,1)))*numpy.transpose(sele)).tolist())))).tolist()<br />
<br />
# Since the minimum rectangle that contains all the selected points (their projections<br />
# on the plane) MUST have an edge on the convex hull edge, we redefine our coordinate<br />
# system (basis vectors of the plane [the orthogonal vector to the plane is fixed]) and<br />
# calculate the max and min pts and the rectangle they form, keeping track of the global<br />
# minimum-area rectancle and its basis vectors and max/min pts<br />
for i in xrange(-1,len(hull)-1):<br />
v1 = (numpy.array(hull[i+1]) - numpy.array(hull[i])) / numpy.linalg.norm(numpy.array(hull[i+1]) - numpy.array(hull[i]))<br />
v2 = numpy.cross(V[:,2],v1) / numpy.linalg.norm(numpy.cross(V[:,2],v1))<br />
v1ls = map(lambda x: numpy.vdot(x,v1), hull)<br />
v2ls = map(lambda x: numpy.vdot(x,v2), hull)<br />
if i==-1 or (max(v1ls) - min(v1ls))*(max(v2ls) - min(v2ls)) < minimum_rect_area:<br />
minimum_rect_area = (max(v1ls) - min(v1ls))*(max(v2ls) - min(v2ls))<br />
minimum_rect_area_vec1 = v1<br />
minimum_rect_area_vec2 = v2<br />
max_rect_vec1 = max(v1ls)<br />
min_rect_vec1 = min(v1ls)<br />
max_rect_vec2 = max(v2ls)<br />
min_rect_vec2 = min(v2ls)<br />
<br />
# Create the coordinate system matrix (3x3 in R3) that corresponds to a set of basis<br />
# vectors orthogonal to the rectangle edges<br />
V = numpy.array([[minimum_rect_area_vec1[0],minimum_rect_area_vec2[0],V[0,2]],[minimum_rect_area_vec1[1],minimum_rect_area_vec2[1],V[1,2]],[minimum_rect_area_vec1[2],minimum_rect_area_vec2[2],V[2,2]]])<br />
least_mag = min(max_rect_vec1, max_rect_vec2)<br />
<br />
# Now draw the vecs and the plane<br />
drawVecs(V,list(max_rect_vec1*minimum_rect_area_vec1),list(max_rect_vec2*minimum_rect_area_vec2),zsize,least_mag,width)<br />
drawTriFan(list((max_rect_vec1*minimum_rect_area_vec1)+(max_rect_vec2*minimum_rect_area_vec2)),list((max_rect_vec1*minimum_rect_area_vec1)+(min_rect_vec2*minimum_rect_area_vec2)),list((min_rect_vec1*minimum_rect_area_vec1)+(min_rect_vec2*minimum_rect_area_vec2)),list((min_rect_vec1*minimum_rect_area_vec1)+(max_rect_vec2*minimum_rect_area_vec2)))<br />
cmd.zoom('visible')<br />
<br />
def drawTriFan(v1, v2, v3, v4):<br />
mycgofan = []<br />
mycgofan = [BEGIN,TRIANGLE_FAN]<br />
mycgofan.extend([COLOR]+[0.3,0.7,0.4])<br />
mycgofan.extend([VERTEX] + v1)<br />
mycgofan.extend([VERTEX] + v2)<br />
mycgofan.extend([VERTEX] + v3)<br />
mycgofan.extend([VERTEX] + v4)<br />
mycgofan.append(END)<br />
mycgofan.extend([SPHERE, 0., 0., 0., 0.3])<br />
cmd.load_cgo(mycgofan, 'myTriFan')<br />
<br />
def drawVecs(V, v1, v2, zsize, least_mag, width):<br />
tail = [CYLINDER, 0, 0, 0, v1[0] + 2*(v1/numpy.linalg.norm(v1))[0], v1[1] + 2*(v1/numpy.linalg.norm(v1))[1], v1[2] + 2*(v1/numpy.linalg.norm(v1))[2], 0.04*width, 0.9, 0.2, 0.2, 0.9, 0.2, 0.2]<br />
head = [CONE, v1[0] + 2*(v1/numpy.linalg.norm(v1))[0], v1[1] + 2*(v1/numpy.linalg.norm(v1))[1], v1[2] + 2*(v1/numpy.linalg.norm(v1))[2], v1[0] + 5*(v1/numpy.linalg.norm(v1))[0], v1[1] + 5*(v1/numpy.linalg.norm(v1))[1], v1[2] + 5*(v1/numpy.linalg.norm(v1))[2], 0.07*width, 0.0, 0.9, 0.2, 0.2, 0.9, 0.2, 0.2, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_1')<br />
tail = [CYLINDER, 0, 0, 0, v2[0] + 2*(v2/numpy.linalg.norm(v2))[0], v2[1] + 2*(v2/numpy.linalg.norm(v2))[1], v2[2] + 2*(v2/numpy.linalg.norm(v2))[2], 0.04*width, 0.2, 0.9, 0.2, 0.2, 0.9, 0.2]<br />
head = [CONE, v2[0] + 2*(v2/numpy.linalg.norm(v2))[0], v2[1] + 2*(v2/numpy.linalg.norm(v2))[1], v2[2] + 2*(v2/numpy.linalg.norm(v2))[2], v2[0] + 5*(v2/numpy.linalg.norm(v2))[0], v2[1] + 5*(v2/numpy.linalg.norm(v2))[1], v2[2] + 5*(v2/numpy.linalg.norm(v2))[2], 0.07*width, 0.0, 0.2, 0.9, 0.2, 0.2, 0.9, 0.2, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_2')<br />
tail = [CYLINDER, 0, 0, 0, zsize*least_mag*V[0,2], zsize*least_mag*V[1,2], zsize*least_mag*V[2,2], 0.04*width, 0.2, 0.2, 0.9, 0.2, 0.2, 0.9]<br />
head = [CONE, zsize*least_mag*V[0,2], zsize*least_mag*V[1,2], zsize*least_mag*V[2,2], zsize*least_mag*V[0,2] + 3*V[0,2], zsize*least_mag*V[1,2] + 3*V[1,2], zsize*least_mag*V[2,2] + 3*V[2,2], 0.07*width, 0.0, 0.2, 0.2, 0.9, 0.2, 0.2, 0.9, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_3')<br />
<br />
def convexHull(P):<br />
# Get a local list copy of the points and sort them lexically.<br />
# Build the upper and then lower half of the hull, remove duplicates,<br />
# and return a concatenation of both halfs.<br />
points = map(None, P)<br />
points.sort()<br />
upper = [points[0], points[1]]<br />
for p in points[2:]:<br />
upper.append(p)<br />
while len(upper) > 2 and not _isRightTurn(upper[-3:]):<br />
del upper[-2]<br />
points.reverse()<br />
lower = [points[0], points[1]]<br />
for p in points[2:]:<br />
lower.append(p)<br />
while len(lower) > 2 and not _isRightTurn(lower[-3:]):<br />
del lower[-2]<br />
del lower[0]<br />
del lower[-1]<br />
return tuple(upper + lower)<br />
<br />
def _isRightTurn((p, q, r)):<br />
assert p != q and q != r and p != r <br />
if numpy.linalg.det([[1,1,1],[p[0],q[0],r[0]],[p[1],q[1],r[1]]]) < 0:<br />
return 1<br />
else:<br />
return 0<br />
<br />
cmd.extend("svdEm", svdEm)<br />
cmd.extend("drawTriFan", drawTriFan)<br />
# --- END PYTHON SCRIPT --- #<br />
# Thanks to Dinu C. Gherman for his convexHull script which we used and modified.<br />
# Since all PyMOL selections are unique, we need not worry, but if the list is<br />
# NOT UNIQUE, use a dictionary and set the key values to 1.<br />
<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 7:''' Animations (&ge; intermediate/advanced)</div>==<br />
See the [[#Animations | Animations]] section below.<br />
<br />
{{div15}}<br />
='''Animations'''=<br />
<br />
== <span style="font-weight:normal;">A classification scheme</span> ==<br />
The possible types of 3D figures and animations are enumerated in Table 1. Below the symbol for each category is a tangible example of that particular type of illustration. The principles and practices used to create superb static figures (''i.e.'', M<sub>s</sub>V<sub>s</sub>) also apply to the design and rendering of animations, each frame of which can be essentially considered a stand-alone figure.<br />
<br />
{|border="0" style="width:45%; border-collapse:collapse;"<br />
|<br />
|<br />
|colspan="2" align="center" style="border-left:1px solid rgb(180,180,180);border-top:1px solid rgb(180,180,180);border-right:1px solid rgb(180,180,180);background-color:rgb(245,245,245);"|Coordinates of molecular entities ('M')<br />
|-<br />
|<br />
|<br />
|align="center" style="border-left:1px solid rgb(180,180,180);border-bottom:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:1px 0px 2px 0px;"| ''static''<br />
|align="center" style="border-right:1px solid rgb(180,180,180);border-bottom:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:1px 0px 2px 0px;"| ''dynamic''<br />
|-<br />
|rowspan="2" style="text-align:center;border-top:1px solid rgb(180,180,180);border-left:1px solid rgb(180,180,180);border-bottom:1px solid rgb(180,180,180);background-color:rgb(245,245,245);"| Viewpoint ('V')<br />
|align="center" style="border-top:1px solid rgb(180,180,180);border-right:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:0px 5px 0px 0px;"| ''static'' <br />
|align="center" | '''M<sub>s</sub>V<sub>s</sub>'''<br /><span style="font-size:x-small;">A standard (static) molecular illustration</span><br />
|align="center" style="border-right:2px solid rgb(100,100,100);" | '''M<sub>d</sub>V<sub>s</sub>'''<br /><span style="font-size:x-small;">Visualize an MD trajectory from a single/fixed viewpoint</span><br />
|-<br />
|align="center" style="border-bottom:1px solid rgb(180,180,180);border-right:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:0px 5px 0px 0px;" | ''dynamic''<br />
|align="center" style="border-bottom:2px solid rgb(100,100,100);" | '''M<sub>s</sub>V<sub>d</sub>'''<br /><span style="font-size:x-small;">A rotating camera 'scan' of the molecular objects</span><br />
|align="center" style="border-bottom:2px solid rgb(100,100,100); border-right:2px solid rgb(100,100,100);" | '''M<sub>d</sub>V<sub>d</sub>'''<br /><span style="font-size:x-small;">Visualize a trajectory from dynamically changing viewpoints</span><br />
|+ align="bottom" style="font-size:110%;font-family:serif;font-weight:normal;text-align:left;" | '''Table 1''': A classification of figures &amp; animations.<br />
|}<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>s</sub>V<sub>s</sub> &mdash; Molecule is static, View is static</span> ==<br />
These are simply the 'ordinary', static figures illustrated by most of the case studies in this tutorial.<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>s</sub>V<sub>d</sub> &mdash; Molecule is static, View is dynamic</span> ==<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>d</sub>V<sub>s</sub> &mdash; Molecule is dynamic, View is static</span> ==<br />
<br />
[[File:Movie.gif|200px|thumb|left|Movie of a DNA helicase unwinding dsDNA (animated GIF format)]]<br />
A movie illustrating conformational changes in a helicase as it unwinds double stranded DNA.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
set ambient = 0.3<br />
set light_count = 6<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.6<br />
set sphere_scale = 0.5<br />
set cartoon_rect_width=0.9<br />
set cartoon_rect_length=2.0<br />
set cartoon_loop_radius=0.5<br />
# mesh_radius -to adjust thickness of electron<br />
# density contours<br />
set mesh_radius = 0.02<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load ff01.pdb,mov,1<br />
load ff02.pdb,mov,2<br />
load ff03.pdb,mov,3<br />
load ff04.pdb,mov,4<br />
load ff05.pdb,mov,5<br />
load ff06.pdb,mov,6<br />
load ff07.pdb,mov,7<br />
load ff08.pdb,mov,8<br />
load ff09.pdb,mov,9<br />
load ff10.pdb,mov,10<br />
load ff11.pdb,mov,11<br />
load ff12.pdb,mov,12<br />
load ff13.pdb,mov,13<br />
load ff14.pdb,mov,14<br />
load ff15.pdb,mov,15<br />
load ff16.pdb,mov,16<br />
load ff17.pdb,mov,17<br />
load ff18.pdb,mov,18<br />
load ff19.pdb,mov,19<br />
load ff20.pdb,mov,20<br />
load ff21.pdb,mov,21<br />
load ff22.pdb,mov,22<br />
load ff23.pdb,mov,23<br />
load ff24.pdb,mov,24<br />
load ff25.pdb,mov,25<br />
load ff26.pdb,mov,26<br />
load ff27.pdb,mov,27<br />
load ff28.pdb,mov,28<br />
load ff29.pdb,mov,29<br />
load ff30.pdb,mov,30<br />
<br />
<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
# show cartoon ribbons<br />
show cartoon, chain a<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
cartoon automatic<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then uncomment the following<br />
# line to detect secondary structure.<br />
# Warning, very coarse approximation.<br />
# Or get header from http://www.mbfys.lu.se/Services/SecStr/<br />
#util.ss 1a2w<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
util.chainbow("(mov)")<br />
<br />
# Show spheres for chloride ions<br />
#show spheres, name sg <br />
<br />
# Show sticks for bonds<br />
#show sticks, (resn cys) and not (name n,c,o)<br />
show sticks, resn atp or resn po4<br />
show sticks, resn adp or chain e or chain d<br />
show sticks, (resid 540 or resid 563 or resid 545 or resid 377 or resid 358 or resid 335 or resid 373 or resid 475 or resid 483 or resid 485) and not (name c or name o or name n)<br />
hide cartoon, chain e or chain d or resn atp or resn adp or resn po4<br />
<br />
color red, elem o<br />
color blue, elem n<br />
color gray, chain d<br />
color white, chain e<br />
color orange, elem p<br />
color gray, elem c and (resn po4 or resn adp or resn atp)<br />
color firebrick, elem o and (name o1p or name o2p or name o3' or name o5')<br />
unbond resn po4, resn adp<br />
<br />
#alter B/753:758/, ss='S'<br />
<br />
# set up simple rotation commands<br />
<br />
mset 1 - 15<br />
<br />
### cut below here and paste into script ###<br />
set_view (\<br />
0.017624758, -0.997306943, -0.071203344,\<br />
-0.656398058, 0.042179316, -0.753232718,\<br />
0.754207492, 0.060014214, -0.653885424,\<br />
0.000000950, -0.000033716, -206.950531006,\<br />
45.939758301, 43.484542847, 46.991050720,\<br />
159.799530029, 216.515686035, 0.000000000 )<br />
### cut above here and paste into script ###<br />
<br />
<br />
<br />
#set ray_trace_mode=3<br />
viewport 700,500<br />
<br />
#### make output directory (NOTE: preceeding "/" = literal python)<br />
<br />
/if not os.path.exists("png"): os.mkdir("png")<br />
<br />
####enable raytracing<br />
<br />
set ray_trace_frames=1<br />
set cache_frame=0<br />
<br />
#### render<br />
<br />
mpng png/mov<br />
</source><br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>d</sub>V<sub>d</sub> &mdash; Molecule is dynamic, View is dynamic</span> ==<br />
<br />
{{div15}}<br />
='''Useful links'''=<br />
<br />
A compilation of links and other online resources that were helpful in creating these examples. Please edit as you see fit.<br />
<br />
== <span style="font-weight:normal;">PyMOL-related</span> ==<br />
* PyMOL's list of links to user-maintained script collections, tutorials, ''etc.'' - http://pymol.org/links.html<br />
<br />
== <span style="font-weight:normal;">Python-related</span> ==<br />
<br />
== <span style="font-weight:normal;">General MolVis</span> ==<br />
<br />
* Conceptual background<br />
** Useful general info (historical &amp; conceptual), links, ''etc.'' - http://en.wikipedia.org/wiki/Molecular_graphics<br />
** The "''graphics pipeline''" - http://en.wikipedia.org/wiki/Graphics_pipeline<br />
<br />
* Historical background &amp; significance<br />
** Martz &amp; Francoeur's online history of MolVis - http://www.umass.edu/microbio/rasmol/history.htm<br />
** Levinthal's account of the early days - <br />
<br />
* Individual pages, script repositories, ''etc.''<br />
** Lev Gelb's (WashU) MolVis page - http://www.chemistry.wustl.edu/~gelb/visualization.html<br />
<br />
{{div15}}<br />
='''Input files, raw data'''=<br />
The following tarball provides all of the input files referred to in the above scripts &mdash; coordinate files (<tt>.pdb</tt>), electron density maps (<tt>.xplor</tt>), ''etc.''<br />
* <tt>[[Media:PLoS_BiomolGraph_2010_InputFiles.tar.bz2|PLoS_BiomolGraph_2010_InputFiles.tar.bz2]]</tt> (2.1M)<br />
* To extract the archive on Unix/Linux, issue the following command at the prompt ("$]"):<br />$] <tt>tar jxvf PLoS_BiomolGraph_2010_InputFiles.tar.bz2</tt><br />
<br />
{{div15}}<br />
='''Abbreviations, symbols'''=<br />
The following abbreviations, acronyms, or other symbols may be encountered on this wiki page:<br />
* "dsDNA" = double-stranded DNA<br />
* "API" = '''A'''pplication '''P'''rogramming '''I'''nterface</div>Jameshttps://pymolwiki.org/index.php?title=PLoS&diff=10847PLoS2012-09-20T16:21:56Z<p>James: Changed dssp2pdb url to permanent url: http://dssp2pdb.bravais.net/</p>
<hr />
<div><!-- <span style="font-family:Myriad; font-weight:bold; font-size:x-large;">''Biomolecular Graphics: In Principle and in Practice''</span> --><br />
<span style="font-family:Myriad; font-weight:bold; font-size:x-large;">''An Introduction to Biomolecular Graphics''</span><br />
<br />
= '''Overview, general notes''' =<br />
<!-- :: NB. Hey guys, instead of using <nowiki><PRE>code here</PRE></nowiki> use <nowiki><source lang="python">python code</source></nowiki> or <nowiki><source lang="language-name-here">some code</source></nowiki> for syntax highlighting on the wiki. --><br />
<br />
* This is the online supplemental wiki for "[http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1000918 An Introduction to Biomolecular Graphics]" ''PLoS Comput Biol'' (2010) ''6(8)'': e1000918. doi:10.1371/journal.pcbi.1000918.<br />
<br />
* '''Update''' (01nov2011) &mdash; An erratum is [[Media:MuraEtAl_PLoS_BiomolGraphics_SuppFigS3_01nov2011_erratum.pdf|now available]] for Supplementary Figure S3 (and the associated legend, pg S13) of the ''PLoS Comp Bio'' paper. Special thanks to Steve Bottomley (Curtin Univ) for pointing-out that the relative orientation between panels B and C of Fig S3 is not clearly described; the revised figure and caption attempt to clarify this point.<br />
<br />
{{div15}}<br />
<br />
='''Figures'''=<br />
This section illustrates the figure-creation process, from initial conception &rarr; final multi-panel figure ready for publication. Organized as various "case studies" that are representative of the tasks typically faced by structural or computational biologists, this section provides several step-by-step examples. These examples are entirely self-contained, and the materials include everything from ''(i)'' raw, starting data (''e.g.'', PDB files) to ''(ii)'' actual, working PyMOL or Python scripts and ''(iii)'' final output image files.<br />
<br />
{{div10}}<br />
==<div style="background-color:#efeddf; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 1:''' Overall fold / domain level (&ge; novice/intermediate)</div>==<br />
[[File:Csos3-stereo01.png|300px|thumb|left|Stereo view of a protein fold]]<br />
Illustration of the overall fold of carbonic anhydrase, CsoS3, from Halothiobacillus neapolitanus.(PDB ID 2G13). The three domains that compose this enzyme are distinguished by coloring each domain separately (blue, yellow, red). The orientation was chosen to feature the location of the active site (outlined by side chains and zinc ion), and to show the two-fold symmetry relationship between the active domain (yellow) and homologous but defunct domain (red). SSEs are labeled directly on the individual SSEs. Domain labels are colored to correspond to the domains they are labeling. Labels in the active site are given an “outer glow” to make them legible in a region of the figure that is dense in detail. Depth is conveyed by use of fog, veiling less important structural features in the back of the enzyme. <br />
<br />
Ingredients for this figure:<br />
<br />
1) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3_18o_nobreak.pdb coordinates ]. <br />
<br />
2) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3-left.pml Pymol script for left half of stereo image]. The script can be modified to produce the right half of the stereo image by changing the line "turn y, 3.5" to "turn y, -3.5"<br />
<br />
3) Download [http://www.doe-mbi.ucla.edu/~sawaya/uvla/fold/csos3-stereo01.psd labeled figure in photoshop format].<br />
<br />
Tips:<br />
1) If you are modifying this script to illustrate a different set of coordinates, it is best to have the secondary structure assignments in the header. Otherwise, the secondary structure assignment made by pymol may be inaccurate.<br />
<br />
<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Overall Fold -left half of stereo image<br />
<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
<br />
# Larger values of ambient make the image brighter<br />
set ambient=0.3<br />
<br />
# Larger values of direct eliminates shadows<br />
set direct=1.0<br />
set ribbon_radius =0.2<br />
<br />
# cartoon_highlight_color will give a separate color to edges of secondary structural elements.<br />
set cartoon_highlight_color =grey50<br />
<br />
# ray_trace_mode=1 makes a black outline around the secondary structural elements<br />
set ray_trace_mode=1<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.2<br />
<br />
# mesh_radius -to adjust thickness of electron density contours<br />
set mesh_radius = 0.02<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load csos3_18o_nobreak.pdb, csos3<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
# show cartoon ribbons<br />
show cartoon<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
set cartoon_tube_radius, 0.2<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then get secondary structure assignments <br />
# from dssp http://swift.cmbi.kun.nl/gv/dssp/<br />
# Then convert assignments into a PDB header<br />
# http://dssp2pdb.bravais.net/<br />
# If you want to define secondary structure manually, <br />
# Use the following syntax 'S'=strand 'H'=helix<br />
# alter B/753:758/, ss='S'<br />
<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
set cartoon_cylindrical_helices=0<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
# Here I make some customized colors as mixtures of red,green,blue<br />
set_color maarine= [0.3, 0.8, 1.0]<br />
set_color graay=[0.8,0.8,0.8]<br />
set_color greeen=[0.0,0.5,0.0]<br />
<br />
color gray50, elem C<br />
color greeen, elem ZN<br />
color blue, resid 38:147 and name ca<br />
color yellow, resid 148:397 and name ca<br />
color red, resid 398:514 and name ca<br />
<br />
# Show spheres for chloride ions<br />
show spheres, elem ZN<br />
<br />
# Show sticks for bonds<br />
show sticks, (resid 173 or resid 175 or resid 177 or resid 242 or resid 253) and not (name n or name c or name o)<br />
<br />
set_view (\<br />
0.091340274, -0.606698275, 0.789650559,\<br />
-0.991202235, -0.131515890, 0.013612081,\<br />
0.095602803, -0.783963323, -0.613382638,\<br />
0.001799395, 0.001679182, -246.492980957,\<br />
12.976243019, 41.245639801, 62.928291321,\<br />
187.538497925, 249.492980957, 0.000000000 )<br />
<br />
turn y, 3.5<br />
viewport 1200,1500<br />
#ray<br />
#png csos3-left.png<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 2:''' Ligand-binding sites (&ge; novice/intermediate)</div>==<br />
[[File:Dutpase active02-labeled.png|200px|thumb|left|Active Site Figure]]Illustration of the active site of dUTPase from Mycobacterium tuberculosis (PDB ID 1SIX). The orientation of the active site was chosen to feature the geometry of the chemical reaction catalyzed by this enzyme, specifically the in-line nucleophilic attack of water 212 on the alpha-phosphate of dUTP. Fine tuning of the orientation was made to eliminate overlap of side chains and to make all hydrogen bonds (dashed lines) visible. Only side chains directly involved in catalysis are depicted. Carbons are colored according to five conserved motifs of the dUTPase family. Non-conserved residues are given an undistracting gray color and are veiled in fog. Labels were colored to correspond to the side chains they are labeling.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Active Site<br />
<br />
set mesh_radius = 0.01 <br />
set antialias = 1 <br />
set stick_radius = 0.22<br />
set dash_radius=0.07<br />
set sphere_scale= 0.22<br />
set ribbon_radius =0.1 <br />
set direct =0.0<br />
set cartoon_fancy_helices=1<br />
bg_color white<br />
set gamma=1.5<br />
util.ray_shadows('none')<br />
set ray_trace_mode=1<br />
<br />
# load pdb and map file <br />
load dumpnpp_10t.pdb, mtb <br />
<br />
cartoon automatic<br />
show cartoon<br />
hide nonbonded<br />
hide lines <br />
<br />
color white, (chain A or chain B or chain C) and (n;ca)<br />
color yellow, (resid 171) or (n;PA) or (n;PB) or (n;PG)<br />
color white, (elem C)<br />
#magnesium<br />
show sphere, (resid 171)<br />
color green, (resid 171)<br />
#waters<br />
show sphere, (resid 173:175 or resid 212)<br />
show sticks, (chain C and resid 170)<br />
<br />
<br />
color marine, (resid 22:32 and elem C) and chain C<br />
color green, (resid 57:76 and elem C) and chain C<br />
color yellow, (resid 77:93 and elem C) and chain A<br />
color orange, (resid 102:115 and elem C) and chain C<br />
color red, (resid 134:145 and elem C ) and chain B<br />
<br />
<br />
show sticks, (chain A and resid 83 and not n;n,c,o )<br />
show sticks, (chain A and resid 86 and not n;n,c,o )<br />
show sticks, (chain A and resid 77 and not n;n,c,o )<br />
show sticks, (chain C and resid 24 and not n;n,c,o)<br />
show sticks, (chain C and resid 28 and not n;n,c,o)<br />
show sticks, (chain B and resid 140 and not n;n,c,o)<br />
show sticks, (chain C and resid 64 and not n;n,c,o)<br />
show sticks, (chain C and resid 113 and not n;n,c,o)<br />
show sticks, (chain C and resid 64:66 )<br />
hide sticks, (chain C and resid 64 and n;n,c,o)<br />
show sticks, (chain A and resid 91 and n;n,c,o,ca)<br />
<br />
<br />
distance (resid 171 and chain C), (resid 173 and chain C)<br />
color green, dist01<br />
distance (resid 171 and chain C), (resid 174 and chain C)<br />
color green , dist02<br />
distance (resid 171 and chain C), (resid 175 and chain C)<br />
color green , dist03<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1A)<br />
color green , dist04<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1B)<br />
color green , dist05<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1G)<br />
color green , dist06<br />
distance (resid 173 and chain C), (resid 28 and chain C and n;OD2)<br />
color marine, dist07<br />
distance (resid 174 and chain C), (resid 28 and chain C and n;OD1)<br />
color marine, dist08<br />
distance (resid 175 and chain C), (resid 24 and chain C and n;OD2)<br />
color marine, dist09<br />
distance (resid 212 and chain A), (resid 170 and chain C and n;PA)<br />
color red, dist10<br />
distance (resid 212 and chain A), (resid 113 and chain C and n;OE1)<br />
color orange, dist11<br />
distance (resid 212 and chain A), (resid 83 and chain A and n;OD2)<br />
color yellow, dist12<br />
distance (resid 113 and chain C and n;ne2), (resid 170 and chain C and n;O3A)<br />
color orange, dist13<br />
distance (resid 65 and chain C and n;N), (resid 170 and chain C and n;O3A)<br />
color green, dist14<br />
distance (resid 65 and chain C and n;OG), (resid 170 and chain C and n;N2A)<br />
color green, dist15<br />
distance (resid 66 and chain C and n;N), (resid 170 and chain C and n;O3B)<br />
color green, dist16<br />
distance (resid 64 and chain C and n;NH2), (resid 170 and chain C and n;O1B)<br />
color green, dist17<br />
distance (resid 64 and chain C and n;NE), (resid 170 and chain C and n;O1B)<br />
color green, dist18<br />
distance (resid 83 and chain A and n;OD2), (resid 170 and chain C and n;O3')<br />
color yellow, dist19<br />
distance (resid 140 and chain B and n;NH1), (resid 170 and chain C and n;O2G)<br />
color red, dist20<br />
distance (resid 140 and chain B and n;NH2), (resid 170 and chain C and n;O1G)<br />
color red, dist21<br />
distance (resid 140 and chain B and n;NE), (resid 24 and chain C and n;OD1)<br />
color red, dist22<br />
distance (resid 140 and chain B and n;NH2), (resid 24 and chain C and n;OD2)<br />
color red, dist23<br />
distance (resid 170 and chain C and n;O4), (resid 77 and chain A and n;ND2)<br />
color yellow, dist24<br />
distance (resid 170 and chain C and n;N3), (resid 91 and chain A and n;O)<br />
color yellow, dist24<br />
distance (resid 170 and chain C and n;O2), (resid 91 and chain A and n;N)<br />
color yellow, dist24<br />
<br />
hide labels<br />
<br />
set cartoon_flat_sheets = 1.0<br />
set cartoon_smooth_loops = 0<br />
<br />
set_view (\<br />
0.045321193, 0.677332938, -0.734195530,\<br />
0.631984174, -0.588606596, -0.504004478,\<br />
-0.773574233, -0.441189915, -0.454773396,\<br />
0.000917640, 0.000133177, -65.177696228,\<br />
14.812702179, 8.131608009, 17.861175537,\<br />
54.978454590, 79.653022766, 0.000000000 )<br />
<br />
<br />
# ray 1500,1500<br />
viewport 700,800<br />
</source><br />
<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 3:''' Structure alignment (&ge; novice/intermediate)</div>==<br />
<br />
[[File:Overlay03.png|200px|thumb|left|Overlay of aligned alpha-carbon traces]]<br />
An overlay of five simvastatin synthetase crystal structures illustrating degrees of hinge closing imparted by ligand binding (PDB IDs 3HLB, 3HLC, 3HLE, 3HLF, and 3HLG). Hinge motion in this two-domain enzyme is highlighted by superimposing only atoms in one of the domains (depicted in gray in this figure). The range of motion is highlighted by the rainbow colors assigned to the upper domain. The orientation of the molecule is chosen to make the range of motion evident (hinge axis is normal to the plane of the page). Each of the structures is labeled explicitly in the figure, rather than burying the information in the figure legend. Color coding the labels makes it easier to comprehend how each ligand affects the hinge motion. The structures are represented as a alpha-carbon trace rather than a cartoon ribbon because the motion is relatively small and the alpha carbon trace allows a more exact representation of the position of the atoms.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT for Overlay of Aligned Molecules<br />
<br />
#Load the individual, superimposed molecules<br />
load lovd_c2_refmac10-b_lsq.pdb, G0-Se<br />
load lovd-gx27_refmac11_lsq.pdb, G5<br />
load lovd_gx27-s76a-mja_aps-refmac3_lsq.pdb, G5-S76-MJA<br />
load lovd-gx27-s76a-sim-aps_refmac6_lsq.pdb, G5-S76-Sim<br />
load lovd-gx27-s76a-lov-aps_refmac6.pdb, G5-S76-Lov<br />
<br />
hide everything<br />
show ribbon<br />
set ray_trace_mode=0<br />
<br />
color red, G0-Se<br />
color orange, G5<br />
color yellow, G5-S76-MJA<br />
color limegreen, G5-S76-Sim<br />
color blue, G5-S76-Lov<br />
color gray, resid 1:92 or resid 204:413<br />
<br />
set ribbon_radius=0.3<br />
<br />
<br />
show sticks, resid 134 and not (name C or name N or name O)<br />
show sticks, resid 86 and not (name C or name N or name O)<br />
show sticks, resn 803<br />
show sticks, G5-MJA and resid 501<br />
show sticks, resid 320 and not (name C or name N or name O) and ( G5-S76-Sim or G5-S76-Lov)<br />
show sticks, resid 334 and not (name C or name N or name O) and ( G5-S76-Sim or G5-S76-Lov)<br />
show spheres, resid 320 and (name od1 or name od2) and G5-S76-Sim<br />
show spheres, resid 334 and (name cg1 or name cg2) and G5-S76-Sim<br />
color red, elem o<br />
<br />
<br />
set sphere_transparency=0.5<br />
set ray_shadow=off<br />
<br />
bg_color white<br />
<br />
viewport 1071,1051<br />
<br />
set_view (\<br />
0.836338997, 0.441327691, -0.325210959,\<br />
0.390257686, -0.062672906, 0.918569088,\<br />
0.385009199, -0.895153403, -0.224648848,\<br />
-0.000003189, 0.000000304, -189.126144409,\<br />
1.563406944, 17.993612289, -24.687477112,\<br />
171.387252808, 203.264083862, 0.000000000 )<br />
~ <br />
</source><br />
<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 4:''' Volumetric data (&ge; intermediate)</div>==<br />
<br />
[[File:Density-stereo.png|300px|thumb|left|Electron density map]] <br />
Illustration of an electron density map (omit map) from the enzyme, dUTPase from Mycobacterium tuberulosis (PDB ID [http://www.rcsb.org/pdb/explore.do?structureId=1six 1SIX]).<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT Electron Density Map -Left half of stereo image<br />
<br />
# general settings<br />
set mesh_radius = 0.015 <br />
set antialias = 1 <br />
set stick_radius = 0.22<br />
set sphere_scale= 0.22<br />
set ribbon_radius =0.1 <br />
# higher values of direct will lighten the image<br />
set direct =0.5<br />
# make the dash lines visible by increasing the thicknes of the dash_radius<br />
set dash_radius = 0.1<br />
#turn of shadows because they complicate the image<br />
util.ray_shadows('none')<br />
bg_color white<br />
<br />
<br />
# load pdb and map file <br />
load dumpnpp_10t.pdb, mtb <br />
load omit_twin_out.xplor, 1fofc<br />
<br />
# show e-density nearby<br />
# show positive contours of the map 4.2 sigma or higher within 18 angstroms of residue 170 of chain C<br />
isomesh pos, 1fofc, 4.2, (resid 170 and chain C ), 18.0<br />
color marine, pos<br />
# show negative contours of the map -4.2 sigma or lower within 18 angstroms of residue 170 of chain C<br />
isomesh neg, 1fofc, -4.2, (resid 170 and chain C ), 18.0<br />
color red, neg<br />
<br />
cartoon automatic<br />
hide nonbonded<br />
hide lines <br />
<br />
color white, (chain A or chain B or chain C) and (n;ca)<br />
color yellow, (resid 171) or (n;PA) or (n;PB) or (n;PG)<br />
color white, (elem C)<br />
#magnesium<br />
show sphere, (resid 171)<br />
color green, (resid 171)<br />
#waters<br />
show sphere, (resid 173:175 or resid 212)<br />
show sticks, (chain C and resid 170)<br />
show sticks, (chain A and resid 83 and not n;n,c,o )<br />
show sticks, (chain C and resid 24 and not n;n,c,o)<br />
show sticks, (chain C and resid 28 and not n;n,c,o)<br />
show sticks, (chain C and resid 64 and not n;n,c,o)<br />
show sticks, (chain C and resid 113 and not n;n,c,o)<br />
show sticks, (chain C and resid 64:66 )<br />
<br />
distance (resid 171 and chain C), (resid 173 and chain C)<br />
distance (resid 171 and chain C), (resid 174 and chain C)<br />
distance (resid 171 and chain C), (resid 175 and chain C)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1A)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1B)<br />
distance (resid 171 and chain C), (resid 170 and chain C and n;O1G)<br />
distance (resid 173 and chain C), (resid 28 and chain C and n;OD2)<br />
distance (resid 174 and chain C), (resid 28 and chain C and n;OD1)<br />
distance (resid 175 and chain C), (resid 24 and chain C and n;OD2)<br />
distance (resid 212 and chain A), (resid 170 and chain C and n;PA)<br />
distance (resid 212 and chain A), (resid 113 and chain C and n;OE1)<br />
distance (resid 212 and chain A), (resid 83 and chain A and n;OD2)<br />
distance (resid 113 and chain C and n;ne2), (resid 170 and chain C and n;O3A)<br />
distance (resid 65 and chain C and n;N), (resid 170 and chain C and n;O3A)<br />
distance (resid 65 and chain C and n;OG), (resid 170 and chain C and n;N2A)<br />
distance (resid 66 and chain C and n;N), (resid 170 and chain C and n;O3B)<br />
distance (resid 64 and chain C and n;NH2), (resid 170 and chain C and n;O1B)<br />
distance (resid 64 and chain C and n;NE), (resid 170 and chain C and n;O1B)<br />
distance (resid 83 and chain A and n;OD2), (resid 170 and chain C and n;O3')<br />
color yellow, dist*<br />
color red, dist10<br />
<br />
hide labels<br />
<br />
set_view (\<br />
-0.350610733, 0.599414885, -0.719504118,\<br />
-0.160659447, -0.795388758, -0.584337831,\<br />
-0.922586679, -0.089291766, 0.375185639,\<br />
0.002084959, 0.000028796, -51.327602386,\<br />
14.307765961, 9.915379524, 17.268175125,\<br />
42.648197174, 61.923065186, 0.000000000 )<br />
<br />
turn y, 3.5<br />
viewport 1000, 1000<br />
<br />
#ray<br />
#png density-left.png<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 5:''' Interfaces (&ge; intermediate)</div>==<br />
<br />
[[File:Interface02 labeled.png|250px|thumb|left|alt text]]<br />
<br />
Illustration of an intermolecular interface from the PE-PPE protein complex from Mycobacterium tuberulosis (PDB ID 2G38). The left panel illustrates the complex between PE and PPE proteins as a cartoon ribbon. The two proteins are colored separately to make the interface evident. Hydrophobic side chains involved in the interface are labeled. The right panel illustrates the complementary surfaces of the interface by splitting the complex apart like a clamshell. The smaller protein is the PE protein, the larger protein is the PPE protein. Warm colors indicate strong hydrophobicity; cool colors depict weak hydrophobicity. The left and right panels are depicted on the same scale so the viewer can see how residues labeled on the left correspond to red patches in the surface on the right.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT -for Intermolecular Interface<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
set direct =0.3<br />
set transparency=0.0<br />
set ray_trace_mode=0<br />
set sphere_transparency=0.0<br />
set light_count=2<br />
set ray_shadow=on<br />
set ray_shadows=on<br />
set orthoscopic = on<br />
set opaque_background,0<br />
# control the position of the light so shadows are cast<br />
# in cavities of the molecular surface<br />
set light =[ -0.50000, -0.70000, -0.750000 ]<br />
<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.8<br />
set line_radius = 0.01<br />
set sphere_scale = 0.35<br />
set cartoon_rect_width=0.5<br />
set cartoon_rect_length=2.2<br />
set cartoon_loop_radius=0.4<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load pe-trans-hydrofob.pdb, pe<br />
load ppe-trans-hydrofob.pdb, ppe<br />
load pe-rot-hydrofob.pdb, pe-hydrofob<br />
load ppe-rot-hydrofob.pdb, ppe-hydrofob<br />
<br />
# show cartoon ribbons<br />
show cartoon, pe or ppe<br />
show surface, pe-hydrofob or ppe-hydrofob<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
cartoon automatic<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then uncomment the following<br />
# line to detect secondary structure.<br />
# util.ss 1a2w<br />
# Warning, very coarse approximation.<br />
# Or get secondary structure assignments from dssp<br />
# http://swift.cmbi.kun.nl/gv/dssp/<br />
# Then convert assignments into a PDB header<br />
# http://structure.usc.edu/dssp2pdb/<br />
#If you want to define secondary structure manually, <br />
#Use the following syntax<br />
#alter B/753:758/, ss='S'<br />
<br />
<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
<br />
<br />
# hydrophobicity values are printed in the B-factor column<br />
# of the pdb file. So, color by B-factor.<br />
cmd.spectrum("b",selection=("pe-hydrofob"),quiet=0)<br />
cmd.spectrum("b",selection=("ppe-hydrofob"),quiet=0)<br />
cmd.spectrum("b",selection=("pe"),quiet=0)<br />
cmd.spectrum("b",selection=("ppe"),quiet=0)<br />
<br />
color white, ppe <br />
color gray, pe <br />
<br />
# Show spheres for cysteine sulfurs<br />
show spheres, name sg <br />
<br />
# Show sticks for bonds<br />
show sticks, (resn cys) and not (name n,c,o)<br />
<br />
show sticks, chain B and (resid 31 or resid 167 or resid 74 or resid 78 or resid 71 or resid 45 or resid 173) and not (name n or name c or name o)<br />
show sticks, chain A and (resid 58 or resid 54 or resid 76 or resid 73) and not (name n or name c or name o)<br />
<br />
hide labels<br />
<br />
set_view (\<br />
-0.881387651, -0.417317063, 0.221362144,\<br />
0.171217963, 0.154523358, 0.973037899,\<br />
-0.440271527, 0.895526111, -0.064742655,\<br />
0.000100300, -0.000183796, -328.588287354,\<br />
4.581910610, 13.162490845, 90.285400391,\<br />
270.283447266, 386.892944336, 1.000000000 )<br />
<br />
<br />
viewport 600, 700<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 6:''' Large-scale structures, best-fit planes (&ge; intermediate/advanced)</div>==<br />
<br />
[[File:SvdEm.jpg|250px|thumb|left|Fig. 6: svdPLoS &ndash; Compute and display the best-fit plane to a membrane bilayer.]]<br />
<br />
As an advanced biomolecular graphics example, this figure illustrates the results from computing and rendering the best-fit plane to a set of atoms. Such a problem arises in many contexts, including membrane proteins and the lipid bilayers in which they are embedded. As described in the article, the plane was calculated via SVD on the phosphate atoms (orange spheres) of one leaflet of this POPC bilayer, and is rendered as a semi-transparent orange surface. To represent this plane, we chose the minimal-area rectangle that contained all projections of the points onto the plane. The two leaflets are shown as wireframes, with a single lipid shown as CPK spheres; carbons are colored wheat in one leaflet and light grey in the other. The three singular vectors from SVD correspond to the bilayer normal (z-direction) and the two vectors which span the subspace defining the 2D plane of best fit (‘best’ in the sense of linear least-squares minimization of the deviation of z-coordinates of all atoms from the plane).<br />
<br />
<br />
<source lang="python"><br />
# --- BEGIN PYTHON SCRIPT - Higher-order structures and plane-fitting --- #<br />
# using the array module for efficient arrays of numeric values<br />
from array import *<br />
<br />
# system stuff<br />
import os, sys, string<br />
import copy<br />
<br />
# pretty printing<br />
import pprint<br />
<br />
# for importing as a plugin into PyMol<br />
from pymol import cmd<br />
from pymol import stored<br />
from pymol import selector<br />
from pymol.cgo import *<br />
<br />
# using numpy for linear algebra<br />
import numpy<br />
<br />
def svdEm(sel1, zsize=0.75, width=10):<br />
cmd.reset()<br />
# make the lists for holding coordinates<br />
# partial lists (subset of atoms selected for calculation)<br />
stored.sel1 = []<br />
# full lists (the whole molecular entity)<br />
stored.mol1 = []<br />
<br />
# Get the selected coordinates for the best-fit plane<br />
cmd.iterate_state(1, selector.process(sel1), "stored.sel1.append([x,y,z])")<br />
<br />
# Get molecule name<br />
mol1 = cmd.identify(sel1,1)[0][0]<br />
<br />
# Get all molecule coords. We do this because we have to transform the whole<br />
# molcule, not just the selected subset, and then make sure that at least 3<br />
# atoms are selected (3 pts, assuming non-colinearity, are required to form a plane):<br />
cmd.iterate_state(1, mol1, "stored.mol1.append([x,y,z])")<br />
assert( len(stored.sel1) >= 3 )<br />
<br />
# Center the atom selection to avoid affine transformations;<br />
# in particular, center to the selection of interest:<br />
COM1 = numpy.sum(stored.sel1,axis=0) / float(len(stored.sel1))<br />
stored.sel1 = stored.sel1 - COM1<br />
sele = map(None, stored.sel1)<br />
<br />
# V and M are the orthonormal bases, and S provides the singular values.<br />
V, S, M = numpy.linalg.svd( numpy.dot( numpy.transpose(stored.sel1), stored.sel1))<br />
<br />
# We already have our solution, in the results from SVD.<br />
# We just need to check for reflections and then produce<br />
# the rotation. V and M are orthonormal, so their det's<br />
# are +/-1.<br />
reflect = float(str(float(numpy.linalg.det(V) * numpy.linalg.det(M))))<br />
if reflect == -1.0:<br />
S[-1] = -S[-1]<br />
V[:,-1] = -V[:,-1]<br />
<br />
# center the molecule<br />
stored.sel1 = stored.mol1 - COM1<br />
stored.sel1 = stored.sel1.tolist()<br />
<br />
# update the coordinates with the new ones in the PyMOL molecular object<br />
cmd.alter_state(1,mol1,"(x,y,z)=stored.sel1.pop(0)")<br />
cmd.center('visible')<br />
cmd.orient()<br />
<br />
# find the convex hull of the projections of the selected points on the plane<br />
hull = (numpy.transpose(numpy.matrix(numpy.delete(V,2,1))*numpy.transpose(convexHull(numpy.transpose(numpy.matrix(numpy.transpose(numpy.delete(V,2,1)))*numpy.transpose(sele)).tolist())))).tolist()<br />
<br />
# Since the minimum rectangle that contains all the selected points (their projections<br />
# on the plane) MUST have an edge on the convex hull edge, we redefine our coordinate<br />
# system (basis vectors of the plane [the orthogonal vector to the plane is fixed]) and<br />
# calculate the max and min pts and the rectangle they form, keeping track of the global<br />
# minimum-area rectancle and its basis vectors and max/min pts<br />
for i in xrange(-1,len(hull)-1):<br />
v1 = (numpy.array(hull[i+1]) - numpy.array(hull[i])) / numpy.linalg.norm(numpy.array(hull[i+1]) - numpy.array(hull[i]))<br />
v2 = numpy.cross(V[:,2],v1) / numpy.linalg.norm(numpy.cross(V[:,2],v1))<br />
v1ls = map(lambda x: numpy.vdot(x,v1), hull)<br />
v2ls = map(lambda x: numpy.vdot(x,v2), hull)<br />
if i==-1 or (max(v1ls) - min(v1ls))*(max(v2ls) - min(v2ls)) < minimum_rect_area:<br />
minimum_rect_area = (max(v1ls) - min(v1ls))*(max(v2ls) - min(v2ls))<br />
minimum_rect_area_vec1 = v1<br />
minimum_rect_area_vec2 = v2<br />
max_rect_vec1 = max(v1ls)<br />
min_rect_vec1 = min(v1ls)<br />
max_rect_vec2 = max(v2ls)<br />
min_rect_vec2 = min(v2ls)<br />
<br />
# Create the coordinate system matrix (3x3 in R3) that corresponds to a set of basis<br />
# vectors orthogonal to the rectangle edges<br />
V = numpy.array([[minimum_rect_area_vec1[0],minimum_rect_area_vec2[0],V[0,2]],[minimum_rect_area_vec1[1],minimum_rect_area_vec2[1],V[1,2]],[minimum_rect_area_vec1[2],minimum_rect_area_vec2[2],V[2,2]]])<br />
least_mag = min(max_rect_vec1, max_rect_vec2)<br />
<br />
# Now draw the vecs and the plane<br />
drawVecs(V,list(max_rect_vec1*minimum_rect_area_vec1),list(max_rect_vec2*minimum_rect_area_vec2),zsize,least_mag,width)<br />
drawTriFan(list((max_rect_vec1*minimum_rect_area_vec1)+(max_rect_vec2*minimum_rect_area_vec2)),list((max_rect_vec1*minimum_rect_area_vec1)+(min_rect_vec2*minimum_rect_area_vec2)),list((min_rect_vec1*minimum_rect_area_vec1)+(min_rect_vec2*minimum_rect_area_vec2)),list((min_rect_vec1*minimum_rect_area_vec1)+(max_rect_vec2*minimum_rect_area_vec2)))<br />
cmd.zoom('visible')<br />
<br />
def drawTriFan(v1, v2, v3, v4):<br />
mycgofan = []<br />
mycgofan = [BEGIN,TRIANGLE_FAN]<br />
mycgofan.extend([COLOR]+[0.3,0.7,0.4])<br />
mycgofan.extend([VERTEX] + v1)<br />
mycgofan.extend([VERTEX] + v2)<br />
mycgofan.extend([VERTEX] + v3)<br />
mycgofan.extend([VERTEX] + v4)<br />
mycgofan.append(END)<br />
mycgofan.extend([SPHERE, 0., 0., 0., 0.3])<br />
cmd.load_cgo(mycgofan, 'myTriFan')<br />
<br />
def drawVecs(V, v1, v2, zsize, least_mag, width):<br />
tail = [CYLINDER, 0, 0, 0, v1[0] + 2*(v1/numpy.linalg.norm(v1))[0], v1[1] + 2*(v1/numpy.linalg.norm(v1))[1], v1[2] + 2*(v1/numpy.linalg.norm(v1))[2], 0.04*width, 0.9, 0.2, 0.2, 0.9, 0.2, 0.2]<br />
head = [CONE, v1[0] + 2*(v1/numpy.linalg.norm(v1))[0], v1[1] + 2*(v1/numpy.linalg.norm(v1))[1], v1[2] + 2*(v1/numpy.linalg.norm(v1))[2], v1[0] + 5*(v1/numpy.linalg.norm(v1))[0], v1[1] + 5*(v1/numpy.linalg.norm(v1))[1], v1[2] + 5*(v1/numpy.linalg.norm(v1))[2], 0.07*width, 0.0, 0.9, 0.2, 0.2, 0.9, 0.2, 0.2, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_1')<br />
tail = [CYLINDER, 0, 0, 0, v2[0] + 2*(v2/numpy.linalg.norm(v2))[0], v2[1] + 2*(v2/numpy.linalg.norm(v2))[1], v2[2] + 2*(v2/numpy.linalg.norm(v2))[2], 0.04*width, 0.2, 0.9, 0.2, 0.2, 0.9, 0.2]<br />
head = [CONE, v2[0] + 2*(v2/numpy.linalg.norm(v2))[0], v2[1] + 2*(v2/numpy.linalg.norm(v2))[1], v2[2] + 2*(v2/numpy.linalg.norm(v2))[2], v2[0] + 5*(v2/numpy.linalg.norm(v2))[0], v2[1] + 5*(v2/numpy.linalg.norm(v2))[1], v2[2] + 5*(v2/numpy.linalg.norm(v2))[2], 0.07*width, 0.0, 0.2, 0.9, 0.2, 0.2, 0.9, 0.2, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_2')<br />
tail = [CYLINDER, 0, 0, 0, zsize*least_mag*V[0,2], zsize*least_mag*V[1,2], zsize*least_mag*V[2,2], 0.04*width, 0.2, 0.2, 0.9, 0.2, 0.2, 0.9]<br />
head = [CONE, zsize*least_mag*V[0,2], zsize*least_mag*V[1,2], zsize*least_mag*V[2,2], zsize*least_mag*V[0,2] + 3*V[0,2], zsize*least_mag*V[1,2] + 3*V[1,2], zsize*least_mag*V[2,2] + 3*V[2,2], 0.07*width, 0.0, 0.2, 0.2, 0.9, 0.2, 0.2, 0.9, 1.0, 1.0]<br />
cmd.load_cgo(tail + head,'vec_3')<br />
<br />
def convexHull(P):<br />
# Get a local list copy of the points and sort them lexically.<br />
# Build the upper and then lower half of the hull, remove duplicates,<br />
# and return a concatenation of both halfs.<br />
points = map(None, P)<br />
points.sort()<br />
upper = [points[0], points[1]]<br />
for p in points[2:]:<br />
upper.append(p)<br />
while len(upper) > 2 and not _isRightTurn(upper[-3:]):<br />
del upper[-2]<br />
points.reverse()<br />
lower = [points[0], points[1]]<br />
for p in points[2:]:<br />
lower.append(p)<br />
while len(lower) > 2 and not _isRightTurn(lower[-3:]):<br />
del lower[-2]<br />
del lower[0]<br />
del lower[-1]<br />
return tuple(upper + lower)<br />
<br />
def _isRightTurn((p, q, r)):<br />
assert p != q and q != r and p != r <br />
if numpy.linalg.det([[1,1,1],[p[0],q[0],r[0]],[p[1],q[1],r[1]]]) < 0:<br />
return 1<br />
else:<br />
return 0<br />
<br />
cmd.extend("svdEm", svdEm)<br />
cmd.extend("drawTriFan", drawTriFan)<br />
# --- END PYTHON SCRIPT --- #<br />
# Thanks to Dinu C. Gherman for his convexHull script which we used and modified.<br />
# Since all PyMOL selections are unique, we need not worry, but if the list is<br />
# NOT UNIQUE, use a dictionary and set the key values to 1.<br />
<br />
</source><br />
<br />
{{div10}}<br />
==<div style="background-color:#eeecde; margin-top:0px;border-bottom: 0px dotted #999999; padding-top:3px;font-weight:normal;">'''Case 7:''' Animations (&ge; intermediate/advanced)</div>==<br />
See the [[#Animations | Animations]] section below.<br />
<br />
{{div15}}<br />
='''Animations'''=<br />
<br />
== <span style="font-weight:normal;">A classification scheme</span> ==<br />
The possible types of 3D figures and animations are enumerated in Table 1. Below the symbol for each category is a tangible example of that particular type of illustration. The principles and practices used to create superb static figures (''i.e.'', M<sub>s</sub>V<sub>s</sub>) also apply to the design and rendering of animations, each frame of which can be essentially considered a stand-alone figure.<br />
<br />
{|border="0" style="width:45%; border-collapse:collapse;"<br />
|<br />
|<br />
|colspan="2" align="center" style="border-left:1px solid rgb(180,180,180);border-top:1px solid rgb(180,180,180);border-right:1px solid rgb(180,180,180);background-color:rgb(245,245,245);"|Coordinates of molecular entities ('M')<br />
|-<br />
|<br />
|<br />
|align="center" style="border-left:1px solid rgb(180,180,180);border-bottom:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:1px 0px 2px 0px;"| ''static''<br />
|align="center" style="border-right:1px solid rgb(180,180,180);border-bottom:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:1px 0px 2px 0px;"| ''dynamic''<br />
|-<br />
|rowspan="2" style="text-align:center;border-top:1px solid rgb(180,180,180);border-left:1px solid rgb(180,180,180);border-bottom:1px solid rgb(180,180,180);background-color:rgb(245,245,245);"| Viewpoint ('V')<br />
|align="center" style="border-top:1px solid rgb(180,180,180);border-right:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:0px 5px 0px 0px;"| ''static'' <br />
|align="center" | '''M<sub>s</sub>V<sub>s</sub>'''<br /><span style="font-size:x-small;">A standard (static) molecular illustration</span><br />
|align="center" style="border-right:2px solid rgb(100,100,100);" | '''M<sub>d</sub>V<sub>s</sub>'''<br /><span style="font-size:x-small;">Visualize an MD trajectory from a single/fixed viewpoint</span><br />
|-<br />
|align="center" style="border-bottom:1px solid rgb(180,180,180);border-right:2px solid rgb(100,100,100);background-color:rgb(245,245,245);padding:0px 5px 0px 0px;" | ''dynamic''<br />
|align="center" style="border-bottom:2px solid rgb(100,100,100);" | '''M<sub>s</sub>V<sub>d</sub>'''<br /><span style="font-size:x-small;">A rotating camera 'scan' of the molecular objects</span><br />
|align="center" style="border-bottom:2px solid rgb(100,100,100); border-right:2px solid rgb(100,100,100);" | '''M<sub>d</sub>V<sub>d</sub>'''<br /><span style="font-size:x-small;">Visualize a trajectory from dynamically changing viewpoints</span><br />
|+ align="bottom" style="font-size:110%;font-family:serif;font-weight:normal;text-align:left;" | '''Table 1''': A classification of figures &amp; animations.<br />
|}<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>s</sub>V<sub>s</sub> &mdash; Molecule is static, View is static</span> ==<br />
These are simply the 'ordinary', static figures illustrated by most of the case studies in this tutorial.<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>s</sub>V<sub>d</sub> &mdash; Molecule is static, View is dynamic</span> ==<br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>d</sub>V<sub>s</sub> &mdash; Molecule is dynamic, View is static</span> ==<br />
<br />
[[File:Movie.gif|200px|thumb|left|Movie of a DNA helicase unwinding dsDNA (animated GIF format)]]<br />
A movie illustrating conformational changes in a helicase as it unwinds double stranded DNA.<br />
<br />
<source lang="python"><br />
#BEGIN PYMOL SCRIPT<br />
# antialias =1 smooths jagged edges, 0 turns it off<br />
set antialias = 1<br />
set ambient = 0.3<br />
set light_count = 6<br />
<br />
# stick_radius -adjust thickness of atomic bonds<br />
set stick_radius = 0.6<br />
set sphere_scale = 0.5<br />
set cartoon_rect_width=0.9<br />
set cartoon_rect_length=2.0<br />
set cartoon_loop_radius=0.5<br />
# mesh_radius -to adjust thickness of electron<br />
# density contours<br />
set mesh_radius = 0.02<br />
<br />
# bg_color --set the background color<br />
bg_color white<br />
<br />
# load pdb file and give it an object name<br />
load ff01.pdb,mov,1<br />
load ff02.pdb,mov,2<br />
load ff03.pdb,mov,3<br />
load ff04.pdb,mov,4<br />
load ff05.pdb,mov,5<br />
load ff06.pdb,mov,6<br />
load ff07.pdb,mov,7<br />
load ff08.pdb,mov,8<br />
load ff09.pdb,mov,9<br />
load ff10.pdb,mov,10<br />
load ff11.pdb,mov,11<br />
load ff12.pdb,mov,12<br />
load ff13.pdb,mov,13<br />
load ff14.pdb,mov,14<br />
load ff15.pdb,mov,15<br />
load ff16.pdb,mov,16<br />
load ff17.pdb,mov,17<br />
load ff18.pdb,mov,18<br />
load ff19.pdb,mov,19<br />
load ff20.pdb,mov,20<br />
load ff21.pdb,mov,21<br />
load ff22.pdb,mov,22<br />
load ff23.pdb,mov,23<br />
load ff24.pdb,mov,24<br />
load ff25.pdb,mov,25<br />
load ff26.pdb,mov,26<br />
load ff27.pdb,mov,27<br />
load ff28.pdb,mov,28<br />
load ff29.pdb,mov,29<br />
load ff30.pdb,mov,30<br />
<br />
<br />
<br />
# hide nonbonded atoms (i.e. waters)<br />
hide nonbonded<br />
<br />
# show cartoon ribbons<br />
show cartoon, chain a<br />
<br />
# Hide the default line representation of atomic bonds<br />
hide lines<br />
<br />
# Use standard helix, strand, and loop representations<br />
# other possibilities: cartoon loop, cartoon rect,<br />
# cartoon oval, and cartoon tube<br />
cartoon automatic<br />
<br />
# If you dont have secondary structure assignments<br />
# in the PDB header then uncomment the following<br />
# line to detect secondary structure.<br />
# Warning, very coarse approximation.<br />
# Or get header from http://www.mbfys.lu.se/Services/SecStr/<br />
#util.ss 1a2w<br />
<br />
# Make fancy helices with ridge on the edges like<br />
# molscript does<br />
# 1 is on. 0 is off.<br />
set cartoon_fancy_helices=1<br />
<br />
# Make the strands flat=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a strand<br />
set cartoon_flat_sheets = 1.0<br />
<br />
# Draw the loops smooth=1 or pass through CA positions=0<br />
# Set to 0 when showing side chains from a loop<br />
set cartoon_smooth_loops = 0<br />
<br />
# Set the color of the residues<br />
# to find the names of the colors available<br />
# click on the rainbow colored square in the<br />
# upper right corner of the graphics window<br />
util.chainbow("(mov)")<br />
<br />
# Show spheres for chloride ions<br />
#show spheres, name sg <br />
<br />
# Show sticks for bonds<br />
#show sticks, (resn cys) and not (name n,c,o)<br />
show sticks, resn atp or resn po4<br />
show sticks, resn adp or chain e or chain d<br />
show sticks, (resid 540 or resid 563 or resid 545 or resid 377 or resid 358 or resid 335 or resid 373 or resid 475 or resid 483 or resid 485) and not (name c or name o or name n)<br />
hide cartoon, chain e or chain d or resn atp or resn adp or resn po4<br />
<br />
color red, elem o<br />
color blue, elem n<br />
color gray, chain d<br />
color white, chain e<br />
color orange, elem p<br />
color gray, elem c and (resn po4 or resn adp or resn atp)<br />
color firebrick, elem o and (name o1p or name o2p or name o3' or name o5')<br />
unbond resn po4, resn adp<br />
<br />
#alter B/753:758/, ss='S'<br />
<br />
# set up simple rotation commands<br />
<br />
mset 1 - 15<br />
<br />
### cut below here and paste into script ###<br />
set_view (\<br />
0.017624758, -0.997306943, -0.071203344,\<br />
-0.656398058, 0.042179316, -0.753232718,\<br />
0.754207492, 0.060014214, -0.653885424,\<br />
0.000000950, -0.000033716, -206.950531006,\<br />
45.939758301, 43.484542847, 46.991050720,\<br />
159.799530029, 216.515686035, 0.000000000 )<br />
### cut above here and paste into script ###<br />
<br />
<br />
<br />
#set ray_trace_mode=3<br />
viewport 700,500<br />
<br />
#### make output directory (NOTE: preceeding "/" = literal python)<br />
<br />
/if not os.path.exists("png"): os.mkdir("png")<br />
<br />
####enable raytracing<br />
<br />
set ray_trace_frames=1<br />
set cache_frame=0<br />
<br />
#### render<br />
<br />
mpng png/mov<br />
</source><br />
<br />
{{div10}}<br />
== <span style="font-weight:normal;">M<sub>d</sub>V<sub>d</sub> &mdash; Molecule is dynamic, View is dynamic</span> ==<br />
<br />
{{div15}}<br />
='''Useful links'''=<br />
<br />
A compilation of links and other online resources that were helpful in creating these examples. Please edit as you see fit.<br />
<br />
== <span style="font-weight:normal;">PyMOL-related</span> ==<br />
* PyMOL's list of links to user-maintained script collections, tutorials, ''etc.'' - http://pymol.org/links.html<br />
<br />
== <span style="font-weight:normal;">Python-related</span> ==<br />
<br />
== <span style="font-weight:normal;">General MolVis</span> ==<br />
<br />
* Conceptual background<br />
** Useful general info (historical &amp; conceptual), links, ''etc.'' - http://en.wikipedia.org/wiki/Molecular_graphics<br />
** The "''graphics pipeline''" - http://en.wikipedia.org/wiki/Graphics_pipeline<br />
<br />
* Historical background &amp; significance<br />
** Martz &amp; Francoeur's online history of MolVis - http://www.umass.edu/microbio/rasmol/history.htm<br />
** Levinthal's account of the early days - <br />
<br />
* Individual pages, script repositories, ''etc.''<br />
** Lev Gelb's (WashU) MolVis page - http://www.chemistry.wustl.edu/~gelb/visualization.html<br />
<br />
{{div15}}<br />
='''Input files, raw data'''=<br />
The following tarball provides all of the input files referred to in the above scripts &mdash; coordinate files (<tt>.pdb</tt>), electron density maps (<tt>.xplor</tt>), ''etc.''<br />
* <tt>[[Media:PLoS_BiomolGraph_2010_InputFiles.tar.bz2|PLoS_BiomolGraph_2010_InputFiles.tar.bz2]]</tt> (2.1M)<br />
* To extract the archive on Unix/Linux, issue the following command at the prompt ("$]"):<br />$] <tt>tar jxvf PLoS_BiomolGraph_2010_InputFiles.tar.bz2</tt><br />
<br />
{{div15}}<br />
='''Abbreviations, symbols'''=<br />
The following abbreviations, acronyms, or other symbols may be encountered on this wiki page:<br />
* "dsDNA" = double-stranded DNA<br />
* "API" = '''A'''pplication '''P'''rogramming '''I'''nterface</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9609Palette Colorbars2011-11-30T07:29:30Z<p>James: </p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_green''<br />
::[[File:Colorbar-blue_green.png|300px]]<br />
<br />
''blue_magenta''<br />
::[[File:Pymol-blue_magenta.png|300px]]<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png|300px]]<br />
<br />
''blue_white_green''<br />
::[[File:Pymol-blue_white_green.png|300px]]<br />
<br />
''blue_white_magenta''<br />
::[[File:Pymol-blue_white_magenta.png|300px]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png|300px]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png|300px]]<br />
<br />
= See Also =<br />
* [[Color]]<br />
* [[Spectrum]]<br />
<br />
<br />
[[Category:Coloring]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-blue_white_magenta.png&diff=9608File:Pymol-blue white magenta.png2011-11-30T07:28:42Z<p>James: Pymol blue_white_magenta colorbar</p>
<hr />
<div>Pymol blue_white_magenta colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9606Palette Colorbars2011-11-30T00:34:05Z<p>James: </p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_green''<br />
::[[File:Colorbar-blue_green.png|300px]]<br />
<br />
''blue_magenta''<br />
::[[File:Pymol-blue_magenta.png|300px]]<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png|300px]]<br />
<br />
''blue_white_green''<br />
::[[File:Pymol-blue_white_green.png|300px]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png|300px]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png|300px]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-blue_white_green.png&diff=9605File:Pymol-blue white green.png2011-11-30T00:32:58Z<p>James: Pymol blue_white_green colorbar</p>
<hr />
<div>Pymol blue_white_green colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9604Palette Colorbars2011-11-30T00:30:39Z<p>James: /* Contributed Public Domain Colorbars */</p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_green''<br />
::[[File:Colorbar-blue_green.png|300px]]<br />
<br />
''blue_magenta''<br />
::[[File:Pymol-blue_magenta.png|300px]]<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png|300px]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png|300px]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png|300px]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-blue_magenta.png&diff=9603File:Pymol-blue magenta.png2011-11-30T00:30:05Z<p>James: Pymol blue_magenta colorbar</p>
<hr />
<div>Pymol blue_magenta colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9602Palette Colorbars2011-11-30T00:23:17Z<p>James: </p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_green''<br />
::[[File:Colorbar-blue_green.png|300px]]<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png|300px]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png|300px]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png|300px]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Colorbar-blue_green.png&diff=9601File:Colorbar-blue green.png2011-11-29T23:19:01Z<p>James: Pymol blue_green colorbar</p>
<hr />
<div>Pymol blue_green colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9600Palette Colorbars2011-11-29T23:17:25Z<p>James: /* Contributed Public Domain Colorbars */</p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png|300px]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png|300px]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png|300px]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9599Palette Colorbars2011-11-29T23:13:52Z<p>James: </p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png]]<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9598Palette Colorbars2011-11-29T23:11:11Z<p>James: /* Contributed Public Domain Colorbars */</p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]<br />
<br />
<br />
''blue_red''<br />
::[[File:Pymol-blue_red.png]]<br />
<br />
<br />
<br />
''red_blue''<br />
::[[File:Pymol-red_blue.png]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-blue_red.png&diff=9597File:Pymol-blue red.png2011-11-29T23:09:58Z<p>James: Pymol blue_red colorbar</p>
<hr />
<div>Pymol blue_red colorbar</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-rainbow.png&diff=9596File:Pymol-rainbow.png2011-11-29T23:07:18Z<p>James: uploaded a new version of &quot;File:Pymol-rainbow.png&quot;: Pymol rainbow colorbar</p>
<hr />
<div>Pymol rainbow colorbar</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-red_blue.png&diff=9595File:Pymol-red blue.png2011-11-29T23:06:46Z<p>James: Pymol red_blue colorbar</p>
<hr />
<div>Pymol red_blue colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=9502Iterate2011-10-12T19:50:02Z<p>James: /* Example */</p>
<hr />
<div>'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
= Details = <br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object (see [[#PYMOL API]] below for usage of local objects). For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
===Note about Atom Coordinates===<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To inspect the coordinates of the atoms, see [[Iterate_State]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
====Example====<br />
*The following example shows a common task in PyMOL, changing the B-factor column to display some other property. Let's assume you have a file with a list of numbers, one per line, for each alpha carbon in the protein. Furthermore, assume you want to map these values to the alpha carbons in the protein.<br />
<source lang="python"><br />
# set ALL b-factors to 0.<br />
alter protName, b=0<br />
<br />
# read the new bfactors from disk<br />
f = open('fileName','r').readlines()<br />
<br />
# set the alpha carbon bfactors.<br />
alter protName and n. CA, b=f.pop(0)<br />
<br />
# Spectrum color bfactors by alpha carbons.<br />
spectrum b, selection=(protName and n. CA)<br />
</source><br />
<br />
=== PYMOL API ===<br />
<br />
<source lang="python"><br />
cmd.iterate(string selection, string expression, int quiet=1, dict space=None)<br />
</source><br />
<br />
When calling iterate, iterate_state, alter or alter_state from a python script, you can use the 'space' argument to pass local objects into the expression namespace.<br />
<br />
The second example from above but without the global pymol.stored variable:<br />
<br />
<source lang="python"><br />
myspace = {'names': []}<br />
cmd.iterate('(all)', 'names.append(name)', space=myspace)<br />
</source><br />
<br />
User defined functions can also be included in the namespace:<br />
<br />
<source lang="python"><br />
def myfunc(resi,resn,name):<br />
print '%s`%s/%s' % (resn ,resi, name)<br />
<br />
myspace = {'myfunc': myfunc}<br />
cmd.iterate('(all)', 'myfunc(resi,resn,name)', space=myspace)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Iterate_State]], [[Alter]], [[Alter_State]], [[Color]], [[Color#Color_by_Spectrum_Example|Coloring with different color sprectrums]].<br />
<br />
[[Category:Commands|Iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9501Palette Colorbars2011-10-11T23:21:15Z<p>James: </p>
<hr />
<div>The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum#Notes|Spectrum]] page.<br />
<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9500Palette Colorbars2011-10-11T23:20:18Z<p>James: </p>
<hr />
<div><br />
The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum|Spectrum#Notes]] page.<br />
<br />
== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9499Palette Colorbars2011-10-11T23:18:00Z<p>James: </p>
<hr />
<div>== Contributed Public Domain Colorbars ==<br />
<br />
The palette colorbars herein correspond to the palettes enumerated on the [[Spectrum]] page.<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9498Palette Colorbars2011-10-11T23:16:44Z<p>James: </p>
<hr />
<div>== Contributed Public Domain Colorbars ==<br />
<br />
These colorbars are placed in the public domain and may be used in any publication freely.<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Palette_Colorbars&diff=9497Palette Colorbars2011-10-11T23:02:51Z<p>James: Started page and added rainbow colorbar</p>
<hr />
<div>== Contributed Colorbars ==<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=Help:Editing&diff=9496Help:Editing2011-10-11T23:02:28Z<p>James: Deleted content, belonged on different page, added by accident.</p>
<hr />
<div></div>Jameshttps://pymolwiki.org/index.php?title=Help:Editing&diff=9495Help:Editing2011-10-11T23:01:13Z<p>James: Added rainbow colorbar</p>
<hr />
<div>== Contributed Colorbars ==<br />
<br />
''rainbow''<br />
::[[File:Pymol-rainbow.png]]</div>Jameshttps://pymolwiki.org/index.php?title=File:Pymol-rainbow.png&diff=9494File:Pymol-rainbow.png2011-10-11T22:59:37Z<p>James: Pymol rainbow colorbar</p>
<hr />
<div>Pymol rainbow colorbar</div>Jameshttps://pymolwiki.org/index.php?title=Spectrum&diff=9493Spectrum2011-10-11T22:55:25Z<p>James: Adding link to new page "Palette Colorbars" that will have colorbars for the various palettes.</p>
<hr />
<div>[[Image:Spectrum_ex2.png|right|thumb|185px]]<br />
= Overview =<br />
[[Spectrum]] colors atoms with a spectrum of colors based on an atomic property.<br />
<br />
= Usage =<br />
<source lang="python"><br />
spectrum [expression [, palette [, selection [, minimum [, maximum [, byres ]]]]]]<br />
</source><br />
<br />
''expression''<br />
::count, b, q, or pc: respectively, atom count, temperature factor, occupancy, or partial charge {default: count}<br />
<br />
''palette''<br />
::string: palette name {default: rainbow}<br />
<br />
''selection''<br />
::string: atoms to color {default: (all)}<br />
<br />
''minimum''<br />
::float: {default: None (automatic)}<br />
<br />
''maximum''<br />
::float: {default: None (automatic)}<br />
<br />
''byres''<br />
::integer: controls whether coloring is applied per-residue {default: 0}<br />
<br />
= Notes =<br />
Minimum and maximum are determined automatically unless '''both''' arguments are provided and ''minimum < maximum''.<br />
<br />
Available palettes include:<br />
*blue_green<br />
*blue_magenta <br />
*blue_red<br />
*blue_white_green<br />
*blue_white_magenta<br />
*blue_white_red<br />
*blue_white_yellow<br />
*blue_yellow<br />
*cbmr<br />
*cyan_magenta<br />
*cyan_red<br />
*cyan_white_magenta<br />
*cyan_white_red<br />
*cyan_white_yellow <br />
*cyan_yellow<br />
*gcbmry<br />
*green_blue<br />
*green_magenta<br />
*green_red<br />
*green_white_blue <br />
*green_white_magenta<br />
*green_white_red<br />
*green_white_yellow <br />
*green_yellow<br />
*green_yellow_red<br />
*magenta_blue<br />
*magenta_cyan<br />
*magenta_green<br />
*magenta_white_blue<br />
*magenta_white_cyan <br />
*magenta_white_green<br />
*magenta_white_yellow<br />
*magenta_yellow<br />
*rainbow<br />
*rainbow2<br />
*rainbow2_rev<br />
*rainbow_cycle<br />
*rainbow_cycle_rev <br />
*rainbow_rev red_blue<br />
*red_cyan red_green<br />
*red_white_blue<br />
*red_white_cyan<br />
*red_white_green<br />
*red_white_yellow<br />
*red_yellow<br />
*red_yellow_green<br />
*rmbc<br />
*yellow_blue<br />
*yellow_cyan<br />
*yellow_cyan_white<br />
*yellow_green<br />
*yellow_magenta<br />
*yellow_red<br />
*yellow_white_blue<br />
*yellow_white_green<br />
*yellow_white_magenta<br />
*yellow_white_red <br />
*yrmbcg<br />
<br />
= Examples =<br />
== Simple ==<br />
<source lang="python"><br />
spectrum b, blue_red, minimum=10, maximum=50<br />
<br />
spectrum count, rainbow_rev, chain A, byres=1<br />
</source><br />
<br />
== Intermediate ==<br />
The following script will create this image:<br />
<br />
[[Image:Spectrum_example.png|385px]]<br />
<br />
<source lang="python"><br />
# color atoms based on their distance from a point<br />
# returns the length of the distance between atom A and atom B<br />
<br />
diff_len = lambda x,y : math.sqrt((x[0]-y[0])*(x[0]-y[0]) + (x[1]-y[1])*(x[1]-y[1]) + (x[2]-y[2])*(x[2]-y[2]))<br />
<br />
# fetch 1hug from the PDB<br />
<br />
fetch 1hug, async=0<br />
<br />
# show it as surface<br />
<br />
as surface<br />
<br />
# create the pseudoatom at the origin<br />
<br />
pseudoatom pOrig, pos=(0,0,0), label=origin<br />
<br />
# these are special PyMOL variables that will hold # the coordinates of <br />
# the atoms and the pseudoatom<br />
<br />
stored.origCoord = []<br />
stored.distCoord = []<br />
<br />
# copy the coordinates into those special variables <br />
<br />
iterate_state 1, pOrig, stored.origCoord.append((x,y,z))<br />
iterate_state 1, 1hug, stored.distCoord.append((x,y,z))<br />
<br />
# extend origCoord to be the same length as the other<br />
<br />
stored.origCoord *= len(stored.distCoord)<br />
<br />
# calculate the distances<br />
<br />
newB = map(lambda x,y: diff_len(x,y), stored.distCoord, stored.origCoord)<br />
<br />
# put them into the b-factor of the protein<br />
<br />
alter 1hug, b=newB.pop(0)<br />
<br />
# color by rainbow_rev or any other<br />
# palette listed in "help spectrum"<br />
<br />
spectrum b, rainbow_rev, 1hug<br />
</source><br />
<br />
= See Also =<br />
<br />
* [[Advanced Coloring]]<br />
* [[Palette Colorbars]]<br />
* [[Advanced_Coloring#Coloring_with_.27chainbows.27_from_a_script|chainbow]]<br />
* [[spectrumany]]</div>Jameshttps://pymolwiki.org/index.php?title=Viewport&diff=9467Viewport2011-09-28T17:08:41Z<p>James: Stylistic correction of language.</p>
<hr />
<div>'''viewport''' changes the size of the viewing port--the visible openGL window (and thus the size of all png files subsequently output).<br />
<br />
No API command can reliably retrieve the viewport dimensions under all circumstances. However, it is possible to obtain the dimensions using a third party image viewer like Gimp or OS X Preview:<br />
<br />
# Save the current view as a png file ("png imagename.png").<br />
# Determine the image dimensions using a viewer program.<br />
<br />
These dimensions can be applied directly using the viewport command or the API.<br />
<br />
===USAGE===<br />
viewport width, height<br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.viewport(int width, int height)<br />
</source><br />
<br />
[[Category:Commands|Viewport]]</div>Jameshttps://pymolwiki.org/index.php?title=Viewport&diff=9466Viewport2011-09-28T17:01:57Z<p>James: Added instructions to reliably obtain viewport dimensions.</p>
<hr />
<div>'''viewport''' changes the size of the viewing port--the visible openGL window (and thus the size of all png files subsequently output).<br />
<br />
No API command can reliably retrieve the viewport dimensions under all circumstances. However, it is possible to obtain the dimensions using a third party image viewer like Gimp or OS X Preview:<br />
<br />
# Save the current view as a png file ("png imagename.png").<br />
# Determine the image dimensions using a viewer program.<br />
<br />
These dimensions can be used directly using the viewport command or the API.<br />
<br />
===USAGE===<br />
viewport width, height<br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.viewport(int width, int height)<br />
</source><br />
<br />
[[Category:Commands|Viewport]]</div>Jameshttps://pymolwiki.org/index.php?title=Covers&diff=5703Covers2008-12-05T22:22:23Z<p>James: </p>
<hr />
<div>= PyMOL-created Journal Covers =<br />
Part of PyMOL's popularity comes from the fact that it is very flexible and it offers arbitrarily high-resolution images as output; this make it a great tool for making journal covers or any press-related images.<br />
<br />
Here are some of the known PyMOL-created Journal Covers. There are surely more out there. If you have a cover you'd like to add, feel free.<br />
<br />
<gallery perrow="5"><br />
Image:080602cnen.pdf.jpg|'''Harnessing Helices''', [http://pubs.acs.org/cen/coverstory/86/8622aboutcover.html Chemical & Engineering News], June 2, 2008 Cover, Vol. 86, Issue 22.<br />
Image:080118_h.a.steinberg_JBC.jpg|''' Fusarium head blight (FHB)''', [http://www.jbc.org/content/vol283/issue3/cover.shtml JBC], January 18, 2008 Cover, Vol. 283, Issue 3.<br />
Image:071213nature.pdf.jpg|'''Pumping Irons''', [http://www.nature.com/nature/journal/v450/n7172/index.html Nature], Dec. 13th, 2007.<br />
Image:0712channels.jpg|[http://www.landesbioscience.com/journals/channels/toc/1/6], Dec 2007.<br />
Image:071123science.pdf.jpg|[http://www.sciencemag.org/content/vol318/issue5854/index.dtl Science], Nov. 23rd, 2007.<br />
Image:071120pnas.jpg|'''Sensing Calciums'''[http://www.pnas.org/content/104/47.toc], Nov 20th, 2007. <br />
Image:071113Structure.png|'''Aminoacyl-tRNA synthetases from human mitochondria'''[http://www.cell.com/structure/issue?pii=S0969-2126(07)X0180-1], Nov. 13th, 2007.<br />
Image:071009science.pdf.jpg|[http://www.sciencemag.org/content/vol318/issue5849/index.dtl Science], Oct. 19th, 2007.<br />
Image:070920nature.pdf.jpg|'''Sensing Acid''', [http://www.nature.com/nature/journal/v449/n7160/index.html Nature], Sept. 20th, 2007.<br />
Image:070816nature.pdf.jpg|'''Form Finds Function?''', [http://www.nature.com/nature/journal/v448/n7155/index.html Nature], Aug. 16thm 2007.<br />
Image:Largecover.gif|[http://www.nature.com/neuro/journal/v10/n8/abs/nn1942.html Nature Neuroscience] Vol. 10 No. 8 Aug. 2007<br />
Image:070803_h.a.steinberg_molec_cell.jpg|'''Paused transcription complexes''', [http://www.cell.com/molecular-cell/issue?pii=S1097-2765(07)X0175-8# Molecular Cell], August 3 2007 Cover, Vol. 27, Issue 3.<br />
Image:070405nature.pdf.jpg|'''Auxin Action Revealed''', [http://www.nature.com/nature/journal/v446/n7136/index.html Nature], Apr. 5th, 2007.<br />
Image:070219cnen.pdf.jpg|'''How Ribosomes Work''', [http://pubs.acs.org/cen/coverstory/85/8508aboutcover.html Chemical & Engineering News], Feb. 19th, 2007.<br />
Image:070215nature.pdf.jpg|'''HIV's Hidden Weakness''', [http://www.nature.com/nature/journal/v445/n7129/index.html Nature], Feb. 15th, 2007.<br />
Image:060904cnen.pdf.jpg|'''Glycosylation Engineering''', [http://pubs.acs.org/subscribe/journals/cen/84/i36/toc/toc_i36.html Chemical & Engineering News], Sept. 4th, 2006.<br />
Image:060817nature.pdf.jpg|'''Chromatin Code Decoded''', [http://www.nature.com/nature/journal/v442/n7104/index.html Nature], Aug. 17th, 2006.<br />
Image:060522cnen.pdf.jpg|'''Halogenases''', [http://pubs.acs.org/subscribe/journals/cen/84/i21/toc/toc_i21.html Chemical & Engineering News], May 22nd, 2006.<br />
Image:051020nature.pdf.jpg|'''The B to Z of DNA''', [http://www.nature.com/nature/journal/v437/n7062/index.html Nature], Oct. 20th, 2005.<br />
Image:050908nature.pdf.jpg|'''Neurotransmission''', [http://www.nature.com/nature/journal/v437/n7056/index.html Nature], Sept. 8th, 2005.<br />
Image:050722science.pdf.jpg|[http://www.sciencemag.org/content/vol309/issue5734/index.dtl Science], July 22nd, 2005.<br />
Image:050609nature.pdf.jpg|'''Probing Prions''', [http://www.nature.com/nature/journal/v435/n7043/index.html Nature], June 9th, 2005.<br />
Image:050429science.pdf.jpg|[http://www.sciencemag.org/content/vol308/issue5722/index.dtl Science], April 29th, 2005.<br />
Image:040910science.pdf.jpg|[http://www.sciencemag.org/content/vol305/issue5690/index.dtl Science], Sept., 10th, 2004.<br />
Image:040123science.pdf.jpg|[http://www.sciencemag.org/content/vol303/issue5657/index.dtl Science], Jan. 23rd, 2004.<br />
Image:Ribbon_hh1.png|[http://www.chembiol.com/content/issue?volume=15&issue=4 Chem. Biol.]<br />
Image:0903_1_1.jpg|[http://pubs.acs.org/journals/achre4/covers/36/articleWindow.achre4.091603.html Accounts of Chemical Research]<br />
</gallery></div>Jameshttps://pymolwiki.org/index.php?title=Covers&diff=5694Covers2008-12-04T21:18:59Z<p>James: </p>
<hr />
<div>= PyMOL-created Journal Covers =<br />
Part of PyMOL's popularity comes from the fact that it is very flexible and it offers arbitrarily high-resolution images as output; this make it a great tool for making journal covers or any press-related images.<br />
<br />
Here are some of the known PyMOL-created Journal Covers. There are surely more out there. If you have a cover you'd like to add, feel free.<br />
<br />
<gallery perrow="5"><br />
Image:080602cnen.pdf.jpg|'''Harnessing Helices''', [http://pubs.acs.org/cen/coverstory/86/8622aboutcover.html Chemical & Engineering News], June 2, 2008 Cover, Vol. 86, Issue 22.<br />
Image:071213nature.pdf.jpg|'''Pumping Irons''', [http://www.nature.com/nature/journal/v450/n7172/index.html Nature], Dec. 13th, 2007.<br />
Image:0712channels.jpg|[http://www.landesbioscience.com/journals/channels/toc/1/6], Dec 2007.<br />
Image:071123science.pdf.jpg|[http://www.sciencemag.org/content/vol318/issue5854/index.dtl Science], Nov. 23rd, 2007.<br />
Image:071120pnas.jpg|'''Sensing Calciums'''[http://www.pnas.org/content/104/47.toc], Nov 20th, 2007. <br />
Image:071113Structure.png|'''Aminoacyl-tRNA synthetases from human mitochondria'''[http://www.cell.com/structure/issue?pii=S0969-2126(07)X0180-1], Nov. 13th, 2007.<br />
Image:071009science.pdf.jpg|[http://www.sciencemag.org/content/vol318/issue5849/index.dtl Science], Oct. 19th, 2007.<br />
Image:070920nature.pdf.jpg|'''Sensing Acid''', [http://www.nature.com/nature/journal/v449/n7160/index.html Nature], Sept. 20th, 2007.<br />
Image:070816nature.pdf.jpg|'''Form Finds Function?''', [http://www.nature.com/nature/journal/v448/n7155/index.html Nature], Aug. 16thm 2007.<br />
Image:070405nature.pdf.jpg|'''Auxin Action Revealed''', [http://www.nature.com/nature/journal/v446/n7136/index.html Nature], Apr. 5th, 2007.<br />
Image:070219cnen.pdf.jpg|'''How Ribosomes Work''', [http://pubs.acs.org/cen/coverstory/85/8508aboutcover.html Chemical & Engineering News], Feb. 19th, 2007.<br />
Image:070215nature.pdf.jpg|'''HIV's Hidden Weakness''', [http://www.nature.com/nature/journal/v445/n7129/index.html Nature], Feb. 15th, 2007.<br />
Image:060904cnen.pdf.jpg|'''Glycosylation Engineering''', [http://pubs.acs.org/subscribe/journals/cen/84/i36/toc/toc_i36.html Chemical & Engineering News], Sept. 4th, 2006.<br />
Image:060817nature.pdf.jpg|'''Chromatin Code Decoded''', [http://www.nature.com/nature/journal/v442/n7104/index.html Nature], Aug. 17th, 2006.<br />
Image:060522cnen.pdf.jpg|'''Halogenases''', [http://pubs.acs.org/subscribe/journals/cen/84/i21/toc/toc_i21.html Chemical & Engineering News], May 22nd, 2006.<br />
Image:051020nature.pdf.jpg|'''The B to Z of DNA''', [http://www.nature.com/nature/journal/v437/n7062/index.html Nature], Oct. 20th, 2005.<br />
Image:050908nature.pdf.jpg|'''Neurotransmission''', [http://www.nature.com/nature/journal/v437/n7056/index.html Nature], Sept. 8th, 2005.<br />
Image:050722science.pdf.jpg|[http://www.sciencemag.org/content/vol309/issue5734/index.dtl Science], July 22nd, 2005.<br />
Image:050609nature.pdf.jpg|'''Probing Prions''', [http://www.nature.com/nature/journal/v435/n7043/index.html Nature], June 9th, 2005.<br />
Image:050429science.pdf.jpg|[http://www.sciencemag.org/content/vol308/issue5722/index.dtl Science], April 29th, 2005.<br />
Image:040910science.pdf.jpg|[http://www.sciencemag.org/content/vol305/issue5690/index.dtl Science], Sept., 10th, 2004.<br />
Image:040123science.pdf.jpg|[http://www.sciencemag.org/content/vol303/issue5657/index.dtl Science], Jan. 23rd, 2004.<br />
Image:Ribbon_hh1.png|[http://www.chembiol.com/content/issue?volume=15&issue=4 Chem. Biol.]<br />
Image:0903_1_1.jpg|[http://pubs.acs.org/journals/achre4/covers/36/articleWindow.achre4.091603.html Accounts of Chemical Research]<br />
Image:Largecover.gif|[http://www.nature.com/neuro/journal/v10/n8/abs/nn1942.html Nature Neuroscience] Vol. 10 No. 8 Aug. 2007<br />
</gallery></div>Jameshttps://pymolwiki.org/index.php?title=File:Largecover.gif&diff=5693File:Largecover.gif2008-12-04T21:14:07Z<p>James: </p>
<hr />
<div>Nature Neuroscience cover image depicting the structure of the nicotinic acetylcholine receptor extracellular domain alpha-1 in the context of a modeled receptor pentamer [Dellisanti, et al., Nature Neuroscience 10, 953 - 962 (2007)]. The cover concept was by Lin Chen, modelling was by Cosma Dellisanti, and the final image produced in PyMOL by James Stroud.</div>Jameshttps://pymolwiki.org/index.php?title=File:Largecover.gif&diff=5692File:Largecover.gif2008-12-04T21:12:30Z<p>James: Nature Neuroscience cover image depicting the structure of the nicotinic acetylcholine receptor extracellular domain alpha-1 in the context of a modeled receptor pentamer [Dellisanti, et al., Nature Neuroscience 10, 953 - 962 (2007)].</p>
<hr />
<div>Nature Neuroscience cover image depicting the structure of the nicotinic acetylcholine receptor extracellular domain alpha-1 in the context of a modeled receptor pentamer [Dellisanti, et al., Nature Neuroscience 10, 953 - 962 (2007)].</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3946Iterate2007-04-09T11:25:46Z<p>James: /* Note about Atom Coordinates */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
===Note about Atom Coordinates===<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To inspect the coordinates of the atoms, see [[Cmd iterate_state]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3945Iterate2007-04-09T11:25:05Z<p>James: /* Note about Atom Coordinates */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
== Note about Atom Coordinates ==<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To inspect the coordinates of the atoms, see [[Cmd iterate_state]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3944Iterate2007-04-09T11:24:29Z<p>James: /* Note */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
== Note about Atom Coordinates ==<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To use the coordinates of the atoms, see [[Cmd iterate_state]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3943Iterate2007-04-09T11:24:01Z<p>James: /* DESCRIPTION */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
== Note ==<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To use the coordinates of the atoms, see [[Cmd iterate_state]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3942Iterate2007-04-09T11:23:47Z<p>James: /* DESCRIPTION */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
<br />
== Note ==<br />
<br />
The coordinates of the atom are not accessible via '''iterate'''. To use the coordinates of the atoms, see [[Cmd iterate_state]].<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate&diff=3941Iterate2007-04-09T11:22:46Z<p>James: /* DESCRIPTION */</p>
<hr />
<div>===DESCRIPTION===<br />
'''iterate''' iterates over an expression with a separate name space for each atom. However, unlike the "alter" command, atomic properties can not be altered. Thus, '''iterate''' is more efficient than '''alter'''.<br />
<br />
Iterate is a powerful tool that can be used to perform operations and aggregations using atomic selections, and store the results in any global object, such as the predefined '''stored''' object. For example, one could iterate over all of the alpha carbons and record their B Factors, or print out all of the secondary structure classifications of all the residues.<br />
<br />
The '''iterate''' command only has access to certain properties. Those properties are:<br />
*'''name''': the atom name<br />
*'''resn''': the residue name<br />
*'''resi''': the residue identifier (residue number)<br />
*'''chain''': the chain name<br />
*'''alt''':<br />
*'''elem''': the chemical element<br />
*'''q'''<br />
*'''b''': the B Factor<br />
*'''segi''':<br />
*'''type''' (ATOM,HETATM): the atom type<br />
*'''formal_charge''': the formal charge of the atom<br />
*'''partial_charge''': the partial charger of the ato<br />
*'''numeric_type'''<br />
*'''text_type '''<br />
*'''ID'''<br />
*'''vdw'''<br />
<br />
All strings in the expression must be explicitly quoted. This operation typically takes a second per thousand atoms.<br />
<br />
'''Note''' that the coordinates of the atom are not accessible via '''iterate'''. To use the coordinates of the atoms, see iterate_state.<br />
<br />
===USAGE===<br />
iterate (selection),expression<br />
<br />
===EXAMPLES===<br />
====Example====<br />
*The following example calculates the net charge on an object.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.net_charge = 0<br />
# sum up the stored charges of all the atoms<br />
iterate (all),stored.net_charge = stored.net_charge + partial_charge<br />
</source><br />
<br />
====Example====<br />
*The following example fills an array, '''stored.names''' with the names of all the residues.<br />
<source lang="python"><br />
# create the global variable between Python and PyMOL<br />
stored.names = []<br />
# get all of the names<br />
iterate (all),stored.names.append(name)<br />
</source><br />
<br />
====Example====<br />
*The following prints the b-factors for all atoms around residue #1.<br />
<source lang="python"><br />
iterate resi 1, print round(b,2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate_state]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate_State&diff=3940Iterate State2007-04-09T11:13:03Z<p>James: /* From Python */</p>
<hr />
<div>===DESCRIPTION===<br />
Iterate state can be used to extract position data from an object or selection. The expression can use the variables x, y, and z which are the position of the current atom. One common usage is to extract the positions as a python list to alter then write back to the molecule using alter_state.<br />
<br />
===USAGE===<br />
iterate_state state,(selection),expression<br />
<br />
===EXAMPLES===<br />
==From PyMOL command line==<br />
To get the sum of x coordinates:<br />
<source lang="python"><br />
stored.sum_x = 0.0<br />
iterate_state 1,(all),stored.sum_x = stored.sum_x + x<br />
</source><br />
To get a list of the positions in a selection<br />
<source lang="python"><br />
stored.pos = []<br />
iterate_state 1, (all), stored.pos.append((x,y,z))<br />
</source><br />
==From Python==<br />
To get a list of positions (import stored first)<br />
<source lang="python"><br />
from pymol import stored<br />
<br />
stored.pos = []<br />
cmd.iterate_state(1, 'all', 'stored.pos.append((x,y,z))')<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate_state]]</div>Jameshttps://pymolwiki.org/index.php?title=Iterate_State&diff=3939Iterate State2007-04-09T11:11:30Z<p>James: /* From Python */</p>
<hr />
<div>===DESCRIPTION===<br />
Iterate state can be used to extract position data from an object or selection. The expression can use the variables x, y, and z which are the position of the current atom. One common usage is to extract the positions as a python list to alter then write back to the molecule using alter_state.<br />
<br />
===USAGE===<br />
iterate_state state,(selection),expression<br />
<br />
===EXAMPLES===<br />
==From PyMOL command line==<br />
To get the sum of x coordinates:<br />
<source lang="python"><br />
stored.sum_x = 0.0<br />
iterate_state 1,(all),stored.sum_x = stored.sum_x + x<br />
</source><br />
To get a list of the positions in a selection<br />
<source lang="python"><br />
stored.pos = []<br />
iterate_state 1, (all), stored.pos.append((x,y,z))<br />
</source><br />
==From Python==<br />
To get a list of positions<br />
<source lang="python"><br />
from pymol import stored<br />
<br />
stored.pos = []<br />
cmd.iterate_state(1, 'all', 'stored.pos.append((x,y,z))')<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Cmd iterate]], [[Cmd alter]], [[Cmd alter_state]]<br />
<br />
[[Category:Commands|iterate_state]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=2781Monitors Hardware Options2006-06-28T20:26:55Z<p>James: /* NVIDIA Quadro FX 1100 graphics card + ViewSonic G225 monitor + Nuvision 60GX glasses + OS X Dual G5 */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
* G225f: Seems to be ViewSonic's latest offering (6/06).<br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + ViewSonic G225 monitor + Nuvision 60GX glasses + OS X Dual G5 ===<br />
<br />
Pushed refresh to 119.9 Hz. I tried several different resolutions starting from the max and worked my way down before it gave me the ~120 Hz refresh. This setup was plug and play stereo: new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means--this the sweetest graphics machine I've ever sat in front of (including SGI Onyx).<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1573Monitors Hardware Options2006-06-28T20:25:05Z<p>James: </p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
* G225f: Seems to be ViewSonic's latest offering (6/06).<br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + ViewSonic G225 monitor + Nuvision 60GX glasses + OS X Dual G5 ===<br />
<br />
Pushed refresh to 119.9 Hz. I tried several different resolutions starting from the max and worked my way down before it gave me the ~120 Hz refresh. This setup was plug and play stereo: new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1572Monitors Hardware Options2006-06-26T20:00:40Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
*G225f: Seems to be ViewSonic's latest offering (6/06). Pushed it to 119.9 Hz. I tried several different resolutions starting from the max and worked my way down before it gave me the ~120 Hz refresh. This setup was plug and play stereo: new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1562Monitors Hardware Options2006-06-26T20:00:05Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
*G225f: Seems to be ViewSonic's latest offering (6/06). Pushed it to 119.9 Hz. I tried several different resolutions starting from the max and worked my way down before it gave me the ~120 Hz refresh. This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1561Monitors Hardware Options2006-06-26T19:59:42Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
*G225f: Seems to be ViewSonic's latest offering (6/06). Pushed it to 119.9 Hz. I tried several different resolutions, starting from the max and worked my way down before it gave me the ~120 Hz refresh. This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1560Monitors Hardware Options2006-06-26T19:58:48Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
*G225f: Seems to be ViewSonic's latest offering (6/06). Pushed it to 119.9 Hz. I tried several different resolutions, starting from the max, before it gave me the ~120 Hz refresh. This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1559Monitors Hardware Options2006-06-26T19:58:17Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
*G225f: Seems to be ViewSonic's latest offering. Pushed it to 119.9 Hz. I tried several different resolutions, starting from the max, before it gave me the ~120 Hz refresh. This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1558Monitors Hardware Options2006-06-26T19:57:00Z<p>James: </p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
<li>G225f: Seems to be ViewSonic's latest offering. Pushed it to 119.9 Hz. I tried several different<br />
resolutions, starting from max, before it gave me the ~120 Hz refresh.<br />
This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and<br />
NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.</li><br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1557Monitors Hardware Options2006-06-26T19:56:22Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
* G225f: Seems to be ViewSonic's latest offering. Pushed it to 119.9 Hz. I tried several different<br />
resolutions, starting from max, before it gave me the ~120 Hz refresh.<br />
This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and<br />
NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.<br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>Jameshttps://pymolwiki.org/index.php?title=Monitors_Hardware_Options&diff=1556Monitors Hardware Options2006-06-26T19:55:57Z<p>James: /* [http://www.viewsonic.com/ ViewSonic] */</p>
<hr />
<div>== CRT Monitors ==<br />
=== [http://www.iiyama.us/pages/content.asp?SID=&NAV=236&PROD=2752 Iiyama HM204DT] ===<br />
This is a 22inch (20inch viewable) monitor which can be configured at ''1280x1024'' at ''120 Hz''<br />
<br />
=== [http://www.viewsonic.com/ ViewSonic] ===<br />
* A90: cheap low end 19". Good investment<br />
* G220fb: nicer 21" monitor. Also good, supports much higher refresh rates than the A90.<br />
* G225f: Seems to be ViewSonic's latest offering. Pushed it to 119.9 Hz. I tried several different<br />
resolutions, starting from max, before it gave me the ~120 Hz refresh.<br />
This monitor was plug and play a new Dual G5 (6/06), the awesome Quadro FX 4500, and<br />
NuVision 60GX Emitter/Glasses Combo. Very choice if you have the means.<br />
<br />
=== [http://www.samsung.com/ Samsung] ===<br />
* Samsung SyncMaster 191T+ (Digital Flat Panel) -- very nice<br />
<br />
=== [http://www.necmitsubishi.com/ NEC/Mitsubshi] ===<br />
* FP2141SB-BK (A high-refresh display for stereo 3D graphics) -- What Warren uses (at ''1440x1050'').<br />
<br />
== Graphics cards : Stereo-ready ==<br />
<br />
=== Nvidia Cards ===<br />
NVidia release proprietary drivers for its cards. Linux drivers for 32-bit and 64-bit can be downloaded from their site.<br />
<br />
<br />
====[http://www.nvidia.com/page/qfx_mr.html NVIDIA Quadro FX 1100]====<br />
This is a very fast and stable graphics card. It has an AGP 8X interface.<br />
<br />
====[http://www.nvidia.com/ NVidia] ==== <br />
While not Quadro cards, these are still very good, cheaper alternatives.<br />
* GeForce 5600 XTQ -- nice low end card (4000-5000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 5950 Ultra -- nice mid level card (~9000 FPS in glxgears 1600x1200 dual)<br />
* GeForce 6800 Ultra -- nice high end card (>14,000 FPS in glxgears 1600x1200 dual)<br />
<br />
== LCD Glasses and Emitters ==<br />
=== [http://www.nuvision3d.com/the60gx.html Nuvision 60GX] ===<br />
These glasses can handle a very high refresh rate (at least ''120 Hz'')<br />
<br />
== Hardware combinations that work ==<br />
<br />
=== NVIDIA Quadro FX 1100 graphics card + Iiyama HM204DT monitor + Nuvision 60GX glasses ===<br />
<br />
This combination provides a very pleasant 3D experience which won't fatigue your eyes.<br />
<br />
[[Category:Hardware_Options|Monitors]]</div>James