[PyMOL] on axis of the subunit

2015-11-29 Thread Smith Liu
Dear All,


Will you please show me how to display an axis of a subunit or a domain by 
pymol?


Smith--
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] save_transformed.py

2015-11-29 Thread Thomas Holder
Hi Smith, and everybody who tried to help you so far,

Short answer: copy and paste this into the PyMOL command line, it will save the 
view-transformed object to "transformed.pdb" in your home folder.

cv=list(cmd.get_view())
cmd.transform_selection("all", \
  cv[0:3]+[0.0]+ \
  cv[3:6]+[0.0]+ \
  cv[6:9]+[0.0]+ \
  cv[12:15]+[1.0], transpose=1)
cmd.save('~/transformed.pdb')

To comment on the many emails that have been posted so far:

1) I think you haven't used the script correct. Instead of "run 
save_trannsforme.py all, newpdb.pdb", you have to do "run save_transformed.py", 
followed by "save_transformed all, newpdb.pdb"
2) The script is actually wrong (missing transpose=1)
3) A correct solution has been posted for example here:
https://sourceforge.net/p/pymol/mailman/message/27824450/

Hope that helps.

Cheers,
  Thomas

On 28 Nov 2015, at 02:52, Jordan Willis  wrote:

> Yes, but what you are describing, saving a new view is your purpose. All 
> orient does is move the camera. It does not do anything to the x,y,z 
> coordinates of the PDB. 
>> On Nov 27, 2015, at 11:49 PM, Smith Liu  wrote:
>> 
>> Dear Jordan, 
>> 
>> To save a new view is not my purpose, my purpose is to save a new set of 
>> PDB. For example, if the original PDB does not orient well by pymol by 
>> default, first I input "orient", and I want to save a set of new pdb, when I 
>> display by pymol the new pdb, it will display as "oriented“. Is any way we 
>> can get this oriented pdb?
>> 
>> Smith
>> 
>> 
>> At 2015-11-28 15:37:10, "Jordan Willis"  wrote:
>> get view takes in camera coordinates. You can’t open a PDB and it have know 
>> anything about the camera view. You will have to grab the view, save it 
>> somewhere, and then load it. You can’t code a view change within the PDB. 
>> 
>> 
>>> On Nov 27, 2015, at 11:27 PM, Smith Liu  wrote:
>>> 
>>> Dear Jordan,
>>> 
>>> My purpose is, once you move a molecule in pymol, I want to save a new pdb, 
>>> when we open the new pdb, pymol will display the new position as default.
>>> 
>>> The script is
>>> 
>>> "# 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)
>>> cmd.save(file,object)
>>> cmd.extend('save_transformed',save_transformed)"
>>> 
>>> shown in http://pymolwiki.org/index.php/Modeling_and_Editing_Structures
>>> 
>>> Here I notice that once load a pdb, you move it a little, then you input 
>>> "get_view", you will get the matrix like
>>> 0.448818117, 0.886667669, -0.111277729
>>> -0.889764965, 0.454960942,  0.036454394
>>> 
>>> which should be the m[0] to m[5] in the above script.
>>> 
>>> In addition, in http://www.pymolwiki.org/index.php/Transform_odb, there is 
>>> also a transcript. For matrix it uses *.odb file. Is this *.odb  same as 
>>> the get_view matrix, if not, can we convert get_view matrix to *.odb?
>>> 
>>> Besides, in http://www.pymolwiki.org/index.php/Transform_selection there is 
>>> another script.
>>> 
>>> I do not know how to use this scripts to realize my purpose.
>>> 
>>> Smith
>>> 
>>> 
>>> 
>>> At 2015-11-28 15:07:18, "Jordan Willis"  wrote:
>>> very possible, can you send me the script?
 On Nov 27, 2015, at 10:58 PM, Smith Liu  wrote:
 
 By Jordan,
 
 by
 
 find ~/ -name “newpdb.pdb” or by
 
 find / -name “newpdb.pdb”
 
 still does not work. Is any possibility the original "save_transformed.py" 
 does not work?
 
 
 Smith
 
 
 At 2015-11-28 13:11:25, "Jordan Willis"  wrote:
 try running 
 
 
 find ~/ -name “newpdb.pdb” 
 
 
> On Nov 27, 2015, at 9:08 PM, Smith Liu  wrote:
> 
> 
> Dear All,
> 
> Osvaldo is new here for this question, so I repeat it a little. By pymol 
> I open a pdb and orient it and I want to save the oriented pdb. First I 
> input command "orient" after load the pdb, then I input command "run 
> save_trannsforme.py all, newpdb.pdb". I have tried to locate the 
> newpdb.pdb by locate newpdb.pdb or find newpdb.pdb, even as the root 
> user, but I cannot find the outpur newpdb.pdb. My pymol is Linux 
> Open-Source PyMOL 1.6.X.
> 
> I am looking forward  to getting a reply from you on how to get the 
> oriented pdb, which should be different from the original PDB I load.
> 
> Smith
> 
> 
> At 2015-11-28 00:44:07, "Shane Caldwell"  
> wrote:
> Hi Smith,
> 
> It will be in whatever folder pymol is launched from. If you launched 
> pymol from a specific 

Re: [PyMOL] save_transformed.py

2015-11-29 Thread Smith Liu
Dear Thomas,


I do not know I still do something wrong.


First I load a PDB in pymol, then I input orient (with orient input the 
molecule really moved significantly in display), then I input 
transform_by_camera_rotation, then I input save /tmp/withneworientation.pdb, 
the withneworientation.pdb was really saved, but the newly saved 
withneworientation.pdb has the all atom orientations (x,y,z) exactly same as 
those of the original PDB I initially input to the pymol for the process I 
obtained the withneworientation.pdb.




Smith







At 2015-11-30 08:08:52, "Thomas Holder"  wrote:
>Hi Smith, and everybody who tried to help you so far,
>
>Short answer: copy and paste this into the PyMOL command line, it will save 
>the view-transformed object to "transformed.pdb" in your home folder.
>
>cv=list(cmd.get_view())
>cmd.transform_selection("all", \
>  cv[0:3]+[0.0]+ \
>  cv[3:6]+[0.0]+ \
>  cv[6:9]+[0.0]+ \
>  cv[12:15]+[1.0], transpose=1)
>cmd.save('~/transformed.pdb')
>
>To comment on the many emails that have been posted so far:
>
>1) I think you haven't used the script correct. Instead of "run 
>save_trannsforme.py all, newpdb.pdb", you have to do "run 
>save_transformed.py", followed by "save_transformed all, newpdb.pdb"
>2) The script is actually wrong (missing transpose=1)
>3) A correct solution has been posted for example here:
>https://sourceforge.net/p/pymol/mailman/message/27824450/
>
>Hope that helps.
>
>Cheers,
>  Thomas
>
>On 28 Nov 2015, at 02:52, Jordan Willis  wrote:
>
>> Yes, but what you are describing, saving a new view is your purpose. All 
>> orient does is move the camera. It does not do anything to the x,y,z 
>> coordinates of the PDB. 
>>> On Nov 27, 2015, at 11:49 PM, Smith Liu  wrote:
>>> 
>>> Dear Jordan, 
>>> 
>>> To save a new view is not my purpose, my purpose is to save a new set of 
>>> PDB. For example, if the original PDB does not orient well by pymol by 
>>> default, first I input "orient", and I want to save a set of new pdb, when 
>>> I display by pymol the new pdb, it will display as "oriented“. Is any way 
>>> we can get this oriented pdb?
>>> 
>>> Smith
>>> 
>>> 
>>> At 2015-11-28 15:37:10, "Jordan Willis"  wrote:
>>> get view takes in camera coordinates. You can’t open a PDB and it have know 
>>> anything about the camera view. You will have to grab the view, save it 
>>> somewhere, and then load it. You can’t code a view change within the PDB. 
>>> 
>>> 
 On Nov 27, 2015, at 11:27 PM, Smith Liu  wrote:
 
 Dear Jordan,
 
 My purpose is, once you move a molecule in pymol, I want to save a new 
 pdb, when we open the new pdb, pymol will display the new position as 
 default.
 
 The script is
 
 "# 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)
 cmd.save(file,object)
 cmd.extend('save_transformed',save_transformed)"
 
 shown in http://pymolwiki.org/index.php/Modeling_and_Editing_Structures
 
 Here I notice that once load a pdb, you move it a little, then you input 
 "get_view", you will get the matrix like
 0.448818117, 0.886667669, -0.111277729
 -0.889764965, 0.454960942,  0.036454394
 
 which should be the m[0] to m[5] in the above script.
 
 In addition, in http://www.pymolwiki.org/index.php/Transform_odb, there is 
 also a transcript. For matrix it uses *.odb file. Is this *.odb  same as 
 the get_view matrix, if not, can we convert get_view matrix to *.odb?
 
 Besides, in http://www.pymolwiki.org/index.php/Transform_selection there 
 is another script.
 
 I do not know how to use this scripts to realize my purpose.
 
 Smith
 
 
 
 At 2015-11-28 15:07:18, "Jordan Willis"  wrote:
 very possible, can you send me the script?
> On Nov 27, 2015, at 10:58 PM, Smith Liu  wrote:
> 
> By Jordan,
> 
> by
> 
> find ~/ -name “newpdb.pdb” or by
> 
> find / -name “newpdb.pdb”
> 
> still does not work. Is any possibility the original 
> "save_transformed.py" does not work?
> 
> 
> Smith
> 
> 
> At 2015-11-28 13:11:25, "Jordan Willis"  wrote:
> try running 
> 
> 
> find ~/ -name “newpdb.pdb” 
> 
> 
>> On Nov 27, 2015, at 9:08 PM, Smith Liu  wrote:
>> 
>> 
>> Dear All,
>> 
>> Osvaldo is new here for this question, so I repeat it a little. By pymol 
>> I open a pdb and orient it and I want to save the