IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
assess_dope.py
1## \example atom/assess_dope.py
2# The script shows how to assess a protein conformation using DOPE.
3
4import IMP
5import IMP.atom
6import IMP.container
7import sys
8
9IMP.setup_from_argv(sys.argv, "assess dope")
10
11
12def 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
20def 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)
36 return d
37
38
39print("creating representation")
40(m, prot) = create_representation()
41
42print("creating DOPE score function")
43d = add_dope(m, prot)
44
45IMP.set_check_level(IMP.USAGE)
46print("DOPE SCORE ::", d.evaluate(False))
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
static bool get_is_setup(const IMP::ParticleAdaptor &p)
Definition Atom.h:245
Score pair of atoms based on DOPE.
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
Gather all the molecular particles of a certain level in the hierarchy.
Select non water and non hydrogen atoms.
Definition pdb.h:320
Return all close unordered pairs of particles taken from the SingletonContainer.
Applies a PairScore to each Pair in a list.
Functionality for loading, creating, manipulating and scoring atomic structures.
void add_dope_score_data(atom::Hierarchy h)
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Hierarchy read_pdb(TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector(), bool select_first_model=true)
Read all the molecules in the first model of the PDB file.
Various classes to hold sets of particles.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.
Definition exception.h:72
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.