IMP logo
IMP Reference Guide  2.17.0
The Integrative Modeling Platform
atom/assess_dope.py

The script shows how to assess a protein conformation using DOPE.

1 ## \example atom/assess_dope.py
2 # The script shows how to assess a protein conformation using DOPE.
3 
4 from __future__ import print_function
5 import IMP
6 import IMP.atom
7 import IMP.container
8 import sys
9 
10 IMP.setup_from_argv(sys.argv, "assess dope")
11 
12 
13 def create_representation():
14  m = IMP.Model()
16  '1fdx.B99990001.pdb'), m, IMP.atom.NonWaterNonHydrogenPDBSelector())
17  prot = IMP.atom.get_by_type(mp0, IMP.atom.CHAIN_TYPE)[0]
18  return (m, prot)
19 
20 
21 def add_dope(m, prot):
22  ps = IMP.atom.get_by_type(prot, IMP.atom.ATOM_TYPE)
23  for p in ps:
25  print("Huh?", p)
26  dpc = IMP.container.ClosePairContainer(ps, 15.0, 1.0)
27  # By default the score is evaluated on all nearby pairs of atoms,
28  # even atoms that are bonded (or related by angles or dihedrals).
29  # This is consistent with the behavior of the score in MODELLER.
30  # If you like you can exclude pairs of atoms belonging to the same residue
31  # by adding a pair filter to the container:
32  # f = IMP.atom.SameResiduePairFilter()
33  # dpc.add_pair_filter(f)
35  dps = IMP.atom.DopePairScore(15.0)
36  d = IMP.container.PairsRestraint(dps, dpc)
37  return d
38 
39 
40 print("creating representation")
41 (m, prot) = create_representation()
42 
43 print("creating DOPE score function")
44 d = add_dope(m, prot)
45 
46 IMP.set_check_level(IMP.USAGE)
47 print("DOPE SCORE ::", d.evaluate(False))