Hi Ahmad,
The center of mass of an atom is its position. A function like
cmd.centerofmass in the context of pymol only makes sense with a selection.
E.g.:
x,y,z = cmd.centerofmass('byres n. ca')
print "COM of protein:", x, y, z
Hope it helps,
Tsjerk
On Thu, Apr 6, 2017 at 6:30 AM, Ahmad Abdelzaher <underoath...@gmail.com>
wrote:
> Well I'm assuming the selection goes in the argument of cmd.centerofmass(),
> however, does it have to be an atom? How should I calculate the center of
> mass for an entire protein?
>
> On Thu, Apr 6, 2017 at 4:48 AM, David Hall <li...@cowsandmilk.net> wrote:
>
>> It returns the x, y, and z coordinates of the center of mass as a list of
>> 3 floats, presumably in that order?
>>
>> Is there another question? The page describes the arguments and their
>> defaults so I am unsure what is lacking.
>>
>> -David
>>
>> On Apr 5, 2017, at 10:29 PM, Ahmad Abdelzaher <underoath...@gmail.com>
>> wrote:
>>
>> I find the documentation about the python api here to be a bit lacking.
>>
>> https://pymolwiki.org/index.php/Centerofmass
>>
>> I would appreciate more info on how to use this: cmd.centerofmass()
>> returns a list of 3 floats.
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>> _______________________________________________
>> 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
>>
>>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> 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.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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