IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
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 import IMP
5 import IMP.atom
6 import IMP.container
7 import sys
8 
9 IMP.setup_from_argv(sys.argv, "assess dope")
10 
11 
12 def create_representation():
13  m = IMP.Model()
15  '1fdx.B99990001.pdb'), m, IMP.atom.NonWaterNonHydrogenPDBSelector())
16  prot = IMP.atom.get_by_type(mp0, IMP.atom.CHAIN_TYPE)[0]
17  return (m, prot)
18 
19 
20 def add_dope(m, prot):
21  ps = IMP.atom.get_by_type(prot, IMP.atom.ATOM_TYPE)
22  for p in ps:
24  print("Huh?", p)
25  dpc = IMP.container.ClosePairContainer(ps, 15.0, 1.0)
26  # By default the score is evaluated on all nearby pairs of atoms,
27  # even atoms that are bonded (or related by angles or dihedrals).
28  # This is consistent with the behavior of the score in MODELLER.
29  # If you like you can exclude pairs of atoms belonging to the same residue
30  # by adding a pair filter to the container:
31  # f = IMP.atom.SameResiduePairFilter()
32  # dpc.add_pair_filter(f)
34  dps = IMP.atom.DopePairScore(15.0)
35  d = IMP.container.PairsRestraint(dps, dpc)
36  return d
37 
38 
39 print("creating representation")
40 (m, prot) = create_representation()
41 
42 print("creating DOPE score function")
43 d = add_dope(m, prot)
44 
45 IMP.set_check_level(IMP.USAGE)
46 print("DOPE SCORE ::", d.evaluate(False))