https://wiki.pymol.org/api.php?action=feedcontributions&user=Moino&feedformat=atomPyMOL Wiki - User contributions [en]2024-03-28T23:17:50ZUser contributionsMediaWiki 1.35.1https://wiki.pymol.org/index.php?title=Surface&diff=5639Surface2008-11-01T01:04:16Z<p>Moino: wikipedia link</p>
<hr />
<div>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]]<br />
<br />
<br />
==Enabling==<br />
To enable the surface representation do<br />
show surface, SEL<br />
for any proper selection SEL.<br />
<br />
==Settings==<br />
*[[surface_best]] <br />
*[[surface_negative_color]] <br />
*[[surface_carve_cutoff]] <br />
*[[surface_negative_visible]] <br />
*[[surface_carve_normal_cutoff]] <br />
*[[surface_normal]] <br />
*[[surface_carve_selection]] <br />
*[[surface_optimize_subsets]] <br />
*[[surface_carve_state]] <br />
*[[surface_poor]] <br />
*[[surface_circumscribe]] <br />
*[[surface_proximity]] <br />
*[[surface_clear_cutoff]] <br />
*[[surface_quality]] <br />
*[[surface_clear_selection]] <br />
*[[surface_ramp_above_mode]] <br />
*[[surface_clear_state]] <br />
*[[surface_solvent]] <br />
*[[surface_color]] <br />
*[[surface_trim_cutoff]] <br />
*[[surface_debug]] <br />
*[[surface_trim_factor]] <br />
*[[surface_miserable]] <br />
*[[surface_type]] <br />
*[[surface_mode]] <br />
<br />
===Examples===<br />
====Transparency====<br />
To adjust the transparency of surfaces try:<br />
<source lang="python"><br />
set transparency, 0.5<br />
</source><br />
Where 1.0 will be an invisible and 0.0 a completely solid surface.<br />
<br />
====Quality====<br />
To smooth your surface representation try:<br />
<source lang="python"><br />
set surface_quality, 1<br />
</source><br />
or higher if you wish, though it will take longer and might look odd.<br />
<br />
====Probe Radius====<br />
To change the probe radius other than default 1.4 Å, you need to change the solvent radius, say, 1.6 Å:<br />
<source lang="python"><br />
set solvent_radius, 1.6<br />
</source><br />
If the surface does not change correspondingly, use:<br />
<source lang="python"><br />
rebuild<br />
</source><br />
<br />
==Tips==<br />
<br />
=== Exporting Surface/Mesh Coordinates to File===<br />
<br />
PyMOL can export its coordinates as WRL wireframe model files for VRML input.<br />
<br />
====Older PyMOL Versions====<br />
<source lang="python"><br />
# export the coordinates to povray<br />
open("surface.inc","w").write(cmd.get_povray()[1])<br />
</source><br />
<br />
====Newer PyMOL Versions====<br />
<source lang="python"><br />
# export the coordinates to .wrl file<br />
save myscene.wrl<br />
</source><br />
or<br />
<source lang="python"><br />
# export the coordinates to .obj file<br />
save myscene.obj<br />
</source><br />
<br />
===Displaying a protein as surface with a ligand as sticks===<br />
The easiest way to do this is to create separate objects for each type of display. <br />
<br />
- Load your protein<br />
- Select the ligand <br />
- Create a separate object for the ligand <br />
- Remove ligand atoms from the protein<br />
- Display both objects separately<br />
<br />
Example:<br />
<source lang="python"><br />
load prot.ent,protein<br />
select ligand,resn FAD<br />
create lig_sticks,ligand<br />
remove ligand<br />
show sticks,lig_sticks<br />
show surface,protein<br />
</source><br />
<br />
<br />
===Calculating a partial surface===<br />
There is, until now, an undocumented way to calculate a surface for only a part of an object without creating a new one:<br />
<source lang="python"><br />
flag ignore, not A/49-63/, set<br />
delete indicate<br />
show surface<br />
</source><br />
If the surface was already computed, then you'll also need to issue the command:<br />
<source lang="python"><br />
rebuild<br />
</source><br />
<br />
<br />
===Displaying surface inside a molecule===<br />
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:<br />
<source lang="python"><br />
set ambient=0<br />
set direct=0.7<br />
set reflect=0.0<br />
set backface_cull=0<br />
</source><br />
Which gives no shadows and only a few artifacts.<br />
<br />
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".<br />
<source lang="python"><br />
util.ray_shadows("heavy")<br />
set two_sided_lighting=1<br />
set backface_cull=0<br />
</source><br />
<br />
===Creating a Closed Surface===<br />
<gallery><br />
Image:Surface_open.png|Example OPEN Surface<br />
Image:Surface_closed.png|Example CLOSED Surface<br />
</gallery><br />
<br />
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.<br />
<source lang="python"><br />
sel A, id 1-100<br />
create B, A<br />
show surface, B<br />
</source><br />
<br />
== Performance ==<br />
To optimize performance and responsiveness, PyMOL tends to defer compute-intensive tasks until their results are actually needed. Thus, <br />
<source lang="python"><br />
cmd.show("surface")<br />
</source><br />
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:<br />
<source lang="python"><br />
cmd.refresh()<br />
</source><br />
after cmd.show.<br />
<br />
[[Category:Representations|Surface]]<br />
[[Category:VRML]]<br />
[[Category:Surfaces]]<br />
[[Category:Performance]]</div>Moinohttps://wiki.pymol.org/index.php?title=Displaying_Biochemical_Properties&diff=8201Displaying Biochemical Properties2008-10-09T07:29:35Z<p>Moino: removed wrong protein identifier at h_add</p>
<hr />
<div>==Selecting secondary structures==<br />
A few examples:<br />
<source lang="python"><br />
select helix, (ss h)<br />
select sheet, (ss s)<br />
select loop, (ss l+'')<br />
</source><br />
<br />
===Manually Assigning Secondary Structure===<br />
You can manually assign secondary stuctures to your protein by<br />
<source lang="python"><br />
alter 96-103/, ss='S'<br />
alter 96-103/, ss='H'<br />
alter 96-103/, ss='L'<br />
</source><br />
<br />
to set residues 96-103 to beta Strand, alpha Helix, and Loop respectively.<br />
<br />
===See Also===<br />
[[Dss]] [[Caver]]<br />
<br />
[[:Category:FAQ|FAQ]] [[:Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
<br />
==Coloring ==<br />
See also [[:Category:Coloring]]. <br />
<br />
===Color by atom type from a script===<br />
See [[Color]] for this.<br />
<br />
===Assign color by B-factor===<br />
See section [[Color]] for this.<br />
<br />
<br />
== Bonds ==<br />
PyMOL can deduce bonds from the PDB structure file, even if the '''CONECT''' records are missing. In fact, PyMOL guesses bonding connectivity based on proximity, based on the empirical observation that two atoms of a given radius will not be generally closer than a certain distance unless they are bonded.<br />
<br />
===Displaying double bonds===<br />
<gallery widths="300px" heights="300px"><br />
Image:DoubleBonds.png|Image showing double bonds in PyMOL. Double bonds are supported in [[lines]] and [[sticks]].<br />
</gallery><br />
<br />
You can go into the [[lines]] mode and turning on the valence display:<br />
<source lang="python"><br />
hide<br />
as lines<br />
set valence, 0.1<br />
</source><br />
<br />
A higher value for valence spreads things out more. I don't know of a way to get the dotted notation.<br />
<br />
===Hydrogen bonds and Polar Contacts===<br />
[[Image:Polar_contacts_small.png|thumb|Polar Contacts in PyMol|center|300px]]<br />
Using the actions [A] button for an object or selection you can display Hydrogen bonds and Polar Contacts.<br />
[A]->find->polar contacts-><select from menu><br />
<br />
The command behind the menus is the <b>dist</b>ance command called with the additional argument mode=2.<br />
<br />
Parameters that control the the identification of H-bonds are defined as<br />
set h_bond_cutoff_center, 3.6<br />
with ideal geometry and<br />
set h_bond_cutoff_edge, 3.2<br />
with minimally acceptable geometry.<br />
<br />
These settings can be changed *before* running the detection process (dist<br />
command mode=2 or via the menus).<br />
<br />
Note that the hydrogen bond geometric criteria used in PyMOL was designed to<br />
emulate that used by DSSP.<br />
<br />
==== Hydrogen bonds between specific atoms ====<br />
<source lang="python"><br />
dist name, sele1, sele2, mode=2<br />
</source><br />
<br />
<br />
==== Hydrogen bonds where find->polar contacts doesn't do what you need ====<br />
You can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use [[h_add]] on the proteins, or provide ligands with valence information and then use h_add.<br />
<br />
Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.<br />
<source lang="python"><br />
# EXAMPLE 1: Show hydrogen bonds between protein <br />
# and docked ligands (which must have hydrogens)<br />
<br />
load target.pdb,prot<br />
load docked_ligs.sdf,lig<br />
<br />
# add hydrogens to protein<br />
<br />
h_add prot<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (lig and acc),(prot and don), 3.2<br />
dist HBD, (lig and don),(prot and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
</source><br />
<source lang="python"><br />
# EXAMPLE 2<br />
# Show hydrogen bonds between two proteins<br />
<br />
load prot1.pdb<br />
load prot2.pdb<br />
<br />
h_add prot1<br />
h_add prot2<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (prot1 and acc),(prot2 and don), 3.2<br />
dist HBD, (prot1 and don),(prot2 and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
<br />
# NOTE: that you could also use this approach between two<br />
# non-overlapping selections within a single object.<br />
</source><br />
There is also a [http://www.ebi.ac.uk/~gareth/pymol/downloads/scripts/hbond.py script] drawing nice hydrogen bonds from [http://www.ebi.ac.uk/~gareth Gareth Stockwell].<br />
<br />
The "polar contacts" mentioned above are probably better at finding hydrogen bonds than these scripts. "Polar contacts" check geometry as well as distance.<br />
<br />
<br />
==Calculating dihedral angles==<br />
The get_dihedral function requires four single-atom selections to work:<br />
<source lang="python"><br />
get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C<br />
</source><br />
<br />
== Cavities ==<br />
See [[Surfaces_and_Voids]]. Also [[Caver]] and [[CASTp]].<br />
<br />
==Surface-Related==<br />
<br />
===Surface Area===<br />
To calculate the surface area of a selection, see [[Get_Area]].<br />
<br />
===Polar surface area===<br />
For a solvent accessible PSA approximation:<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
show dots<br />
set dot_solvent, on<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
For molecular PSA approximation<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
set dot_solvent, off<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.<br />
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...<br />
<br />
===Display solvent accessible surface===<br />
Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.<br />
<br />
PyMOL can only show solvent accessible surfaces using the dot or sphere representations:<br />
<br />
for dots:<br />
<source lang="python"><br />
show dots<br />
set dot_mode,1<br />
set dot_density,3<br />
</source><br />
<br />
for spheres:<br />
<source lang="python"><br />
alter all,vdw=vdw+1.4<br />
show spheres<br />
</source><br />
<br />
===Contact Potential===<br />
See [[Protein_contact_potential]] and [[APBS]].<br />
[[Image:Prot_contact_pot.png|thumb|right|125px]]<br />
<div style="clear:right;"> </div><br />
<br />
===Residues with functional groups===<br />
[[Image:1igt_cys_lys_asp_glu_colored.png|thumb|200px|Whole residues colored (Cys: yellow, Lys: blue, Asp and Glu: red)]]<br />
Poor man's solution: Display protein as surface, colorize all Lys (-NH2), Asp and Glu (-COOH) and Cys (-SH):<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
color slate, resn lys # lysines in light blue<br />
color paleyellow, resn cys # cysteines in light yellow<br />
color tv_red, (resn asp or(resn glu)) # aspartic and glutamic acid in light red<br />
</source><br />
<br />
[[Image:1igt_functional_groups_colored.png|thumb|200px|Only central atoms of functional groups colored (Cys: S, Lys: NH2, Asp and Glu: CO2)]]<br />
Not-''so''-poor-man's solution: In order to have the functional groups better localized, only the central atoms can be colored: <br />
* the S atom of cystein, <br />
* the N and H atoms of the free amine of lysine (may be displayed with three H atoms at all three possible positions)<br />
* the C and two O atoms of free carboxylic groups in aspartic and glutamic acid <br />
In this way, they are better visible through the surface compared to only one colored atom, both amines and carboxylic groups consist of three colored atoms each.<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
select sulf_cys, (resn cys and (elem C)) # get the sulfur atom of cystein residues<br />
color yellow, sulf_cys<br />
<br />
select nitro_lys, (resn lys and name NZ) # get the nitrogens of free amines ("NZ" in PDB file)<br />
select hydro_lys, (elem H and (neighbor nitro_lys)) # get the neighboring H atoms <br />
select amine_lys, (nitro_lys or hydro_lys)<br />
color tv_blue, amine_lys<br />
<br />
<br />
select oxy_asp, (resn asp and (name OD1 or name OD2)) # get the two oxygens of -COOH ("OD1", "OD2")<br />
select carb_asp, (resn asp and (elem C and (neighbor oxy_asp))) # get the connecting C atom<br />
select oxy_glu, (resn glu and (name OE1 or name OE2)) # oxygens "OE1" and "OE2" in PDB file<br />
select carb_glu, (resn glu and (elem c and (neighbor oxy_glu)))<br />
select carboxy, (carb_asp or oxy_asp or carb_glu or oxy_glu)<br />
color tv_red, carboxy<br />
</source><br />
<br />
By displaying the protein as non-transparent surface, only the functional groups (colored atoms) at the surface are visible. The visualization of those groups can be pronounced by displaying the corresponding atoms as spheres, e.g. "as spheres, carboxy + amine_lys + sulf_cys", in this way it might become more clear how accessible they are.<br />
<br />
When displaying the protein as cartoon, the functional groups can be shown as spheres, and the whole residues cys, lys, asp and glu as sticks connected to the backbone, with the atoms of the functional groups again as spheres. However, then also the not accessible residues inside the protein are visible.<br />
<br />
== Backbones ==<br />
===Displaying the C-Alpha trace of proteins===<br />
<source lang="python"><br />
hide<br />
show ribbon<br />
set ribbon_sampling,1<br />
</source><br />
<br />
And if your model only contains CA atoms, you'll also need to issue:<br />
<source lang="python"><br />
set ribbon_trace,1<br />
</source><br />
<br />
===Displaying the Amino Acid Backbone===<br />
The easiest way to see the backbone of the protein is to do<br />
<source lang="python"><br />
hide all<br />
show ribbon<br />
</source><br />
<br />
If you don't like the ribbon representation, you can also do something like<br />
<source lang="python"><br />
hide all<br />
show sticks, name C+O+N+CA<br />
</source><br />
You can replace '''sticks''' in the above by other representations like '''spheres''' or '''lines'''.<br />
<br />
===Displaying the Phosphate backbone of nucleic acids===<br />
====Native Nucleic Acid Rendering in PyMol====<br />
PyMol now better supports viewing nucleic acid structure. [[Nuccyl]] still seems to be the reigning champ for image quality, but see PyMol's native [[Cartoon]] command. For more information on representing nucleic acids, please see the [[:Category:Nucleic_Acids|Nucleic Acids]] Category.<br />
[[Image:Cnam_0.png|right|thumb|130px]] <div style="clear:right;"> </div><br />
<br />
Should you ever want to show the phosphate trace of a nucleic acid molecule:<br />
<source lang="python"><br />
def p_trace(selection="(all)"):<br />
s = str(selection)<br />
cmd.hide('lines',"("+s+")")<br />
cmd.hide('spheres',"("+s+")")<br />
cmd.hide('sticks',"("+s+")")<br />
cmd.hide('ribbon',"("+s+")")<br />
cmd.show('cartoon',"("+s+")")<br />
cmd.set('cartoon_sampling',1,"("+s+")")<br />
cmd.set('cartoon_tube_radius',0.5,"("+s+")")<br />
cmd.extend('p_trace',p_trace)<br />
</source><br />
<br />
and then:<br />
<source lang="python"><br />
p_trace (selection)<br />
</source><br />
<br />
==Align proteins with CA fit==<br />
If two proteins have significant homology, you can use the [[Align]] command:<br />
<source lang="python"><br />
align prot1////ca,prot2<br />
</source><br />
<br />
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.<br />
<br />
[[Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
[[Category:Nucleic_Acids|Displaying Biochemical Properties]]</div>Moinohttps://wiki.pymol.org/index.php?title=Category:FAQ&diff=4019Category:FAQ2008-10-08T00:35:35Z<p>Moino: /* Commands */ link</p>
<hr />
<div>==Overview==<br />
Please post your FAQs here. I suggest you write a Q&A style list with a short answer. More involved answers should link to its own page. Just my suggestion. Should we have topics? Please note, not all AQ are FAQ. Also, many answers to frequently recurring problems are probably best sought by searching for your terms in the Wiki.<br />
<br />
===Installation===<br />
Q: I've installed PyMol_0_98, and recently my structures have stopped displaying. I've tried uninstalling PyMol_0_98 and installing PyMol_0_97, and yet i've ran into the same problem...my .pdb files no longer display, although it is evident that they are being loaded and I can edit them.<br />
<br />
Does anybody have any clue as to what might be the problem?<br />
Thanks, shebsmehr<br />
<br />
<br />
----<br />
===Startup===<br />
Q: I've installed PyMol_0_98 correctly but I can't open my files in .mol2 or .pdb format from the menubar. Instead I can open them with the program. I can't even save the images I create in PyMol and obviously the mivie too.<br />
<br />
Could you help me to solve these problems.<br />
Thanks<br />
Vittorio<br />
<br />
A1: Vittorio, if I understand you correctly, then you need to (a) make sure you have the PDB file on your machine, say Desktop (or home directory, for *nix), then in the GUI click on, "File"->"Open" then use the dialog to find the file you want to load. You can save time if you know where the file is by just using PyMol's "load" command<br />
load fileName, objectName<br />
loads the fileName into a new object called objectName, for example,<br />
load /tmp/1ggz.pdb, 1ggz<br />
<br />
See [[Cmd load|load]], <br />
<br />
A2: To save images you have a couple options. First, to save a quick raw screen dump type, "png fileName" to save a PNG image (IE and other programs can view these files). Or, secondly, if you prefer a higher quality image with ray-traced shadows and textures you can do, "ray" then, the above "png" command.<br />
<br />
See [[Cmd ray|ray]], [[Cmd png|png]], [[:Category:Using_Pymol|Using PyMol]]<br />
<br />
Hope this helps. If it didn't please restate your question to make it more clear.<br />
----<br />
Q: Hi I have a problem. For some reason PyMOl do not display certain areas (several loops) of my .pdb file (1DAN) when in cartoon. When I display the structure in "lines" or "sticks" everything is ok. Furthermore, other .pdb viewers dont have this problem. I have tried several things:<br />
1. Upgraded to the newest version og PyMol.<br />
2. Redefined secondary structure using the "alter command".<br />
3. Imported the .pdb file into SwissViewer, saved as the imported structure as a .pdb file, and then imported into PyMOl.<br />
<br />
None of these things have solved the problem. Help please! (I would hate to have to start using another pdb-viewer!!)<br />
Cheers<br />
Kasper<br />
<br />
----<br />
<br />
Q: Can the startup settings be edited so that MacPyMol starts with a One-Button Mouse mode? Please advise.<br />
A: echo "config_mouse one_button" >> ~/.pymolrc<br />
<br />
----<br />
Q: What I should write into the .pymolrc (Mandriva Linux) to be able open PyMol with .pdb or .pml from shell? I was able to run pymol *.pdb with old 0.99rc6 version, but then I upgraded Mandriva Linux and this option is not working anymore.<br />
<br />
===Settings===<br />
Q: I am wondering how to change the default settings for a color "spectrum". I would like to color by b-factor but not with the default spectrum but from white-to-red.<br />
<br />
A: See [[Color#Color_by_Spectrum_Example]].<br />
----<br />
Q: I would like the distance labels generated with the 'distance' command to be single-digit only, e.g. 2.8 instead of 2.77. How can I do this? Thanks, MindFrog<br />
<br />
A: Setting startup settings and python commands can be done in a file: ~/.pymolrc<br />
E.g. command in there: cmd.set('label_distance_digits',1)<br />
On my windows machine this is in C:\Documents and Settings\jurgen.WHELK.000\.pymolrc<br />
===Commands===<br />
Q: I want to move one object while keeping another fixed. How do I do this?<br />
<br />
A: Load the proteins as separate objects, put the mouse into 3-button editing mode, then shift-middle click-and-drag on the molecule to translate and shift-left-click-and-drag to rotate. (Warren DeLano answer)<br />
----<br />
Q: I'd like to select residues that are in contact with a surface, or else be able to select buried/non-buried residues, is there any way to do this ? [[User:Xevi|Xevi]] 03:52, 16 Jun 2006 (CDT)<br />
: I'm also looking for this (e.g. to see available lysines' -NH2 or cysteines' -SH on the surface), could one maybe cover the protein with an additional layer of new atoms, and then select all protein atoms close to these? Edit: there is now a simple solution for proteins displayed as non-transparent surfaces: [[Displaying_Biochemical_Properties#Residues_with_functional_groups]] -- [[User:Moino|moino]] 19:35, 7 October 2008 (CDT)<br />
----<br />
Q: After using the usual mset command to rotate an object, states/frames are loaded into that object. However, using the "frame" command has odd behaviour (in comparison to loading a molecular dynamics trajectory into the state in which the "frame" command behaves normally). Can anyone explain this?<br />
<br />
----<br />
<br />
Q: How do I suppress the 'ExecutiveRMS' output while running cmd.pair_fit()?<br />
<br />
----<br />
<br />
Q: How does cmd.rms() choose a mapping between atoms in the selections? Exhaustive search over all possibilities?<br />
<br />
----<br />
Q: How do I select (especially, iterate through a set of) bonds? The existence of [http://www.pymolwiki.org/index.php/Cycle_Valence cycle valence] seems to imply that it can be done. Is this possible via the API?<br />
----<br />
<br />
===Export/Import===<br />
Q: Is there any way to export PyMol models onto CAD standards (autocad, archicad) or 3D modeling software (blender, 3DStudio, Maya)? Thanks a lot.<br />
----<br />
Q: I am doing some MD simulations using CHARMM (not AMBER) and would like to visualize the .dcd files output by CHARMM. I understand that PyMol can open .trj files from AMBER but is there a way to open up these .dcd files and if not, are there any plans to implement this? Thank you for your time!<br />
<br />
A: Answering my own question here. See: [[Load_Traj]]<br />
<br />
===Others===<br />
Q: I was wondering what the percentage given under the mutengensis wizard means? Thanks...<br />
----<br />
Q: Some of the bases in RNA helices are missing (not all in any given helix) when I am showing them in the CARTOON mode. How should I set it to get them shown? I tried the Secondary Structure Assignment commands, they did not work.<br />
----<br />
Q: Why does PyMol run version 2.3 of Python when I have Python 2.5 installed? How do I tell it to switch?<br />
----<br />
Q: How do I cite PyMOL?<br />
<br />
A: DeLano, W.L. The PyMOL Molecular Graphics System. (2008) DeLano Scientific LLC, Palo Alto, CA, USA. http://www.pymol.org</div>Moinohttps://wiki.pymol.org/index.php?title=Displaying_Biochemical_Properties&diff=8200Displaying Biochemical Properties2008-10-08T00:29:05Z<p>Moino: /* Residues with functional groups */</p>
<hr />
<div>==Selecting secondary structures==<br />
A few examples:<br />
<source lang="python"><br />
select helix, (ss h)<br />
select sheet, (ss s)<br />
select loop, (ss l+'')<br />
</source><br />
<br />
===Manually Assigning Secondary Structure===<br />
You can manually assign secondary stuctures to your protein by<br />
<source lang="python"><br />
alter 96-103/, ss='S'<br />
alter 96-103/, ss='H'<br />
alter 96-103/, ss='L'<br />
</source><br />
<br />
to set residues 96-103 to beta Strand, alpha Helix, and Loop respectively.<br />
<br />
===See Also===<br />
[[Dss]] [[Caver]]<br />
<br />
[[:Category:FAQ|FAQ]] [[:Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
<br />
==Coloring ==<br />
See also [[:Category:Coloring]]. <br />
<br />
===Color by atom type from a script===<br />
See [[Color]] for this.<br />
<br />
===Assign color by B-factor===<br />
See section [[Color]] for this.<br />
<br />
<br />
== Bonds ==<br />
PyMOL can deduce bonds from the PDB structure file, even if the '''CONECT''' records are missing. In fact, PyMOL guesses bonding connectivity based on proximity, based on the empirical observation that two atoms of a given radius will not be generally closer than a certain distance unless they are bonded.<br />
<br />
===Displaying double bonds===<br />
<gallery widths="300px" heights="300px"><br />
Image:DoubleBonds.png|Image showing double bonds in PyMOL. Double bonds are supported in [[lines]] and [[sticks]].<br />
</gallery><br />
<br />
You can go into the [[lines]] mode and turning on the valence display:<br />
<source lang="python"><br />
hide<br />
as lines<br />
set valence, 0.1<br />
</source><br />
<br />
A higher value for valence spreads things out more. I don't know of a way to get the dotted notation.<br />
<br />
===Hydrogen bonds and Polar Contacts===<br />
[[Image:Polar_contacts_small.png|thumb|Polar Contacts in PyMol|center|300px]]<br />
Using the actions [A] button for an object or selection you can display Hydrogen bonds and Polar Contacts.<br />
[A]->find->polar contacts-><select from menu><br />
<br />
The command behind the menus is the <b>dist</b>ance command called with the additional argument mode=2.<br />
<br />
Parameters that control the the identification of H-bonds are defined as<br />
set h_bond_cutoff_center, 3.6<br />
with ideal geometry and<br />
set h_bond_cutoff_edge, 3.2<br />
with minimally acceptable geometry.<br />
<br />
These settings can be changed *before* running the detection process (dist<br />
command mode=2 or via the menus).<br />
<br />
Note that the hydrogen bond geometric criteria used in PyMOL was designed to<br />
emulate that used by DSSP.<br />
<br />
==== Hydrogen bonds between specific atoms ====<br />
<source lang="python"><br />
dist name, sele1, sele2, mode=2<br />
</source><br />
<br />
<br />
==== Hydrogen bonds where find->polar contacts doesn't do what you need ====<br />
You can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use [[h_add]] on the proteins, or provide ligands with valence information and then use h_add.<br />
<br />
Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.<br />
<source lang="python"><br />
# EXAMPLE 1: Show hydrogen bonds between protein <br />
# and docked ligands (which must have hydrogens)<br />
<br />
load target.pdb,prot<br />
load docked_ligs.sdf,lig<br />
<br />
# add hydrogens to protein<br />
<br />
h_add prot<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (lig and acc),(prot and don), 3.2<br />
dist HBD, (lig and don),(prot and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
</source><br />
<source lang="python"><br />
# EXAMPLE 2<br />
# Show hydrogen bonds between two proteins<br />
<br />
load prot1.pdb<br />
load prot2.pdb<br />
<br />
h_add prot1<br />
h_add prot2<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (prot1 and acc),(prot2 and don), 3.2<br />
dist HBD, (prot1 and don),(prot2 and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
<br />
# NOTE: that you could also use this approach between two<br />
# non-overlapping selections within a single object.<br />
</source><br />
There is also a [http://www.ebi.ac.uk/~gareth/pymol/downloads/scripts/hbond.py script] drawing nice hydrogen bonds from [http://www.ebi.ac.uk/~gareth Gareth Stockwell].<br />
<br />
The "polar contacts" mentioned above are probably better at finding hydrogen bonds than these scripts. "Polar contacts" check geometry as well as distance.<br />
<br />
<br />
==Calculating dihedral angles==<br />
The get_dihedral function requires four single-atom selections to work:<br />
<source lang="python"><br />
get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C<br />
</source><br />
<br />
== Cavities ==<br />
See [[Surfaces_and_Voids]]. Also [[Caver]] and [[CASTp]].<br />
<br />
==Surface-Related==<br />
<br />
===Surface Area===<br />
To calculate the surface area of a selection, see [[Get_Area]].<br />
<br />
===Polar surface area===<br />
For a solvent accessible PSA approximation:<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
show dots<br />
set dot_solvent, on<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
For molecular PSA approximation<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
set dot_solvent, off<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.<br />
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...<br />
<br />
===Display solvent accessible surface===<br />
Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.<br />
<br />
PyMOL can only show solvent accessible surfaces using the dot or sphere representations:<br />
<br />
for dots:<br />
<source lang="python"><br />
show dots<br />
set dot_mode,1<br />
set dot_density,3<br />
</source><br />
<br />
for spheres:<br />
<source lang="python"><br />
alter all,vdw=vdw+1.4<br />
show spheres<br />
</source><br />
<br />
===Contact Potential===<br />
See [[Protein_contact_potential]] and [[APBS]].<br />
[[Image:Prot_contact_pot.png|thumb|right|125px]]<br />
<div style="clear:right;"> </div><br />
<br />
===Residues with functional groups===<br />
[[Image:1igt_cys_lys_asp_glu_colored.png|thumb|200px|Whole residues colored (Cys: yellow, Lys: blue, Asp and Glu: red)]]<br />
Poor man's solution: Display protein as surface, colorize all Lys (-NH2), Asp and Glu (-COOH) and Cys (-SH):<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
color slate, resn lys # lysines in light blue<br />
color paleyellow, resn cys # cysteines in light yellow<br />
color tv_red, (resn asp or(resn glu)) # aspartic and glutamic acid in light red<br />
</source><br />
<br />
[[Image:1igt_functional_groups_colored.png|thumb|200px|Only central atoms of functional groups colored (Cys: S, Lys: NH2, Asp and Glu: CO2)]]<br />
Not-''so''-poor-man's solution: In order to have the functional groups better localized, only the central atoms can be colored: <br />
* the S atom of cystein, <br />
* the N and H atoms of the free amine of lysine (may be displayed with three H atoms at all three possible positions)<br />
* the C and two O atoms of free carboxylic groups in aspartic and glutamic acid <br />
In this way, they are better visible through the surface compared to only one colored atom, both amines and carboxylic groups consist of three colored atoms each.<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
select sulf_cys, (resn cys and (elem C)) # get the sulfur atom of cystein residues<br />
color yellow, sulf_cys<br />
<br />
select nitro_lys, (resn lys and name NZ) # get the nitrogens of free amines ("NZ" in PDB file)<br />
select hydro_lys, (elem H and (neighbor nitro_lys)) # get the neighboring H atoms <br />
select amine_lys, (nitro_lys or hydro_lys)<br />
color tv_blue, amine_lys<br />
<br />
<br />
select oxy_asp, (resn asp and (name OD1 or name OD2)) # get the two oxygens of -COOH ("OD1", "OD2")<br />
select carb_asp, (resn asp and (elem C and (neighbor oxy_asp))) # get the connecting C atom<br />
select oxy_glu, (resn glu and (name OE1 or name OE2)) # oxygens "OE1" and "OE2" in PDB file<br />
select carb_glu, (resn glu and (elem c and (neighbor oxy_glu)))<br />
select carboxy, (carb_asp or oxy_asp or carb_glu or oxy_glu)<br />
color tv_red, carboxy<br />
</source><br />
<br />
By displaying the protein as non-transparent surface, only the functional groups (colored atoms) at the surface are visible. <br />
<br />
When displaying the protein as cartoon, the functional groups can be shown as spheres, and the whole residues cys, lys, asp and glu as sticks connected to the backbone. However, then also the not accessible residues inside the protein are visible.<br />
<br />
== Backbones ==<br />
===Displaying the C-Alpha trace of proteins===<br />
<source lang="python"><br />
hide<br />
show ribbon<br />
set ribbon_sampling,1<br />
</source><br />
<br />
And if your model only contains CA atoms, you'll also need to issue:<br />
<source lang="python"><br />
set ribbon_trace,1<br />
</source><br />
<br />
===Displaying the Amino Acid Backbone===<br />
The easiest way to see the backbone of the protein is to do<br />
<source lang="python"><br />
hide all<br />
show ribbon<br />
</source><br />
<br />
If you don't like the ribbon representation, you can also do something like<br />
<source lang="python"><br />
hide all<br />
show sticks, name C+O+N+CA<br />
</source><br />
You can replace '''sticks''' in the above by other representations like '''spheres''' or '''lines'''.<br />
<br />
===Displaying the Phosphate backbone of nucleic acids===<br />
====Native Nucleic Acid Rendering in PyMol====<br />
PyMol now better supports viewing nucleic acid structure. [[Nuccyl]] still seems to be the reigning champ for image quality, but see PyMol's native [[Cartoon]] command. For more information on representing nucleic acids, please see the [[:Category:Nucleic_Acids|Nucleic Acids]] Category.<br />
[[Image:Cnam_0.png|right|thumb|130px]] <div style="clear:right;"> </div><br />
<br />
Should you ever want to show the phosphate trace of a nucleic acid molecule:<br />
<source lang="python"><br />
def p_trace(selection="(all)"):<br />
s = str(selection)<br />
cmd.hide('lines',"("+s+")")<br />
cmd.hide('spheres',"("+s+")")<br />
cmd.hide('sticks',"("+s+")")<br />
cmd.hide('ribbon',"("+s+")")<br />
cmd.show('cartoon',"("+s+")")<br />
cmd.set('cartoon_sampling',1,"("+s+")")<br />
cmd.set('cartoon_tube_radius',0.5,"("+s+")")<br />
cmd.extend('p_trace',p_trace)<br />
</source><br />
<br />
and then:<br />
<source lang="python"><br />
p_trace (selection)<br />
</source><br />
<br />
==Align proteins with CA fit==<br />
If two proteins have significant homology, you can use the [[Align]] command:<br />
<source lang="python"><br />
align prot1////ca,prot2<br />
</source><br />
<br />
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.<br />
<br />
[[Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
[[Category:Nucleic_Acids|Displaying Biochemical Properties]]</div>Moinohttps://wiki.pymol.org/index.php?title=File:1igt_functional_groups_colored.png&diff=1342File:1igt functional groups colored.png2008-10-08T00:27:14Z<p>Moino: from 1IGT.pdb</p>
<hr />
<div>from 1IGT.pdb</div>Moinohttps://wiki.pymol.org/index.php?title=File:1igt_cys_lys_asp_glu_colored.png&diff=1102File:1igt cys lys asp glu colored.png2008-10-08T00:26:27Z<p>Moino: from 1IGT.pdb</p>
<hr />
<div>from 1IGT.pdb</div>Moinohttps://wiki.pymol.org/index.php?title=Displaying_Biochemical_Properties&diff=8199Displaying Biochemical Properties2008-10-08T00:25:16Z<p>Moino: /* Residues with functional groups */ + images</p>
<hr />
<div>==Selecting secondary structures==<br />
A few examples:<br />
<source lang="python"><br />
select helix, (ss h)<br />
select sheet, (ss s)<br />
select loop, (ss l+'')<br />
</source><br />
<br />
===Manually Assigning Secondary Structure===<br />
You can manually assign secondary stuctures to your protein by<br />
<source lang="python"><br />
alter 96-103/, ss='S'<br />
alter 96-103/, ss='H'<br />
alter 96-103/, ss='L'<br />
</source><br />
<br />
to set residues 96-103 to beta Strand, alpha Helix, and Loop respectively.<br />
<br />
===See Also===<br />
[[Dss]] [[Caver]]<br />
<br />
[[:Category:FAQ|FAQ]] [[:Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
<br />
==Coloring ==<br />
See also [[:Category:Coloring]]. <br />
<br />
===Color by atom type from a script===<br />
See [[Color]] for this.<br />
<br />
===Assign color by B-factor===<br />
See section [[Color]] for this.<br />
<br />
<br />
== Bonds ==<br />
PyMOL can deduce bonds from the PDB structure file, even if the '''CONECT''' records are missing. In fact, PyMOL guesses bonding connectivity based on proximity, based on the empirical observation that two atoms of a given radius will not be generally closer than a certain distance unless they are bonded.<br />
<br />
===Displaying double bonds===<br />
<gallery widths="300px" heights="300px"><br />
Image:DoubleBonds.png|Image showing double bonds in PyMOL. Double bonds are supported in [[lines]] and [[sticks]].<br />
</gallery><br />
<br />
You can go into the [[lines]] mode and turning on the valence display:<br />
<source lang="python"><br />
hide<br />
as lines<br />
set valence, 0.1<br />
</source><br />
<br />
A higher value for valence spreads things out more. I don't know of a way to get the dotted notation.<br />
<br />
===Hydrogen bonds and Polar Contacts===<br />
[[Image:Polar_contacts_small.png|thumb|Polar Contacts in PyMol|center|300px]]<br />
Using the actions [A] button for an object or selection you can display Hydrogen bonds and Polar Contacts.<br />
[A]->find->polar contacts-><select from menu><br />
<br />
The command behind the menus is the <b>dist</b>ance command called with the additional argument mode=2.<br />
<br />
Parameters that control the the identification of H-bonds are defined as<br />
set h_bond_cutoff_center, 3.6<br />
with ideal geometry and<br />
set h_bond_cutoff_edge, 3.2<br />
with minimally acceptable geometry.<br />
<br />
These settings can be changed *before* running the detection process (dist<br />
command mode=2 or via the menus).<br />
<br />
Note that the hydrogen bond geometric criteria used in PyMOL was designed to<br />
emulate that used by DSSP.<br />
<br />
==== Hydrogen bonds between specific atoms ====<br />
<source lang="python"><br />
dist name, sele1, sele2, mode=2<br />
</source><br />
<br />
<br />
==== Hydrogen bonds where find->polar contacts doesn't do what you need ====<br />
You can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use [[h_add]] on the proteins, or provide ligands with valence information and then use h_add.<br />
<br />
Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.<br />
<source lang="python"><br />
# EXAMPLE 1: Show hydrogen bonds between protein <br />
# and docked ligands (which must have hydrogens)<br />
<br />
load target.pdb,prot<br />
load docked_ligs.sdf,lig<br />
<br />
# add hydrogens to protein<br />
<br />
h_add prot<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (lig and acc),(prot and don), 3.2<br />
dist HBD, (lig and don),(prot and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
</source><br />
<source lang="python"><br />
# EXAMPLE 2<br />
# Show hydrogen bonds between two proteins<br />
<br />
load prot1.pdb<br />
load prot2.pdb<br />
<br />
h_add prot1<br />
h_add prot2<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (prot1 and acc),(prot2 and don), 3.2<br />
dist HBD, (prot1 and don),(prot2 and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
<br />
# NOTE: that you could also use this approach between two<br />
# non-overlapping selections within a single object.<br />
</source><br />
There is also a [http://www.ebi.ac.uk/~gareth/pymol/downloads/scripts/hbond.py script] drawing nice hydrogen bonds from [http://www.ebi.ac.uk/~gareth Gareth Stockwell].<br />
<br />
The "polar contacts" mentioned above are probably better at finding hydrogen bonds than these scripts. "Polar contacts" check geometry as well as distance.<br />
<br />
<br />
==Calculating dihedral angles==<br />
The get_dihedral function requires four single-atom selections to work:<br />
<source lang="python"><br />
get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C<br />
</source><br />
<br />
== Cavities ==<br />
See [[Surfaces_and_Voids]]. Also [[Caver]] and [[CASTp]].<br />
<br />
==Surface-Related==<br />
<br />
===Surface Area===<br />
To calculate the surface area of a selection, see [[Get_Area]].<br />
<br />
===Polar surface area===<br />
For a solvent accessible PSA approximation:<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
show dots<br />
set dot_solvent, on<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
For molecular PSA approximation<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
set dot_solvent, off<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.<br />
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...<br />
<br />
===Display solvent accessible surface===<br />
Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.<br />
<br />
PyMOL can only show solvent accessible surfaces using the dot or sphere representations:<br />
<br />
for dots:<br />
<source lang="python"><br />
show dots<br />
set dot_mode,1<br />
set dot_density,3<br />
</source><br />
<br />
for spheres:<br />
<source lang="python"><br />
alter all,vdw=vdw+1.4<br />
show spheres<br />
</source><br />
<br />
===Contact Potential===<br />
See [[Protein_contact_potential]] and [[APBS]].<br />
[[Image:Prot_contact_pot.png|thumb|right|125px]]<br />
<div style="clear:right;"> </div><br />
<br />
===Residues with functional groups===<br />
[[Image:1igt_cys_lys_asp_glu_colored.png|thumb|130px|Whole residues colored (Cys: yellow, Lys: blue, Asp and Glu: red)]]<br />
Poor man's solution: Display protein as surface, colorize all Lys (-NH2), Asp and Glu (-COOH) and Cys (-SH):<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
color slate, resn lys # lysines in light blue<br />
color paleyellow, resn cys # cysteines in light yellow<br />
color tv_red, (resn asp or(resn glu)) # aspartic and glutamic acid in light red<br />
</source><br />
<br />
[[Image:1igt_functional_groups_colored.png|thumb|130px|Only central atoms of functional groups colored (Cys: S, Lys: NH2, Asp and Glu: CO2)]]<br />
Not-''so''-poor-man's solution: In order to have the functional groups better localized, only the central atoms can be colored: <br />
* the S atom of cystein, <br />
* the N and H atoms of the free amine of lysine (may be displayed with three H atoms at all three possible positions)<br />
* the C and two O atoms of free carboxylic groups in aspartic and glutamic acid <br />
In this way, they are better visible through the surface compared to only one colored atom, both amines and carboxylic groups consist of three colored atoms each.<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
select sulf_cys, (resn cys and (elem C)) # get the sulfur atom of cystein residues<br />
color yellow, sulf_cys<br />
<br />
select nitro_lys, (resn lys and name NZ) # get the nitrogens of free amines ("NZ" in PDB file)<br />
select hydro_lys, (elem H and (neighbor nitro_lys)) # get the neighboring H atoms <br />
select amine_lys, (nitro_lys or hydro_lys)<br />
color tv_blue, amine_lys<br />
<br />
<br />
select oxy_asp, (resn asp and (name OD1 or name OD2)) # get the two oxygens of -COOH ("OD1", "OD2")<br />
select carb_asp, (resn asp and (elem C and (neighbor oxy_asp))) # get the connecting C atom<br />
select oxy_glu, (resn glu and (name OE1 or name OE2)) # oxygens "OE1" and "OE2" in PDB file<br />
select carb_glu, (resn glu and (elem c and (neighbor oxy_glu)))<br />
select carboxy, (carb_asp or oxy_asp or carb_glu or oxy_glu)<br />
color tv_red, carboxy<br />
</source><br />
<br />
By displaying the protein as non-transparent surface, only the functional groups (colored atoms) at the surface are visible. <br />
<br />
When displaying the protein as cartoon, the functional groups can be shown as spheres, and the whole residues cys, lys, asp and glu as sticks connected to the backbone. However, then also the not accessible residues inside the protein are visible.<br />
<br />
== Backbones ==<br />
===Displaying the C-Alpha trace of proteins===<br />
<source lang="python"><br />
hide<br />
show ribbon<br />
set ribbon_sampling,1<br />
</source><br />
<br />
And if your model only contains CA atoms, you'll also need to issue:<br />
<source lang="python"><br />
set ribbon_trace,1<br />
</source><br />
<br />
===Displaying the Amino Acid Backbone===<br />
The easiest way to see the backbone of the protein is to do<br />
<source lang="python"><br />
hide all<br />
show ribbon<br />
</source><br />
<br />
If you don't like the ribbon representation, you can also do something like<br />
<source lang="python"><br />
hide all<br />
show sticks, name C+O+N+CA<br />
</source><br />
You can replace '''sticks''' in the above by other representations like '''spheres''' or '''lines'''.<br />
<br />
===Displaying the Phosphate backbone of nucleic acids===<br />
====Native Nucleic Acid Rendering in PyMol====<br />
PyMol now better supports viewing nucleic acid structure. [[Nuccyl]] still seems to be the reigning champ for image quality, but see PyMol's native [[Cartoon]] command. For more information on representing nucleic acids, please see the [[:Category:Nucleic_Acids|Nucleic Acids]] Category.<br />
[[Image:Cnam_0.png|right|thumb|130px]] <div style="clear:right;"> </div><br />
<br />
Should you ever want to show the phosphate trace of a nucleic acid molecule:<br />
<source lang="python"><br />
def p_trace(selection="(all)"):<br />
s = str(selection)<br />
cmd.hide('lines',"("+s+")")<br />
cmd.hide('spheres',"("+s+")")<br />
cmd.hide('sticks',"("+s+")")<br />
cmd.hide('ribbon',"("+s+")")<br />
cmd.show('cartoon',"("+s+")")<br />
cmd.set('cartoon_sampling',1,"("+s+")")<br />
cmd.set('cartoon_tube_radius',0.5,"("+s+")")<br />
cmd.extend('p_trace',p_trace)<br />
</source><br />
<br />
and then:<br />
<source lang="python"><br />
p_trace (selection)<br />
</source><br />
<br />
==Align proteins with CA fit==<br />
If two proteins have significant homology, you can use the [[Align]] command:<br />
<source lang="python"><br />
align prot1////ca,prot2<br />
</source><br />
<br />
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.<br />
<br />
[[Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
[[Category:Nucleic_Acids|Displaying Biochemical Properties]]</div>Moinohttps://wiki.pymol.org/index.php?title=Displaying_Biochemical_Properties&diff=8198Displaying Biochemical Properties2008-10-08T00:17:56Z<p>Moino: /* Residues with functional groups */</p>
<hr />
<div>==Selecting secondary structures==<br />
A few examples:<br />
<source lang="python"><br />
select helix, (ss h)<br />
select sheet, (ss s)<br />
select loop, (ss l+'')<br />
</source><br />
<br />
===Manually Assigning Secondary Structure===<br />
You can manually assign secondary stuctures to your protein by<br />
<source lang="python"><br />
alter 96-103/, ss='S'<br />
alter 96-103/, ss='H'<br />
alter 96-103/, ss='L'<br />
</source><br />
<br />
to set residues 96-103 to beta Strand, alpha Helix, and Loop respectively.<br />
<br />
===See Also===<br />
[[Dss]] [[Caver]]<br />
<br />
[[:Category:FAQ|FAQ]] [[:Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
<br />
==Coloring ==<br />
See also [[:Category:Coloring]]. <br />
<br />
===Color by atom type from a script===<br />
See [[Color]] for this.<br />
<br />
===Assign color by B-factor===<br />
See section [[Color]] for this.<br />
<br />
<br />
== Bonds ==<br />
PyMOL can deduce bonds from the PDB structure file, even if the '''CONECT''' records are missing. In fact, PyMOL guesses bonding connectivity based on proximity, based on the empirical observation that two atoms of a given radius will not be generally closer than a certain distance unless they are bonded.<br />
<br />
===Displaying double bonds===<br />
<gallery widths="300px" heights="300px"><br />
Image:DoubleBonds.png|Image showing double bonds in PyMOL. Double bonds are supported in [[lines]] and [[sticks]].<br />
</gallery><br />
<br />
You can go into the [[lines]] mode and turning on the valence display:<br />
<source lang="python"><br />
hide<br />
as lines<br />
set valence, 0.1<br />
</source><br />
<br />
A higher value for valence spreads things out more. I don't know of a way to get the dotted notation.<br />
<br />
===Hydrogen bonds and Polar Contacts===<br />
[[Image:Polar_contacts_small.png|thumb|Polar Contacts in PyMol|center|300px]]<br />
Using the actions [A] button for an object or selection you can display Hydrogen bonds and Polar Contacts.<br />
[A]->find->polar contacts-><select from menu><br />
<br />
The command behind the menus is the <b>dist</b>ance command called with the additional argument mode=2.<br />
<br />
Parameters that control the the identification of H-bonds are defined as<br />
set h_bond_cutoff_center, 3.6<br />
with ideal geometry and<br />
set h_bond_cutoff_edge, 3.2<br />
with minimally acceptable geometry.<br />
<br />
These settings can be changed *before* running the detection process (dist<br />
command mode=2 or via the menus).<br />
<br />
Note that the hydrogen bond geometric criteria used in PyMOL was designed to<br />
emulate that used by DSSP.<br />
<br />
==== Hydrogen bonds between specific atoms ====<br />
<source lang="python"><br />
dist name, sele1, sele2, mode=2<br />
</source><br />
<br />
<br />
==== Hydrogen bonds where find->polar contacts doesn't do what you need ====<br />
You can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use [[h_add]] on the proteins, or provide ligands with valence information and then use h_add.<br />
<br />
Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.<br />
<source lang="python"><br />
# EXAMPLE 1: Show hydrogen bonds between protein <br />
# and docked ligands (which must have hydrogens)<br />
<br />
load target.pdb,prot<br />
load docked_ligs.sdf,lig<br />
<br />
# add hydrogens to protein<br />
<br />
h_add prot<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (lig and acc),(prot and don), 3.2<br />
dist HBD, (lig and don),(prot and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
</source><br />
<source lang="python"><br />
# EXAMPLE 2<br />
# Show hydrogen bonds between two proteins<br />
<br />
load prot1.pdb<br />
load prot2.pdb<br />
<br />
h_add prot1<br />
h_add prot2<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (prot1 and acc),(prot2 and don), 3.2<br />
dist HBD, (prot1 and don),(prot2 and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
<br />
# NOTE: that you could also use this approach between two<br />
# non-overlapping selections within a single object.<br />
</source><br />
There is also a [http://www.ebi.ac.uk/~gareth/pymol/downloads/scripts/hbond.py script] drawing nice hydrogen bonds from [http://www.ebi.ac.uk/~gareth Gareth Stockwell].<br />
<br />
The "polar contacts" mentioned above are probably better at finding hydrogen bonds than these scripts. "Polar contacts" check geometry as well as distance.<br />
<br />
<br />
==Calculating dihedral angles==<br />
The get_dihedral function requires four single-atom selections to work:<br />
<source lang="python"><br />
get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C<br />
</source><br />
<br />
== Cavities ==<br />
See [[Surfaces_and_Voids]]. Also [[Caver]] and [[CASTp]].<br />
<br />
==Surface-Related==<br />
<br />
===Surface Area===<br />
To calculate the surface area of a selection, see [[Get_Area]].<br />
<br />
===Polar surface area===<br />
For a solvent accessible PSA approximation:<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
show dots<br />
set dot_solvent, on<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
For molecular PSA approximation<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
set dot_solvent, off<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.<br />
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...<br />
<br />
===Display solvent accessible surface===<br />
Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.<br />
<br />
PyMOL can only show solvent accessible surfaces using the dot or sphere representations:<br />
<br />
for dots:<br />
<source lang="python"><br />
show dots<br />
set dot_mode,1<br />
set dot_density,3<br />
</source><br />
<br />
for spheres:<br />
<source lang="python"><br />
alter all,vdw=vdw+1.4<br />
show spheres<br />
</source><br />
<br />
===Contact Potential===<br />
See [[Protein_contact_potential]] and [[APBS]].<br />
[[Image:Prot_contact_pot.png|thumb|right|125px]]<br />
<div style="clear:right;"> </div><br />
<br />
===Residues with functional groups===<br />
Poor man's solution: Display protein as surface, colorize all Lys (-NH2), Asp and Glu (-COOH) and Cys (-SH):<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
color slate, resn lys # lysines in light blue<br />
color paleyellow, resn cys # cysteines in light yellow<br />
color tv_red, (resn asp or(resn glu)) # aspartic and glutamic acid in light red<br />
</source><br />
<br />
Not-''so''-poor-man's solution: In order to have the functional groups better localized, only the central atoms can be colored: <br />
* the S atom of cystein, <br />
* the N and H atoms of the free amine of lysine (may be displayed with three H atoms at all three possible positions)<br />
* the C and two O atoms of free carboxylic groups in aspartic and glutamic acid <br />
In this way, they are better visible through the surface compared to only one colored atom, both amines and carboxylic groups consist of three colored atoms each.<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
select sulf_cys, (resn cys and (elem C)) # get the sulfur atom of cystein residues<br />
color yellow, sulf_cys<br />
<br />
select nitro_lys, (resn lys and name NZ) # get the nitrogens of free amines ("NZ" in PDB file)<br />
select hydro_lys, (elem H and (neighbor nitro_lys)) # get the neighboring H atoms <br />
select amine_lys, (nitro_lys or hydro_lys)<br />
color tv_blue, amine_lys<br />
<br />
<br />
select oxy_asp, (resn asp and (name OD1 or name OD2)) # get the two oxygens of -COOH ("OD1", "OD2")<br />
select carb_asp, (resn asp and (elem C and (neighbor oxy_asp))) # get the connecting C atom<br />
select oxy_glu, (resn glu and (name OE1 or name OE2)) # oxygens "OE1" and "OE2" in PDB file<br />
select carb_glu, (resn glu and (elem c and (neighbor oxy_glu)))<br />
select carboxy, (carb_asp or oxy_asp or carb_glu or oxy_glu)<br />
color tv_red, carboxy<br />
</source><br />
<br />
By displaying the protein as non-transparent surface, only the functional groups (colored atoms) at the surface are visible. <br />
<br />
When displaying the protein as cartoon, the functional groups can be shown as spheres, and the whole residues cys, lys, asp and glu as sticks connected to the backbone. However, then also the not accessible residues inside the protein are visible.<br />
<gallery><br />
Image:1igt_cys_lys_asp_glu_colored.png|Whole residues colored (Cys: yellow, Lys: blue, Asp and Glu: red)<br />
Image:1igt_functional_groups_colored.png|Only central atoms of functional groups colored (Cys: S, Lys: NH2, Asp and Glu: CO2)<br />
</gallery><br />
<br />
== Backbones ==<br />
===Displaying the C-Alpha trace of proteins===<br />
<source lang="python"><br />
hide<br />
show ribbon<br />
set ribbon_sampling,1<br />
</source><br />
<br />
And if your model only contains CA atoms, you'll also need to issue:<br />
<source lang="python"><br />
set ribbon_trace,1<br />
</source><br />
<br />
===Displaying the Amino Acid Backbone===<br />
The easiest way to see the backbone of the protein is to do<br />
<source lang="python"><br />
hide all<br />
show ribbon<br />
</source><br />
<br />
If you don't like the ribbon representation, you can also do something like<br />
<source lang="python"><br />
hide all<br />
show sticks, name C+O+N+CA<br />
</source><br />
You can replace '''sticks''' in the above by other representations like '''spheres''' or '''lines'''.<br />
<br />
===Displaying the Phosphate backbone of nucleic acids===<br />
====Native Nucleic Acid Rendering in PyMol====<br />
PyMol now better supports viewing nucleic acid structure. [[Nuccyl]] still seems to be the reigning champ for image quality, but see PyMol's native [[Cartoon]] command. For more information on representing nucleic acids, please see the [[:Category:Nucleic_Acids|Nucleic Acids]] Category.<br />
[[Image:Cnam_0.png|right|thumb|130px]] <div style="clear:right;"> </div><br />
<br />
Should you ever want to show the phosphate trace of a nucleic acid molecule:<br />
<source lang="python"><br />
def p_trace(selection="(all)"):<br />
s = str(selection)<br />
cmd.hide('lines',"("+s+")")<br />
cmd.hide('spheres',"("+s+")")<br />
cmd.hide('sticks',"("+s+")")<br />
cmd.hide('ribbon',"("+s+")")<br />
cmd.show('cartoon',"("+s+")")<br />
cmd.set('cartoon_sampling',1,"("+s+")")<br />
cmd.set('cartoon_tube_radius',0.5,"("+s+")")<br />
cmd.extend('p_trace',p_trace)<br />
</source><br />
<br />
and then:<br />
<source lang="python"><br />
p_trace (selection)<br />
</source><br />
<br />
==Align proteins with CA fit==<br />
If two proteins have significant homology, you can use the [[Align]] command:<br />
<source lang="python"><br />
align prot1////ca,prot2<br />
</source><br />
<br />
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.<br />
<br />
[[Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
[[Category:Nucleic_Acids|Displaying Biochemical Properties]]</div>Moinohttps://wiki.pymol.org/index.php?title=Talk:Displaying_Biochemical_Properties&diff=314Talk:Displaying Biochemical Properties2008-10-07T23:59:03Z<p>Moino: comments to functional grousp</p>
<hr />
<div># This page is '''very''' important. It needs to be cleaned up and split into various pages.<br />
<br />
==Functional groups==<br />
here it would be great if sb could tell how to select only the groups accessible on the surface but not the residues inside the proteins, a much better solution than that what I have put now. Please check if everything is right, I'm still new to pymol.<br />
* I have tried it with IGG, are the atoms "NZ", "OE" and "OE" always called like this also in other PDB files?<br />
-- 18:59, 7 October 2008 (CDT)<br />
<br />
<br />
------------<br />
<br />
3rd Oct 2007: Looks to me as if there is a strong case for updating the H-bonds/polar contacts section to present a more coherent picture. Anyone object? [[User:Bosmith|Bosmith]]<br />
<br />
Nope, feel free to make the changes!<br />
[[User:Inchoate|Tree]] 11:58, 3 October 2007 (CDT)<br />
<br />
Had a go - what do you reckon? [[User:Bosmith|Bosmith]]<br />
<br />
Nice. Thanks.[[User:Inchoate|Tree]] 16:16, 3 November 2007 (CDT)<br />
<br />
== Organization ==<br />
<br />
This page needs to be a category.</div>Moinohttps://wiki.pymol.org/index.php?title=Displaying_Biochemical_Properties&diff=8197Displaying Biochemical Properties2008-10-07T23:53:46Z<p>Moino: /* Surface-Related */ colorize residues with functional groups, please check for correctness</p>
<hr />
<div>==Selecting secondary structures==<br />
A few examples:<br />
<source lang="python"><br />
select helix, (ss h)<br />
select sheet, (ss s)<br />
select loop, (ss l+'')<br />
</source><br />
<br />
===Manually Assigning Secondary Structure===<br />
You can manually assign secondary stuctures to your protein by<br />
<source lang="python"><br />
alter 96-103/, ss='S'<br />
alter 96-103/, ss='H'<br />
alter 96-103/, ss='L'<br />
</source><br />
<br />
to set residues 96-103 to beta Strand, alpha Helix, and Loop respectively.<br />
<br />
===See Also===<br />
[[Dss]] [[Caver]]<br />
<br />
[[:Category:FAQ|FAQ]] [[:Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
<br />
==Coloring ==<br />
See also [[:Category:Coloring]]. <br />
<br />
===Color by atom type from a script===<br />
See [[Color]] for this.<br />
<br />
===Assign color by B-factor===<br />
See section [[Color]] for this.<br />
<br />
<br />
== Bonds ==<br />
PyMOL can deduce bonds from the PDB structure file, even if the '''CONECT''' records are missing. In fact, PyMOL guesses bonding connectivity based on proximity, based on the empirical observation that two atoms of a given radius will not be generally closer than a certain distance unless they are bonded.<br />
<br />
===Displaying double bonds===<br />
<gallery widths="300px" heights="300px"><br />
Image:DoubleBonds.png|Image showing double bonds in PyMOL. Double bonds are supported in [[lines]] and [[sticks]].<br />
</gallery><br />
<br />
You can go into the [[lines]] mode and turning on the valence display:<br />
<source lang="python"><br />
hide<br />
as lines<br />
set valence, 0.1<br />
</source><br />
<br />
A higher value for valence spreads things out more. I don't know of a way to get the dotted notation.<br />
<br />
===Hydrogen bonds and Polar Contacts===<br />
[[Image:Polar_contacts_small.png|thumb|Polar Contacts in PyMol|center|300px]]<br />
Using the actions [A] button for an object or selection you can display Hydrogen bonds and Polar Contacts.<br />
[A]->find->polar contacts-><select from menu><br />
<br />
The command behind the menus is the <b>dist</b>ance command called with the additional argument mode=2.<br />
<br />
Parameters that control the the identification of H-bonds are defined as<br />
set h_bond_cutoff_center, 3.6<br />
with ideal geometry and<br />
set h_bond_cutoff_edge, 3.2<br />
with minimally acceptable geometry.<br />
<br />
These settings can be changed *before* running the detection process (dist<br />
command mode=2 or via the menus).<br />
<br />
Note that the hydrogen bond geometric criteria used in PyMOL was designed to<br />
emulate that used by DSSP.<br />
<br />
==== Hydrogen bonds between specific atoms ====<br />
<source lang="python"><br />
dist name, sele1, sele2, mode=2<br />
</source><br />
<br />
<br />
==== Hydrogen bonds where find->polar contacts doesn't do what you need ====<br />
You can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use [[h_add]] on the proteins, or provide ligands with valence information and then use h_add.<br />
<br />
Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.<br />
<source lang="python"><br />
# EXAMPLE 1: Show hydrogen bonds between protein <br />
# and docked ligands (which must have hydrogens)<br />
<br />
load target.pdb,prot<br />
load docked_ligs.sdf,lig<br />
<br />
# add hydrogens to protein<br />
<br />
h_add prot<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (lig and acc),(prot and don), 3.2<br />
dist HBD, (lig and don),(prot and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
</source><br />
<source lang="python"><br />
# EXAMPLE 2<br />
# Show hydrogen bonds between two proteins<br />
<br />
load prot1.pdb<br />
load prot2.pdb<br />
<br />
h_add prot1<br />
h_add prot2<br />
<br />
select don, (elem n,o and (neighbor hydro))<br />
select acc, (elem o or (elem n and not (neighbor hydro)))<br />
dist HBA, (prot1 and acc),(prot2 and don), 3.2<br />
dist HBD, (prot1 and don),(prot2 and acc), 3.2<br />
delete don<br />
delete acc<br />
hide (hydro)<br />
<br />
hide labels,HBA<br />
hide labels,HBD<br />
<br />
# NOTE: that you could also use this approach between two<br />
# non-overlapping selections within a single object.<br />
</source><br />
There is also a [http://www.ebi.ac.uk/~gareth/pymol/downloads/scripts/hbond.py script] drawing nice hydrogen bonds from [http://www.ebi.ac.uk/~gareth Gareth Stockwell].<br />
<br />
The "polar contacts" mentioned above are probably better at finding hydrogen bonds than these scripts. "Polar contacts" check geometry as well as distance.<br />
<br />
<br />
==Calculating dihedral angles==<br />
The get_dihedral function requires four single-atom selections to work:<br />
<source lang="python"><br />
get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C<br />
</source><br />
<br />
== Cavities ==<br />
See [[Surfaces_and_Voids]]. Also [[Caver]] and [[CASTp]].<br />
<br />
==Surface-Related==<br />
<br />
===Surface Area===<br />
To calculate the surface area of a selection, see [[Get_Area]].<br />
<br />
===Polar surface area===<br />
For a solvent accessible PSA approximation:<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
show dots<br />
set dot_solvent, on<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
For molecular PSA approximation<br />
<source lang="python"><br />
set dot_density, 3<br />
remove hydro<br />
remove solvent<br />
set dot_solvent, off<br />
get_area elem N+O<br />
get_area elem C+S<br />
get_area all<br />
</source><br />
<br />
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.<br />
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...<br />
<br />
===Display solvent accessible surface===<br />
Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.<br />
<br />
PyMOL can only show solvent accessible surfaces using the dot or sphere representations:<br />
<br />
for dots:<br />
<source lang="python"><br />
show dots<br />
set dot_mode,1<br />
set dot_density,3<br />
</source><br />
<br />
for spheres:<br />
<source lang="python"><br />
alter all,vdw=vdw+1.4<br />
show spheres<br />
</source><br />
<br />
===Contact Potential===<br />
See [[Protein_contact_potential]] and [[APBS]].<br />
[[Image:Prot_contact_pot.png|thumb|right|125px]]<br />
<div style="clear:right;"> </div><br />
<br />
===Residues with functional groups===<br />
Poor man's solution: Display protein as surface, colorize all Lys (-NH2), Asp and Glu (-COOH) and Cys (-SH):<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
color slate, resn lys # lysines in light blue<br />
color paleyellow, resn cys # cysteines in light yellow<br />
color tv_red, (resn asp and (resn glu)) # aspartic and glutamic acid in light red<br />
</source><br />
<br />
Not-''so''-poor-man's solution: In order to have the functional groups better localized, only the central atoms can be colored: <br />
* the S atom of cystein, <br />
* the N and H atoms of the free amine of lysine (may be displayed with three H atoms at all three possible positions)<br />
* the C and two O atoms of free carboxylic groups in aspartic and glutamic acid <br />
In this way, they are better visible through the surface compared to only one colored atom, both amines and carboxylic groups consist of three colored atoms each.<br />
<source lang="python"><br />
remove resn hoh # remove water<br />
h_add prot # add hydrogens<br />
<br />
as surface<br />
color grey90<br />
<br />
select sulf_cys, (resn cys and (elem C)) # get the sulfur atom of cystein residues<br />
color yellow, sulf_cys<br />
<br />
select nitro_lys, (resn lys and name NZ) # get the nitrogens of free amines ("NZ" in PDB file)<br />
select hydro_lys, (elem H and (neighbor nitro_lys)) # get the neighboring H atoms <br />
select amine_lys, (nitro_lys or hydro_lys)<br />
color tv_blue, amine_lys<br />
<br />
<br />
select oxy_asp, (resn asp and (name OD1 or name OD2)) # get the two oxygens of -COOH ("OD1", "OD2")<br />
select carb_asp, (resn asp and (elem C and (neighbor oxy_asp))) # get the connecting C atom<br />
select oxy_glu, (resn glu and (name OE1 or name OE2)) # oxygens "OE1" and "OE2" in PDB file<br />
select carb_glu, (resn glu and (elem c and (neighbor oxy_glu)))<br />
select carboxy, (carb_asp or oxy_asp or carb_glu or oxy_glu)<br />
color tv_red, carboxy<br />
</source><br />
<br />
By displaying the protein as non-transparent surface, only the functional groups (colored atoms) at the surface are visible. <br />
<br />
When displaying the protein as cartoon, the functional groups can be shown as spheres, and the whole residues cys, lys, asp and glu as sticks connected to the backbone. However, then also the not accessible residues inside the protein are visible.<br />
<br />
== Backbones ==<br />
===Displaying the C-Alpha trace of proteins===<br />
<source lang="python"><br />
hide<br />
show ribbon<br />
set ribbon_sampling,1<br />
</source><br />
<br />
And if your model only contains CA atoms, you'll also need to issue:<br />
<source lang="python"><br />
set ribbon_trace,1<br />
</source><br />
<br />
===Displaying the Amino Acid Backbone===<br />
The easiest way to see the backbone of the protein is to do<br />
<source lang="python"><br />
hide all<br />
show ribbon<br />
</source><br />
<br />
If you don't like the ribbon representation, you can also do something like<br />
<source lang="python"><br />
hide all<br />
show sticks, name C+O+N+CA<br />
</source><br />
You can replace '''sticks''' in the above by other representations like '''spheres''' or '''lines'''.<br />
<br />
===Displaying the Phosphate backbone of nucleic acids===<br />
====Native Nucleic Acid Rendering in PyMol====<br />
PyMol now better supports viewing nucleic acid structure. [[Nuccyl]] still seems to be the reigning champ for image quality, but see PyMol's native [[Cartoon]] command. For more information on representing nucleic acids, please see the [[:Category:Nucleic_Acids|Nucleic Acids]] Category.<br />
[[Image:Cnam_0.png|right|thumb|130px]] <div style="clear:right;"> </div><br />
<br />
Should you ever want to show the phosphate trace of a nucleic acid molecule:<br />
<source lang="python"><br />
def p_trace(selection="(all)"):<br />
s = str(selection)<br />
cmd.hide('lines',"("+s+")")<br />
cmd.hide('spheres',"("+s+")")<br />
cmd.hide('sticks',"("+s+")")<br />
cmd.hide('ribbon',"("+s+")")<br />
cmd.show('cartoon',"("+s+")")<br />
cmd.set('cartoon_sampling',1,"("+s+")")<br />
cmd.set('cartoon_tube_radius',0.5,"("+s+")")<br />
cmd.extend('p_trace',p_trace)<br />
</source><br />
<br />
and then:<br />
<source lang="python"><br />
p_trace (selection)<br />
</source><br />
<br />
==Align proteins with CA fit==<br />
If two proteins have significant homology, you can use the [[Align]] command:<br />
<source lang="python"><br />
align prot1////ca,prot2<br />
</source><br />
<br />
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.<br />
<br />
[[Category:Objects_and_Selections|Displaying Biochemical Properties]]<br />
[[Category:Nucleic_Acids|Displaying Biochemical Properties]]</div>Moinohttps://wiki.pymol.org/index.php?title=Category:FAQ&diff=4018Category:FAQ2008-10-07T17:54:15Z<p>Moino: /* Commands */ how to select residues (functional grops) on protein surface?</p>
<hr />
<div>==Overview==<br />
Please post your FAQs here. I suggest you write a Q&A style list with a short answer. More involved answers should link to its own page. Just my suggestion. Should we have topics? Please note, not all AQ are FAQ. Also, many answers to frequently recurring problems are probably best sought by searching for your terms in the Wiki.<br />
<br />
===Installation===<br />
Q: I've installed PyMol_0_98, and recently my structures have stopped displaying. I've tried uninstalling PyMol_0_98 and installing PyMol_0_97, and yet i've ran into the same problem...my .pdb files no longer display, although it is evident that they are being loaded and I can edit them.<br />
<br />
Does anybody have any clue as to what might be the problem?<br />
Thanks, shebsmehr<br />
<br />
<br />
----<br />
===Startup===<br />
Q: I've installed PyMol_0_98 correctly but I can't open my files in .mol2 or .pdb format from the menubar. Instead I can open them with the program. I can't even save the images I create in PyMol and obviously the mivie too.<br />
<br />
Could you help me to solve these problems.<br />
Thanks<br />
Vittorio<br />
<br />
A1: Vittorio, if I understand you correctly, then you need to (a) make sure you have the PDB file on your machine, say Desktop (or home directory, for *nix), then in the GUI click on, "File"->"Open" then use the dialog to find the file you want to load. You can save time if you know where the file is by just using PyMol's "load" command<br />
load fileName, objectName<br />
loads the fileName into a new object called objectName, for example,<br />
load /tmp/1ggz.pdb, 1ggz<br />
<br />
See [[Cmd load|load]], <br />
<br />
A2: To save images you have a couple options. First, to save a quick raw screen dump type, "png fileName" to save a PNG image (IE and other programs can view these files). Or, secondly, if you prefer a higher quality image with ray-traced shadows and textures you can do, "ray" then, the above "png" command.<br />
<br />
See [[Cmd ray|ray]], [[Cmd png|png]], [[:Category:Using_Pymol|Using PyMol]]<br />
<br />
Hope this helps. If it didn't please restate your question to make it more clear.<br />
----<br />
Q: Hi I have a problem. For some reason PyMOl do not display certain areas (several loops) of my .pdb file (1DAN) when in cartoon. When I display the structure in "lines" or "sticks" everything is ok. Furthermore, other .pdb viewers dont have this problem. I have tried several things:<br />
1. Upgraded to the newest version og PyMol.<br />
2. Redefined secondary structure using the "alter command".<br />
3. Imported the .pdb file into SwissViewer, saved as the imported structure as a .pdb file, and then imported into PyMOl.<br />
<br />
None of these things have solved the problem. Help please! (I would hate to have to start using another pdb-viewer!!)<br />
Cheers<br />
Kasper<br />
<br />
----<br />
<br />
Q: Can the startup settings be edited so that MacPyMol starts with a One-Button Mouse mode? Please advise.<br />
A: echo "config_mouse one_button" >> ~/.pymolrc<br />
<br />
----<br />
Q: What I should write into the .pymolrc (Mandriva Linux) to be able open PyMol with .pdb or .pml from shell? I was able to run pymol *.pdb with old 0.99rc6 version, but then I upgraded Mandriva Linux and this option is not working anymore.<br />
<br />
===Settings===<br />
Q: I am wondering how to change the default settings for a color "spectrum". I would like to color by b-factor but not with the default spectrum but from white-to-red.<br />
<br />
A: See [[Color#Color_by_Spectrum_Example]].<br />
----<br />
Q: I would like the distance labels generated with the 'distance' command to be single-digit only, e.g. 2.8 instead of 2.77. How can I do this? Thanks, MindFrog<br />
<br />
A: Setting startup settings and python commands can be done in a file: ~/.pymolrc<br />
E.g. command in there: cmd.set('label_distance_digits',1)<br />
On my windows machine this is in C:\Documents and Settings\jurgen.WHELK.000\.pymolrc<br />
===Commands===<br />
Q: I want to move one object while keeping another fixed. How do I do this?<br />
<br />
A: Load the proteins as separate objects, put the mouse into 3-button editing mode, then shift-middle click-and-drag on the molecule to translate and shift-left-click-and-drag to rotate. (Warren DeLano answer)<br />
----<br />
Q: I'd like to select residues that are in contact with a surface, or else be able to select buried/non-buried residues, is there any way to do this ? [[User:Xevi|Xevi]] 03:52, 16 Jun 2006 (CDT)<br />
: I'm also looking for this (e.g. to see available lysines' -NH2 or cysteines' -SH on the surface), could one maybe cover the protein with an additional layer of new atoms, and then select all protein atoms close to these? [[User:Moino|Moino]] 12:54, 7 October 2008 (CDT)<br />
----<br />
Q: After using the usual mset command to rotate an object, states/frames are loaded into that object. However, using the "frame" command has odd behaviour (in comparison to loading a molecular dynamics trajectory into the state in which the "frame" command behaves normally). Can anyone explain this?<br />
<br />
----<br />
<br />
Q: How do I suppress the 'ExecutiveRMS' output while running cmd.pair_fit()?<br />
<br />
----<br />
<br />
Q: How does cmd.rms() choose a mapping between atoms in the selections? Exhaustive search over all possibilities?<br />
<br />
----<br />
Q: How do I select (especially, iterate through a set of) bonds? The existence of [http://www.pymolwiki.org/index.php/Cycle_Valence cycle valence] seems to imply that it can be done. Is this possible via the API?<br />
----<br />
<br />
===Export/Import===<br />
Q: Is there any way to export PyMol models onto CAD standards (autocad, archicad) or 3D modeling software (blender, 3DStudio, Maya)? Thanks a lot.<br />
----<br />
Q: I am doing some MD simulations using CHARMM (not AMBER) and would like to visualize the .dcd files output by CHARMM. I understand that PyMol can open .trj files from AMBER but is there a way to open up these .dcd files and if not, are there any plans to implement this? Thank you for your time!<br />
<br />
A: Answering my own question here. See: [[Load_Traj]]<br />
<br />
===Others===<br />
Q: I was wondering what the percentage given under the mutengensis wizard means? Thanks...<br />
----<br />
Q: Some of the bases in RNA helices are missing (not all in any given helix) when I am showing them in the CARTOON mode. How should I set it to get them shown? I tried the Secondary Structure Assignment commands, they did not work.<br />
----<br />
Q: Why does PyMol run version 2.3 of Python when I have Python 2.5 installed? How do I tell it to switch?<br />
----<br />
Q: How do I cite PyMOL?<br />
<br />
A: DeLano, W.L. The PyMOL Molecular Graphics System. (2008) DeLano Scientific LLC, Palo Alto, CA, USA. http://www.pymol.org</div>Moino