1 """@namespace IMP.pmi.sampling_tools
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 create_floppy_bodies(particles,max_step):
17 return [
SampleObjects(
'Floppy_Bodies_SimplifiedModel',[particles,max_step])]
23 include_siblings=
False,
24 exclude_backbone=
False):
25 """Add necessary attributes to the selected residues for MD sampling.
26 @param mdl The IMP model
27 @param hier Hierarchy to sample
28 @param particles Particles to sample
29 @param include_siblings Get the siblings of the passed particles and sample them too
30 @param exclude_backbone Don't sample backbone atoms
35 backbone = [IMP.atom.AT_C,IMP.atom.AT_N, IMP.atom.AT_CA]
40 if hierarchies
is not None:
41 particles+=[h.get_particle()
for h
in hierarchies]
49 if exclude_backbone
and IMP.atom.Atom(mdl,pp.get_index()).get_atom_type()
in backbone:
51 IMP.core.XYZ(mdl,pp.get_index()).set_coordinates_are_optimized(
True)
52 mdl.add_attribute(vxkey,pp.get_index(),0.0)
53 mdl.add_attribute(vykey,pp.get_index(),0.0)
54 mdl.add_attribute(vzkey,pp.get_index(),0.0)
56 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)