IMP
2.4.0
The Integrative Modeling Platform
IMP Mainpage
Modules
Classes
Examples
atom/load_protein_restrain_bonds.py
Load a protein from a PDB file and then restrain all the bonds to have their current length.
1
## \example atom/load_protein_restrain_bonds.py
2
# Load a protein from a PDB file and then restrain all the bonds to have their
3
# current length.
4
#
5
6
from
__future__
import
print_function
7
import
IMP.atom
8
import
IMP.container
9
m =
IMP.kernel.Model
()
10
prot =
IMP.atom.read_pdb
(
IMP.atom.get_example_path
(
"example_protein.pdb"
), m)
11
IMP.atom.add_bonds
(prot)
12
bds =
IMP.atom.get_internal_bonds
(prot)
13
bl =
IMP.container.ListSingletonContainer
(bds)
14
h =
IMP.core.Harmonic
(0, 1)
15
bs =
IMP.atom.BondSingletonScore
(h)
16
br =
IMP.container.SingletonsRestraint
(bs, bl)
17
m.add_restraint(br)
18
print(m.evaluate(
False
))