[Chimera-users] Place marker at centre of volume box python command

Kyle Morris kylelmorris at berkeley.edu
Fri Jun 1 15:45:00 PDT 2018


Hi Elaine,

This was very helpful to get me on track. I needed this to be
scriptable and found a way using a mixture of your suggestions.

volume #0 showOutlineBox true
reset; cofr #0; ac mc

This places a marker at the map centre in #1. I noticed it was
necessary to display the map box to get the cofr to be the box centre,
otherwise it was slightly offset and more like centre of mass.

It worked in one case, hopefully will do for all.

Thanks for your help!
Kyle

> On 1 Jun 2018, at 12:37, Elaine Meng <meng at cgl.ucsf.edu> wrote:
>
> Oh, and if you needed it to be an atom/marker rather than a spherical surface or crosshatch “+", you could add that with Build Structure (in menu under Tools… Structure Editing), Start Structure:  atom.  One of the placement options is to enter x,y,z coordinates.  I don’t think there is a way to create a marker by directly specifying its coordinates (other than making a marker file by hand), but markers and atoms are treated the same way for most purposes in Chimera.
>
> Elaine
>
>> On Jun 1, 2018, at 12:30 PM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
>>
>> Hi Kyle,
>> This is not a python answer (as I don’t know python) but you can calculate the coordinates of the center from the information shown in Volume Viewer, Features… Coordinates.
>> <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/framevolumeviewer.html>
>> <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/volumeviewer.html#coordinates>
>>
>> Origin index refers to the grid indices of the XYZ origin (coordinates 0,0,0) and Voxel size is the spacing of grid points. You would also need to know the number of grid points in each dimension, which is given above the histogram in Volume Viewer.
>>
>> If you want the visual of a dummy at that center, could use command “shape sphere” with the “center” option giving your previously calculated x,y,z coordinates.
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html#sphere>
>>
>> Or, you could use command “cofr” specifying the x,y,z coordinates to set rotation center to that point and then show center of rotation crosshatch with “set showcofr”
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/cofr.html>
>>
>> I hope this helps,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>>
>>
>>> On Jun 1, 2018, at 11:57 AM, Kyle Morris <kylelmorris at berkeley.edu> wrote:
>>>
>>> Hi Chimera dev,
>>> Is there a python command to place a marker at the precise centre of a volume’s box, regardless of the centre of mass of the volume in the box?
>>> I have played with creating dummy volumes and measuring their centres but it’s clunky and got a bit stuck with doing this. A single command would be cleaner, if it’s possible.
>>> As always thanks for your help!
>>> Best wishes,
>>> Kyle
>>
>>
>> _______________________________________________
>> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
>> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>>
>




More information about the Chimera-users mailing list