IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
structure_from_sequence.py
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')
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
void add_radii(Hierarchy d, const ForceFieldParameters *ffp=get_all_atom_CHARMM_parameters(), FloatKey radius_key=FloatKey("radius"))
void write_pdb(const Selection &mhd, TextOutput out, unsigned int model=1)
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
The topology of a complete CHARMM model.
Functionality for loading, creating, manipulating and scoring atomic structures.
CHARMMParameters * get_all_atom_CHARMM_parameters()