Hi James, It could look something like this:
# for_rutley.py
# fetch a protein
cmd.fetch("1rx1", async=0)
# make a blank list
l=[]
# iterate over all lysine's alpha carbons
cmd.iterate_state(1, "n. CA and resn lys", "l.append((x,y,z))")
# set a counter to 0 for controlling unique names
p=0
# iterate over all coordinates and create a
# pseudoatom at each lysine's alpha carbon
for ca in l:
p+=1
cmd.pseudoatom("pseudo%s" % (p), pos=ca)
# measure the pairwise distances across all pseudoatoms just created
cmd.distance("/pseudo*", "/pseudo*")
I bet someone like Thomas or Tsjerk could code this in half the number of
lines, but this should be a starting point.
Cheers,
-- Jason
On Thu, Aug 22, 2013 at 9:55 AM, James Rutley <[email protected]> wrote:
>
>
> ---------- Forwarded message ----------
> From: James Rutley <[email protected]>
> Date: 22 August 2013 14:50
> Subject: Script writing
> To: [email protected]
>
>
> Hi,
>
> I am new to Pymol and programming. What's the best way to approach
> creating a script that does the following:
>
> [image: Inline images 3]
>
> Thanks,
>
> James,
> UCL
>
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> PyMOL-users mailing list ([email protected])
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/[email protected]
>
--
Jason Vertrees, PhD
Director of Core Modeling Products
Schrödinger, Inc.
(e) [email protected]
(o) +1 (603) 374-7120
<<image.png>>
------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________ PyMOL-users mailing list ([email protected]) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/[email protected]
