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