This is a read-only mirror of pymolwiki.org

Difference between revisions of "Surface"

From PyMOL Wiki
Jump to navigation Jump to search
m (changed teh -> the)
m (wikipedia link)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
The surface representation of a protein, in PyMol, shows the "Connolly" surface or the surface that would be traced out by the '''surfaces''' of waters in contact with the protein at all possible positions. [[Image:Surface_ex.png|thumb|Surface Representation Example|right]]
+
The surface representation of a protein, in PyMol, shows the [http://en.wikipedia.org/wiki/Connolly_surface "Connolly" surface] or the surface that would be traced out by the '''surfaces''' of waters in contact with the protein at all possible positions. [[Image:Surface_ex.png|thumb|Surface Representation Example|right]]
  
  
Line 8: Line 8:
  
 
==Settings==
 
==Settings==
===Transparency===
+
*[[surface_best]]               
 +
*[[surface_negative_color]]   
 +
*[[surface_carve_cutoff]]       
 +
*[[surface_negative_visible]] 
 +
*[[surface_carve_normal_cutoff]] 
 +
*[[surface_normal]]           
 +
*[[surface_carve_selection]]     
 +
*[[surface_optimize_subsets]] 
 +
*[[surface_carve_state]]         
 +
*[[surface_poor]]             
 +
*[[surface_circumscribe]]       
 +
*[[surface_proximity]]         
 +
*[[surface_clear_cutoff]]       
 +
*[[surface_quality]]           
 +
*[[surface_clear_selection]]     
 +
*[[surface_ramp_above_mode]]   
 +
*[[surface_clear_state]]         
 +
*[[surface_solvent]]           
 +
*[[surface_color]]               
 +
*[[surface_trim_cutoff]]       
 +
*[[surface_debug]]               
 +
*[[surface_trim_factor]]       
 +
*[[surface_miserable]]           
 +
*[[surface_type]]             
 +
*[[surface_mode]] 
 +
 
 +
===Examples===
 +
====Transparency====
 
To adjust the transparency of surfaces try:
 
To adjust the transparency of surfaces try:
 
<source lang="python">
 
<source lang="python">
Line 15: Line 42:
 
Where 1.0 will be an invisible and 0.0 a completely solid surface.
 
Where 1.0 will be an invisible and 0.0 a completely solid surface.
  
===Quality===
+
====Quality====
 
To smooth your surface representation try:
 
To smooth your surface representation try:
 
<source lang="python">
 
<source lang="python">
Line 22: Line 49:
 
or higher if you wish, though it will take longer and might look odd.
 
or higher if you wish, though it will take longer and might look odd.
  
===Probe Radius===
+
====Probe Radius====
 
To change the probe radius other than default 1.4 Å, you need to change the solvent radius, say, 1.6 Å:
 
To change the probe radius other than default 1.4 Å, you need to change the solvent radius, say, 1.6 Å:
 
<source lang="python">
 
<source lang="python">
Line 33: Line 60:
  
 
==Tips==
 
==Tips==
 +
 +
=== Exporting Surface/Mesh Coordinates to File===
 +
 +
PyMOL can export its coordinates as WRL wireframe model files for VRML input.
 +
 +
====Older PyMOL Versions====
 +
<source lang="python">
 +
# export the coordinates to povray
 +
open("surface.inc","w").write(cmd.get_povray()[1])
 +
</source>
 +
 +
====Newer PyMOL Versions====
 +
<source lang="python">
 +
# export the coordinates to .wrl file
 +
save myscene.wrl
 +
</source>
 +
or
 +
<source lang="python">
 +
# export the coordinates to .obj file
 +
save myscene.obj
 +
</source>
 +
 
===Displaying a protein as surface with a ligand as sticks===
 
===Displaying a protein as surface with a ligand as sticks===
 
The easiest way to do this is to create separate objects for each type of display.  
 
The easiest way to do this is to create separate objects for each type of display.  
Line 84: Line 133:
  
 
===Creating a Closed Surface===
 
===Creating a Closed Surface===
[[Image:Surface_open.png|thumb|Example OPEN Surface|left|200px]]
+
<gallery>
[[Image:Surface_closed.png|thumb|Example CLOSED Surface|left|200px]]
+
Image:Surface_open.png|Example OPEN Surface
 
+
Image:Surface_closed.png|Example CLOSED Surface
 
+
</gallery>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
To create what I'll call a '''closed surface''' (see images), you need to first make your atom selections, then create a new object for that selection then show the surface for that object.  Here's an example.
 
To create what I'll call a '''closed surface''' (see images), you need to first make your atom selections, then create a new object for that selection then show the surface for that object.  Here's an example.
 
+
<source lang="python">
 
  sel A, id 1-100
 
  sel A, id 1-100
 
  create B, A
 
  create B, A
 
  show surface, B
 
  show surface, B
 +
</source>
 +
 +
== Performance ==
 +
To optimize performance and responsiveness, PyMOL tends to defer compute-intensive tasks until their results are actually needed.  Thus,
 +
<source lang="python">
 +
cmd.show("surface")
 +
</source>
 +
doesn't actually show a surface, it only sets the surface visibility flag on the atoms present (for future reference).  An actual surface won't be computed until PyMOL is asked to refresh or render the display.  When running a script, you can force an update by calling:
 +
<source lang="python">
 +
cmd.refresh()
 +
</source>
 +
after cmd.show.
  
 
[[Category:Representations|Surface]]
 
[[Category:Representations|Surface]]
 +
[[Category:VRML]]
 +
[[Category:Surfaces]]
 +
[[Category:Performance]]

Revision as of 01:04, 1 November 2008

The surface representation of a protein, in PyMol, shows the "Connolly" surface or the surface that would be traced out by the surfaces of waters in contact with the protein at all possible positions.

Surface Representation Example


Enabling

To enable the surface representation do

show surface, SEL

for any proper selection SEL.

Settings

Examples

Transparency

To adjust the transparency of surfaces try:

set transparency, 0.5

Where 1.0 will be an invisible and 0.0 a completely solid surface.

Quality

To smooth your surface representation try:

set surface_quality, 1

or higher if you wish, though it will take longer and might look odd.

Probe Radius

To change the probe radius other than default 1.4 Å, you need to change the solvent radius, say, 1.6 Å:

set solvent_radius, 1.6

If the surface does not change correspondingly, use:

rebuild

Tips

Exporting Surface/Mesh Coordinates to File

PyMOL can export its coordinates as WRL wireframe model files for VRML input.

Older PyMOL Versions

# export the coordinates to povray
open("surface.inc","w").write(cmd.get_povray()[1])

Newer PyMOL Versions

# export the coordinates to .wrl file
save myscene.wrl

or

# export the coordinates to .obj file
save myscene.obj

Displaying a protein as surface with a ligand as sticks

The easiest way to do this is to create separate objects for each type of display.

- Load your protein - Select the ligand - Create a separate object for the ligand - Remove ligand atoms from the protein - Display both objects separately

Example:

load prot.ent,protein
select ligand,resn FAD
create lig_sticks,ligand
remove ligand
show sticks,lig_sticks
show surface,protein


Calculating a partial surface

There is, until now, an undocumented way to calculate a surface for only a part of an object without creating a new one:

flag ignore, not A/49-63/, set
delete indicate
show surface

If the surface was already computed, then you'll also need to issue the command:

rebuild


Displaying surface inside a molecule

As far as I can tell, setting ambient to zero alone doesn't quite do the job, since some triangles still get lit by the light source. The best combination I can find is:

set ambient=0
set direct=0.7
set reflect=0.0
set backface_cull=0

Which gives no shadows and only a few artifacts.

As an alternative, you might just consider showing the inside of the surface directly...that will create less visual artifacts, and so long as ambient and direct are sufficiently low, it will look reasonable in "ray".

util.ray_shadows("heavy")
set two_sided_lighting=1
set backface_cull=0

Creating a Closed Surface

To create what I'll call a closed surface (see images), you need to first make your atom selections, then create a new object for that selection then show the surface for that object. Here's an example.

 sel A, id 1-100
 create B, A
 show surface, B

Performance

To optimize performance and responsiveness, PyMOL tends to defer compute-intensive tasks until their results are actually needed. Thus,

cmd.show("surface")

doesn't actually show a surface, it only sets the surface visibility flag on the atoms present (for future reference). An actual surface won't be computed until PyMOL is asked to refresh or render the display. When running a script, you can force an update by calling:

cmd.refresh()

after cmd.show.