From: Jason V. <jas...@sc...> - 2010-10-25 15:03:48
|
Hi Martin & Tsjerk, There is a another difference between the two aside from the off-by-one characteristic. PyMOL has to keep track of atoms, so a simple 'index' could work. But, then when the user removes an atom from the middle of a structure, do we shift indices above it down? (This could make bonds point to new places!) Leave them as is? (But there aren't N-atoms anymore, there's N-1.) So, PyMOL has two indices, one tracks the absolute numbering (ID) and doesn't change between (molecular) object builds, and the other tracks the atom's relative position from the first atom found. This could be confusing, so how about some code: # create an alanine fragment frag ala # now read the label on the ALA`2/HA; C-alpha's hydrogen # it should read, '7-9' label *, "%s-%s" % (index,ID) [.. read the label before copying and pasting below ..] # Now, remove the alpha carbon; subsequent commands # will need to rebuild the connection table, generating # new numbers for index remove 2/CA # hide the labels hide labels # now read the label on the 2/HA atom ("6-9") label *, "%s-%s" % (index,ID) Cheers, -- Jason On Mon, Oct 25, 2010 at 6:49 AM, Tsjerk Wassenaar <ts...@gm...> wrote: > Never get used to that only-reply-to-sender policy... > > > ---------- Forwarded message ---------- > From: Tsjerk Wassenaar <ts...@gm...> > Date: Mon, Oct 25, 2010 at 12:30 PM > Subject: Re: [PyMOL] What is the difference between Atom ID and Index > To: Martin Hediger <ma...@bl...> > > > Hi Martin, > > ID is indeed the atom id from the coordinate (PDB) file. Index, AFAIK, > is the atom index in the model, starting from 1. > > Probably you should get yourself acquainted with the command line and > with python, as it will help you to solve these and other problems. > For example, you can access properties from the atoms easily through > constructions like these: > > x = [ at.id for at in cmd.get_model(selection).atom ] > y = [ at.index for at in cmd.get_model(selection).atom ] > > That will first build a selection/model object, with a list of atoms > (.atom), over which you can iterate to extract some properties. To > check whether the index is indeed a straightforward list of increasing > numbers, you can then look at the output of > > print y == range(1,len(y)+1) > > Hope it helps :) > > Tsjerk > > On Mon, Oct 25, 2010 at 10:55 AM, Martin Hediger <ma...@bl...> wrote: >> Dear All >> I'm trying to figure out for myself, what the two labels 'Label > Atom >> Identifiers > ID' and 'Label > Atom Identifiers > index' mean, or what >> the respective difference between the two is. For sure, the numerical >> value is very different when I show the labels in a structure. ID seems >> to be the index of the atom in the list of atom-descriptor lines in the >> PDB input file. But I cant figure out what 'index' is referring to. >> >> Any help on this would be very welcome. >> >> Martin >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North America contest >> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> > > > > -- > 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 > > > > -- > 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 > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) Jas...@sc... (o) +1 (603) 374-7120 |