Scripts: save.py

File save.py, 683 bytes (added by goddard, 9 years ago)
Line 
1# Fit an atomic model in a map and save new coordinates and map to files.
2
3from chimera import runCommand as run, openModels
4run('open 1grl')
5run('open emdbID:1080')
6run('fit #0 #1')
7
8# Get PDB and map Python objects
9m, v = openModels.list()
10
11# Save the map using Python function
12map_path = "/tmp/mymap.mrc"
13from VolumeData import save_grid_data
14save_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
20pdb_path = "/tmp/fitpdb.pdb"
21from Midas import write
22write(m, v, pdb_path)
23
24# Or save the pdb using a command
25#run('write relative #1 #0 %s' % pdb_path)