[PyMOL] succinct secondary structure 'readout'

2010-03-09 Thread Ferdinand Alte
Hi, I would like to get secondary structure information from a PyMol file. I know that the following command gives a long list of every residue: >> iterate & n. ca, print resn,resi,ss I found the following script, that gives you a more "condensed" list (see below): >> PyMOL>@.

Re: [PyMOL] PyMOL succinct secondary structure \'readout\'

2010-03-05 Thread Tsjerk Wassenaar
Hi Ferdi, It is better to post such questions to the user list. As you've noticed I also answer mails there. But I'm not the only one, and you'll get access to a whole community. Besides, the posts get archived for future reference. Aside from that, it is commonly regarded impolite to address such

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-11 Thread Frieda Reichsman
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

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-10 Thread Tsjerk Wassenaar
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

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread gilleain torrance
Hi everyone, Sorry for posting my replies to the list; I hope this is all generally useful. Firstly, the bug: the obvious cause is if the line "if ss == currentType:" is never true. In that case, it is making a list of one-residue sses, with, as Tsjerk correctly pointed out, the default end of -1.

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Frieda Reichsman
Hi Tsjerk, I am getting two errors. Is there a problem with line endings? I am taking the code in emails and on the wiki and pasting it into a text editor (BBEdit), then copying that and pasting into the PyMOL command line. The text editor is saving the text with Unix (LF) which I take to

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Frieda Reichsman
Hi Gilleain, I tried the code with a different, single pdb file (1CRN) loaded in PyMOL, and got the same output formatting. The original PyMOL file I am working with has seven different protein structures in it. The pdb IDs are 1ujc 1h2e 1k6m 1e58 1nt4 1dkq 1qwo and they have been aligned

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Tsjerk Wassenaar
Hi Gillean, For what it's worth, I experienced the same... No dashes in the numbers: 1-1 1--1 L 1-2 2--1 L 2-3 3--1 L ... etc. The double dash must come from the "-1" value used as default for your SSE class. Better double check what's going on there :) Cheers, Tsjerk On 10/9/07, gilleain

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread gilleain torrance
Hi Frieda, That's odd. It seems to work okay for mulitchain proteins (I'll add some extra bits to handle chains). The "--" in the output is weird. It suggests that either the start numbers end in a dash or the end number start with a dash. It's difficult to diagnose the bug, if bug there is, with

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Tsjerk Wassenaar
Hi Frieda, The slash should tell Pymol that the following should be parsed as python code, but it should work without too, since "while" is a python keyword. The output you show bothers me. For my case it gives: [['PRO', '7', 'L'], ['ASP', '8', 'L'], ['PRO', '9', 'H'], ['ALA', '16', 'H'], ['LEU',

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Frieda Reichsman
Hi Tsjerk, Frieda, I made a different solution (I can't get Tsjerk's to work, oddly - it looks like it should step through sses correctly, but I can't see why the " sslist.pop(i)" gives what it should). Anyway, my 'versions' :) are on the wiki as: http://www.pymolwiki.org/index.php/Ss whic

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Frieda Reichsman
Hi Tsjerk, When I paste your script into the command line of PyMol (MacPyMol to be exact), this is the response: Traceback (most recent call last): File "/home/local/warren/MacPyMOL070703/build/Deployment/ MacPyMOL.app/pymol/modules/pymol/parser.py", line 456, in parse File "", line 2

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Tsjerk Wassenaar
Hi Gillean, Frieda, The versions posted on the wiki should work for older versions of Python/Pymol. Don't see why it shouldn't. Anyway, in my implementation, the pop(i) throws out the element which is the same as the next one, for each element. After that, sslist contains exactly what is requested

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread gilleain torrance
Hi Tsjerk, Frieda, I made a different solution (I can't get Tsjerk's to work, oddly - it looks like it should step through sses correctly, but I can't see why the " sslist.pop(i)" gives what it should). Anyway, my 'versions' :) are on the wiki as: http://www.pymolwiki.org/index.php/Ss which

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-09 Thread Tsjerk Wassenaar
Hi Frieda, In addition to my previous mail, the following works for me: sslist=[] iterate n. ca, sslist.append( [resn,resi,ss] ) /i=1, j=len(sslist)-1 /while i wrote: > > Hi Frieda, > > There's no such command. You'll have to parse the output you get through a > script which filters it in the wa

Re: [PyMOL] succinct secondary structure 'readout'

2007-10-08 Thread Tsjerk Wassenaar
Hi Frieda, There's no such command. You'll have to parse the output you get through a script which filters it in the way you want. This isn't difficult though (good python exercise :p). Best, Tsjerk On 10/9/07, Frieda Reichsman wrote: > > Hi, > > I would like to get secondary structure informa

[PyMOL] succinct secondary structure 'readout'

2007-10-08 Thread Frieda Reichsman
Hi, I would like to get secondary structure information from a PyMOL file. I searched the list and found this: > I need a list of the secondary structure assigned to each residue by dss in > pymol. Is there a simple way to write this information to a file, or dump it > to the screen? To