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

Reply via email to