Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Modeling and Editing Structures
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Modeling in PyMOL= ==Saving with transformed coordinates== Here is a simple script that saves the molecule with coordinates from the current orientation. (invoke it with 'run save_transformed.py' and type the new save_transformed.py command thereafter). <source lang="python"> # Adds the command save_transformed # Usage: save_transformed object, file def save_transformed(object,file): m = cmd.get_view(0) ttt = [m[0], m[1], m[2], 0.0, m[3], m[4], m[5], 0.0, m[6], m[7], m[8], 0.0, 0.0, 0.0, 0.0, 1.0] cmd.transform_object(object,ttt,transpose=1) cmd.save(file,object) cmd.extend('save_transformed',save_transformed) </source> ==Translate or rotate individual objects== There is a "[[translate]]" function similar to "[[rotate]]", feel free to use them in the following forms: <source lang="python"> translate vector,object-name,state (vector needs to be something like [x,y,z]) translate [1,0,0],pept rotate axis,angle,object-name,state (axis can be either the letter x,y,z or a 3D vector [x,y,z]) rotate x,90,pept rotate [1,1,1],10,pept </source> ==Moving one segment relative to the rest== This means moving two parts of one object into different directions. The easiest way to do this is to split the objects and then use the rotate command. <source lang="python"> load 1FJ1.pdb # split PDB file create anti=(chain F) create fab=(chain A,B) # delete original object delete 1FJ1 # color objects color green,fab color pink,anti # color interface select inter = (byres ((fab within 5 of anti)\ or (anti within 5 of fab))) color yellow,inter # splay apart orient origin fab rotate y,60,fab origin anti rotate y,-60, anti # zoom interface region zoom inter show sph,inter disable inter </source> ==[[Split_States|Split states]] to objects== There is also a new command in the 0.95 series: <source lang="python"> split_states object-name </source> which will spread a PDB "biological unit" (or any multi-state object -- including SD files) over a series of independent objects. This makes it possible to interact with such objects more naturally than with "all_states = 1". ==Altering secondary structures== Examples: <source lang="python"> alter A/10:34/, ss='H' alter A/35:40/, ss='L' alter A/41:60/, ss='S' </source> ==Altering van der Waals radii== Example: <source lang="python"> alter (elem Fe),vdw=1.8 rebuild </source> (The value for Fe is wrecked in PyMOL at the moment, so running the above line might be a good idea). ==Altering atom coordinates== Example: <source lang="python"> alter_state 1,(pdb1cse),x=x-10.0 </source> The latter section can contain formulae involving at least the xyz coordinates, lots of constants and the (+-*/) operators. ==Deleting bonds== Select the bond using Ctrl-right-click, then either <source lang="python"> unbond pk1,pk2 </source> or hit Ctrl-D. ==Converting D- to L- amino acids== The inversion function was changed in version 0.95 to take advantage of multiple picked atoms. To invert a center, Ctrl-middle-click to pick the center atom as pk1 and two stationary atoms as pk2 and pk3. Then type Ctrl-E to invert. ==Adding disulfide bonds== You can use the [[bond]] command to attach them: <source lang="python"> bond 24/sg,26/sg bond 56/sg,99/sg unpick </source> (unpick will hide the bond baton which gets displayed.) Additionally, the residue names can be changed for bonded cysteines: <source lang="python"> alter cys/,name='CYX' </source> or for specific residues <source lang="python"> alter 24+26+56+99/,name='CYX' </source> ==Adding hydrogen bonds== :''See [[Displaying_Biochemical_Properties#Hydrogen_bonds_and_Polar_Contacts|Displaying biochemical properties]].'' ==Protonating ligands== If your ligands come in with valid valencies and formal charges, PyMOL's h_add command can protonate ligands. (NOTE that there is a minor technical hiccup with SD-files which are loaded by default as immutable "discrete" objects.) Suffice it to say that in order to make changes to the chemical structure, an object must be loaded with the "discrete" flag set to zero. Unfortunately, much of the molecular editing stuff remains to be documented. Here's an example sequence, but I'm not sure it will help to much...as indicated in the manual, this is immature functionality with some major gaps. Attach in particular is very limited... <source lang="python"> # show valences set valence=0.05 # load cysteine fragment fragment cys # remove hydrogens remove (hydro) # edit gamma S edit cys////sg # add hydrogen attach H,1,1 # add planer, trivalent nitrogen onto C terminus edit cys////C attach N,3,3 # edit that nitrogen edit (elem N and neighbor cys////C) # attach a tetrahedral methyl (note random position) attach C,4,4 # here's an example of adding a whole residue from the library edit cys////N editor.attach_amino_acid("pk1","ace") # now restore missing hydrogens (note that the names are off...) h_add </source> ==Superposition of two molecules== Using pair_fit requires that you specify a set of paired atoms in each structure. Fortunately, you no longer have to specify each pair separately, so long as the ordering is the same in each selection (almost always true). <source lang="python"> pair_fit ( trna10 and resid 10:15 and name P ), ( ref4 and resid 10:15 and name P ) </source> Another example: <source lang="python"> pair_fit prot1///11-26/CA, prot2///34-49/CA </source> would superimpose prot1 on prot2 using C-alphas from residues 11-26 in prot1 and 34-49 in prot2. ==Manual superposition of two molecules== You can also align to structures using mouse rotation/translation. For this, you need to protect those molecules you don't want to move with (action menu -> movement -> protect) in the selection menu. Protect one object, deprotect the other, grab the deprotected object and move with Shift-Mouse. Don't forget to switch to Mouse Editing mode. ==Adding and using your own fragments== Pymol has some build-in fragments (amino acids and simple functional groups). You can add your own fragments, eg. sugars, in this way: Create the molecule you want to use as a fragment. Save it as a .pkl file in <pymol_path>/data/chempy/fragments. How to use the fragment: Pick the atom (ctrl-middle) where you want to add the fragment. This will usually be a hydrogen atom (which will be removed). Then use the command: editor.attach_fragment('pk1','my_fragment_name',11,0) where my_fragment_name is the name of the pkl-file (w/o .pkl extension) and 11 is the number of the connecting (hydrogen) atom in the fragment. To determine this number, press '[L]abel' -> 'atom identifiers' -> 'index' and choose the hydrogen atom you want. If you want a menu item for your fragment, you can probably put it in <pymol_path>/modules/pmg_tk/skins/normal/__init__.py, but I haven't tried this. [[Category:Advanced Issues|Modeling and Editing Structures]] [[Category:Biochemical_Properties]] [[Category:States]]
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Modeling and Editing Structures
(section)
Add topic