00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPHELPER_SIMPLIFY_RESTRAINT_H
00009 #define IMPHELPER_SIMPLIFY_RESTRAINT_H
00010
00011 #include "helper_config.h"
00012 #include <IMP/SingletonContainer.h>
00013 #include <IMP/atom.h>
00014 #include <IMP/core.h>
00015 #include <IMP/misc.h>
00016 #include <IMP/em/FitRestraint.h>
00017 #include <IMP/em/DensityMap.h>
00018 #include <IMP/core/rigid_bodies.h>
00019
00020 IMPHELPER_BEGIN_NAMESPACE
00021
00022 class SimpleConnectivity;
00023 class SimpleDistance;
00024 class SimpleDiameter;
00025 class SimpleExcludedVolume;
00026 class SimpleEMFit;
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 IMPHELPEREXPORT SimpleConnectivity create_simple_connectivity_on_rigid_bodies(
00039 const core::RigidBodies &rbs,
00040 Refiner *ref=IMP::core::internal::get_rigid_members_refiner());
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 IMPHELPEREXPORT SimpleConnectivity create_simple_connectivity_on_molecules(
00053 const atom::Hierarchies &mhs);
00054
00055
00056
00057
00058
00059
00060
00061 IMPHELPEREXPORT SimpleDistance create_simple_distance(Particles *ps);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 IMPHELPEREXPORT SimpleDiameter create_simple_diameter(
00073 Particles *ps, Float diameter);
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 IMPHELPEREXPORT SimpleExcludedVolume
00090 create_simple_excluded_volume_on_rigid_bodies(
00091 const core::RigidBodies &rbs,
00092 Refiner *ref= IMP::core::internal::get_rigid_members_refiner());
00093
00094
00095
00096
00097
00098
00099
00100 IMPHELPEREXPORT SimpleExcludedVolume
00101 create_simple_excluded_volume_on_molecules(
00102 const atom::Hierarchies &mhs);
00103
00104
00105
00106
00107
00108
00109
00110
00111 IMPHELPEREXPORT SimpleEMFit create_simple_em_fit(
00112 atom::Hierarchies const &mhs, em::DensityMap *dmap);
00113
00114
00115
00116 IMPHELPEREXPORT em::DensityMap *load_em_density_map(
00117 char const *map_fn, float spacing, float resolution);
00118
00119 IMPHELPEREXPORT core::RigidBodies set_rigid_bodies(
00120 atom::Hierarchies const &mhs);
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 class IMPHELPEREXPORT SimpleConnectivity
00131 {
00132 IMP_NO_SWIG(
00133 friend IMPHELPEREXPORT SimpleConnectivity
00134 create_simple_connectivity_on_rigid_bodies(
00135 const core::RigidBodies &rbs, Refiner *ref);
00136 friend IMPHELPEREXPORT SimpleConnectivity
00137 create_simple_connectivity_on_molecules(
00138 atom::Hierarchies const &mhs);
00139 )
00140 public:
00141 core::ConnectivityRestraint *get_restraint()
00142 {
00143 return connectivity_restraint_;
00144 }
00145
00146 core::HarmonicUpperBound *get_harmonic_upper_bound()
00147 {
00148 return harmonic_upper_bound_;
00149 }
00150
00151 core::SphereDistancePairScore *get_sphere_distance_pair_score()
00152 {
00153 return sphere_distance_pair_score_;
00154 }
00155
00156
00157
00158
00159 void set_mean(Float mean)
00160 {
00161 harmonic_upper_bound_->set_mean(mean);
00162 }
00163
00164
00165 void set_stddev(Float sd)
00166 {
00167 static Float k = harmonic_upper_bound_->k_from_standard_deviation(sd);
00168 harmonic_upper_bound_->set_k(k);
00169 }
00170
00171
00172
00173
00174 void set_k(Float k)
00175 {
00176 harmonic_upper_bound_->set_k(k);
00177 }
00178
00179 VersionInfo get_version_info() const
00180 {
00181 return IMP::get_module_version_info();
00182 }
00183
00184 void show(std::ostream &out = std::cout) const
00185 {
00186 out << "SimpleConnectivity(";
00187 if ( connectivity_restraint_ )
00188 connectivity_restraint_->show(out);
00189 out << ")";
00190 }
00191
00192 private:
00193
00194 SimpleConnectivity(
00195 core::ConnectivityRestraint *connectivity_restraint,
00196 core::HarmonicUpperBound *harmonic_upper_bound,
00197 core::SphereDistancePairScore *sphere_distance_pair_score)
00198 : connectivity_restraint_(connectivity_restraint)
00199 , harmonic_upper_bound_(harmonic_upper_bound)
00200 , sphere_distance_pair_score_(sphere_distance_pair_score)
00201 {}
00202
00203 IMP::Pointer<core::ConnectivityRestraint> connectivity_restraint_;
00204 IMP::Pointer<core::HarmonicUpperBound> harmonic_upper_bound_;
00205 IMP::Pointer<core::SphereDistancePairScore> sphere_distance_pair_score_;
00206 };
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 class IMPHELPEREXPORT SimpleDistance
00218 {
00219 IMP_NO_SWIG(friend IMPHELPEREXPORT SimpleDistance
00220 create_simple_distance(Particles *ps));
00221 public:
00222 core::DistanceRestraint *get_restraint()
00223 {
00224 return distance_restraint_;
00225 }
00226
00227 core::HarmonicUpperBound *get_harmonic_upper_bound()
00228 {
00229 return harmonic_upper_bound_;
00230 }
00231
00232
00233
00234
00235 void set_mean(Float mean)
00236 {
00237 harmonic_upper_bound_->set_mean(mean);
00238 }
00239
00240
00241 void set_stddev(Float sd)
00242 {
00243 static Float k = harmonic_upper_bound_->k_from_standard_deviation(sd);
00244 harmonic_upper_bound_->set_k(k);
00245 }
00246
00247
00248
00249
00250 void set_k(Float k)
00251 {
00252 harmonic_upper_bound_->set_k(k);
00253 }
00254
00255 VersionInfo get_version_info() const
00256 {
00257 return IMP::get_module_version_info();
00258 }
00259
00260 void show(std::ostream &out = std::cout) const
00261 {
00262 out << "SimpleDistance(";
00263 if ( distance_restraint_ )
00264 distance_restraint_->show(out);
00265 out << ")";
00266 }
00267
00268 private:
00269
00270 SimpleDistance(
00271 core::DistanceRestraint *distance_restraint,
00272 core::HarmonicUpperBound *harmonic_upper_bound)
00273 : distance_restraint_(distance_restraint)
00274 , harmonic_upper_bound_(harmonic_upper_bound)
00275 {}
00276
00277 IMP::Pointer<core::DistanceRestraint> distance_restraint_;
00278 IMP::Pointer<core::HarmonicUpperBound> harmonic_upper_bound_;
00279 };
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 class IMPHELPEREXPORT SimpleDiameter
00290 {
00291 IMP_NO_SWIG(friend IMPHELPEREXPORT SimpleDiameter
00292 create_simple_diameter(Particles *ps,
00293 Float diameter));
00294 public:
00295
00296 core::DiameterRestraint *get_restraint()
00297 {
00298 return diameter_restraint_;
00299 }
00300
00301 core::HarmonicUpperBound *get_harmonic_upper_bound()
00302 {
00303 return harmonic_upper_bound_;
00304 }
00305
00306
00307
00308
00309 void set_mean(Float mean)
00310 {
00311 harmonic_upper_bound_->set_mean(mean);
00312 }
00313
00314
00315 void set_stddev(Float sd)
00316 {
00317 static Float k = harmonic_upper_bound_->k_from_standard_deviation(sd);
00318 harmonic_upper_bound_->set_k(k);
00319 }
00320
00321
00322
00323
00324 void set_k(Float k)
00325 {
00326 harmonic_upper_bound_->set_k(k);
00327 }
00328
00329 VersionInfo get_version_info() const
00330 {
00331 return IMP::get_module_version_info();
00332 }
00333
00334 void show(std::ostream &out = std::cout) const
00335 {
00336 out << "SimpleDiameter(";
00337 if ( diameter_restraint_ )
00338 diameter_restraint_->show(out);
00339 out << ")";
00340 }
00341
00342 private:
00343
00344 SimpleDiameter(
00345 core::DiameterRestraint *diameter_restraint,
00346 core::HarmonicUpperBound *harmonic_upper_bound)
00347 : diameter_restraint_(diameter_restraint)
00348 , harmonic_upper_bound_(harmonic_upper_bound)
00349 {}
00350
00351 IMP::Pointer<core::DiameterRestraint> diameter_restraint_;
00352 IMP::Pointer<core::HarmonicUpperBound> harmonic_upper_bound_;
00353 };
00354
00355
00356
00357
00358
00359 class IMPHELPEREXPORT SimpleExcludedVolume
00360 {
00361 IMP_NO_SWIG(friend IMPHELPEREXPORT SimpleExcludedVolume
00362 create_simple_excluded_volume_on_rigid_bodies(
00363 const core::RigidBodies &rbs, Refiner*ref);
00364 );
00365 IMP_NO_SWIG(friend IMPHELPEREXPORT SimpleExcludedVolume
00366 create_simple_excluded_volume_on_molecules(
00367 atom::Hierarchies const &mhs);
00368 );
00369 public:
00370
00371 core::ExcludedVolumeRestraint *get_restraint()
00372 {
00373 return excluded_volume_restraint_;
00374 }
00375
00376 VersionInfo get_version_info() const
00377 {
00378 return IMP::get_module_version_info();
00379 }
00380
00381 void show(std::ostream &out = std::cout) const
00382 {
00383 out << "SimpleExcludedVolume(";
00384 if ( excluded_volume_restraint_ )
00385 excluded_volume_restraint_->show(out);
00386 out << ")";
00387 }
00388
00389 private:
00390
00391 SimpleExcludedVolume(
00392 core::ExcludedVolumeRestraint *excluded_volume_restraint)
00393 : excluded_volume_restraint_(excluded_volume_restraint)
00394 {}
00395
00396 IMP::Pointer<core::ExcludedVolumeRestraint> excluded_volume_restraint_;
00397 };
00398
00399
00400
00401
00402
00403
00404 class IMPHELPEREXPORT SimpleEMFit
00405 {
00406 IMP_NO_SWIG(friend IMPHELPEREXPORT SimpleEMFit create_simple_em_fit(
00407 atom::Hierarchies const &mhs, em::DensityMap *dmap));
00408 public:
00409 em::FitRestraint *get_restraint()
00410 {
00411 return fit_restraint_;
00412 }
00413
00414 VersionInfo get_version_info() const
00415 {
00416 return IMP::get_module_version_info();
00417 }
00418
00419 void show(std::ostream &out = std::cout) const
00420 {
00421 out << "SimpleEMFit(";
00422 if ( fit_restraint_ )
00423 fit_restraint_->show(out);
00424 out << ")";
00425 }
00426
00427 private:
00428
00429 SimpleEMFit(
00430 em::FitRestraint *fit_restraint)
00431 : fit_restraint_(fit_restraint)
00432 {}
00433
00434 IMP::Pointer<em::FitRestraint> fit_restraint_;
00435 };
00436
00437 IMPHELPER_END_NAMESPACE
00438
00439 #endif