2 """useful tools for setting up sampling"""
8 """ hack class to provide things to sample for PMI::samplers """
9 def __init__(self,dict_name,pack_in_dict):
10 self.d={dict_name:pack_in_dict}
11 def get_particles_to_sample(self):
14 def enable_md_sampling(mdl,
17 include_siblings=
False,
18 exclude_backbone=
False):
19 """ Adds necessary attributes to the selected residues for MD sampling
20 @param model The IMP model
21 @param hier Hierarchy to sample
22 @param particles Particles to sample
23 @param selection Single or multiple selections for enabling sampling
24 @param include_siblings Get the siblings of the passed particles and sample them too
25 @param exclude_backbone Don't sample backbone atoms
30 backbone = [IMP.atom.AT_C,IMP.atom.AT_N, IMP.atom.AT_CA]
42 if exclude_backbone
and IMP.atom.Atom(mdl,pp.get_particle_index()).get_atom_type()
in backbone:
44 IMP.core.XYZ(mdl,pp.get_particle_index()).set_coordinates_are_optimized(
True)
45 mdl.add_attribute(vxkey,pp.get_particle_index(),0.0)
46 mdl.add_attribute(vykey,pp.get_particle_index(),0.0)
47 mdl.add_attribute(vzkey,pp.get_particle_index(),0.0)
49 return [
SampleObjects(
'Floppy_Bodies_SimplifiedModel',[all_ps])]
The standard decorator for manipulating molecular structures.
A decorator for a particle representing an atom.
A decorator for a particle with x,y,z coordinates.
Functionality for loading, creating, manipulating and scoring atomic structures.
Hierarchies get_leaves(const Selection &h)