IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
load_protein_restrain_bonds.py
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
import
IMP.atom
7
import
IMP.container
8
m=
IMP.Model
()
9
prot=
IMP.atom.read_pdb
(
IMP.atom.get_example_path
(
"example_protein.pdb"
), m)
10
IMP.atom.add_bonds
(prot)
11
bds=
IMP.atom.get_internal_bonds
(prot)
12
bl=
IMP.container.ListSingletonContainer
(bds)
13
h=
IMP.core.Harmonic
(0,1)
14
bs=
IMP.atom.BondSingletonScore
(h)
15
br=
IMP.container.SingletonsRestraint
(bs, bl)
16
m.add_restraint(br)
17
print
m.evaluate(
False
)