Hi, Wouldn't you get about the same if you did:
import string proper = set([ i.resi for i in cmd.get_model('all').atom if not i.resi[-1] in string.ascii_letters ]) I admit, there is a pattern with my previous posts :p And I know, the import statement can be added as __import__('string').ascii_letters, but even I think that's a bit too wild... :D Cheers, Tsjerk On Wed, Feb 16, 2011 at 12:01 AM, Jason Vertrees <jason.vertr...@schrodinger.com> wrote: > Hi Nat, > > I don't think PyMOL natively handles something that slick. I would > then start scripting: > > fetch 3edx, async=0 > > # start a Python block > > python > > # import stored > > from pymol import stored > > # create a set to hold residue identifiers > > stored.resiList = set() > > # this set will contain those residues ids w/letters > > badList = set() > > # populate the residue list > > cmd.iterate("3edx", "stored.resiList.add(resi)") > > # foreach residue in the list, look for anything resembling > # a number followed by a non-number (eg. letter) > # and add it to the bad list > > for x in stored.resiList: > if None != re.search("\d+\D", x): > #print x > badList.add(x) > > # the set difference will be what you're looking for > > print "Good residues are" > print stored.resiList - badList > > python end > > > Cheers, > > -- Jason > > > > > > On Tue, Feb 15, 2011 at 5:22 PM, Nat Echols <nathaniel.ech...@gmail.com> > wrote: >> On Tue, Feb 15, 2011 at 2:07 PM, Jason Vertrees >> <jason.vertr...@schrodinger.com> wrote: >>> >>> Interesting question. PyMOL's wildcards can help here: >>> >>> select allButInsertionsA, not (i. *A) >>> >>> This will look for all residue NUMBERS that end in "A" and select >>> everything but that. >> >> Thanks, that definitely helps a lot. I just realized that my original >> question was poorly formulated, however: the insertion code often (maybe >> always?) changes from residue to residue (PDB ID 3edx is one example). So I >> could build up a list of all insertion codes, or just use all uppercase >> characters, but I'm worried about the size of the resulting selection >> strings. (I managed to crash PyMOL for the first time in years last week >> with a very long selection.) Can I instead select for a *blank* insertion >> code? >> -Nat >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net >> > > > > -- > Jason Vertrees, PhD > PyMOL Product Manager > Schrodinger, LLC > > (e) jason.vertr...@schrodinger.com > (o) +1 (603) 374-7120 > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net