/// \brief Use the specified DSSP file to check the hbond calculations for the specified PDB file
		///
		/// \todo Remove the arg_warn_only_on_diff argument if dssp_ignores_valid_residue_1 is resolved
		inline void dssp_hbond_calc_test_suite_fixture::use_dssp_file_to_check_hbonds_calcs(const path &arg_dssp_file,        ///< The DSSP file to compare against
		                                                                                    const path &arg_pdb_file,         ///< The PDB file to check
		                                                                                    const bool &arg_warn_only_on_diff ///< Whether to only warn on differences
		                                                                                    ) {
			BOOST_REQUIRE( exists( arg_pdb_file ) );
			// const auto read_dssp_start_time = high_resolution_clock::now();
			const auto dssp_hbonds = parse_dssp_for_calc_testing( arg_dssp_file );
			// const auto read_dssp_stop_time  = high_resolution_clock::now();

			if ( ! dssp_hbonds.empty() ) {
				// const auto read_pdb_start_time = high_resolution_clock::now();
				const auto parsed_pdb          = read_pdb_file( arg_pdb_file );
				// const auto read_pdb_stop_time  = high_resolution_clock::now();

				protein_from_dssp_and_pdb( read_dssp_file( arg_dssp_file ), parsed_pdb, dssp_skip_policy::DONT_SKIP__BREAK_ANGLES );

				// const auto calc_start_time = high_resolution_clock::now();
				const auto bifur_hbonds = dssp_hbond_calc::calc_bifur_hbonds_of_pdb__recalc_backbone_residues(
					parsed_pdb
				);
				// const auto calc_stop_time  = high_resolution_clock::now();

				// std::cerr << "Read DSSP   : " << durn_to_seconds_string ( read_dssp_stop_time - read_dssp_start_time ) << "\n";
				// std::cerr << "Read PDB    : " << durn_to_seconds_string ( read_pdb_stop_time  - read_pdb_start_time  ) << "\n";
				// std::cerr << "Calc hbonds : " << durn_to_seconds_string ( calc_stop_time      - calc_start_time      ) << "\n";

				// BOOST_TEST_INFO() isn't present in Boost > 1.58.0
				// BOOST_TEST_INFO  ( "Checking DSSP file \"" + arg_dssp_file.string() + "\"" );
				if ( arg_warn_only_on_diff ) {
					BOOST_WARN_EQUAL ( difference_string( dssp_hbonds, bifur_hbonds ), none );
				}
				else {
					BOOST_CHECK_EQUAL( difference_string( dssp_hbonds, bifur_hbonds ), none );
				}
			}
		}
Пример #2
0
 bool operator()(const T& e)
 {
     BOOST_WARN_EQUAL(e.what(), mMessage); // additional failure info
     return e.what() == mMessage;
 }