| 1 | # Fit an atomic model in a map and save new coordinates and map to files.
|
|---|
| 2 |
|
|---|
| 3 | from chimera import runCommand as run, openModels
|
|---|
| 4 | run('open 1grl')
|
|---|
| 5 | run('open emdbID:1080')
|
|---|
| 6 | run('fit #0 #1')
|
|---|
| 7 |
|
|---|
| 8 | # Get PDB and map Python objects
|
|---|
| 9 | m, v = openModels.list()
|
|---|
| 10 |
|
|---|
| 11 | # Save the map using Python function
|
|---|
| 12 | map_path = "/tmp/mymap.mrc"
|
|---|
| 13 | from VolumeData import save_grid_data
|
|---|
| 14 | save_grid_data(v.data, map_path)
|
|---|
| 15 |
|
|---|
| 16 | # Or save the map using a command
|
|---|
| 17 | #run('volume #1 save %s' % map_path)
|
|---|
| 18 |
|
|---|
| 19 | # Save the PDB relative to the volume coordinate system using Python function
|
|---|
| 20 | pdb_path = "/tmp/fitpdb.pdb"
|
|---|
| 21 | from Midas import write
|
|---|
| 22 | write(m, v, pdb_path)
|
|---|
| 23 |
|
|---|
| 24 | # Or save the pdb using a command
|
|---|
| 25 | #run('write relative #1 #0 %s' % pdb_path)
|
|---|