https://wiki.pymol.org/api.php?action=feedcontributions&user=Vladimircho&feedformat=atomPyMOL Wiki - User contributions [en]2024-03-29T14:30:05ZUser contributionsMediaWiki 1.35.1https://wiki.pymol.org/index.php?title=Category:Modeling_and_Editing_Structures&diff=3843Category:Modeling and Editing Structures2005-10-01T02:24:45Z<p>Vladimircho: /* Manual superposition of two molecules */</p>
<hr />
<div>=Modeling in PyMOL=<br />
<br />
==Saving with transformed coordinates==<br />
<br />
Here is a simple script that saves the molecule with coordinates from the current orientation.<br />
(invoke it with 'run save_transformed.py' and type the new save_transformed.py command thereafter).<br />
<source lang="python"><br />
# Adds the command save_transformed<br />
# Usage: save_transformed object, file<br />
def save_transformed(object,file):<br />
m = cmd.get_view(0)<br />
ttt = [m[0], m[1], m[2], 0.0,<br />
m[3], m[4], m[5], 0.0,<br />
m[6], m[7], m[8], 0.0,<br />
0.0, 0.0, 0.0, 1.0]<br />
cmd.transform_object(object,ttt)<br />
cmd.save(file,object)<br />
<br />
cmd.extend('save_transformed',save_transformed)<br />
</source><br />
<br />
<br />
==Translate or rotate individual objects==<br />
There is a "translate" function similar to "rotate", the docs for these don't exist yet, because the implementation isn't finished. However, feel free to use them in the following forms:<br />
<br />
<source lang="python"><br />
translate vector,object-name,state<br />
(vector needs to be something like [x,y,z])<br />
<br />
translate [1,0,0],pept<br />
<br />
rotate axis,angle,object-name,state<br />
(axis can be either the letter x,y,z or a 3D vector [x,y,z])<br />
rotate x,90,pept<br />
rotate [1,1,1],10,pept<br />
</source><br />
<br />
==Moving one segment relative to the rest==<br />
<br />
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.<br />
<source lang="python"><br />
load 1FJ1.pdb<br />
<br />
# split PDB file<br />
<br />
create anti=(chain F) <br />
create fab=(chain A,B)<br />
<br />
# delete original object<br />
delete 1FJ1<br />
<br />
# color objects<br />
color green,fab<br />
color pink,anti<br />
<br />
# color interface<br />
select inter = (byres ((fab within 5 of anti)\<br />
or (anti within 5 of fab)))<br />
<br />
color yellow,inter<br />
<br />
# splay apart<br />
orient<br />
origin fab<br />
rotate y,60,fab<br />
origin anti<br />
rotate y,-60, anti<br />
<br />
# zoom interface region<br />
zoom inter<br />
show sph,inter<br />
disable inter<br />
</source><br />
<br />
==Split states to objects==<br />
There is also a new command in the 0.95 series:<br />
<source lang="python"><br />
split_states object-name<br />
</source><br />
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".<br />
<br />
<br />
<br />
==Altering secondary structures==<br />
<br />
Examples:<br />
<source lang="python"><br />
alter A/10:34/, ss='H'<br />
alter A/35:40/, ss='L'<br />
alter A/41:60/, ss='S'<br />
</source><br />
<br />
==Altering van der Waals radii==<br />
<br />
Example:<br />
<source lang="python"><br />
alter (elem Fe),vdw=1.8<br />
rebuild<br />
</source><br />
(The value for Fe is wrecked in PyMOL at the moment, so running the above line might be a good idea).<br />
<br />
<br />
==Altering atom coordinates==<br />
<br />
Example:<br />
<source lang="python"><br />
alter_state 1,(pdb1cse),x=x-10.0 <br />
</source><br />
The latter section can contain formulae involving at least the xyz coordinates, lots of constants and the (+-*/) operators.<br />
<br />
<br />
==Deleting bonds==<br />
<br />
Select the bond using Ctrl-right-click, then either<br />
<source lang="python"><br />
unbond pk1,pk2<br />
</source><br />
or hit Ctrl-D.<br />
<br />
<br />
==Converting D- to L- amino acids==<br />
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.<br />
<br />
<br />
==Adding disulfide bonds==<br />
You can use the [[Cmd bond]] command to attach them:<br />
<source lang="python"><br />
bond 24/sg,26/sg<br />
bond 56/sg,99/sg<br />
unpick<br />
</source><br />
(unpick will hide the bond baton which gets displayed.)<br />
Additionally, the residue names can be changed for bonded cysteines:<br />
<source lang="python"><br />
alter cys/,name='CYX'<br />
</source><br />
or for specific residues<br />
<source lang="python"><br />
alter 24+26+56+99/,name='CYX'<br />
</source><br />
<br />
<br />
==Adding hydrogen bonds==<br />
See 'displaying biochemical properties'.<br />
<br />
<br />
==Protonating ligands==<br />
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.<br />
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...<br />
<br />
<source lang="python"><br />
# show valences<br />
set valence=0.05<br />
<br />
# load cysteine fragment<br />
fragment cys<br />
<br />
# remove hydrogens<br />
remove (hydro)<br />
<br />
# edit gamma S<br />
edit cys////sg<br />
<br />
# add hydrogen<br />
attach H,1,1<br />
<br />
# add planer, trivalent nitrogen onto C terminus<br />
edit cys////C<br />
attach N,3,3<br />
<br />
# edit that nitrogen<br />
edit (elem N and neighbor cys////C)<br />
<br />
# attach a tetrahedral methyl (note random position)<br />
attach C,4,4<br />
<br />
# here's an example of adding a whole residue from the library<br />
edit cys////N<br />
editor.attach_amino_acid("pk1","ace")<br />
<br />
# now restore missing hydrogens (note that the names are off...)<br />
h_add<br />
</source><br />
<br />
<br />
==Superposition of two molecules==<br />
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).<br />
<source lang="python"><br />
pair_fit ( trna10 and resid 10:15 and name P ), ( ref4 and resid 10:15 and name P )<br />
</source><br />
<br />
Another example:<br />
<source lang="python"><br />
pair_fit prot1///11-26/CA, prot2///34-49/CA<br />
</source><br />
would superimpose prot1 on prot2 using C-alphas from residues 11-26 in prot1 and 34-49 in prot2.<br />
<br />
==Manual superposition of two molecules==<br />
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.<br />
<br />
Protect one object, deprotect the other, grab the deprotected object and move with Shift-Mouse. <br />
Don't forget to switch to Mouse Editing mode.<br />
<br />
[[Category:Advanced Issues|Modeling and Editing Structures]]</div>Vladimirchohttps://wiki.pymol.org/index.php?title=Category:Modeling_and_Editing_Structures&diff=3842Category:Modeling and Editing Structures2005-10-01T02:08:00Z<p>Vladimircho: /* Manual superposition of two molecules */</p>
<hr />
<div>=Modeling in PyMOL=<br />
<br />
==Saving with transformed coordinates==<br />
<br />
Here is a simple script that saves the molecule with coordinates from the current orientation.<br />
(invoke it with 'run save_transformed.py' and type the new save_transformed.py command thereafter).<br />
<source lang="python"><br />
# Adds the command save_transformed<br />
# Usage: save_transformed object, file<br />
def save_transformed(object,file):<br />
m = cmd.get_view(0)<br />
ttt = [m[0], m[1], m[2], 0.0,<br />
m[3], m[4], m[5], 0.0,<br />
m[6], m[7], m[8], 0.0,<br />
0.0, 0.0, 0.0, 1.0]<br />
cmd.transform_object(object,ttt)<br />
cmd.save(file,object)<br />
<br />
cmd.extend('save_transformed',save_transformed)<br />
</source><br />
<br />
<br />
==Translate or rotate individual objects==<br />
There is a "translate" function similar to "rotate", the docs for these don't exist yet, because the implementation isn't finished. However, feel free to use them in the following forms:<br />
<br />
<source lang="python"><br />
translate vector,object-name,state<br />
(vector needs to be something like [x,y,z])<br />
<br />
translate [1,0,0],pept<br />
<br />
rotate axis,angle,object-name,state<br />
(axis can be either the letter x,y,z or a 3D vector [x,y,z])<br />
rotate x,90,pept<br />
rotate [1,1,1],10,pept<br />
</source><br />
<br />
==Moving one segment relative to the rest==<br />
<br />
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.<br />
<source lang="python"><br />
load 1FJ1.pdb<br />
<br />
# split PDB file<br />
<br />
create anti=(chain F) <br />
create fab=(chain A,B)<br />
<br />
# delete original object<br />
delete 1FJ1<br />
<br />
# color objects<br />
color green,fab<br />
color pink,anti<br />
<br />
# color interface<br />
select inter = (byres ((fab within 5 of anti)\<br />
or (anti within 5 of fab)))<br />
<br />
color yellow,inter<br />
<br />
# splay apart<br />
orient<br />
origin fab<br />
rotate y,60,fab<br />
origin anti<br />
rotate y,-60, anti<br />
<br />
# zoom interface region<br />
zoom inter<br />
show sph,inter<br />
disable inter<br />
</source><br />
<br />
==Split states to objects==<br />
There is also a new command in the 0.95 series:<br />
<source lang="python"><br />
split_states object-name<br />
</source><br />
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".<br />
<br />
<br />
<br />
==Altering secondary structures==<br />
<br />
Examples:<br />
<source lang="python"><br />
alter A/10:34/, ss='H'<br />
alter A/35:40/, ss='L'<br />
alter A/41:60/, ss='S'<br />
</source><br />
<br />
==Altering van der Waals radii==<br />
<br />
Example:<br />
<source lang="python"><br />
alter (elem Fe),vdw=1.8<br />
rebuild<br />
</source><br />
(The value for Fe is wrecked in PyMOL at the moment, so running the above line might be a good idea).<br />
<br />
<br />
==Altering atom coordinates==<br />
<br />
Example:<br />
<source lang="python"><br />
alter_state 1,(pdb1cse),x=x-10.0 <br />
</source><br />
The latter section can contain formulae involving at least the xyz coordinates, lots of constants and the (+-*/) operators.<br />
<br />
<br />
==Deleting bonds==<br />
<br />
Select the bond using Ctrl-right-click, then either<br />
<source lang="python"><br />
unbond pk1,pk2<br />
</source><br />
or hit Ctrl-D.<br />
<br />
<br />
==Converting D- to L- amino acids==<br />
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.<br />
<br />
<br />
==Adding disulfide bonds==<br />
You can use the [[Cmd bond]] command to attach them:<br />
<source lang="python"><br />
bond 24/sg,26/sg<br />
bond 56/sg,99/sg<br />
unpick<br />
</source><br />
(unpick will hide the bond baton which gets displayed.)<br />
Additionally, the residue names can be changed for bonded cysteines:<br />
<source lang="python"><br />
alter cys/,name='CYX'<br />
</source><br />
or for specific residues<br />
<source lang="python"><br />
alter 24+26+56+99/,name='CYX'<br />
</source><br />
<br />
<br />
==Adding hydrogen bonds==<br />
See 'displaying biochemical properties'.<br />
<br />
<br />
==Protonating ligands==<br />
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.<br />
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...<br />
<br />
<source lang="python"><br />
# show valences<br />
set valence=0.05<br />
<br />
# load cysteine fragment<br />
fragment cys<br />
<br />
# remove hydrogens<br />
remove (hydro)<br />
<br />
# edit gamma S<br />
edit cys////sg<br />
<br />
# add hydrogen<br />
attach H,1,1<br />
<br />
# add planer, trivalent nitrogen onto C terminus<br />
edit cys////C<br />
attach N,3,3<br />
<br />
# edit that nitrogen<br />
edit (elem N and neighbor cys////C)<br />
<br />
# attach a tetrahedral methyl (note random position)<br />
attach C,4,4<br />
<br />
# here's an example of adding a whole residue from the library<br />
edit cys////N<br />
editor.attach_amino_acid("pk1","ace")<br />
<br />
# now restore missing hydrogens (note that the names are off...)<br />
h_add<br />
</source><br />
<br />
<br />
==Superposition of two molecules==<br />
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).<br />
<source lang="python"><br />
pair_fit ( trna10 and resid 10:15 and name P ), ( ref4 and resid 10:15 and name P )<br />
</source><br />
<br />
Another example:<br />
<source lang="python"><br />
pair_fit prot1///11-26/CA, prot2///34-49/CA<br />
</source><br />
would superimpose prot1 on prot2 using C-alphas from residues 11-26 in prot1 and 34-49 in prot2.<br />
<br />
==Manual superposition of two molecules==<br />
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.<br />
<br />
Protect one molecule, deprotect the other, and move with Shift-Mouse. Don't forget to switch to Mouse Editing mode.<br />
<br />
[[Category:Advanced Issues|Modeling and Editing Structures]]</div>Vladimircho