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
22 DominoParams() : max_value_threshold_(10.),
23 max_anchor_penetration_(0.1),
24 heap_size_(10000),cache_size_(50000){}
25 void add(
const boost::property_tree::ptree &pt) {
26 max_value_threshold_ = pt.get<
float>(
"domino.max_value_threshold");
27 max_num_states_for_subset_ =
28 pt.get<
int>(
"domino.max_num_states_for_subset");
29 max_anchor_penetration_ = pt.get<
float>(
"domino.max_anchor_penetration");
30 heap_size_ = pt.get<
int>(
"domino.heap_size");
31 cache_size_ = pt.get<
int>(
"domino.cache_size");
33 void show(std::ostream& s=std::cout)
const{
34 s<<
"domino parameters: max_val_thr="<<max_value_threshold_
35 <<
" max_num_states4subset="<<max_num_states_for_subset_
36 <<
" max_anchor_penetration="<<max_anchor_penetration_
37 <<
" heap_size="<<heap_size_
38 <<
"cache_size="<<cache_size_<<std::endl;
40 float max_value_threshold_;
41 int max_num_states_for_subset_;
42 float max_anchor_penetration_;
49 XlinkParams() : upper_bound_(10.),
52 treat_between_residues_(true)
54 void add(
const boost::property_tree::ptree &pt) {
55 upper_bound_ = pt.get<
float>(
"xlink.upper_bound");
56 k_ = pt.get<
float>(
"xlink.k");
57 max_xlink_val_ = pt.get<
float>(
"xlink.max_value");
58 treat_between_residues_ = pt.get<
bool>(
"xlink.between_residues");
61 void show(std::ostream& s=std::cout)
const{
62 s<<
"xlink parameters: upper_bound:"<<upper_bound_<<
" k:"<<k_<<
63 "max_xlink_val_="<<max_xlink_val_
64 <<
" treat_between_residues_="<<treat_between_residues_
67 float upper_bound_,k_;
69 bool treat_between_residues_;
73 struct ConnectivityParams {
74 ConnectivityParams() : upper_bound_(10.),
76 max_conn_rest_val_(2.){}
77 void add(
const boost::property_tree::ptree &pt) {
78 upper_bound_ = pt.get<
float>(
"connectivity.upper_bound");
79 k_ = pt.get<
float>(
"connectivity.k");
80 max_conn_rest_val_ = pt.get<
float>(
"connectivity.max_value");
82 void show(std::ostream& s=std::cout)
const{
83 s<<
"connectivity parameters: upper_bound="<<upper_bound_
85 <<
" max_conn_val="<<max_conn_rest_val_;
92 float max_conn_rest_val_;
97 struct FragmentsParams {
98 FragmentsParams() : frag_len_(30),bead_radius_scale_(1.),
99 load_atomic_(false),subunit_rigid_(false){}
100 void add(
const boost::property_tree::ptree &pt) {
101 frag_len_ = pt.get<
int>(
"fragments.length");
102 bead_radius_scale_ = pt.get<
float>(
"fragments.radius_scale");
103 load_atomic_ = pt.get<
bool>(
"fragments.atomic");
104 subunit_rigid_ = pt.get<
bool>(
"fragments.rigid");
106 void show(std::ostream& s=std::cout)
const{
107 s<<
"fragment parameters: frag_len="<<frag_len_
108 <<
" bead_rad_scale="<<bead_radius_scale_
109 <<
" load_atomic="<<load_atomic_
110 <<
" rigid="<<subunit_rigid_;
115 float bead_radius_scale_;
125 RogParams() : max_score_(5),scale_(1.6){}
126 void add(
const boost::property_tree::ptree &pt) {
127 scale_ = pt.get<
float>(
"radius_of_gyration.scale");
128 max_score_ = pt.get<
float>(
"radius_of_gyration.max_score");
130 float get_max_score()
const{
return max_score_;}
131 float get_scale()
const {
return scale_;}
132 void show(std::ostream& s=std::cout)
const{
133 s<<
"rog params: scale="<<scale_<<
" max_score:"<<max_score_<<std::endl;
137 float max_score_,scale_;
143 EVParams():pair_distance_(3.),
147 maximum_ev_score_for_pair_(0.3),
148 allowed_percentage_of_bad_pairs_(0.05),
150 void add(
const boost::property_tree::ptree &pt) {
151 pair_distance_ = pt.get<
float>(
"excluded_volume.distance");
152 pair_slack_ = pt.get<
float>(
"excluded_volume.slack");
153 hlb_mean_ = pt.get<
float>(
"excluded_volume.lower_bound");
154 hlb_k_ = pt.get<
float>(
"excluded_volume.k");
155 maximum_ev_score_for_pair_
156 = pt.get<
float>(
"excluded_volume.max_score_for_pair");
157 allowed_percentage_of_bad_pairs_
158 = pt.get<
float>(
"excluded_volume.allowed_percentage_of_bad_pairs");
159 scoring_mode_ = pt.get<
int>(
"excluded_volume.scoring_mode");
161 if (scoring_mode_ < 0 || scoring_mode_ > 2) {
162 throw boost::property_tree::ptree_bad_data(
163 "excluded_volume.scoring_mode should be 0, 1, or 2",
167 void show(std::ostream& s=std::cout)
const{
168 s<<
"EV params: pair_distance="<<pair_distance_<<
169 " pair_slack="<<pair_slack_<<
170 " mean="<<hlb_mean_<<
" k="<<hlb_k_<<
171 " maximum_ev_score_for_pair:"<<maximum_ev_score_for_pair_<<
172 " allowed_percentage_of_bad_pairs:"<<allowed_percentage_of_bad_pairs_<<
173 " scoing_mode:"<<scoring_mode_<<std::endl;
175 float pair_distance_,pair_slack_,hlb_mean_,hlb_k_,maximum_ev_score_for_pair_;
176 float allowed_percentage_of_bad_pairs_;
183 struct FiltersParams {
185 FiltersParams() : max_num_violated_xlink_(4),
186 max_num_violated_conn_(4),
187 max_num_violated_ev_(3){}
188 void add(
const boost::property_tree::ptree &pt) {
189 max_num_violated_conn_ = pt.get<
int>(
"filters.conn_max_violations");
190 max_num_violated_xlink_ = pt.get<
int>(
"filters.xlink_max_violations");
191 max_num_violated_ev_ = pt.get<
int>(
"filters.ev_max_violations");
193 void show(std::ostream& s=std::cout)
const{
194 s<<
"filters params: max_num_violated_xlink="<<max_num_violated_xlink_
195 <<
" max_num_violated_conn:"<<max_num_violated_conn_
196 <<
"max num_violated_ev:"<<max_num_violated_ev_<<std::endl;
199 int max_num_violated_xlink_,max_num_violated_conn_;
200 int max_num_violated_ev_;
206 struct FittingParams {
208 FittingParams() : pca_max_angle_diff_(15.),
209 pca_max_size_diff_(10.),
210 pca_max_cent_dist_diff_(10.), max_asmb_fit_score_(.5){}
211 void add(
const boost::property_tree::ptree &pt) {
212 pca_max_angle_diff_ = pt.get<
float>(
"fitting.pca_max_angle_diff");
213 pca_max_size_diff_ = pt.get<
float>(
"fitting.pca_max_size_diff");
214 pca_max_cent_dist_diff_ = pt.get<
float>(
"fitting.pca_max_cent_dist_diff");
215 max_asmb_fit_score_ = pt.get<
float>(
"fitting.max_asmb_fit_score");
217 void show(std::ostream& s=std::cout)
const{
218 s<<
"filters params: pca_max_angle_diff="<<pca_max_angle_diff_
219 <<
" pca_max_size_diff:"<<pca_max_size_diff_
220 <<
"pca_max_cent_dist_diff:"<<pca_max_cent_dist_diff_
221 <<
"max_asmb_fit_score:"<<max_asmb_fit_score_<<std::endl;
224 float pca_max_angle_diff_,pca_max_size_diff_;
225 float pca_max_cent_dist_diff_,max_asmb_fit_score_;
230 struct ComplementarityParams {
232 ComplementarityParams() : max_score_(100000),
233 max_penetration_(200),
234 interior_layer_thickness_(2),
235 boundary_coef_(-3),comp_coef_(1),penetration_coef_(2){}
236 void add(
const boost::property_tree::ptree &pt) {
237 max_score_ = pt.get<
float>(
"complementarity.max_score");
238 max_penetration_ = pt.get<
float>(
"complementarity.max_penetration");
239 interior_layer_thickness_
240 = pt.get<
float>(
"complementarity.interior_layer_thickness");
241 boundary_coef_ = pt.get<
float>(
"complementarity.boundary_coef");
242 comp_coef_ = pt.get<
float>(
"complementarity.comp_coef");
243 penetration_coef_ = pt.get<
float>(
"complementarity.penetration_coef");
245 void show(std::ostream& s=std::cout)
const{
246 s<<
"complementarity params: max_score="<<max_score_
247 <<
" max penetration:"<<max_penetration_
248 <<
" interior layer thickness:"<<interior_layer_thickness_
249 <<
" boundary coeffiecent:"<<boundary_coef_
250 <<
" complementarity coefficient: "<<comp_coef_
251 <<
" penetration coefficient: "<<penetration_coef_<<std::endl;
254 float max_score_,max_penetration_;
255 float interior_layer_thickness_;
256 float boundary_coef_, comp_coef_, penetration_coef_;
260 class IMPMULTIFITEXPORT AlignmentParams {
262 AlignmentParams(
const char* param_filename);
263 const DominoParams& get_domino_params()
const {
return domino_params_;}
264 const FittingParams& get_fitting_params()
const {
return fitting_params_;}
265 const ComplementarityParams& get_complementarity_params()
const {
266 return complementarity_params_;}
267 const XlinkParams& get_xlink_params()
const {
return xlink_params_;}
268 const ConnectivityParams& get_connectivity_params()
const {
271 const RogParams& get_rog_params()
const {
return rog_params_;}
272 const FragmentsParams& get_fragments_params()
const {
273 return fragments_params_;
275 const FiltersParams& get_filters_params()
const {
return filters_params_;}
276 const EVParams& get_ev_params()
const {
return ev_params_;}
277 void show(std::ostream& s=std::cout)
const {
278 s<<
"alignment parameters"<<std::endl;
279 fitting_params_.show(s);s<<std::endl;
280 complementarity_params_.show(s);s<<std::endl;
281 domino_params_.show(s);s<<std::endl;
282 fragments_params_.show(s);s<<std::endl;
283 rog_params_.show(s);s<<std::endl;
284 conn_params_.show(s);s<<std::endl;
285 xlink_params_.show(s);s<<std::endl;
286 filters_params_.show(s);s<<std::endl;
287 ev_params_.show(s);s<<std::endl;
290 DominoParams domino_params_;
291 FittingParams fitting_params_;
292 ComplementarityParams complementarity_params_;
293 XlinkParams xlink_params_;
294 ConnectivityParams conn_params_;
295 FragmentsParams fragments_params_;
296 RogParams rog_params_;
297 FiltersParams filters_params_;
302 IMPMULTIFIT_END_NAMESPACE
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
Various general useful macros for IMP.