IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
simulate_density_from_pdb.py
1
#!/usr/bin/env python
2
3
import
IMP.em
4
5
def
main():
6
IMP.base.set_log_level
(IMP.base.SILENT)
7
usage =
"""%prog [options] <complex.pdb>
8
<output: density.mrc> <resolution> <a/pix>
9
10
Samples a protein into a simulated 3D density map."""
11
parser =
IMP.OptionParser
(usage=usage, imp_module=
IMP.em
)
12
(options, args) = parser.parse_args()
13
if
len(args) != 4:
14
parser.error(
"incorrect number of arguments"
)
15
pdb_fn=args[0]
16
mrc_fn=args[1]
17
resolution=float(args[2])
18
apix=float(args[3])
19
#read the protein
20
mdl=
IMP.Model
()
21
mh=
IMP.atom.read_pdb
(pdb_fn,mdl,
IMP.atom.NonWaterNonHydrogenPDBSelector
())
22
IMP.atom.add_radii
(mh)
23
#sample the density
24
dmap =
IMP.em.particles2density
(
IMP.core.get_leaves
(mh),resolution,apix)
25
IMP.em.write_map
(dmap,mrc_fn,
IMP.em.MRCReaderWriter
())
26
27
if
__name__ ==
"__main__"
:
28
main()