
Hi Tom, I saw your message on the web and I tried to use your script on Chimera 1.3. Unfortunately it does not work, it give me the following message: 0 models opened Do you think it is because of the Chimera version? Do you have suggestion? Thank you very much, Armida Oops. That script I posted for calculating the inertia of a molecule had some problems. The printed matrix of axes was transposed though the correct axes were used for the displayed ellipsoid. Also I was using inertia matrix I_ij = sum_over_k(m_k*r_ki*r_kj) omitting the diagonal term. Should have been I_ij = sum_over_k(m_k*(|r_k| - r_ki*r_kj)). And finally I incorrectly computed the ellipsoid size along each axis. Everything was a little bit wrong. Here's the fixed version. Tested in Chimera version 1.2500 but should work with earlier versions. Tom

Hi Armida, I just tried the script in Chimera 1.3 and in a recent daily build (1.4) and it worked in both. I'm guessing that when you tried it, Chimera did not know the file type of the script because it was not named ending with ".py". If you look at the link below, even though the mail program names the file "attachment.ksh", the original name is "inertiapdb.py". You could name it that or actually anything that ends in .py and then it should work. For example, I saved the script file to my Desktop and named it inertiapdb.py. Then I started Chimera, then opened a PDB file, then used "File... Open" in the menu to open inertiapdb.py -- an ellipsoid is shown in the Chimera window and numerical information is shown in the Reply Log. I hope this helps, ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On May 14, 2009, at 6:42 AM, A. Di Fenza wrote:
Hi Tom, I saw your message on the web and I tried to use your script on Chimera 1.3. Unfortunately it does not work, it give me the following message:
0 models opened
Do you think it is because of the Chimera version? Do you have suggestion?
Thank you very much, Armida
Oops. That script I posted for calculating the inertia of a molecule had some problems. The printed matrix of axes was transposed though the correct axes were used for the displayed ellipsoid. Also I was using inertia matrix I_ij = sum_over_k(m_k*r_ki*r_kj) omitting the diagonal term. Should have been I_ij = sum_over_k(m_k*(|r_k| - r_ki*r_kj)). And finally I incorrectly computed the ellipsoid size along each axis. Everything was a little bit wrong. Here's the fixed version. Tested in Chimera version 1.2500 but should work with earlier versions.
Tom

Dear Elaine, your guess was perfectly right! Thank you very much for the detailed instructions it is the first time I use Chimera and that was what I needed, now it works. I have a question about the algorithm. As far as I have understood, the script looks at the element name, say CA or N or C, to assign the atom mass. So that if I have a pdb made of CA atoms only, the atom masses used in the inertia matrix calculation are all the same. Is this right? I need to be sure because I calculated with your script the inertia matrix for the same protein first with all-atom and then with only the CA, and I got that they are very similar although using the same mass for all the atoms is a quite big approximation. Thank you very much for your help! Armida Elaine Meng wrote:
Hi Armida, I just tried the script in Chimera 1.3 and in a recent daily build (1.4) and it worked in both.
I'm guessing that when you tried it, Chimera did not know the file type of the script because it was not named ending with ".py". If you look at the link below, even though the mail program names the file "attachment.ksh", the original name is "inertiapdb.py". You could name it that or actually anything that ends in .py and then it should work.
For example, I saved the script file to my Desktop and named it inertiapdb.py. Then I started Chimera, then opened a PDB file, then used "File... Open" in the menu to open inertiapdb.py -- an ellipsoid is shown in the Chimera window and numerical information is shown in the Reply Log.
I hope this helps, ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html
On May 14, 2009, at 6:42 AM, A. Di Fenza wrote:
Hi Tom, I saw your message on the web and I tried to use your script on Chimera 1.3. Unfortunately it does not work, it give me the following message:
0 models opened
Do you think it is because of the Chimera version? Do you have suggestion?
Thank you very much, Armida
Oops. That script I posted for calculating the inertia of a molecule had some problems. The printed matrix of axes was transposed though the correct axes were used for the displayed ellipsoid. Also I was using inertia matrix I_ij = sum_over_k(m_k*r_ki*r_kj) omitting the diagonal term. Should have been I_ij = sum_over_k(m_k*(|r_k| - r_ki*r_kj)). And finally I incorrectly computed the ellipsoid size along each axis. Everything was a little bit wrong. Here's the fixed version. Tested in Chimera version 1.2500 but should work with earlier versions.
Tom

Hi Armida, Yes, I believe it uses masses based on element assignments in Chimera. I didn't write the script, but looking at it I see "a.element.mass": <http://www.cgl.ucsf.edu/pipermail/chimera-users/attachments/20080321/21f01cd...
How the element is assigned depends on the input file. PDB files can have an element column, but if that is not present, the atom name is used. In that case, it is important that the atom names be in the correct columns, otherwise it is not possible to distinguish calcium from carbon named CA. See discussion of PDB format: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/framepdbintro.html
You can doublecheck the element assignments by using "Select... Chemistry... element... [etc.]" and seeing if that selects what you expect. You could select carbons and see if that selects the same number of atoms as when you select the whole model. Best, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On May 15, 2009, at 2:38 AM, A. Di Fenza wrote:
Dear Elaine,
your guess was perfectly right! Thank you very much for the detailed instructions it is the first time I use Chimera and that was what I needed, now it works.
I have a question about the algorithm. As far as I have understood, the script looks at the element name, say CA or N or C, to assign the atom mass. So that if I have a pdb made of CA atoms only, the atom masses used in the inertia matrix calculation are all the same. Is this right? I need to be sure because I calculated with your script the inertia matrix for the same protein first with all-atom and then with only the CA, and I got that they are very similar although using the same mass for all the atoms is a quite big approximation.
Thank you very much for your help! Armida

Hi Armida, Elaine is right. The atoms are weighted by their mass, carbon counts 12 times more than a hydrogen. Isotopic abundances are not considered -- I think Chimera's atom.element.mass is just the number of protons plus neutrons in the post prevalent isotope. It is not too surprising that the inertia ellipsoid comes out nearly identical for CA only versus all atoms for a protein. The CA atoms give a good approximation to the mass distribution. The main difference is that the total mass will be different, but that is normalized out in the ellipsoid calculation. Tom Elaine Meng wrote:
Hi Armida, Yes, I believe it uses masses based on element assignments in Chimera. I didn't write the script, but looking at it I see "a.element.mass":
<http://www.cgl.ucsf.edu/pipermail/chimera-users/attachments/20080321/21f01cd...
How the element is assigned depends on the input file. PDB files can have an element column, but if that is not present, the atom name is used. In that case, it is important that the atom names be in the correct columns, otherwise it is not possible to distinguish calcium from carbon named CA. See discussion of PDB format: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/framepdbintro.html
You can doublecheck the element assignments by using "Select... Chemistry... element... [etc.]" and seeing if that selects what you expect. You could select carbons and see if that selects the same number of atoms as when you select the whole model.
Best, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html
On May 15, 2009, at 2:38 AM, A. Di Fenza wrote:
Dear Elaine,
your guess was perfectly right! Thank you very much for the detailed instructions it is the first time I use Chimera and that was what I needed, now it works.
I have a question about the algorithm. As far as I have understood, the script looks at the element name, say CA or N or C, to assign the atom mass. So that if I have a pdb made of CA atoms only, the atom masses used in the inertia matrix calculation are all the same. Is this right? I need to be sure because I calculated with your script the inertia matrix for the same protein first with all-atom and then with only the CA, and I got that they are very similar although using the same mass for all the atoms is a quite big approximation.
Thank you very much for your help! Armida
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

On May 15, 2009, at 10:40 AM, Tom Goddard wrote:
Hi Armida,
Elaine is right. The atoms are weighted by their mass, carbon counts 12 times more than a hydrogen. Isotopic abundances are not considered -- I think Chimera's atom.element.mass is just the number of protons plus neutrons in the post prevalent isotope.
The mass is the number from the periodic table of the elements -- which is an average across isotopes. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

On Mon, 18 May 2009, Eric Pettersen wrote:
On May 15, 2009, at 10:40 AM, Tom Goddard wrote:
Hi Armida,
Elaine is right. The atoms are weighted by their mass, carbon counts 12 times more than a hydrogen. Isotopic abundances are not considered -- I think Chimera's atom.element.mass is just the number of protons plus neutrons in the post prevalent isotope.
The mass is the number from the periodic table of the elements -- which is an average across isotopes.
--Eric
More explicitly, the atom's mass is the "standard atomic weight" as given in <http://en.wikipedia.org/wiki/List_of_elements_by_atomic_weight>. - Greg
participants (5)
-
A. Di Fenza
-
Elaine Meng
-
Eric Pettersen
-
Greg Couch
-
Tom Goddard