[Chimera-users] alter volume data with python

Elaine Meng meng at cgl.ucsf.edu
Tue Feb 2 09:41:58 PST 2010


Hi Michael,
You can search the archive by going to the Chimera home page and  
clicking the quick link "Contact Us" on the lefthand side, which gets  
you here (where there is a search field):
<http://www.cgl.ucsf.edu/chimera/docs/feedback.html>

I don't know about python, but here is a summary of the "user  
interface" ways to modify data:
<http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/savemodel.html>

In your case, I'm thinking you could show an isosurface at the density  
value you want as your cutoff (with Volume Viewer or the "volume"  
command), then use the "mask" command to generate a new map with  
values only inside the surface, zero elsewhere.
<http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/mask.html>

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Feb 1, 2010, at 6:26 PM, Michael Zimmermann wrote:

> Dear Chimera users,
> I cannot find a way to search the chimera-users archive, so I
> appologize if this has been asked already.  I wish to alter some
> volume data in specific ways; delete (zero out) all volume values that
> do not meet certain density criteria.  The following code modifies the
> matrix values, but I can't figure out how to update the map that is
> being displayed in the volume viewer.
>
> I would like to be able to do something like:
> opened[0].full_matrix = H
> Then I would only see the swath that I "selected" with the following  
> code.
>
> #  
> ------------------------------------------------------------------------
> source = '1R0A_antigen_6A_8s_0.425f_inv.mrc'
> opened = chimera.openModels.open(source)
> em = opened[0]
> H = em.full_matrix()
> s = H.shape
> for k in range(0,s[2]-1):
> 	for i in range(0,s[0]-1):
> 		for j in range(0,s[1]-1):
> 			if(H[i,j,k] >= -.28) and (H[i,j,k] <= -0.001):
> 				H[i,j,k] = H[i,j,k]+1
> 			else:
> 				H[i,j,k] = 0
>
> #  
> ------------------------------------------------------------------------
>
> Thank you,
>
> -- 
> Michael Zimmermann
> Ph.D. student in Bioinformatics and Computational Biology
> Department of Biochemistry, Biophysics and Molecular Biology
> Iowa State University
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users




More information about the Chimera-users mailing list