IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
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
6import IMP.atom
7import IMP.container
8import sys
9
10IMP.setup_from_argv(sys.argv, "load protein restrain bonds")
11
12m = IMP.Model()
13prot = IMP.atom.read_pdb(IMP.atom.get_example_path("example_protein.pdb"), m)
17h = IMP.core.Harmonic(0, 1)
20print(br.evaluate(False))
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Score the bond based on a UnaryFunction,.
Bonds get_internal_bonds(Hierarchy mhd, bool with_representations=false)
Get the bonds internal to this tree.
Applies a SingletonScore to each Singleton in a list.
Harmonic function (symmetric about the mean)
Functionality for loading, creating, manipulating and scoring atomic structures.
void add_bonds(Hierarchy d, const ForceFieldParameters *ffp=get_all_atom_CHARMM_parameters())
Add bonds using definitions from given force field parameters.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Hierarchy read_pdb(TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector(), bool select_first_model=true)
Read all the molecules in the first model of the PDB file.
Various classes to hold sets of particles.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.