8 #ifndef IMPMULTIFIT_ALIGNMENT_PARAMS_H
9 #define IMPMULTIFIT_ALIGNMENT_PARAMS_H
13 #include <IMP/multifit/multifit_config.h>
15 #include <boost/property_tree/ptree.hpp>
16 #include <cereal/access.hpp>
20 IMPMULTIFIT_BEGIN_NAMESPACE
24 : max_value_threshold_(10.),
25 max_anchor_penetration_(0.1),
28 void add(
const boost::property_tree::ptree& pt) {
29 max_value_threshold_ = pt.get<
float>(
"domino.max_value_threshold");
30 max_num_states_for_subset_ =
31 pt.get<
int>(
"domino.max_num_states_for_subset");
32 max_anchor_penetration_ = pt.get<
float>(
"domino.max_anchor_penetration");
33 heap_size_ = pt.get<
int>(
"domino.heap_size");
34 cache_size_ = pt.get<
int>(
"domino.cache_size");
36 void show(std::ostream& s = std::cout)
const {
37 s <<
"domino parameters: max_val_thr=" << max_value_threshold_
38 <<
" max_num_states4subset=" << max_num_states_for_subset_
39 <<
" max_anchor_penetration=" << max_anchor_penetration_
40 <<
" heap_size=" << heap_size_ <<
"cache_size=" << cache_size_
43 float max_value_threshold_;
44 int max_num_states_for_subset_;
45 float max_anchor_penetration_;
50 friend class cereal::access;
52 template<
class Archive>
void serialize(Archive &ar) {
53 ar(max_value_threshold_, max_num_states_for_subset_,
54 max_anchor_penetration_, heap_size_, cache_size_);
64 treat_between_residues_(true) {}
65 void add(
const boost::property_tree::ptree& pt) {
66 upper_bound_ = pt.get<
float>(
"xlink.upper_bound");
67 k_ = pt.get<
float>(
"xlink.k");
68 max_xlink_val_ = pt.get<
float>(
"xlink.max_value");
69 treat_between_residues_ = pt.get<
bool>(
"xlink.between_residues");
72 void show(std::ostream& s = std::cout)
const {
73 s <<
"xlink parameters: upper_bound:" << upper_bound_ <<
" k:" << k_
74 <<
"max_xlink_val_=" << max_xlink_val_
75 <<
" treat_between_residues_=" << treat_between_residues_ << std::endl;
77 float upper_bound_, k_;
79 bool treat_between_residues_;
82 friend class cereal::access;
84 template<
class Archive>
void serialize(Archive &ar) {
85 ar(upper_bound_, k_, max_xlink_val_, treat_between_residues_);
90 struct ConnectivityParams {
94 max_conn_rest_val_(2.) {}
95 void add(
const boost::property_tree::ptree& pt) {
96 upper_bound_ = pt.get<
float>(
"connectivity.upper_bound");
97 k_ = pt.get<
float>(
"connectivity.k");
98 max_conn_rest_val_ = pt.get<
float>(
"connectivity.max_value");
100 void show(std::ostream& s = std::cout)
const {
101 s <<
"connectivity parameters: upper_bound=" << upper_bound_ <<
" k=" << k_
102 <<
" max_conn_val=" << max_conn_rest_val_;
109 float max_conn_rest_val_;
112 friend class cereal::access;
114 template<
class Archive>
void serialize(Archive &ar) {
115 ar(upper_bound_, k_, max_conn_rest_val_);
120 struct FragmentsParams {
123 bead_radius_scale_(1.),
125 subunit_rigid_(false) {}
126 void add(
const boost::property_tree::ptree& pt) {
127 frag_len_ = pt.get<
int>(
"fragments.length");
128 bead_radius_scale_ = pt.get<
float>(
"fragments.radius_scale");
129 load_atomic_ = pt.get<
bool>(
"fragments.atomic");
130 subunit_rigid_ = pt.get<
bool>(
"fragments.rigid");
132 void show(std::ostream& s = std::cout)
const {
133 s <<
"fragment parameters: frag_len=" << frag_len_
134 <<
" bead_rad_scale=" << bead_radius_scale_
135 <<
" load_atomic=" << load_atomic_ <<
" rigid=" << subunit_rigid_;
140 float bead_radius_scale_;
146 friend class cereal::access;
148 template<
class Archive>
void serialize(Archive &ar) {
149 ar(frag_len_, bead_radius_scale_, load_atomic_, subunit_rigid_);
156 RogParams() : max_score_(5), scale_(1.6) {}
157 void add(
const boost::property_tree::ptree& pt) {
158 scale_ = pt.get<
float>(
"radius_of_gyration.scale");
159 max_score_ = pt.get<
float>(
"radius_of_gyration.max_score");
161 float get_max_score()
const {
return max_score_; }
162 float get_scale()
const {
return scale_; }
163 void show(std::ostream& s = std::cout)
const {
164 s <<
"rog params: scale=" << scale_ <<
" max_score:" << max_score_
170 float max_score_, scale_;
171 friend class cereal::access;
173 template<
class Archive>
void serialize(Archive &ar) {
174 ar(max_score_, scale_);
182 : pair_distance_(3.),
186 maximum_ev_score_for_pair_(0.3),
187 allowed_percentage_of_bad_pairs_(0.05),
189 void add(
const boost::property_tree::ptree& pt) {
190 pair_distance_ = pt.get<
float>(
"excluded_volume.distance");
191 pair_slack_ = pt.get<
float>(
"excluded_volume.slack");
192 hlb_mean_ = pt.get<
float>(
"excluded_volume.lower_bound");
193 hlb_k_ = pt.get<
float>(
"excluded_volume.k");
194 maximum_ev_score_for_pair_ =
195 pt.get<
float>(
"excluded_volume.max_score_for_pair");
196 allowed_percentage_of_bad_pairs_ =
197 pt.get<
float>(
"excluded_volume.allowed_percentage_of_bad_pairs");
198 scoring_mode_ = pt.get<
int>(
"excluded_volume.scoring_mode");
200 if (scoring_mode_ < 0 || scoring_mode_ > 2) {
201 throw boost::property_tree::ptree_bad_data(
202 "excluded_volume.scoring_mode should be 0, 1, or 2", scoring_mode_);
205 void show(std::ostream& s = std::cout)
const {
206 s <<
"EV params: pair_distance=" << pair_distance_
207 <<
" pair_slack=" << pair_slack_ <<
" mean=" << hlb_mean_
209 <<
" maximum_ev_score_for_pair:" << maximum_ev_score_for_pair_
210 <<
" allowed_percentage_of_bad_pairs:" << allowed_percentage_of_bad_pairs_
211 <<
" scoring_mode:" << scoring_mode_ << std::endl;
213 float pair_distance_, pair_slack_, hlb_mean_, hlb_k_,
214 maximum_ev_score_for_pair_;
215 float allowed_percentage_of_bad_pairs_;
220 friend class cereal::access;
222 template<
class Archive>
void serialize(Archive &ar) {
223 ar(pair_distance_, pair_slack_, hlb_mean_, hlb_k_,
224 maximum_ev_score_for_pair_, allowed_percentage_of_bad_pairs_,
230 struct FiltersParams {
233 : max_num_violated_xlink_(4),
234 max_num_violated_conn_(4),
235 max_num_violated_ev_(3) {}
236 void add(
const boost::property_tree::ptree& pt) {
237 max_num_violated_conn_ = pt.get<
int>(
"filters.conn_max_violations");
238 max_num_violated_xlink_ = pt.get<
int>(
"filters.xlink_max_violations");
239 max_num_violated_ev_ = pt.get<
int>(
"filters.ev_max_violations");
241 void show(std::ostream& s = std::cout)
const {
242 s <<
"filters params: max_num_violated_xlink=" << max_num_violated_xlink_
243 <<
" max_num_violated_conn:" << max_num_violated_conn_
244 <<
"max num_violated_ev:" << max_num_violated_ev_ << std::endl;
248 int max_num_violated_xlink_, max_num_violated_conn_;
249 int max_num_violated_ev_;
251 friend class cereal::access;
253 template<
class Archive>
void serialize(Archive &ar) {
254 ar(max_num_violated_xlink_, max_num_violated_conn_,
255 max_num_violated_ev_);
260 struct FittingParams {
263 : pca_max_angle_diff_(15.),
264 pca_max_size_diff_(10.),
265 pca_max_cent_dist_diff_(10.),
266 max_asmb_fit_score_(.5) {}
267 void add(
const boost::property_tree::ptree& pt) {
268 pca_max_angle_diff_ = pt.get<
float>(
"fitting.pca_max_angle_diff");
269 pca_max_size_diff_ = pt.get<
float>(
"fitting.pca_max_size_diff");
270 pca_max_cent_dist_diff_ = pt.get<
float>(
"fitting.pca_max_cent_dist_diff");
271 max_asmb_fit_score_ = pt.get<
float>(
"fitting.max_asmb_fit_score");
273 void show(std::ostream& s = std::cout)
const {
274 s <<
"filters params: pca_max_angle_diff=" << pca_max_angle_diff_
275 <<
" pca_max_size_diff:" << pca_max_size_diff_
276 <<
"pca_max_cent_dist_diff:" << pca_max_cent_dist_diff_
277 <<
"max_asmb_fit_score:" << max_asmb_fit_score_ << std::endl;
281 float pca_max_angle_diff_, pca_max_size_diff_;
282 float pca_max_cent_dist_diff_, max_asmb_fit_score_;
284 friend class cereal::access;
286 template<
class Archive>
void serialize(Archive &ar) {
287 ar(pca_max_angle_diff_, pca_max_size_diff_, pca_max_cent_dist_diff_,
288 max_asmb_fit_score_);
293 struct ComplementarityParams {
295 ComplementarityParams()
296 : max_score_(100000),
297 max_penetration_(200),
298 interior_layer_thickness_(2),
301 penetration_coef_(2) {}
302 void add(
const boost::property_tree::ptree& pt) {
303 max_score_ = pt.get<
float>(
"complementarity.max_score");
304 max_penetration_ = pt.get<
float>(
"complementarity.max_penetration");
305 interior_layer_thickness_ =
306 pt.get<
float>(
"complementarity.interior_layer_thickness");
307 boundary_coef_ = pt.get<
float>(
"complementarity.boundary_coef");
308 comp_coef_ = pt.get<
float>(
"complementarity.comp_coef");
309 penetration_coef_ = pt.get<
float>(
"complementarity.penetration_coef");
311 void show(std::ostream& s = std::cout)
const {
312 s <<
"complementarity params: max_score=" << max_score_
313 <<
" max penetration:" << max_penetration_
314 <<
" interior layer thickness:" << interior_layer_thickness_
315 <<
" boundary coefficient:" << boundary_coef_
316 <<
" complementarity coefficient: " << comp_coef_
317 <<
" penetration coefficient: " << penetration_coef_ << std::endl;
321 float max_score_, max_penetration_;
322 float interior_layer_thickness_;
323 float boundary_coef_, comp_coef_, penetration_coef_;
325 friend class cereal::access;
327 template<
class Archive>
void serialize(Archive &ar) {
328 ar(max_score_, max_penetration_, interior_layer_thickness_,
329 boundary_coef_, comp_coef_, penetration_coef_);
334 class IMPMULTIFITEXPORT AlignmentParams {
338 AlignmentParams(
const char* param_filename);
339 const DominoParams& get_domino_params()
const {
return domino_params_; }
340 const FittingParams& get_fitting_params()
const {
return fitting_params_; }
341 const ComplementarityParams& get_complementarity_params()
const {
342 return complementarity_params_;
344 const XlinkParams& get_xlink_params()
const {
return xlink_params_; }
345 const ConnectivityParams& get_connectivity_params()
const {
348 const RogParams& get_rog_params()
const {
return rog_params_; }
349 const FragmentsParams& get_fragments_params()
const {
350 return fragments_params_;
352 const FiltersParams& get_filters_params()
const {
return filters_params_; }
353 const EVParams& get_ev_params()
const {
return ev_params_; }
354 void show(std::ostream& s = std::cout)
const {
355 s <<
"alignment parameters" << std::endl;
356 fitting_params_.show(s);
358 complementarity_params_.show(s);
360 domino_params_.show(s);
362 fragments_params_.show(s);
366 conn_params_.show(s);
368 xlink_params_.show(s);
370 filters_params_.show(s);
377 DominoParams domino_params_;
378 FittingParams fitting_params_;
379 ComplementarityParams complementarity_params_;
380 XlinkParams xlink_params_;
381 ConnectivityParams conn_params_;
382 FragmentsParams fragments_params_;
383 RogParams rog_params_;
384 FiltersParams filters_params_;
387 friend class cereal::access;
389 template<
class Archive>
void serialize(Archive &ar) {
390 ar(domino_params_, fitting_params_, complementarity_params_,
391 xlink_params_, conn_params_, fragments_params_, rog_params_,
392 filters_params_, ev_params_);
397 IMPMULTIFIT_END_NAMESPACE
A more IMP-like version of the std::vector.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.
Macros to help in implementing Value objects.