IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
charmm_topology.py
1 ## \example atom/charmm_topology.py
2 # This example shows how to use IMP's CHARMM topology reader to
3 # build an atomic structure (in this case, alanine dipeptide) from
4 # primary sequence, and to apply topology patches.
5 #
6 
7 import IMP.atom
8 import sys
9 
10 IMP.setup_from_argv(sys.argv, "CHARMM topology")
11 
12 # Read CHARMM non-hydrogen parameters
14 
15 # Start building a single segment (chain) topology
17 
18 # Get the topology of an ideal alanine from the CHARMM topology
19 ideal_ala = ff.get_residue_topology(IMP.atom.ALA)
20 
21 # Use ideal topology as a template to make the real alanine topology
22 # ("real" topology can be modified, e.g. by patching)
23 ala = IMP.atom.CHARMMResidueTopology(ideal_ala)
24 
25 # Apply ACE and CT3 patches to our topology. Normally a residue can only
26 # be patched once, so reset the patched flag after the first patch.
27 ace = ff.get_patch("ACE")
28 ct3 = ff.get_patch("CT3")
29 ace.apply(ala)
30 ala.set_patched(False)
31 ct3.apply(ala)
32 
33 # Add the residue and chain to the top-level topology
34 st.add_residue(ala)
36 t.add_segment(st)
37 
38 # Make a Hierarchy using this topology
39 m = IMP.Model()
40 h = t.create_hierarchy(m)
41 IMP.atom.show(h)
CHARMMParameters * get_heavy_atom_CHARMM_parameters()
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
The topology of a single residue in a model.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
The topology of a single CHARMM segment in a model.
The topology of a complete CHARMM model.
Functionality for loading, creating, manipulating and scoring atomic structures.