This example shows how to use IMP::core::RigidBody and IMP::core::ExcludedVolumeRestraint. We will construct a molecular hierarchy consisting of five proteins, and then apply connectivity restraint obtained from yeast two-hybrid experimental data to these proteins. We will define these proteins as rigid bodies and apply excluded volume restraint to prevent these proteins from interpenetrating. On the following figure, we see an XML representation of the molecular hierarchy.
<!-- File: eg2_representation.xml -->
<Representation>
<Protein id="Protein1"><Chain filename="data/protein1.pdb"/></Protein>
<Protein id="Protein2"><Chain filename="data/protein2.pdb"/></Protein>
<Protein id="Protein3"><Chain filename="data/protein3.pdb"/></Protein>
<Protein id="Protein4"><Chain filename="data/protein4.pdb"/></Protein>
<Protein id="Protein5"><Chain filename="data/protein5.pdb"/></Protein>
</Representation>
From restrainer's point of view, a Rigid Body is a special form of restraint. Therefore, to make some parts of the hierarchy rigid, suitable rigid body declarations should be placed in the restraint XML file.
<!-- File: eg2_restraint.xml -->
<RigidBody>
</RigidBody>
<ExcludedVolume>
</ExcludedVolume>
<Y2H>
</Y2H>
19 restrainer = IMP.restrainer.Main()
22 rep = restrainer.add_representation(
24 rsr = restrainer.add_restraint(
33 model = restrainer.get_model()
36 protein1_hierarchy = rep.get_imp_hierarchy_by_id(
'Protein1')
39 root_hierarchy = rep.get_root_imp_hierarchy()
42 protein1_rb = rsr.get_rigid_body_by_id(
"Protein1")
45 rbs = rsr.get_all_rigid_bodies()