From b2658f9cecddf118da6196bea67c68bee4828ea7 Mon Sep 17 00:00:00 2001 From: Valerio Mariani <valerio.mariani@unibas.ch> Date: Tue, 19 Jun 2012 14:27:49 +0200 Subject: [PATCH] Removed tabs and one warning in ldt-related code --- modules/mol/alg/src/filter_clashes.cc | 36 +++++++++---------- modules/mol/alg/src/filter_clashes.hh | 18 +++++----- modules/mol/alg/src/lddt.cc | 24 ++++++------- modules/mol/alg/src/local_dist_diff_test.cc | 38 ++++++++++----------- modules/mol/alg/src/local_dist_diff_test.hh | 2 +- 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/modules/mol/alg/src/filter_clashes.cc b/modules/mol/alg/src/filter_clashes.cc index 43689bf16..27ffb8448 100644 --- a/modules/mol/alg/src/filter_clashes.cc +++ b/modules/mol/alg/src/filter_clashes.cc @@ -386,19 +386,19 @@ EntityView CheckStereoChemistry(const EntityView& ent, const StereoChemicalParam } else { LOG_VERBOSE("BOND:" << " " << res.GetChain() << " " << res.GetName() << " " << res.GetNumber() << " " << bond_str << " " << min_length << " " << max_length << " " << blength << " " << zscore << " " << "PASS") } - bond_count++; + bond_count++; running_sum_zscore_bonds+=zscore; - String bond_elems=bond_string_elems(ele1,ele2); - std::map<String,Real>::const_iterator find_be = bond_length_sum.find(bond_elems); - if (find_be==bond_length_sum.end()) { - bond_length_sum[bond_elems]=blength; - bond_zscore_sum[bond_elems]=zscore; - bond_counter_sum[bond_elems]=1; - } else { - bond_length_sum[bond_elems]+=blength; - bond_zscore_sum[bond_elems]+=zscore; - bond_counter_sum[bond_elems]+=1; - } + String bond_elems=bond_string_elems(ele1,ele2); + std::map<String,Real>::const_iterator find_be = bond_length_sum.find(bond_elems); + if (find_be==bond_length_sum.end()) { + bond_length_sum[bond_elems]=blength; + bond_zscore_sum[bond_elems]=zscore; + bond_counter_sum[bond_elems]=1; + } else { + bond_length_sum[bond_elems]+=blength; + bond_zscore_sum[bond_elems]+=zscore; + bond_counter_sum[bond_elems]+=1; + } } } @@ -481,18 +481,18 @@ EntityView CheckStereoChemistry(const EntityView& ent, const StereoChemicalParam LOG_SCRIPT("Average Z-Score for bond lengths: " << avg_zscore_bonds); LOG_SCRIPT("Bonds outside of tolerance range: " << bad_bond_count << " out of " << bond_count); LOG_SCRIPT("Bond\tAvg Length\tAvg zscore\tNum Bonds") - + for (std::map<String,Real>::const_iterator bls_it=bond_length_sum.begin();bls_it!=bond_length_sum.end();++bls_it) { String key = (*bls_it).first; - int counter=bond_counter_sum[key]; + int counter=bond_counter_sum[key]; Real sum_bond_length=(*bls_it).second; - Real sum_bond_zscore=bond_zscore_sum[key]; - Real avg_length=sum_bond_length/static_cast<Real>(counter); - Real avg_zscore=sum_bond_zscore/static_cast<Real>(counter); + Real sum_bond_zscore=bond_zscore_sum[key]; + Real avg_length=sum_bond_length/static_cast<Real>(counter); + Real avg_zscore=sum_bond_zscore/static_cast<Real>(counter); LOG_SCRIPT(key << "\t" << avg_length << "\t" << avg_zscore << "\t" << counter); } LOG_SCRIPT("Average Z-Score angle widths: " << avg_zscore_angles); - LOG_SCRIPT("Angles outside of tolerance range: " << bad_angle_count << " out of " << angle_count); + LOG_SCRIPT("Angles outside of tolerance range: " << bad_angle_count << " out of " << angle_count); return filtered; } diff --git a/modules/mol/alg/src/filter_clashes.hh b/modules/mol/alg/src/filter_clashes.hh index 731fe41c4..64ae81040 100644 --- a/modules/mol/alg/src/filter_clashes.hh +++ b/modules/mol/alg/src/filter_clashes.hh @@ -29,7 +29,7 @@ class ClashingDistances { public: - /// \brief Default constructor (creates an empty list) + /// \brief Default constructor (creates an empty list) ClashingDistances(): valid_flag_(true) {} /// \brief Adds or replaces an entry @@ -40,10 +40,10 @@ public: /// \brief Recovers a reference distance and a tolerance threshold (respectively) from the list std::pair<Real,Real> GetClashingDistance(const String& ele1,const String& ele2) const; - /// \brief Recovers the longest distance in the list, corrected by tolerance + /// \brief Recovers the longest distance in the list, corrected by tolerance Real GetMaxAdjustedDistance() const; - /// \brief Returns true if the list is empty (i.e. in an invalid, useless state) + /// \brief Returns true if the list is empty (i.e. in an invalid, useless state) bool IsEmpty() const; /// \brief Prints all distances in the list to standard output @@ -68,19 +68,19 @@ public: /// \brief Adds or replaces an entry void SetParam(const String& param, const String& residue, Real value, Real st_dev); - /// \brief Recovers mean and standard deviation (respectively) of a stereo⁻chemical item (bond or angle) from the list + /// \brief Recovers mean and standard deviation (respectively) of a stereo⁻chemical item (bond or angle) from the list /// - /// Item format: Bond: X-Y, Angle:X-Y-Z + /// Item format: Bond: X-Y, Angle:X-Y-Z std::pair<Real,Real> GetParam(const String& element,const String& residue) const; /// \brief Checks if the list contains an entry for a specific stereo-chemical item (a bond or atom in a specific residue) /// - /// Item format: Bond: X-Y, Angle:X-Y-Z + /// Item format: Bond: X-Y, Angle:X-Y-Z bool ContainsParam(const String& param,const String& residue) const; - - /// \brief Returns true if the list is empty (i.e. in an invalid, useless state) + + /// \brief Returns true if the list is empty (i.e. in an invalid, useless state) /// - /// Item format: Bond: X-Y, Angle:X-Y-Z + /// Item format: Bond: X-Y, Angle:X-Y-Z bool IsEmpty() const; /// \brief Prints all distances in the list to standard output diff --git a/modules/mol/alg/src/lddt.cc b/modules/mol/alg/src/lddt.cc index f5f91e3ce..d77c6afa7 100644 --- a/modules/mol/alg/src/lddt.cc +++ b/modules/mol/alg/src/lddt.cc @@ -102,13 +102,13 @@ std::pair<int,int> compute_coverage (const EntityView& v,const GlobalRDMap& glob int main (int argc, char **argv) { - // sets some default values for parameters + // sets some default values for parameters String version = "Beta - 2012-06-13"; Real bond_tolerance = 8.0; Real angle_tolerance = 8.0; Real radius=15.0; - // creates the required loading profile + // creates the required loading profile IOProfile profile; profile.bond_feasibility_check=false; @@ -128,7 +128,7 @@ int main (int argc, char **argv) ("angle_tolerance,a", po::value<Real>(), "tolerance in stddev for angles") ("inclusion_radius,r", po::value<Real>(), "distance inclusion radius") ("files", po::value< std::vector<String> >(), "input file(s)") - ("reference",po::value<String>(),"reference(s)") + ("reference",po::value<String>(),"reference(s)") ; po::positional_options_description p; p.add("files", -1); @@ -207,7 +207,7 @@ int main (int argc, char **argv) radius=vm["inclusion_radius"].as<Real>(); } - // loads the reference file and creates the list of distances to check in lddt + // loads the reference file and creates the list of distances to check in lddt String ref_file=files.back(); EntityHandle ref=load(ref_file, profile); if (!ref) { @@ -217,7 +217,7 @@ int main (int argc, char **argv) EntityView ref_view=ref.Select(sel); GlobalRDMap glob_dist_list = CreateDistanceList(ref_view,radius); - // prints out parameters used in the lddt calculation + // prints out parameters used in the lddt calculation std::cout << "Verbosity level: " << verbosity_level << std::endl; if (structural_checks) { std::cout << "Stereo-chemical and steric clash checks: On " << std::endl; @@ -236,7 +236,7 @@ int main (int argc, char **argv) } LOG_INFO("LDDT INFO FORMAT: Chain1 Residue1 ResNum1 Atom1 Chain2 Residue2 ResNum2 Atom2 ModelDist TargetDist Difference Tolerance Status"); - // cycles through the models to evaluate + // cycles through the models to evaluate for (size_t i=0; i<files.size(); ++i) { EntityHandle model=load(files[i], profile); if (!model) { @@ -264,14 +264,14 @@ int main (int argc, char **argv) aitv.SetElement(firstletter); } } - v=v1; + v=v1; std::cout << "File: " << files[i] << std::endl; std::pair<int,int> cov = compute_coverage(v,glob_dist_list); std::cout << "Coverage: " << (float(cov.first)/float(cov.second)) << " (" << cov.first << " out of " << cov.second << " residues)" << std::endl; - if (structural_checks) { + if (structural_checks) { // reads in parameter files - boost::filesystem::path loc(parameter_filename); + boost::filesystem::path loc(parameter_filename); boost::filesystem::ifstream infile(loc); if (!infile) { std::cout << "Could not find " << parameter_filename << std::endl; @@ -314,7 +314,7 @@ int main (int argc, char **argv) return 0; } - // computes the lddt score + // computes the lddt score std::vector<Real> cutoffs; cutoffs.push_back(0.5); cutoffs.push_back(1.0); @@ -326,7 +326,7 @@ int main (int argc, char **argv) std::cout << "Global LDDT score: " << lddt << std::endl; std::cout << "(" << std::fixed << total_ov.first << " conserved distances in the model out of " << total_ov.second << " checked)" << std::endl; - // prints the residue-by-residue statistics + // prints the residue-by-residue statistics std::cout << "Local LDDT Score:" << std::endl; std::cout << "Chain\tResName\tResNum\tScore\t(Conserved/Total)" << std::endl; for (ResidueViewIter rit=v.ResiduesBegin();rit!=v.ResiduesEnd();++rit){ @@ -337,7 +337,7 @@ int main (int argc, char **argv) if (ritv.HasProp(label)) { lddt_local=ritv.GetFloatProp(label); conserved_dist=ritv.GetIntProp(label+"_conserved"); - total_dist=ritv.GetIntProp(label+"_total"); + total_dist=ritv.GetIntProp(label+"_total"); } if (lddt_local!=0) { std::cout << ritv.GetChain() << "\t" << ritv.GetName() << "\t" << ritv.GetNumber() << '\t' << lddt_local << "\t" << "("<< conserved_dist << "/" << total_dist << ")" <<std::endl; diff --git a/modules/mol/alg/src/local_dist_diff_test.cc b/modules/mol/alg/src/local_dist_diff_test.cc index 089b24026..e69978fbc 100644 --- a/modules/mol/alg/src/local_dist_diff_test.cc +++ b/modules/mol/alg/src/local_dist_diff_test.cc @@ -7,7 +7,7 @@ namespace ost { namespace mol { namespace alg { namespace { -// helper function +// helper function String swapped_name(const String& name) { if (name=="OE1") return "OE2"; @@ -78,12 +78,12 @@ std::pair<bool,Real> within_tolerance(Real mdl_dist, std::pair<Real,Real>& value } // helper function -std::pair<Real, Real> calc_overlap1(const ResidueRDMap& res_distance_list, const ResNum& rnum, +std::pair<long int, long int> calc_overlap1(const ResidueRDMap& res_distance_list, const ResNum& rnum, ChainView mdl_chain, std::vector<Real>& tol_list, bool only_fixed, bool swap,std::vector<std::pair<long int, long int> >& overlap_list, bool log ) { - std::pair<Real, Real> overlap(0.0, 0.0); + std::pair<long int, long int> overlap(0, 0); ResidueView mdl_res=mdl_chain.FindResidue(rnum); for (ResidueRDMap::const_iterator ai=res_distance_list.begin(); ai!=res_distance_list.end(); ++ai) { UAtomIdentifiers uais = ai->first; @@ -279,7 +279,7 @@ void update_existence_map (ExistenceMap& ex_map, const EntityView& ev, int ref_c if (find_uai_ci!=ex_map.end()) { uai_value=find_uai_ci->second; } - uai_value |= 1 << (ref_counter); + uai_value |= 1 << (ref_counter); ex_map[uai]=uai_value; } } @@ -312,8 +312,8 @@ void merge_distance_lists(GlobalRDMap& ref_dist_map, const GlobalRDMap& new_dist // if you find the distance in the residue new, udate min and max if (find_new_rd_ci != find_new_res_ci->second.end()) { std::pair <Real,Real> new_minmax = find_new_rd_ci->second; - Real min = ref_minmax.first; - Real max = ref_minmax.second; + Real min = ref_minmax.first; + Real max = ref_minmax.second; if (new_minmax.first < min) min = new_minmax.first; if (new_minmax.second > max) max = new_minmax.second; ref_dist_map_it->second[ref_rd] = std::make_pair<Real,Real>(min,max); @@ -411,29 +411,29 @@ bool UniqueAtomIdentifier::operator<(const UniqueAtomIdentifier& rhs) const if (chain_ < rhs.GetChainName()) { return true; } else if (chain_ > rhs.GetChainName()) { - return false; + return false; } else { if (residue_ < rhs.GetResNum()) { return true; } else if (residue_ > rhs.GetResNum()) { - return false; + return false; } else { if (residue_name_ < rhs.GetResidueName()) { return true; } else if (residue_name_ > rhs.GetResidueName()) { - return false; + return false; } else { if (atom_ < rhs.GetAtomName()) { return true; } else if (atom_ > rhs.GetAtomName()) { - return false; + return false; } else { - return false; - } - } - } + return false; + } + } + } } -} +} GlobalRDMap CreateDistanceList(const EntityView& ref,Real max_dist) { @@ -473,7 +473,7 @@ GlobalRDMap CreateDistanceList(const EntityView& ref,Real max_dist) } GlobalRDMap CreateDistanceListFromMultipleReferences(const std::vector<EntityView>& ref_list, std::vector<Real>& cutoff_list, Real max_dist) -{ +{ int ref_counter=0; ExistenceMap ex_map; GlobalRDMap glob_dist_list = CreateDistanceList(ref_list[0],max_dist); @@ -532,7 +532,7 @@ std::pair<long int,long int> LocalDistDiffTest(const EntityView& mdl, const Glob for (GlobalRDMap::const_iterator i=glob_dist_list.begin(), e=glob_dist_list.end(); i!=e; ++i) { ResNum rn = i->first; if (i->second.size()!=0) { - std::pair<Real, Real> ov1=calc_overlap1(i->second, rn, mdl_chain, cutoff_list, + std::pair<long int, long int> ov1=calc_overlap1(i->second, rn, mdl_chain, cutoff_list, false, false, overlap_list,true); total_ov.first+=ov1.first; total_ov.second+=ov1.second; @@ -543,8 +543,8 @@ std::pair<long int,long int> LocalDistDiffTest(const EntityView& mdl, const Glob int mdl_res_index =mdlr.GetIndex(); Real local_lddt=static_cast<Real>(overlap_list[mdl_res_index].first)/(static_cast<Real>(overlap_list[mdl_res_index].second) ? static_cast<Real>(overlap_list[mdl_res_index].second) : 1); mdlr.SetFloatProp(local_lddt_property_string, local_lddt); - mdlr.SetIntProp(local_lddt_property_string+"_conserved", overlap_list[mdl_res_index].first); - mdlr.SetIntProp(local_lddt_property_string+"_total", overlap_list[mdl_res_index].second); + mdlr.SetIntProp(local_lddt_property_string+"_conserved", overlap_list[mdl_res_index].first); + mdlr.SetIntProp(local_lddt_property_string+"_total", overlap_list[mdl_res_index].second); } } } diff --git a/modules/mol/alg/src/local_dist_diff_test.hh b/modules/mol/alg/src/local_dist_diff_test.hh index 3d92b5bf9..894d54605 100644 --- a/modules/mol/alg/src/local_dist_diff_test.hh +++ b/modules/mol/alg/src/local_dist_diff_test.hh @@ -54,7 +54,7 @@ public: bool operator==(const UniqueAtomIdentifier& rhs) const; // required because UniqueAtomIdentifier is used as a key for a std::map - bool operator<(const UniqueAtomIdentifier& rhs) const; + bool operator<(const UniqueAtomIdentifier& rhs) const; private: -- GitLab