The class maintains a set of structures found by a Sampler protocol and allows them to be queried and loaded and saved. import IMP.example import IMP.statistics (m,c)=IMP.example.create_model_and_particles() ps= IMP.core.DistancePairScore(IMP.core.HarmonicLowerBound(1,1)) r= IMP.container.PairsRestraint(ps, IMP.container.ClosePairContainer(c, 2.0)) m.add_restraint(r) # we don't want to see lots of log messages about restraint evaluation m.set_log_level(IMP.WARNING) # the container (c) stores a list of particles, which are alse XYZR particles # we can construct a list of all the decorated particles xyzrs= IMP.core.XYZRsTemp(c.get_particles()) s= IMP.core.MCCGSampler(m) s.set_number_of_attempts(10) # but we do want something to watch s.set_log_level(IMP.TERSE) # find some configurations which move the particles far apart configs= s.get_sample(); for i in range(0, configs.get_number_of_configurations()): configs.set_configuration(i) # print out the sphere containing the point set # - Why? - Why not? sphere= IMP.core.get_enclosing_sphere(xyzrs) print sphere # cluster the solutions based on their coordinates e= IMP.statistics.ConfigurationSetXYZEmbedding(configs, c) # of course, this doesn't return anything of interest since the points are # randomly distributed, but, again, why not? clustering = IMP.statistics.get_lloyds_kmeans(e, 3, 1000) for i in range(0,clustering.get_number_of_clusters()): # load the configuration for a central point configs.set_configuration(clustering.get_cluster_representative(i)) sphere= IMP.core.get_enclosing_sphere(xyzrs) print sphere
Public Member Functions | |
def | __disown__ |
ConfigurationSet (Model *m, std::string name="ConfigurationSet %1%") | |
unsigned int | get_number_of_configurations () const |
virtual std::string | get_type_name () const |
virtual ::IMP::VersionInfo | get_version_info () const |
void | save_configuration () |
Save the current configuration of the Model. | |
void | set_configuration (int i) |
Load the ith configuration into the Model. | |
Friends | |
template<class T > | |
void | IMP::internal::unref (T *) |
void IMP::ConfigurationSet::set_configuration | ( | int | i | ) |
Load the ith configuration into the Model.
Passing -1 returns it to the base configuration.