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>
19 IMPMULTIFIT_BEGIN_NAMESPACE
23 : max_value_threshold_(10.),
24 max_anchor_penetration_(0.1),
27 void add(
const boost::property_tree::ptree& pt) {
28 max_value_threshold_ = pt.get<
float>(
"domino.max_value_threshold");
29 max_num_states_for_subset_ =
30 pt.get<
int>(
"domino.max_num_states_for_subset");
31 max_anchor_penetration_ = pt.get<
float>(
"domino.max_anchor_penetration");
32 heap_size_ = pt.get<
int>(
"domino.heap_size");
33 cache_size_ = pt.get<
int>(
"domino.cache_size");
35 void show(std::ostream& s = std::cout)
const {
36 s <<
"domino parameters: max_val_thr=" << max_value_threshold_
37 <<
" max_num_states4subset=" << max_num_states_for_subset_
38 <<
" max_anchor_penetration=" << max_anchor_penetration_
39 <<
" heap_size=" << heap_size_ <<
"cache_size=" << cache_size_
42 float max_value_threshold_;
43 int max_num_states_for_subset_;
44 float max_anchor_penetration_;
55 treat_between_residues_(true) {}
56 void add(
const boost::property_tree::ptree& pt) {
57 upper_bound_ = pt.get<
float>(
"xlink.upper_bound");
58 k_ = pt.get<
float>(
"xlink.k");
59 max_xlink_val_ = pt.get<
float>(
"xlink.max_value");
60 treat_between_residues_ = pt.get<
bool>(
"xlink.between_residues");
63 void show(std::ostream& s = std::cout)
const {
64 s <<
"xlink parameters: upper_bound:" << upper_bound_ <<
" k:" << k_
65 <<
"max_xlink_val_=" << max_xlink_val_
66 <<
" treat_between_residues_=" << treat_between_residues_ << std::endl;
68 float upper_bound_, k_;
70 bool treat_between_residues_;
74 struct ConnectivityParams {
78 max_conn_rest_val_(2.) {}
79 void add(
const boost::property_tree::ptree& pt) {
80 upper_bound_ = pt.get<
float>(
"connectivity.upper_bound");
81 k_ = pt.get<
float>(
"connectivity.k");
82 max_conn_rest_val_ = pt.get<
float>(
"connectivity.max_value");
84 void show(std::ostream& s = std::cout)
const {
85 s <<
"connectivity parameters: upper_bound=" << upper_bound_ <<
" k=" << k_
86 <<
" max_conn_val=" << max_conn_rest_val_;
93 float max_conn_rest_val_;
97 struct FragmentsParams {
100 bead_radius_scale_(1.),
102 subunit_rigid_(false) {}
103 void add(
const boost::property_tree::ptree& pt) {
104 frag_len_ = pt.get<
int>(
"fragments.length");
105 bead_radius_scale_ = pt.get<
float>(
"fragments.radius_scale");
106 load_atomic_ = pt.get<
bool>(
"fragments.atomic");
107 subunit_rigid_ = pt.get<
bool>(
"fragments.rigid");
109 void show(std::ostream& s = std::cout)
const {
110 s <<
"fragment parameters: frag_len=" << frag_len_
111 <<
" bead_rad_scale=" << bead_radius_scale_
112 <<
" load_atomic=" << load_atomic_ <<
" rigid=" << subunit_rigid_;
117 float bead_radius_scale_;
127 RogParams() : max_score_(5), scale_(1.6) {}
128 void add(
const boost::property_tree::ptree& pt) {
129 scale_ = pt.get<
float>(
"radius_of_gyration.scale");
130 max_score_ = pt.get<
float>(
"radius_of_gyration.max_score");
132 float get_max_score()
const {
return max_score_; }
133 float get_scale()
const {
return scale_; }
134 void show(std::ostream& s = std::cout)
const {
135 s <<
"rog params: scale=" << scale_ <<
" max_score:" << max_score_
141 float max_score_, scale_;
148 : pair_distance_(3.),
152 maximum_ev_score_for_pair_(0.3),
153 allowed_percentage_of_bad_pairs_(0.05),
155 void add(
const boost::property_tree::ptree& pt) {
156 pair_distance_ = pt.get<
float>(
"excluded_volume.distance");
157 pair_slack_ = pt.get<
float>(
"excluded_volume.slack");
158 hlb_mean_ = pt.get<
float>(
"excluded_volume.lower_bound");
159 hlb_k_ = pt.get<
float>(
"excluded_volume.k");
160 maximum_ev_score_for_pair_ =
161 pt.get<
float>(
"excluded_volume.max_score_for_pair");
162 allowed_percentage_of_bad_pairs_ =
163 pt.get<
float>(
"excluded_volume.allowed_percentage_of_bad_pairs");
164 scoring_mode_ = pt.get<
int>(
"excluded_volume.scoring_mode");
166 if (scoring_mode_ < 0 || scoring_mode_ > 2) {
167 throw boost::property_tree::ptree_bad_data(
168 "excluded_volume.scoring_mode should be 0, 1, or 2", scoring_mode_);
171 void show(std::ostream& s = std::cout)
const {
172 s <<
"EV params: pair_distance=" << pair_distance_
173 <<
" pair_slack=" << pair_slack_ <<
" mean=" << hlb_mean_
175 <<
" maximum_ev_score_for_pair:" << maximum_ev_score_for_pair_
176 <<
" allowed_percentage_of_bad_pairs:" << allowed_percentage_of_bad_pairs_
177 <<
" scoring_mode:" << scoring_mode_ << std::endl;
179 float pair_distance_, pair_slack_, hlb_mean_, hlb_k_,
180 maximum_ev_score_for_pair_;
181 float allowed_percentage_of_bad_pairs_;
188 struct FiltersParams {
191 : max_num_violated_xlink_(4),
192 max_num_violated_conn_(4),
193 max_num_violated_ev_(3) {}
194 void add(
const boost::property_tree::ptree& pt) {
195 max_num_violated_conn_ = pt.get<
int>(
"filters.conn_max_violations");
196 max_num_violated_xlink_ = pt.get<
int>(
"filters.xlink_max_violations");
197 max_num_violated_ev_ = pt.get<
int>(
"filters.ev_max_violations");
199 void show(std::ostream& s = std::cout)
const {
200 s <<
"filters params: max_num_violated_xlink=" << max_num_violated_xlink_
201 <<
" max_num_violated_conn:" << max_num_violated_conn_
202 <<
"max num_violated_ev:" << max_num_violated_ev_ << std::endl;
206 int max_num_violated_xlink_, max_num_violated_conn_;
207 int max_num_violated_ev_;
211 struct FittingParams {
214 : pca_max_angle_diff_(15.),
215 pca_max_size_diff_(10.),
216 pca_max_cent_dist_diff_(10.),
217 max_asmb_fit_score_(.5) {}
218 void add(
const boost::property_tree::ptree& pt) {
219 pca_max_angle_diff_ = pt.get<
float>(
"fitting.pca_max_angle_diff");
220 pca_max_size_diff_ = pt.get<
float>(
"fitting.pca_max_size_diff");
221 pca_max_cent_dist_diff_ = pt.get<
float>(
"fitting.pca_max_cent_dist_diff");
222 max_asmb_fit_score_ = pt.get<
float>(
"fitting.max_asmb_fit_score");
224 void show(std::ostream& s = std::cout)
const {
225 s <<
"filters params: pca_max_angle_diff=" << pca_max_angle_diff_
226 <<
" pca_max_size_diff:" << pca_max_size_diff_
227 <<
"pca_max_cent_dist_diff:" << pca_max_cent_dist_diff_
228 <<
"max_asmb_fit_score:" << max_asmb_fit_score_ << std::endl;
232 float pca_max_angle_diff_, pca_max_size_diff_;
233 float pca_max_cent_dist_diff_, max_asmb_fit_score_;
237 struct ComplementarityParams {
239 ComplementarityParams()
240 : max_score_(100000),
241 max_penetration_(200),
242 interior_layer_thickness_(2),
245 penetration_coef_(2) {}
246 void add(
const boost::property_tree::ptree& pt) {
247 max_score_ = pt.get<
float>(
"complementarity.max_score");
248 max_penetration_ = pt.get<
float>(
"complementarity.max_penetration");
249 interior_layer_thickness_ =
250 pt.get<
float>(
"complementarity.interior_layer_thickness");
251 boundary_coef_ = pt.get<
float>(
"complementarity.boundary_coef");
252 comp_coef_ = pt.get<
float>(
"complementarity.comp_coef");
253 penetration_coef_ = pt.get<
float>(
"complementarity.penetration_coef");
255 void show(std::ostream& s = std::cout)
const {
256 s <<
"complementarity params: max_score=" << max_score_
257 <<
" max penetration:" << max_penetration_
258 <<
" interior layer thickness:" << interior_layer_thickness_
259 <<
" boundary coefficient:" << boundary_coef_
260 <<
" complementarity coefficient: " << comp_coef_
261 <<
" penetration coefficient: " << penetration_coef_ << std::endl;
265 float max_score_, max_penetration_;
266 float interior_layer_thickness_;
267 float boundary_coef_, comp_coef_, penetration_coef_;
271 class IMPMULTIFITEXPORT AlignmentParams {
273 AlignmentParams(
const char* param_filename);
274 const DominoParams& get_domino_params()
const {
return domino_params_; }
275 const FittingParams& get_fitting_params()
const {
return fitting_params_; }
276 const ComplementarityParams& get_complementarity_params()
const {
277 return complementarity_params_;
279 const XlinkParams& get_xlink_params()
const {
return xlink_params_; }
280 const ConnectivityParams& get_connectivity_params()
const {
283 const RogParams& get_rog_params()
const {
return rog_params_; }
284 const FragmentsParams& get_fragments_params()
const {
285 return fragments_params_;
287 const FiltersParams& get_filters_params()
const {
return filters_params_; }
288 const EVParams& get_ev_params()
const {
return ev_params_; }
289 void show(std::ostream& s = std::cout)
const {
290 s <<
"alignment parameters" << std::endl;
291 fitting_params_.show(s);
293 complementarity_params_.show(s);
295 domino_params_.show(s);
297 fragments_params_.show(s);
301 conn_params_.show(s);
303 xlink_params_.show(s);
305 filters_params_.show(s);
312 DominoParams domino_params_;
313 FittingParams fitting_params_;
314 ComplementarityParams complementarity_params_;
315 XlinkParams xlink_params_;
316 ConnectivityParams conn_params_;
317 FragmentsParams fragments_params_;
318 RogParams rog_params_;
319 FiltersParams filters_params_;
324 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.
Various general useful macros for IMP.