Pymol- Generating Rms Value Of Different Structures
1
4
Entering edit mode
13.6 years ago
Thaman ★ 3.3k

Hi,

I want to write simple python script for computing RMS deviation value between two GROUP (ligand, unligand) which have 5 STRUCTURE in each GROUP. My main objective is to get RMS deviation value between two structure within or without GROUP. I have loaded all structure in PyMol. I want to generate Python script file which contains Pymol (fit command for different structures either within ligand or unligand group or ligand-unligand group) and will compute RMS value and output can be seen in PyMol terminal. I am wondering how to make python file which can generate such a RMS deviation value between structures.

Any suggestions and help are welcome

pymol python scripting • 6.6k views
ADD COMMENT
0
Entering edit mode

Since you already accepted this answer I suppose you have enough information to continue your work. If something is unclear, just add comment and I'll try to explain.

ADD REPLY
0
Entering edit mode

I am trying this whole day but couldn't figure it out completely. I have tried like this way:- http://pastebin.com/ue7GGHAE and tried to run script in the PyMol terminal where I have loaded all structures. Can you please let me know how can I continue. Thank you

ADD REPLY
0
Entering edit mode

I have tried like this way but it's not working, http://pastebin.com/ue7GGHAE . I have loaded all the structrues and tried to run script on the PyMol terminal. Can you please guide me? Thank you

ADD REPLY
0
Entering edit mode

Answer updated. Now you should be able to figure it out :-)

ADD REPLY
4
Entering edit mode
13.6 years ago

You can generelly write a normal Python script that is used in PyMOL. All you need to do is import the PyMOL-specific modules (from pymol import stored, cmd) and install the script via the plugin menu.

For an example, see http://www.pymolwiki.org/index.php/Simple_Scripting

For RMS calculations do the following (cf. basic script body):

  • write your script inside a function (you will probably not want it to be executed when PyMOL is starting up and your structures are not yet loaded)
  • use the cmd.extend("functionName", functionName) command so PyMOL knows about it
  • test your script with just two structures and one RMS to be calculated (so it is easier to spot PyMOL-specific errors) - for this, type functionName() in the PyMOL shell
  • be aware that fit and cmd.fit have slightly different syntax; for the cmd version it is for instance rms=cmd.fit("2cbd and name ca", "1bcd and name ca")
ADD COMMENT
0
Entering edit mode

I am trying this whole day but couldn't figure it out completely. I have tried like this way:- [http://pastebin.com/nrwC61vG] and tried to run script in the PyMol terminal where I have loaded all structures. Can you please let me know how can I continue. Thank you

ADD REPLY
0
Entering edit mode

Some extra character in above link, correct one --http://pastebin.com/nrwC61vG

ADD REPLY
0
Entering edit mode

I succeed using fit command in python script but couldn't generate all structure combination RMS value when I used python combination() to do it like in my script. Get errors like str1com = list(it.combinations(str1, 2)) AttributeError: 'module' object has no attribute 'combinations'

ADD REPLY
0
Entering edit mode

Try print sys.version in the PyMOL shell, which should tell you which python version PyMOL is using. itertools is only available in python>=2.6, in case you are using version 2.5 you would need to find another way to get the combinations.

ADD REPLY
0
Entering edit mode

I have 2.7 Python version which I downloaded recently. Is it define that I have to used cmd.extend("functionN", functionN) two argument? I wanted to generate automatically all RMS value of 10 structures combinations after file is run without taking input manually.

ADD REPLY
0
Entering edit mode

Your system's python version does not necessarily have to be the same as the one in PyMOL, I am not sure if PyMOL should work with 2.7 already. Still, you will not want the script to be executed before the structures are loaded (otherwise it would produce an error). An alternative to calling the function from shell might be to integrate it in the plugins menu: http://pastebin.com/kp1Z6c98

ADD REPLY
0
Entering edit mode

Is there any means to check whether plugin has been install correctly? My python script is generating error when it tries to import intertools.combination module. I have tried like you said installing pluging first and calling Function from pymol terminal but still not working.

ADD REPLY
0
Entering edit mode

Is there any means to check whether plugin has been install correctly? My python script is generating error when it tries to import intertools.combination module. I have tried like you said installing pluging first and calling Function from pymol terminal but still not working : http://pastebin.com/gybGy5Gi

ADD REPLY
0
Entering edit mode

If PyMOL is starting up without a shell message saying that a plugin produced an error it should generally work (provided the plugin is installed, ie. listed). Did you check the sys.version from within PyMOL?

ADD REPLY
0
Entering edit mode

Yes I did, PyMOL>print sys.version 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]

ADD REPLY
0
Entering edit mode

Yes, this means that you are using python 2.4.2 in PyMOL and not 2.7. Since itertools.combinations is only avalable for 2.6 and newer, it can not work this way.

ADD REPLY
0
Entering edit mode

So my options would be either to change Python version to 2.4.2 or find different module for combination? What do you suggest me if I want to complete my task with the same configuration? Thank you

ADD REPLY

Login before adding your answer.

Traffic: 2011 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6