home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.21.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
version 2.21.0
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
import
sys
10
11
IMP.setup_from_argv
(sys.argv,
"load protein restrain bonds"
)
12
13
m =
IMP.Model
()
14
prot =
IMP.atom.read_pdb
(
IMP.atom.get_example_path
(
"example_protein.pdb"
), m)
15
IMP.atom.add_bonds
(prot)
16
bds = IMP.atom.get_internal_bonds(prot)
17
bl =
IMP.container.ListSingletonContainer
(m, bds)
18
h =
IMP.core.Harmonic
(0, 1)
19
bs =
IMP.atom.BondSingletonScore
(h)
20
br =
IMP.container.SingletonsRestraint
(bs, bl)
21
print(br.evaluate(
False
))