[PyMOL] What is the difference between Atom ID and Index
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 ATT 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 (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
[PyMOL] Fwd: Question about Iterate and Edit-Mode
... -- Forwarded message -- From: Tsjerk Wassenaar tsje...@gmail.com Date: Mon, Oct 25, 2010 at 12:39 PM Subject: Re: [PyMOL] Question about Iterate and Edit-Mode To: Martin Hediger ma@bluewin.ch Hi Martin, Without diving into the source, I think it is more like: for i in selection: execute(command, atom=i) with execute being a function taking a string and an atom id :) and doing something like: eval(command, locals=locals()) Note that there will be some trickery to extend the locals dictionary with the properties that can be included in the command (resi, ID, b, etc.). Hope it helps, Tsjerk On Sun, Oct 24, 2010 at 2:12 PM, Martin Hediger ma@bluewin.ch wrote: Dear All I am trying to get behind the way 'iterate' works, since I see it quite frequently in PyMOL scripts. The example in the help page is a bit limited in the sense that I cant explain to myself what actually is happening. Say, if I were to write the functionality of 'iterate' using a for-loop, how would this for-loop look like? Something like this maybe? for i in selection: i.expression() I'm a bit confused about what can go into 'expression'. The second question is related to the Edit-Mode of PyMOL. When I switch to Edit-Mode and click on a atom, a couple of states/objects (?) appear in the object list: pk1, pkmol, pkresi, pkchain, pkobject. What do these objects mean? What are they useful for? I'm sure there is a reason for them, but I cant figure it out. Thanks a lot for your help guys. Martin -- Nokia and ATT 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 (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 -- 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 ATT 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 (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
[PyMOL] Fwd: What is the difference between Atom ID and Index
Never get used to that only-reply-to-sender policy... -- Forwarded message -- From: Tsjerk Wassenaar tsje...@gmail.com 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@bluewin.ch 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@bluewin.ch 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 ATT 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 (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 -- 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 ATT 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 (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
Re: [PyMOL] Fwd: What is the difference between Atom ID and Index
Thanks Tsjerk (on both occasions). As a matter of fact, I'm kind of making a living out of writing a Python script once in a while, so thats no worry ;) What I was trying to get at was that I was trying to understand how certain PyMOL scripts work, and naturally from that become able to improve my own ones. In particular, I was trying to understand the following script: http://pastebin.com/5mkwWJdd Its is supposed to find hydrogen bonds within a structure and it should allow to monitor the change in the HB network throughout a reaction. Credit to the person who wrote it. Especially, lines 61 to 69 make heavy use of iterate, but I cant quite follow it. Understanding 'iterate' (and naturally iterate_state, alter and alter_state), I believe, would help me alot in writing better scripts. Anyway, thanks again for the support. Martin On 25.10.10 12:49, Tsjerk Wassenaar wrote: Never get used to that only-reply-to-sender policy... -- Forwarded message -- From: Tsjerk Wassenaartsje...@gmail.com Date: Mon, Oct 25, 2010 at 12:30 PM Subject: Re: [PyMOL] What is the difference between Atom ID and Index To: Martin Hedigerma@bluewin.ch 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 Hedigerma@bluewin.ch 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 ATT 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 (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 -- Nokia and ATT 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 (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
Re: [PyMOL] Fwd: What is the difference between Atom ID and Index
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 tsje...@gmail.com wrote: Never get used to that only-reply-to-sender policy... -- Forwarded message -- From: Tsjerk Wassenaar tsje...@gmail.com 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@bluewin.ch 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@bluewin.ch 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 ATT 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 (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 -- 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 ATT 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 (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 -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia
[PyMOL] Bug in Snow Leopard
Hi all, I'm using PyMOL version 1.3 installed via Fink on my MacBook Pro with Snow Leopard 10.6.4. I've noticed a strange OS-specific bug when using the Spaces feature of my Mac while running PyMOL. If I attempt to change Space, my system appears to do some sort of restart, without actually restarting. In other words, every program quits and the even Finder relaunches and anything unsaved gets lost. I realize this is a fairly system specific bug, but I'm wondering if anyone else running Snow Leopard who uses the Spaces feature runs into this and if so, whether or not you've found a solution. Normally I would just stop using the Spaces feature, but I've gotten in the habit of using it and do it without thinking, and lose everything I'm working on. Any advice would help, but I'm hoping to not have to turn off the feature. Thanks. Tom -- Thomas D. Grant Graduate Research Assistant Hauptman-Woodward Medical Research Institute 700 Ellicott St. Buffalo, NY 14203 -- Nokia and ATT 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 (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
Re: [PyMOL] Bug in Snow Leopard
Hi Tom - I’ve also experienced this behavior, which led me to a) attempt to learn not to switch Spaces while using Fink-installed X11 PyMOL (other X11 programs, e.g. CCP4i, appear not to have the same issue); b) make all of my figures using .pml scripts so that if I’ve changed something it’s already saved before I even see it in PyMOL; and c) find and install a very handy (commercial - $15 but worth every penny) program called ForeverSave which will automatically backup and save your other, non-X11 files (i.e. anything that can be saved with Cmd-S) in case you accidentally do switch Spaces, which as you say is hard not to do once you’re in the habit. http://www.tool-forcesw.com/foreversave/ As I recall, the behavior began to appear with the 10.6.3 update; both the “delta” and “combo” installs produced the same problem. (For a while I had reverted to 10.6.2, but then accidentally told Software Update to do its thing, which got me back to the same point, after which I didn’t feel like reinstalling everything again. 10.6.4 obviously didn’t fix the issue either.) Despite having fairly successfully worked around the issue for a good 9 months or so, the I’d love to see this issue go away, too. Any thoughts from developers or other python- or X11-savvy folks? I’m afraid I’m not one of them. Jared -- Jared Sampson Xiangpeng Kong Lab NYU Langone Medical Center New York, NY 10016 (212) 263-7898 On 10/25/10 2:34 PM, Thomas Grant tomer...@gmail.com wrote: Hi all, I'm using PyMOL version 1.3 installed via Fink on my MacBook Pro with Snow Leopard 10.6.4. I've noticed a strange OS-specific bug when using the Spaces feature of my Mac while running PyMOL. If I attempt to change Space, my system appears to do some sort of restart, without actually restarting. In other words, every program quits and the even Finder relaunches and anything unsaved gets lost. I realize this is a fairly system specific bug, but I'm wondering if anyone else running Snow Leopard who uses the Spaces feature runs into this and if so, whether or not you've found a solution. Normally I would just stop using the Spaces feature, but I've gotten in the habit of using it and do it without thinking, and lose everything I'm working on. Any advice would help, but I'm hoping to not have to turn off the feature. Thanks. Tom -- Thomas D. Grant Graduate Research Assistant Hauptman-Woodward Medical Research Institute 700 Ellicott St. Buffalo, NY 14203 This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. = -- Nokia and ATT 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 (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