From: Jason V. <jas...@gm...> - 2009-09-02 16:52:33
|
Folmer, I wrote a script like this a while ago. I was importing huge selection lists into PyMOL and it was crashing. So, I created a script to turn selection lists like, 1+2+3+4+5+6+7+101+102+103+104 into 1-7+101-104 Here's an example execution: PyMOL>fetch 1cll PyMOL>sele EE, resn GLU PyMOL>print collapseSel("EE") 123+67+114+6-7+104+11+140+45+14+47+82-84+54+87+120+127+139+119+31 If your protein has non-standard amino acid numbers like "9F" instead of just "9", this will fail, because it doesn't know how to convert a "9F" into a number. I just posted the script to the PyMOLWiki at: http://pymolwiki.org/index.php/CollapseSel Feel free to use that. Hope this helps, -- Jason > [PyMOL] Getting ranges from selections > From: Folmer Fredslund <folmerf@gm...> - 2009-09-02 15:19 > Dear all, > > For several reasons I have been printing the residue numbers from > selections. This could be just the loops, or interface residues > defined with the script from Jason Vertrees. > > I use iterate for this and it works well enough, however I would like > to be able to make: > > 1. a non-redundant list (e.g. residue 12 will only appear once) > 2. adjacent numbers into ranges (e.g. residues 1, 2, 4, 5, 6, 10, 11, > 12 would become 1:2, 4:6, 10:12 or something similar) > > Any ideas on how to do this best? Ideally this should of course be > possible from within PyMOL, but any kind of script that will work on > your normal linux distribution would make me happy. > > Best regards, > > Folmer Fredslund -- Jason Vertrees, PhD PyMOL -- http://www.pymol.org/ PyMOLWiki -- http://www.pymolwiki.org/ |