IMP  2.0.1
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 optparse import OptionParser
8 
9 def parse_args():
10  usage = """%prog [options] <pdb file name>
11 
12 This program generates the Connolly surface for a given PDB file."""
13 
14  parser = OptionParser(usage)
15  parser.add_option("--density", dest="density", default=10.0, type="float",
16  metavar="D",
17  help="density of probe points, per cubic angstrom "
18  "(default 10.0)")
19  parser.add_option("--radius", dest="rp", default=1.8, type="float",
20  metavar="R",
21  help="probe radius in angstroms (default 1.8)")
22 
23  opts, args = parser.parse_args()
24  if len(args) != 1:
25  parser.error("incorrect number of arguments")
26  return args[0], opts.density, opts.rp
27 
28 def main():
29  infile, density, rp = parse_args()
30  outfile = infile + '.ms'
31 
32  m = IMP.Model()
33  h = IMP.atom.read_pdb(infile, m,
36  outfile, density, rp)
37 
38 if __name__ == "__main__":
39  main()