IMP logo
IMP Reference Guide  develop.4390929e3e,2024/11/12
The Integrative Modeling Platform
atom/structure_from_sequence.py

An atomic protein structure is created from primary (amino-acid) sequence.

1 ## \example atom/structure_from_sequence.py
2 # An atomic protein structure is created from primary (amino-acid) sequence.
3 #
4 
5 import IMP.atom
6 import sys
7 
8 IMP.setup_from_argv(sys.argv, "structure from sequence")
9 
10 # Use the CHARMM all-atom (i.e. including hydrogens) topology and parameters
12 
13 # Create a single chain of amino acids and apply the standard C- and N-
14 # termini patches
15 topology.add_sequence('IACGACKPECPVNIIQGS')
16 topology.apply_default_patches()
17 
18 # Make an IMP Hierarchy (atoms, residues, chains) that corresponds to
19 # this topology
20 m = IMP.Model()
21 h = topology.create_hierarchy(m)
22 
23 # Generate coordinates for all atoms in the Hierarchy, using CHARMM internal
24 # coordinate information (an extended chain conformation will be produced).
25 # Since in some cases this information can be incomplete, better results will
26 # be obtained if the atom types are assigned first and the CHARMM parameters
27 # file is loaded, as we do here, so missing information can be filled in.
28 # It will still work without that information, but will approximate the
29 # coordinates.
30 topology.add_atom_types(h)
31 topology.add_coordinates(h)
32 
33 # Hierarchies in IMP must have radii
35 
36 # Write out the final structure to a PDB file
37 IMP.atom.write_pdb(h, 'structure.pdb')