Just want to confirm that this works beautifully.
Thanks so much, Tsjerk.

On Oct 10, 2007, at 3:25 AM, Tsjerk Wassenaar wrote:

Hi Frieda,

I had to rewrite the script to get the output desired, now also using a class definition :p
It works fine for me:

PyMOL>@../..\ss.pml
PyMOL>class SSList:\
PyMOL>list = []\
PyMOL>def purge( self, resi, ss ):\
PyMOL>if not self.list or self.list[-1][0] != ss:\
PyMOL>self.list.append( [ss, resi, resi ] )\
PyMOL>else:\
PyMOL>self.list[-1][2] = resi\
PyMOL>def __repr__( self ):\
PyMOL>return "\n".join( map( self.repr_item, self.list ) )\
PyMOL>def repr_item( self, item ):\
PyMOL>return item[0]+" ("+item[1]+"-"+item[2]+")"
PyMOL>sslist = SSList()
PyMOL>cmd.iterate( "n. ca", "sslist.purge( resi, ss )" )
PyMOL>print sslist
L (2-3)
H (4-14)
L (15-23)
H (24-44)
L (45-50)
H (51-72)
L (73-73)
H (74-84)
L (85-86)

Of course it should be properly wrapped as a function... ;)

Cheers,

Tsjerk


--
Tsjerk A. Wassenaar, Ph.D.
Junior UD (post-doc)
Biomolecular NMR, Bijvoet Center
Utrecht University
Padualaan 8
3584 CH Utrecht
The Netherlands
P: +31-30-2539931
F: +31-30-2537623
---------------------------------------------------------------------- ---
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users

///////////////////////////////////////////

Frieda Reichsman
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///////////////////////////////////////////


Reply via email to