Re: [PyMOL] How to automate RMSD calculation for large no of structures

2014-01-09 Thread Om Shiv
Hello

I am using the following script file:

### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files

wt_file = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb
mut_glob = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\models\1APS\1APS_*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):

print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###

I ran the above script using Pymol. But I am receiving the following error:

PyMOLrun D:/STUDY/STRUCTURE_PPT/RMSD/Pymol/mut_rmsd.py

ExecutiveProcessPDBFile-Error: Unable to open file
'D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\OriginalAPS.pdb'.
Traceback (most recent call last):

File C:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parsing.py, line
455, in run_file
execfile(file,global_ns,local_ns)

File D:/STUDY/STRUCTURE_PPT/RMSD/Pymol/mut_rmsd.py, line 11, in module
cmd.load(wt_file,wt)

File C:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\importing.py, line
878, in load
if _self._raising(r,_self): raise pymol.CmdException

CmdException: pymol.CmdException instance at 0x06FF1580

Can anyone help please.


On Thu, Jan 9, 2014 at 4:48 PM, Om Shiv harhaalmekhu...@gmail.com wrote:

 Thanks Jared


 On Thu, Jan 9, 2014 at 12:03 AM, Sampson, Jared 
 jared.samp...@nyumc.orgwrote:

  Hi Om -

  I hope you don't mind me posting your questions back to the list.
  (When replying to this list, you have to use Reply All, otherwise it just
 goes to the sender.)

  Also, a quick disclaimer: I haven't used PyMOL on Windows in over 5
 years, so what I'm saying may not be entirely accurate.  (Others, please
 correct me if there's anything incorrect here.)


Hi I have installed Pymol in windows 7 platform. Why does it not
 allow me to save the script in the Pymol folder ?

   Is there any way to save it in Pymol working directory ?


  I don't think you really want to save it to the folder where PyMOL is
 installed (if that's what you mean by the Pymol folder).  The working
 directory is the directory from which PyMOL is launched.  You can see where
 this is by typing `pwd` at the PyMOL command prompt.  Some other shell
 commands work as well, such as `cd` and `ls`.


   Thanks for your guidance.

 I have modified your script as follows:

 ### begin script ###

 from pymol import cmd
 from glob import glob

 # Edit these two variables with the paths to your files
 wt_file = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb
 mut_glob = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\models\1APS\1APS_*.pdb

 # load the wild-type pdb
 cmd.load(wt_file,wt)

 # loop through the mutants
 for file in glob(mut_glob):
 print file
 cmd.load(file,mut)
 rms = cmd.align(wt,mut)[0]
 print  %s rmsd: %s % (file,rms)
 cmd.delete(mut)

 ### end script ###

  Used the following command from the command line:  run
 D:\STUDY\STRUCTURE_PPT\RMSD\mut-rmsd.py

  But I am receiving the following error:

 IOError: [Errno 2] No such file or directory: 'D:
 \\STUDY\\STRUCTURE_PPT\\RMSD\\mut-rmsd.py'

  Please help.
  thanks


  Maybe try using the GUI:

  1. File  Log... - create a log file (I usually call mine log.pml),
 which will be useful later.
 2. File  Run... - navigate to your mut-rmsd.py file and run it.
 3. Go back and open your log file to see what the command looked like
 when you ran the script.

  PyMOL log files are very widely useful for finding out how to translate
 GUI actions into scriptable commands.

  Hope that helps!

  Cheers,
 Jared



 On Wed, Jan 8, 2014 at 1:13 AM, Sampson, Jared 
 jared.samp...@nyumc.orgwrote:

 Hi Om -

  Here is another option that loads only one mutant at a time.  You can
 save the following as a Python script (e.g., mut-rmsd.py) and run it from
 the PyMOL command line by typing `run mut-rmsd.py` (with a full or relative
 path if it's not in PyMOL's working directory).

  For more information about these functions, you can also check out a
 few things on the PyMOL Wiki:

  http://pymolwiki.org/index.php/Process_All_Files_In_Directory
 http://pymolwiki.org/index.php/Align

  ### begin script ###

   from pymol import cmd
 from glob import glob

  # Edit these two variables with the paths to your files
 wt_file = wt.pdb
 mut_glob = mut/*.pdb

  # load the wild-type pdb
 cmd.load(wt_file,wt)

  # loop through the mutants
 for file in glob(mut_glob):
 print file
 cmd.load(file,mut)
 rms = cmd.align(wt,mut)[0]
 print  %s rmsd: %s % (file,rms)
 cmd.delete(mut)

  ### end script ###

  Hope that helps.

  Cheers,
 Jared

  --
 Jared Sampson
 Xiangpeng Kong Lab
 NYU Langone Medical Center
 550 First Avenue
 New York, NY 10016
 212-263-7898
 http://kong.med.nyu.edu/






  On Jan 7, 2014, at 11:58 AM, Om Shiv harhaalmekhu...@gmail.com wrote:

  Hello All

  I am a new user to Pymol and Python.

  I have a PDB Structure with 

Re: [PyMOL] How to automate RMSD calculation for large no of structures

2014-01-09 Thread Schubert, Carsten [JRDUS]
Hi Om,

asides from the usual list of suspects like access permissions try double 
backslashes or  a raw string in your path-filenames. Python on Windows is a bit 
peculiar in that respect. Read up on raw strings in the Python docs.

Try

wt_file = D:\\STUDY\\STRUCTURE_PPT\\RMSD\\Pymol\\Original\\1APS.pdb
or
wt_file = rD:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb

note the 'r' at the beginning of the string indicating a raw string.

HTH

Carsten

From: Om Shiv [mailto:harhaalmekhu...@gmail.com]
Sent: Thursday, January 09, 2014 6:26 AM
To: Sampson, Jared
Cc: pymol-users@lists.sourceforge.net
Subject: Re: [PyMOL] How to automate RMSD calculation for large no of structures

Hello
I am using the following script file:
### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files
wt_file = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb
mut_glob = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\models\1APS\1APS_*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):

print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###
I ran the above script using Pymol. But I am receiving the following error:

PyMOLrun D:/STUDY/STRUCTURE_PPT/RMSD/Pymol/mut_rmsd.py

ExecutiveProcessPDBFile-Error: Unable to open file 
'D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\OriginalAPS.pdb'.
Traceback (most recent call last):

File C:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parsing.py, line 455, 
in run_file
execfile(file,global_ns,local_ns)

File D:/STUDY/STRUCTURE_PPT/RMSD/Pymol/mut_rmsd.py, line 11, in module
cmd.load(wt_file,wt)

File C:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\importing.py, line 878, 
in load
if _self._raising(r,_self): raise pymol.CmdException

CmdException: pymol.CmdException instance at 0x06FF1580
Can anyone help please.

On Thu, Jan 9, 2014 at 4:48 PM, Om Shiv 
harhaalmekhu...@gmail.commailto:harhaalmekhu...@gmail.com wrote:
Thanks Jared

On Thu, Jan 9, 2014 at 12:03 AM, Sampson, Jared 
jared.samp...@nyumc.orgmailto:jared.samp...@nyumc.org wrote:
Hi Om -

I hope you don't mind me posting your questions back to the list.  (When 
replying to this list, you have to use Reply All, otherwise it just goes to the 
sender.)

Also, a quick disclaimer: I haven't used PyMOL on Windows in over 5 years, so 
what I'm saying may not be entirely accurate.  (Others, please correct me if 
there's anything incorrect here.)


Hi I have installed Pymol in windows 7 platform. Why does it not allow me to 
save the script in the Pymol folder ?
 Is there any way to save it in Pymol working directory ?

I don't think you really want to save it to the folder where PyMOL is installed 
(if that's what you mean by the Pymol folder).  The working directory is the 
directory from which PyMOL is launched.  You can see where this is by typing 
`pwd` at the PyMOL command prompt.  Some other shell commands work as well, 
such as `cd` and `ls`.


Thanks for your guidance.

I have modified your script as follows:
### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files
wt_file = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb
mut_glob = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\models\1APS\1APS_*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):
print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###
Used the following command from the command line:  run 
D:\STUDY\STRUCTURE_PPT\RMSD\mut-rmsd.py
But I am receiving the following error:

IOError: [Errno 2] No such file or directory: 
'D:\\STUDY\\STRUCTURE_PPT\\RMSD\\mut-rmsd.py'

Please help.
thanks

Maybe try using the GUI:

1. File  Log... - create a log file (I usually call mine log.pml), which 
will be useful later.
2. File  Run... - navigate to your mut-rmsd.py file and run it.
3. Go back and open your log file to see what the command looked like when you 
ran the script.

PyMOL log files are very widely useful for finding out how to translate GUI 
actions into scriptable commands.

Hope that helps!

Cheers,
Jared




On Wed, Jan 8, 2014 at 1:13 AM, Sampson, Jared 
jared.samp...@nyumc.orgmailto:jared.samp...@nyumc.org wrote:
Hi Om -

Here is another option that loads only one mutant at a time.  You can save the 
following as a Python script (e.g., mut-rmsd.py) and run it from the PyMOL 
command line by typing `run mut-rmsd.py` (with a full or relative path if it's 
not in PyMOL's working directory).

For more information about these functions, you can also check out a few things 
on the PyMOL Wiki:

http://pymolwiki.org/index.php/Process_All_Files_In_Directory
http://pymolwiki.org/index.php/Align

### begin script ###

from pymol import cmd
from glob import glob

# Edit these two 

Re: [PyMOL] How to automate RMSD calculation for large no of structures

2014-01-09 Thread Sampson, Jared
Thanks, Carsten.  I thought it would turn out to be something related to the 
paths, but couldn't put my finger on it.

(I was able to run the script fine without either of those fixes on Incentive 
PyMOL 1.5.0 32-bit on a Win XP VirtualBox VM guest on a Mac OS 10.8 host.  Not 
sure why that might be.)

Relatedly, I decided to try out Robert's align_allfiles.py (which is super 
handy--it prints all the RMSDs in block form at the end, sorted both 
alphabetically by filename AND by RMSD...very nice, Robert!), and found that 
the regular expression for the extension doesn't compile as desired on Windows, 
due to the same issue.  For example, I was getting values for the `obj_name1` 
variable with backslashes (e.g. mut\3opl.pdb), which turned into underscores 
(mut_3opl) in the object names.  The selections were wrong and the script 
couldn't delete the objects, because the names didn't match, and it printed out 
a list of rmsds of 0.000.

That line (line 36) should read as follows:

  extension = re.compile( r'(^.*[\\/]|\.(pdb|ent|brk))' )

Note the raw string r as well as the double-backslash inside the brackets.

Robert, perhaps you could update the script on your website?

Cheers,
Jared

--
Jared Sampson
Xiangpeng Kong Lab
NYU Langone Medical Center
550 First Avenue
New York, NY 10016
212-263-7898
http://kong.med.nyu.edu/



On Jan 9, 2014, at 2:33 PM, Schubert, Carsten [JRDUS] 
cschu...@its.jnj.commailto:cschu...@its.jnj.com wrote:

Hi Om,

asides from the usual list of suspects like access permissions try double 
backslashes or  a raw string in your path-filenames. Python on Windows is a bit 
peculiar in that respect. Read up on raw strings in the Python docs.

Try

wt_file = 
D:\\STUDY\\STRUCTURE_PPT\\RMSD\\Pymol\\Original\\1APS.pdbsmb://STUDY//STRUCTURE_PPT//RMSD//Pymol//Original//1APS.pdb
or
wt_file = rD:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb

note the ‘r’ at the beginning of the string indicating a raw string.

HTH

Carsten



This email message, including any attachments, is for the sole use of the 
intended recipient(s) and may contain information that is proprietary, 
confidential, and exempt from disclosure under applicable law. Any unauthorized 
review, use, disclosure, or distribution is prohibited. If you have received 
this email in error please notify the sender by return email and delete the 
original message. Please note, the recipient should check this email and any 
attachments for the presence of viruses. The organization accepts no liability 
for any damage caused by any virus transmitted by this email.
=
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
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] How to automate RMSD calculation for large no of structures

2014-01-08 Thread Sampson, Jared
Hi Om -

I hope you don't mind me posting your questions back to the list.  (When 
replying to this list, you have to use Reply All, otherwise it just goes to the 
sender.)

Also, a quick disclaimer: I haven't used PyMOL on Windows in over 5 years, so 
what I'm saying may not be entirely accurate.  (Others, please correct me if 
there's anything incorrect here.)


Hi I have installed Pymol in windows 7 platform. Why does it not allow me to 
save the script in the Pymol folder ?

 Is there any way to save it in Pymol working directory ?

I don't think you really want to save it to the folder where PyMOL is installed 
(if that's what you mean by the Pymol folder).  The working directory is the 
directory from which PyMOL is launched.  You can see where this is by typing 
`pwd` at the PyMOL command prompt.  Some other shell commands work as well, 
such as `cd` and `ls`.


Thanks for your guidance.

I have modified your script as follows:

### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files
wt_file = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\Original\1APS.pdb
mut_glob = D:\STUDY\STRUCTURE_PPT\RMSD\Pymol\models\1APS\1APS_*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):
print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###

Used the following command from the command line:  run 
D:\STUDY\STRUCTURE_PPT\RMSD\mut-rmsd.py

But I am receiving the following error:

IOError: [Errno 2] No such file or directory: 
'D:\\STUDY\\STRUCTURE_PPT\\RMSD\\mut-rmsd.py'smb://STUDY//STRUCTURE_PPT//RMSD//mut-rmsd.py'

Please help.
thanks

Maybe try using the GUI:

1. File  Log... - create a log file (I usually call mine log.pml), which 
will be useful later.
2. File  Run... - navigate to your mut-rmsd.py file and run it.
3. Go back and open your log file to see what the command looked like when you 
ran the script.

PyMOL log files are very widely useful for finding out how to translate GUI 
actions into scriptable commands.

Hope that helps!

Cheers,
Jared



On Wed, Jan 8, 2014 at 1:13 AM, Sampson, Jared 
jared.samp...@nyumc.orgmailto:jared.samp...@nyumc.org wrote:
Hi Om -

Here is another option that loads only one mutant at a time.  You can save the 
following as a Python script (e.g., mut-rmsd.py) and run it from the PyMOL 
command line by typing `run mut-rmsd.py` (with a full or relative path if it's 
not in PyMOL's working directory).

For more information about these functions, you can also check out a few things 
on the PyMOL Wiki:

http://pymolwiki.org/index.php/Process_All_Files_In_Directory
http://pymolwiki.org/index.php/Align

### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files
wt_file = wt.pdb
mut_glob = mut/*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):
print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Xiangpeng Kong Lab
NYU Langone Medical Center
550 First Avenue
New York, NY 10016
212-263-7898
http://kong.med.nyu.edu/






On Jan 7, 2014, at 11:58 AM, Om Shiv 
harhaalmekhu...@gmail.commailto:harhaalmekhu...@gmail.com wrote:

Hello All

I am a new user to Pymol and Python.

I have a PDB Structure with single chain (A) and I have modeled 500 single 
point mutants of this wild structure.

Now for each such 500 modeled structures, I would like to calculate RMSD (ALL 
ATOMS) with the wild type PDB structure.

Can anybody help me with the script to automate calculation of 500 RMSD 
calculations using PYMOL ?

Secondly, what threshold value of RMSD can be considered above which we can say 
that the mutant structure is considerably different than the wild type ?

Thanks in advance.
--
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.netmailto: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


This email message, including any attachments, is for the sole use of the 
intended recipient(s) and may contain information that is proprietary, 
confidential, and exempt 

[PyMOL] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Om Shiv
Hello All

I am a new user to Pymol and Python.

I have a PDB Structure with single chain (A) and I have modeled 500 single
point mutants of this wild structure.

Now for each such 500 modeled structures, I would like to calculate RMSD
(ALL ATOMS) with the wild type PDB structure.

Can anybody help me with the script to automate calculation of 500 RMSD
calculations using PYMOL ?

Secondly, what threshold value of RMSD can be considered above which we can
say that the mutant structure is considerably different than the wild type ?

Thanks in advance.
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
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] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Jed Goldstone
Check out Robert Campbell's Pymol script repository.
I think align_all_to_all.py should do what you want, including exporting 
RMSD values.

http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/

Jed


On 1/7/2014 11:58 AM, Om Shiv wrote:
 Hello All

 I am a new user to Pymol and Python.

 I have a PDB Structure with single chain (A) and I have modeled 500
 single point mutants of this wild structure.

 Now for each such 500 modeled structures, I would like to calculate RMSD
 (ALL ATOMS) with the wild type PDB structure.

 Can anybody help me with the script to automate calculation of 500 RMSD
 calculations using PYMOL ?

 Secondly, what threshold value of RMSD can be considered above which we
 can say that the mutant structure is considerably different than the
 wild type ?

 Thanks in advance.


 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk



 ___
 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


-- 

Jed Goldstone, PhD
Research Specialist
Woods Hole Oceanographic Institution
Redfield 3-52 MS#32
Woods Hole, MA 02543
http://www.whoi.edu/hpb/Site.do?id=481
Phone: 508-289-4823

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
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] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Robert Campbell
On Tue, 2014-01-07 12:05  EST,  Jed Goldstone jgoldst...@whoi.edu wrote:

 Check out Robert Campbell's Pymol script repository.
 I think align_all_to_all.py should do what you want, including exporting 
 RMSD values.
 
 http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/

Actually, I think Om only wants to align the individual mutants to the
wild-type not all 500 mutants against each other which is what the above
script does.  Also, I think for 500 structure you probably don't want to
load all 500 in at one time, so it would be better to have a script that
only loads each mutant one at a time, calculates its RMSD to the wild-type
and then deletes it.

I have modified my align_all.py script to create a new one called
align_allfiles.py and added that to the above website.  It is also attached
here.  To specify the use of all atoms simply add that to the mobile and
target selections.  You can also specify PyMOL's cutoff and cycles
arguments to the align function (defaults to cycles=5, cutoff=2)

align_allfiles target_model, files=mutants*.pdb, mobile_selection=all,
   target_selection=all

It will print out a list of RMSD values for each mutant in order read in as
well as sorted by RMSD.


Cheers,
Rob

 Jed
 
 
 On 1/7/2014 11:58 AM, Om Shiv wrote:
  Hello All
 
  I am a new user to Pymol and Python.
 
  I have a PDB Structure with single chain (A) and I have modeled 500
  single point mutants of this wild structure.
 
  Now for each such 500 modeled structures, I would like to calculate RMSD
  (ALL ATOMS) with the wild type PDB structure.
 
  Can anybody help me with the script to automate calculation of 500 RMSD
  calculations using PYMOL ?
 
  Secondly, what threshold value of RMSD can be considered above which we
  can say that the mutant structure is considerably different than the
  wild type ?
 
  Thanks in advance.
 




-- 
Robert L. Campbell, Ph.D.
Senior Research Associate/Adjunct Assistant Professor
Dept. of Biomedical  Molecular Sciences
Botterell Hall Rm 644
Queen's University, 
Kingston, ON K7L 3N6  Canada
Tel: 613-533-6821
robert.campb...@queensu.cahttp://pldserver1.biochem.queensu.ca/~rlc
#! /usr/bin/env python
# original Written by Jules Jacobsen (jacob...@ebi.ac.uk). Feel free to do whatever you like with this code.
# extensively modified by Robert L. Campbell (r...@queensu.ca)

from pymol import cmd
import glob, re

def align_allfiles(target=None,files=None,mobile_selection='name ca',target_selection='name ca',cutoff=2, cycles=5,cgo_object=0):
  
  Aligns all models in a list of files to one target

  usage:
align_allfiles [target][files=filenames][target_selection=name ca][mobile_selection=name ca]
[cutoff=2][cycles=5][cgo_object=0]
where target specifies the model id you want to align all others against,
and target_selection, mobile_selection, cutoff and cycles are options
passed to the align command.  You can specify the files to load and align
using a wildcard.

By default the selection is all C-alpha atoms and the cutoff is 2 and the
number of cycles is 5.
Setting cgo_object to 1, will cause the generation of an alignment object for
each object.  They will be named like object_on_target, where object and
target will be replaced by the real object and target names.

Example:
  align_allfiles target=name1, files=model.B*.pdb, mobile_selection=c. b  n. n+ca+c+o,target_selection=c. a  n. n+ca+c+o

  
  cutoff = int(cutoff)
  cycles = int(cycles)
  cgo_object = int(cgo_object)

  file_list = glob.glob(files)
  file_list.sort()
  extension = re.compile( '(^.*[\/]|\.(pdb|ent|brk))' )
  object_list = []

  rmsd = {}
  rmsd_list = []
  for i in range(len(file_list)):
obj_name1 = extension.sub('',file_list[i])
object_list.append(extension.sub('',file_list[i]))
cmd.load(file_list[i],obj_name1)
if cgo_object:
  objectname = 'align_%s_on_%s' % (object_list[i],target)
  rms = cmd.align('%s  %s'%(object_list[i],mobile_selection),'%s  %s'%(target,target_selection),cutoff=cutoff,cycles=cycles,object=objectname)
else:
  rms = cmd.align('%s  %s'%(object_list[i],mobile_selection),'%s  %s'%(target,target_selection),cutoff=cutoff,cycles=cycles)

rmsd[object_list[i]] = (rms[0],rms[1])
rmsd_list.append((object_list[i],rms[0],rms[1]))
cmd.delete(obj_name1)

  rmsd_list.sort(lambda x,y: cmp(x[1],y[1]))
# loop over dictionary and print out matrix of final rms values
  print Aligning against:,target
  for object_name in object_list:
print %s: %6.3f using %d atoms % (object_name,rmsd[object_name][0],rmsd[object_name][1])

  print \nSorted from best match to worst:
  for r in rmsd_list:
print %s: %6.3f using %d atoms % r

cmd.extend('align_allfiles',align_allfiles)
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 

Re: [PyMOL] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Tsjerk Wassenaar
If the Wild-Type is called wildtype:

rmsds = [(i,cmd.align(i,wildtype)[0]) for i in cmd.get_object_list(not
wildtype)]
print rmsds

or, writing out the results directly

open(rmsds.dat,w).writelines(%s %f\n%(i,cmd.align(i,wildtype)[0])
for i in cmd.get_object_list(not wildtype))

Cheers,

Tsjerk


On Tue, Jan 7, 2014 at 7:20 PM, Robert Campbell
robert.campb...@queensu.cawrote:

 On Tue, 2014-01-07 12:05  EST,  Jed Goldstone jgoldst...@whoi.edu wrote:

  Check out Robert Campbell's Pymol script repository.
  I think align_all_to_all.py should do what you want, including exporting
  RMSD values.
 
  http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/

 Actually, I think Om only wants to align the individual mutants to the
 wild-type not all 500 mutants against each other which is what the above
 script does.  Also, I think for 500 structure you probably don't want to
 load all 500 in at one time, so it would be better to have a script that
 only loads each mutant one at a time, calculates its RMSD to the wild-type
 and then deletes it.

 I have modified my align_all.py script to create a new one called
 align_allfiles.py and added that to the above website.  It is also attached
 here.  To specify the use of all atoms simply add that to the mobile and
 target selections.  You can also specify PyMOL's cutoff and cycles
 arguments to the align function (defaults to cycles=5, cutoff=2)

 align_allfiles target_model, files=mutants*.pdb, mobile_selection=all,
target_selection=all

 It will print out a list of RMSD values for each mutant in order read in as
 well as sorted by RMSD.


 Cheers,
 Rob

  Jed
 
 
  On 1/7/2014 11:58 AM, Om Shiv wrote:
   Hello All
  
   I am a new user to Pymol and Python.
  
   I have a PDB Structure with single chain (A) and I have modeled 500
   single point mutants of this wild structure.
  
   Now for each such 500 modeled structures, I would like to calculate
 RMSD
   (ALL ATOMS) with the wild type PDB structure.
  
   Can anybody help me with the script to automate calculation of 500 RMSD
   calculations using PYMOL ?
  
   Secondly, what threshold value of RMSD can be considered above which we
   can say that the mutant structure is considerably different than the
   wild type ?
  
   Thanks in advance.
  




 --
 Robert L. Campbell, Ph.D.
 Senior Research Associate/Adjunct Assistant Professor
 Dept. of Biomedical  Molecular Sciences
 Botterell Hall Rm 644
 Queen's University,
 Kingston, ON K7L 3N6  Canada
 Tel: 613-533-6821
 robert.campb...@queensu.cahttp://pldserver1.biochem.queensu.ca/~rlc


 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 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




-- 
Tsjerk A. Wassenaar, Ph.D.
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
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] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Thomas Holder
I like to add that to get the ALL ATOMS RMSD you need to pass cycles=0 to 
cmd.align or to Rob's align_allfiles. Otherwise, the outlier rejection 
refinement might drop atoms from the alignment.

Cheers,
  Thomas

On 07 Jan 2014, at 13:58, Tsjerk Wassenaar tsje...@gmail.com wrote:

 If the Wild-Type is called wildtype:
 
 rmsds = [(i,cmd.align(i,wildtype)[0]) for i in cmd.get_object_list(not 
 wildtype)]
 print rmsds
 
 or, writing out the results directly
 
 open(rmsds.dat,w).writelines(%s %f\n%(i,cmd.align(i,wildtype)[0]) for 
 i in cmd.get_object_list(not wildtype))
 
 Cheers,
 
 Tsjerk
 
 On Tue, Jan 7, 2014 at 7:20 PM, Robert Campbell robert.campb...@queensu.ca 
 wrote:
 On Tue, 2014-01-07 12:05  EST,  Jed Goldstone jgoldst...@whoi.edu wrote:
 
  Check out Robert Campbell's Pymol script repository.
  I think align_all_to_all.py should do what you want, including exporting
  RMSD values.
 
  http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/
 
 Actually, I think Om only wants to align the individual mutants to the
 wild-type not all 500 mutants against each other which is what the above
 script does.  Also, I think for 500 structure you probably don't want to
 load all 500 in at one time, so it would be better to have a script that
 only loads each mutant one at a time, calculates its RMSD to the wild-type
 and then deletes it.
 
 I have modified my align_all.py script to create a new one called
 align_allfiles.py and added that to the above website.  It is also attached
 here.  To specify the use of all atoms simply add that to the mobile and
 target selections.  You can also specify PyMOL's cutoff and cycles
 arguments to the align function (defaults to cycles=5, cutoff=2)
 
 align_allfiles target_model, files=mutants*.pdb, mobile_selection=all,
target_selection=all
 
 It will print out a list of RMSD values for each mutant in order read in as
 well as sorted by RMSD.
 
 
 Cheers,
 Rob
 
  Jed
 
 
  On 1/7/2014 11:58 AM, Om Shiv wrote:
   Hello All
  
   I am a new user to Pymol and Python.
  
   I have a PDB Structure with single chain (A) and I have modeled 500
   single point mutants of this wild structure.
  
   Now for each such 500 modeled structures, I would like to calculate RMSD
   (ALL ATOMS) with the wild type PDB structure.
  
   Can anybody help me with the script to automate calculation of 500 RMSD
   calculations using PYMOL ?
  
   Secondly, what threshold value of RMSD can be considered above which we
   can say that the mutant structure is considerably different than the
   wild type ?
  
   Thanks in advance.
  
 
 --
 Robert L. Campbell, Ph.D.
 Senior Research Associate/Adjunct Assistant Professor
 Dept. of Biomedical  Molecular Sciences
 Botterell Hall Rm 644
 Queen's University,
 Kingston, ON K7L 3N6  Canada
 Tel: 613-533-6821
 robert.campb...@queensu.cahttp://pldserver1.biochem.queensu.ca/~rlc

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
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] How to automate RMSD calculation for large no of structures

2014-01-07 Thread Sampson, Jared
Hi Om -

Here is another option that loads only one mutant at a time.  You can save the 
following as a Python script (e.g., mut-rmsd.py) and run it from the PyMOL 
command line by typing `run mut-rmsd.py` (with a full or relative path if it's 
not in PyMOL's working directory).

For more information about these functions, you can also check out a few things 
on the PyMOL Wiki:

http://pymolwiki.org/index.php/Process_All_Files_In_Directory
http://pymolwiki.org/index.php/Align

### begin script ###

from pymol import cmd
from glob import glob

# Edit these two variables with the paths to your files
wt_file = wt.pdb
mut_glob = mut/*.pdb

# load the wild-type pdb
cmd.load(wt_file,wt)

# loop through the mutants
for file in glob(mut_glob):
print file
cmd.load(file,mut)
rms = cmd.align(wt,mut)[0]
print  %s rmsd: %s % (file,rms)
cmd.delete(mut)

### end script ###

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Xiangpeng Kong Lab
NYU Langone Medical Center
550 First Avenue
New York, NY 10016
212-263-7898
http://kong.med.nyu.edu/






On Jan 7, 2014, at 11:58 AM, Om Shiv 
harhaalmekhu...@gmail.commailto:harhaalmekhu...@gmail.com wrote:

Hello All

I am a new user to Pymol and Python.

I have a PDB Structure with single chain (A) and I have modeled 500 single 
point mutants of this wild structure.

Now for each such 500 modeled structures, I would like to calculate RMSD (ALL 
ATOMS) with the wild type PDB structure.

Can anybody help me with the script to automate calculation of 500 RMSD 
calculations using PYMOL ?

Secondly, what threshold value of RMSD can be considered above which we can say 
that the mutant structure is considerably different than the wild type ?

Thanks in advance.
--
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
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


This email message, including any attachments, is for the sole use of the 
intended recipient(s) and may contain information that is proprietary, 
confidential, and exempt from disclosure under applicable law. Any unauthorized 
review, use, disclosure, or distribution is prohibited. If you have received 
this email in error please notify the sender by return email and delete the 
original message. Please note, the recipient should check this email and any 
attachments for the presence of viruses. The organization accepts no liability 
for any damage caused by any virus transmitted by this email.
=
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
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