Hi,   Tom,

 

Sorry to bother you again. When I  run the code you shared with me in the following (I modified it a little bit),

 

+++++++++++++++++++++++++++++++++++++++++++++++

import sys, getopt

sys.path.insert(0, '/home/rli/.local/UCSF-Chimera64-1.10.2 /lib')

from _chimera import OpenModels

m = OpenModels.open('1a0m', 'PDB')[0]                              # Open atomic model

v = OpenModels.open('1a0m', 'EDSID')[0]                            # Open xray density map, #1

for a in m.atoms:

    xyz = a.coord().data()

    i,j,k = v.data.xyz_to_ijk(xyz)

print 'Atom %s is at grid point %.1f, %.1f, %.1f' % (a.oslIdent(), i, j, k)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

I got such an error:

-------------------------------------------------------------------------

Traceback (most recent call last):

  File "atomgrid.py", line 8, in <module>

    m = OpenModels.open('1a0m', 'PDB')[0]               # Open atomic model

AttributeError: type object '_chimera.OpenModels' has no attribute 'open'

-----------------------------------------------------------------------------------

 

I don’t know which part I did is wrong. Thank you very much for your help again.

 

Best,

Rongjian

From: Tom Goddard [mailto:goddard@sonic.net]
Sent: Thursday, February 11, 2016 5:42 PM
To: rongjian li
Cc: chimera-users@cgl.ucsf.edu
Subject: Re: [Chimera-users] mapping between MRC and PDB

 

Hi Rongjian,

 

  Here is some python that you can open in Chimera (File / Open) that will load an atomic model (PDB 1a0m) and density map (x-ray map for 1a0m) and print the density map grid index of each atom.  The index is floating point since the atoms of course are not exactly at grid points.

 

  The Chimera Python scripts web page has more example code

 

            http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts

 

  Tom