IMP  2.0.1
The Integrative Modeling Platform
em_restraint.py
1 ## \example restrainer/em_restraint.py
2 ## This example shows how to use IMP::em::FitRestraint.
3 ##
4 ## \include em_representation.xml
5 ## \include em_restraint.xml
6 ##
7 
8 #-- File: em_restraint.py --#
9 
10 import IMP
11 import IMP.restrainer
12 
13 # Create restrainer object
14 restrainer = IMP.restrainer.Main()
15 
16 # Add representation and restraint to restrainer
17 rep = restrainer.add_representation(IMP.restrainer.get_example_path('input/em_representation.xml'))
18 rsr = restrainer.add_restraint(IMP.restrainer.get_example_path('input/em_restraint.xml'))
19 
20 ###=======================================================================###
21 # At this point all data from XML files have been placed into the model.
22 # Now it is possible to perform various operations on the IMP model.
23 ###=======================================================================###
24 
25 # Get the IMP model object used by restrainer
26 model = restrainer.get_model()
27 
28 # Get restraint by name
29 r = rsr.get_restraint_by_name('em_restraint')
30 
31 # Get EM density map header from the restraint
32 dmap_header = r.dmap_header
33 
34 # Get IMP::em::FitRestraint
35 fit_restraint = r.imp_restraint
36 fit_restraint.evaluate(False)