Mary,

You can write a Python loop like the following:

f=open("distance.txt","w")

pairs = ( \
( "45/ca", "47/ca"), \
( "45/ca", "49/ca"), \
( "45/ca", "51/ca"), \
)

for a in pairs:\
  f.write("%-10s %-10s %8.3f\n"%(a[0],a[1],cmd.get_distance(a[0],a[1])))
f.close()

will create a file like:

45/ca      47/ca         6.737
45/ca      49/ca        11.982
45/ca      51/ca        16.304

Note: PyMOL 0.97 or above may be required for the get_distance command (I
think).

Cheers,
Warren

--
mailto:war...@delsci.com
Warren L. DeLano, Ph.D.
Principal Scientist
DeLano Scientific LLC
Voice (650)-346-1154 
Fax   (650)-593-4020
  

> -----Original Message-----
> From: pymol-users-ad...@lists.sourceforge.net 
> [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
> Mary C. Corbett
> Sent: Tuesday, September 21, 2004 10:27 AM
> To: pymol-users@lists.sourceforge.net
> Subject: [PyMOL] logging distances in a dist object
> 
> Is there a way to print the distances generated in a "dist" 
> object by the dist command or by a mouse selection into a log 
> file.  I can see them on the screen but I'd like to be able 
> to write them to a separate file.
> 
> Thanks
> Mary
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one 
> of 170 Project Admins to receive an Apple iPod Mini FREE for 
> your judgement on who ports your project to Linux PPC the 
> best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php 
> _______________________________________________
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pymol-users
> 



Reply via email to