22 #include <utility/exit.hh>
23 #include <utility/vector1_bool.hh>
30 #include <utility/vector1.hh>
41 using namespace chemical;
74 if ( initialized_ )
return;
78 name2weight_type_[
"hbw_NONE"] =
hbw_NONE;
79 name2weight_type_[
"hbw_SR_BB"] =
hbw_SR_BB;
80 name2weight_type_[
"hbw_LR_BB"] =
hbw_LR_BB;
83 name2weight_type_[
"hbw_SC"] =
hbw_SC;
90 name2don_chem_type_[
"hbdon_NONE"] =
hbdon_NONE;
91 name2don_chem_type_[
"hbdon_PBA"] =
hbdon_PBA;
92 name2don_chem_type_[
"hbdon_CXA"] =
hbdon_CXA;
93 name2don_chem_type_[
"hbdon_IMD"] =
hbdon_IMD;
94 name2don_chem_type_[
"hbdon_IME"] =
hbdon_IME;
95 name2don_chem_type_[
"hbdon_IND"] =
hbdon_IND;
96 name2don_chem_type_[
"hbdon_AMO"] =
hbdon_AMO;
97 name2don_chem_type_[
"hbdon_GDE"] =
hbdon_GDE;
98 name2don_chem_type_[
"hbdon_GDH"] =
hbdon_GDH;
99 name2don_chem_type_[
"hbdon_AHX"] =
hbdon_AHX;
100 name2don_chem_type_[
"hbdon_HXL"] =
hbdon_HXL;
101 name2don_chem_type_[
"hbdon_H2O"] =
hbdon_H2O;
105 name2acc_chem_type_[
"hbacc_NONE"] =
hbacc_NONE;
106 name2acc_chem_type_[
"hbacc_PBA"] =
hbacc_PBA;
107 name2acc_chem_type_[
"hbacc_CXA"] =
hbacc_CXA;
108 name2acc_chem_type_[
"hbacc_CXL"] =
hbacc_CXL;
109 name2acc_chem_type_[
"hbacc_IMD"] =
hbacc_IMD;
110 name2acc_chem_type_[
"hbacc_IME"] =
hbacc_IME;
111 name2acc_chem_type_[
"hbacc_AHX"] =
hbacc_AHX;
112 name2acc_chem_type_[
"hbacc_HXL"] =
hbacc_HXL;
119 name2acc_chem_type_[
"hbacc_H2O"] =
hbacc_H2O;
128 name2seq_sep_type_[
"seq_sep_M4"] =
seq_sep_M4;
129 name2seq_sep_type_[
"seq_sep_M3"] =
seq_sep_M3;
130 name2seq_sep_type_[
"seq_sep_M2"] =
seq_sep_M2;
132 name2seq_sep_type_[
"seq_sep_P2"] =
seq_sep_P2;
133 name2seq_sep_type_[
"seq_sep_P3"] =
seq_sep_P3;
134 name2seq_sep_type_[
"seq_sep_P4"] =
seq_sep_P4;
141 name2geo_dim_type_[
"hbgd_NONE"] =
hbgd_NONE;
145 name2geo_dim_type_[
"hbgd_AHD"] =
hbgd_AHD;
146 name2geo_dim_type_[
"hbgd_chi"] =
hbgd_chi;
148 assert( name2weight_type_.size() ==
hbw_MAX );
150 assert( name2don_chem_type_.size() ==
hbdon_MAX );
151 assert( name2acc_chem_type_.size() ==
hbacc_MAX );
152 assert( name2seq_sep_type_.size() ==
seq_sep_MAX );
153 assert( name2geo_dim_type_.size() ==
hbgd_MAX );
156 weight_type2name_.resize(
hbw_MAX );
157 for ( map< string, HBondWeightType >::const_iterator iter = name2weight_type_.begin(),
158 iter_end = name2weight_type_.end(); iter != iter_end; ++iter ) {
159 weight_type2name_[ iter->second ] = iter->first;
163 for ( map< string, HBDerivType >::const_iterator iter = name2deriv_type_.begin(),
164 iter_end = name2deriv_type_.end(); iter != iter_end; ++iter ) {
165 deriv_type2name_[ iter->second ] = iter->first;
169 for ( map< string, HBDonChemType >::const_iterator iter = name2don_chem_type_.begin(),
170 iter_end = name2don_chem_type_.end(); iter != iter_end; ++iter ) {
171 don_chem_type2name_[ iter->second ] = iter->first;
175 for ( map< string, HBAccChemType >::const_iterator iter = name2acc_chem_type_.begin(),
176 iter_end = name2acc_chem_type_.end(); iter != iter_end; ++iter ) {
177 acc_chem_type2name_[ iter->second ] = iter->first;
181 for ( map< string, HBSeqSep >::const_iterator iter = name2seq_sep_type_.begin(),
182 iter_end = name2seq_sep_type_.end(); iter != iter_end; ++iter ) {
183 seq_sep_type2name_[ iter->second ] = iter->first;
187 for ( map< string, Hybridization >::const_iterator
188 iter = name2hybridization_type_.begin(),
189 iter_end = name2hybridization_type_.end();
190 iter != iter_end; ++iter ) {
191 hybridization_type2name_[iter->second ] = iter->first;
194 geo_dim_type2name_.resize(
hbgd_MAX );
195 for ( map< string, HBGeoDimType >::const_iterator iter = name2geo_dim_type_.begin(),
196 iter_end = name2geo_dim_type_.end(); iter != iter_end; ++iter ) {
197 geo_dim_type2name_[ iter->second ] = iter->first;
207 map< string, HBondWeightType >::const_iterator iter( name2weight_type_.find( name ) );
208 if ( iter == name2weight_type_.end() ) {
209 utility_exit_with_message(
"unrecognized hydrogen bond weight type '"+name+
"'");
218 return weight_type2name_[ type ];
226 map< string, HBondWeightType >::const_iterator iter( name2weight_type_.find( name ) );
227 return iter != name2weight_type_.end();
238 map< string, HBDerivType >::const_iterator iter( name2deriv_type_.find( name ) );
239 if ( iter == name2deriv_type_.end() ) {
240 utility_exit_with_message(
"unrecognized hydrogen bond deriv type "+name);
249 return deriv_type2name_[ type ];
257 map< string, HBDerivType >::const_iterator iter( name2deriv_type_.find( name ) );
258 return iter != name2deriv_type_.end();
270 map< string, HBDonChemType >::const_iterator iter( name2don_chem_type_.find( name ) );
271 if ( iter == name2don_chem_type_.end() ) {
272 utility_exit_with_message(
"unrecognized hydrogen bond donor chemical type '"+name+
"'");
281 return don_chem_type2name_[ type ];
289 map< string, HBDonChemType >::const_iterator iter( name2don_chem_type_.find( name ) );
290 return iter != name2don_chem_type_.end();
300 map< string, HBAccChemType >::const_iterator iter( name2acc_chem_type_.find( name ) );
301 if ( iter == name2acc_chem_type_.end() ) {
302 utility_exit_with_message(
"unrecognized hydrogen bond acceptor chemical type '"+name+
"'");
311 return acc_chem_type2name_[ type ];
319 map< string, HBAccChemType >::const_iterator iter( name2acc_chem_type_.find( name ) );
320 return iter != name2acc_chem_type_.end();
329 map< string, HBSeqSep >::const_iterator iter( name2seq_sep_type_.find( name ) );
330 if ( iter == name2seq_sep_type_.end() ) {
331 utility_exit_with_message(
"unrecognized hydrogen bond sequence separation type '"+name+
"'");
340 return seq_sep_type2name_[ type ];
348 map< string, HBSeqSep >::const_iterator iter( name2seq_sep_type_.find( name ) );
349 return iter != name2seq_sep_type_.end();
360 map< string, Hybridization >::const_iterator iter( name2hybridization_type_.find( name ) );
361 if ( iter == name2hybridization_type_.end() ) {
362 utility_exit_with_message(
"unrecognized chemical hybridization type '"+name+
"'");
371 return hybridization_type2name_[ type ];
379 map< string, Hybridization >::const_iterator iter( name2hybridization_type_.find( name ) );
380 return iter != name2hybridization_type_.end();
389 map< string, HBGeoDimType >::const_iterator iter( name2geo_dim_type_.find( name ) );
390 if ( iter == name2geo_dim_type_.end() ) {
391 utility_exit_with_message(
"unrecognized hydrogen bond geometric dimension type '"+name+
"'");
400 return geo_dim_type2name_[ type ];
408 map< string, HBGeoDimType >::const_iterator iter( name2geo_dim_type_.find( name ) );
409 return iter != name2geo_dim_type_.end();