[Chimera-users] Volume blob and sum internal map value(s)

Tom Goddard goddard at sonic.net
Thu Jan 17 15:09:34 PST 2019


Hi Lothar,

  You could use a Python script in Chimera to record info about every connected surface piece.  Here is an example script

	http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/surfvol.py <http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/surfvol.py>

That example script does not find the enclosed total map intensity.  That requires masking the volume.  Maybe an easier approach would be to forget about the surface and instead work with the 3d map data directly finding which grid points are connected above a specified threshold level.  The Segger segmentation code in Chimera does that (menu Tools / Volume Data / Segment Map).  Click the Options button on the Segger window and set smoothing steps to 0.  Set the threshold level you want in volume viewer and segment.  Select all regions and use Segger menu Regions / Mean and SD to report the mean density for each of the selected regions.  You want more info, like the x,y,z center coordinate.  If you are comfortable with Python you could then find the RegionMeanAndSD() routine in 

	chimera/share/Segger/segment_dialog.py

and modify it to report more info like include the x,y,z center position.  It will take some study of the code to figure out how to do that.  Basically each segmented region in segger is a list of map grid indices and you would need to write some code to find the center position.  The code in Segger/regions.py in the mean_and_sd() routine shows how the mean and standard deviation is computed for a region from its grid points.

	Tom



> On Jan 17, 2019, at 2:32 PM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> 
> Hi Lothar,
> Unfortunately not really (without coding) since “sel” is the only way of specifying the blobs individually in a command, and clicking on them is the only way to select them.  Surely it could be done with python, probably avoiding selection entirely, but somebody else would have to advise on that.  
> 
> About blob center, it is even more annoying, I’m afraid… although the center of “mass” of the masked map could be reported with “measure center”, it is given in grid indices.  If you add a marker at the center with the “mark true” option, then you can use “measure center” on the marker to get actual coordinates.  However the marker is a new model so you have to know the next available model number and probably you’d want to delete it before you create the next one.
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/measure.html#center>
> 
> For example
> 
> measure center #3 mark true
> … if that gives marker model #4, then …
> measure center #4
> close #4
> 
> (I was hoping that it would work just to use command “cofr sel” which will would change the center of rotation to the selected blob and report that center in the Reply Log.  However, that gives different numbers, and when I add a new atom with those coordinates, is not in the right place… must be in a different coordinate system than the molecule and map.)
> 
> Sorry about the hassle,
> Elaine
> -----
> Elaine C. Meng, Ph.D.
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
>> On Jan 17, 2019, at 10:07 AM, Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov> wrote:
>> 
>> Hi Elaine, 
>> 
>>  it seems to be working. Since I have a number of peaks and a number of different maps to deal with, is there a way to iterate over all blobs in a map without having to click on them ? If iteration works, is there a way to write out the blob center in adition to its integrated value so I can match it with a nearby heavy atom (I need to know which blob stems from which atom of course) ?
>> 
>> Thanks,
>> Lothar
>> From: Elaine Meng <meng at cgl.ucsf.edu>
>> Sent: Wednesday, January 16, 2019 9:07:27 PM
>> To: Esser, Lothar (NIH/NCI) [E]
>> Cc: chimera-users BB
>> Subject: Re: [Chimera-users] Volume blob and sum internal map value(s)
>> 
>> Hi Lothar,
>> It’s a little more circuitous:
>> 
>> (1) use “sop split” to make the blobs independently selectable (otherwise when you select any one blob, it selects all the blobs in the same surface model)
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/sop.html#split>
>> 
>> (2) select the blob of interest (Ctrl-click)
>> 
>> (3) mask map with selected blob, e.g. for map #0 command something like: 
>> 
>> mask #0 sel mod #3
>> 
>> …model #3 is the new masked map
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/mask.html>
>> 
>> (4) use “measure mapSum” on new map to sum all of its values, e.g.
>> 
>> measure mapsum #3 
>> 
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/measure.html#mapSum>
>> 
>> I hope this helps,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.                       
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>> 
>> 
>>> On Jan 16, 2019, at 3:15 PM, Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov> wrote:
>>> 
>>> Hi, 
>>>  I seem to remember that the following is possible but I cannot figure it out anymore:
>>> 
>>> One can read, say, an electron density map, contour it at desired level and in "Measure and Color Blobs" one can individually select blobs that are of interest and determine their volume and surface area. 
>>> 
>>> That works well. What I don't remember is how to integrate the map values inside the blob. I think it was implemented once but it currently escapes me. 
>>> 
>>> Any advice welcome. 
>>> Thanks, 
>>> Lothar
>> 
>> _______________________________________________
>> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
>> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
> 
> 
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190117/0434da0b/attachment.html>


More information about the Chimera-users mailing list