This script shows how to create DENSITY representations and set up the Gaussian EM restraint.
These representations are useful when you are doing EM fitting with rigid bodies.
Preliminary step: you should convert your EM map to a GMM file with the command line utility create_gmm.py (located in isd/pyext/src/create_gmm.py):
"""This script shows how to create DENSITY representations
and set up the Gaussian EM restraint.
These representations are useful when you are doing EM fitting with
rigid bodies.
Preliminary step: you should convert your EM map to a GMM file
with the command line utility create_gmm.py
(located in isd/pyext/src/create_gmm.py):
~~~
python create_gmm.py emd_1883.mrc 50 emd_1883.gmm50.txt -m emd_1883.gmm50.mrc
~~~
"""
import IMP
import sys
try:
import sklearn
except ImportError:
print("To run this example, please first install the 'sklearn'")
print("Python module.")
sys.exit(0)
st = s.create_state()
mol = st.create_molecule("Rpn4", sequence=seqs["1WCM:D"], chain_id="D")
atomic_res = mol.add_structure(
mol.add_representation(
atomic_res,
resolutions=[1, 10],
density_residues_per_component=10,
density_prefix="Rpn4_gmm",
density_force_compute=False,
density_voxel_size=3.0)
mol.add_representation(mol.get_non_atomic_residues(),
resolutions=[10],
setup_particles_as_densities=True)
hier = s.build()
output_objects = []
hier, representation_type=IMP.atom.DENSITIES).get_selected_particles()
densities,
slope=0.01,
scale_target_to_mass=False,
target_mass_scale=100000,
weight=100.0)
emr.add_to_model()
output_objects.append(emr)
mdl.update()
print(emr.evaluate())
Class for storing model, its restraints, constraints, and particles.
Select hierarchy particles identified by the biological name.
Fit Gaussian-decorated particles to an EM map (also represented with a set of Gaussians).
A dictionary-like wrapper for reading and storing sequence data.
Represent the root node of the global IMP.atom.Hierarchy.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
Functionality for loading, creating, manipulating and scoring atomic structures.
void show_with_representations(Hierarchy h, std::ostream &out=std::cout)
Traverse through the tree and show atom info, including representations.
Create movers and set up constraints for PMI objects.
Protocols for sampling structures and analyzing them.
Restraints for handling electron microscopy maps.
Set of Python classes to create a multi-state, multi-resolution IMP hierarchy.
Python classes to represent, score, sample and analyze models.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Support for the RMF file format for storing hierarchical molecular data and markup.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.