IMP  2.2.0
The Integrative Modeling Platform
surface.py
1 #!/usr/bin/env python
2 
3 __doc__ = "Generate a Connolly surface for a PDB."
4 
5 import IMP.atom
6 import IMP.multifit
7 from IMP import OptionParser
8 
9 
10 def parse_args():
11  usage = """%prog [options] <pdb file name>
12 
13 This program generates the Connolly surface for a given PDB file."""
14 
15  parser = OptionParser(usage)
16  parser.add_option("--density", dest="density", default=10.0, type="float",
17  metavar="D",
18  help="density of probe points, per cubic angstrom "
19  "(default 10.0)")
20  parser.add_option("--radius", dest="rp", default=1.8, type="float",
21  metavar="R",
22  help="probe radius in angstroms (default 1.8)")
23 
24  opts, args = parser.parse_args()
25  if len(args) != 1:
26  parser.error("incorrect number of arguments")
27  return args[0], opts.density, opts.rp
28 
29 
30 def main():
31  infile, density, rp = parse_args()
32  outfile = infile + '.ms'
33 
34  m = IMP.kernel.Model()
35  h = IMP.atom.read_pdb(infile, m,
38  outfile, density, rp)
39 
40 if __name__ == "__main__":
41  main()
Select non water and non hydrogen atoms.
Definition: pdb.h:197
void write_connolly_surface(atom::Atoms as, base::TextOutput fn, float density, float probe_radius)
Write the Connolly surface for a set of atoms to a file.
See IMP.multifit for more information.
IMP::kernel::OptionParser OptionParser
See IMP.atom for more information.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Hierarchies get_leaves(const Selection &h)
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72