IMP  2.2.1
The Integrative Modeling Platform
pdb2density.py
1 ## \example em/pdb2density.py
2 # A simple example showing how to simulate density from a protein.
3 # IMP uses a Gaussian smoothing kernel. see SampledDensityMap::resample for documentation.
4 #
5 
6 import IMP.em
7 import IMP.core
8 import IMP.atom
10 # read protein
12 mh = IMP.atom.read_pdb(IMP.em.get_example_path("input.pdb"), m, sel)
13 # add radius info to each atom, otherwise the resampling would fail.
15 ps = IMP.core.get_leaves(mh)
16 # decide on resolution and spacing you would like to simulate to
17 resolution = 10.
18 apix = 1.5
19 dmap = IMP.em.particles2density(ps, resolution, apix)
20 # write out the map in the favorite format (xplor, mrc, em and spider are
21 # supported)
22 IMP.em.write_map(dmap, "example.mrc", IMP.em.MRCReaderWriter())
SampledDensityMap * particles2density(const kernel::ParticlesTemp &ps, Float resolution, Float apix, int sig_cutoff=3, const FloatKey &weight_key=IMP::atom::Mass::get_mass_key())
Resample a set of particles into a density grid.
void add_radii(Hierarchy d, const ForceFieldParameters *ffp=get_all_atom_CHARMM_parameters(), FloatKey radius_key=FloatKey("radius"))
GenericHierarchies get_leaves(Hierarchy mhd)
Get all the leaves of the bit of hierarchy.
void write_map(DensityMap *m, std::string filename)
See IMP.em for more information.
Definition: CoarseCC.h:23
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
See IMP.core for more information.
Select all non-water non-alternative ATOM and HETATM records.
Definition: pdb.h:219
See IMP.atom for more information.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72