[PyMOL] getting Residue environment distances and residue-residue distances programatically

2010-03-23 Thread hari jayaram
Hi
I want to write a python/pymol  script that will give me residue -residue
distances within a pdb file programmatically

I know that within pymol I can get a distance object using

select r55 , chain A and resi 55
select r 22 , chain A and resi 22

distance (r55) ,(r22)

This creates the dist01 object . If I wanted to do this using a python
script and get a pretty print of all the distances in the distance object ,
how do I do that?
Also pointers to other python toolkits that can allow me to make such
measurements outside pymol will be greatly appreciated.

Thanks for your help
Hari
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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] getting Residue environment distances and residue-residue distances programatically

2010-03-23 Thread David Hall
PyMol doesn't provide programmatic access to actual bond objects.
Instead, you have to do what was suggested 5 days ago:

http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg07745.html

-David

On Tue, Mar 23, 2010 at 3:48 PM, hari jayaram  wrote:
> Hi
> I want to write a python/pymol  script that will give me residue -residue
> distances within a pdb file programmatically
> I know that within pymol I can get a distance object using
> select r55 , chain A and resi 55
> select r 22 , chain A and resi 22
> distance (r55) ,(r22)
> This creates the dist01 object . If I wanted to do this using a python
> script and get a pretty print of all the distances in the distance object ,
> how do I do that?
> Also pointers to other python toolkits that can allow me to make such
> measurements outside pymol will be greatly appreciated.
> Thanks for your help
> Hari
>
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> 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
>

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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] getting Residue environment distances and residue-residue distances programatically

2010-03-23 Thread Nathaniel Echols
On Tue, Mar 23, 2010 at 12:48 PM, hari jayaram  wrote:

> Hi
> I want to write a python/pymol  script that will give me residue -residue
> distances within a pdb file programmatically
>
> I know that within pymol I can get a distance object using
>
> select r55 , chain A and resi 55
> select r 22 , chain A and resi 22
>
> distance (r55) ,(r22)
>
> This creates the dist01 object . If I wanted to do this using a python
> script and get a pretty print of all the distances in the distance object ,
> how do I do that?
> Also pointers to other python toolkits that can allow me to make such
> measurements outside pymol will be greatly appreciated.
>

CCTBX will do this for sure - it supports a selection syntax very similar to
PyMOL's.  It isn't particularly intuitive, however; if you're interested in
using it, contact me offline and I can send you some examples.

There is also BioPython, which is written for bioinformatics rather than
crystallography and appears to have a much simpler API (but will definitely
read PDB files).

-Nat
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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] getting Residue environment distances and residue-residue distances programatically

2010-03-23 Thread hari jayaram
Thanks a tonne David and Nathaniel,
The script in that post
is
exactly what I was looking for.

I may also give cctbx.python a try , If I remember right phenix, cns and
xplor use a similar kind of selection syntax which as Nat said is not too
different from pymol given its roots.

Thanks again
Hari


On Tue, Mar 23, 2010 at 4:03 PM, David Hall  wrote:
>
> PyMol doesn't provide programmatic access to actual bond objects.
> Instead, you have to do what was suggested 5 days ago:
>
>
http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg07745.html
>
> -David
>
> On Tue, Mar 23, 2010 at 3:48 PM, hari jayaram  wrote:
> > Hi
> > I want to write a python/pymol  script that will give me residue
-residue
> > distances within a pdb file programmatically
> > I know that within pymol I can get a distance object using
> > select r55 , chain A and resi 55
> > select r 22 , chain A and resi 22
> > distance (r55) ,(r22)
> > This creates the dist01 object . If I wanted to do this using a python
> > script and get a pretty print of all the distances in the distance
object ,
> > how do I do that?
> > Also pointers to other python toolkits that can allow me to make such
> > measurements outside pymol will be greatly appreciated.
> > Thanks for your help
> > Hari
> >
> >
> >
--
> > Download Intel® Parallel Studio Eval
> > Try the new software tools for yourself. Speed compiling, find bugs
> > proactively, and fine-tune applications for parallel performance.
> > See why Intel Parallel Studio got high marks during beta.
> > http://p.sf.net/sfu/intel-sw-dev
> > ___
> > 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
> >
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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] getting Residue environment distances and residue-residue distances programatically

2010-03-23 Thread Jason Vertrees
Hari,

> I want to write a python/pymol  script that will give me residue -residue
> distances within a pdb file programmatically

In PyMOL, this is easy to program.  Here's a small script to give you
all pairwise distances of the atoms in residue 30 of chain A of 1hpv:

import pymol
from pymol import stored
fetch 1hpv, async=0
remove not (i. 30 and c. A)
orient
stored.ids = []
iterate_state 1, 1hpv, stored.ids.append(ID)
python
for x in stored.ids:
for y in stored.ids:
print "Dist from atom ID %d to %d = %f" % 
(x,y,cmd.get_distance( "ID
%s" % x, "ID %s" % y))
python end


Doing this from a script is easy.  Doing this from extant distance
objects is not.

Cheers,

-- Jason


On Tue, Mar 23, 2010 at 3:48 PM, hari jayaram  wrote:
> Hi
> I want to write a python/pymol  script that will give me residue -residue
> distances within a pdb file programmatically
> I know that within pymol I can get a distance object using
> select r55 , chain A and resi 55
> select r 22 , chain A and resi 22
> distance (r55) ,(r22)
> This creates the dist01 object . If I wanted to do this using a python
> script and get a pretty print of all the distances in the distance object ,
> how do I do that?
> Also pointers to other python toolkits that can allow me to make such
> measurements outside pymol will be greatly appreciated.
> Thanks for your help
> Hari
>
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> 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
>



-- 
Jason Vertrees, PhD
PyMOL Product Manager
Schrodinger, LLC

(e) jason.vertr...@schrodinger.com
(o) +1 (603) 374-7120

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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