/** * \file fitting_solutions_reader_writer.cpp * \brief handles reading and writing of fitting solutions * volume calculation. * * Copyright 2007-2013 IMP Inventors. All rights reserved. * */ #include #include #include #include IMPMULTIFIT_BEGIN_NAMESPACE namespace { FittingSolutionRecord parse_fitting_line(const std::string &line) { IMP_LOG_VERBOSE("line:"< string_split_iterator; IMP_USAGE_CHECK(line.size() > 0,"no data to parse"< line_split,fit_rotation_split,fit_translation_split, dock_rotation_split,dock_translation_split; boost::split(line_split, line, boost::is_any_of("|")); IMP_USAGE_CHECK(line_split.size() == 11, "FittingSolutionRecord::parse_fitting_line Wrong format of input line : "<< "not enough fields:"<(line_split[0])); fit_sol.set_solution_filename( boost::lexical_cast(line_split[1])); fit_sol.set_fit_transformation( algebra::Transformation3D( algebra::Rotation3D( boost::lexical_cast(fit_rotation_split[0]), boost::lexical_cast(fit_rotation_split[1]), boost::lexical_cast(fit_rotation_split[2]), boost::lexical_cast(fit_rotation_split[3])), algebra::Vector3D( boost::lexical_cast(fit_translation_split[0]), boost::lexical_cast(fit_translation_split[1]), boost::lexical_cast(fit_translation_split[2])))); IMP_LOG_VERBOSE("tranformation is set:" <(line_split[4])); fit_sol.set_match_average_distance( boost::lexical_cast(line_split[5])); fit_sol.set_envelope_penetration_score( boost::lexical_cast(line_split[6])); fit_sol.set_fitting_score(boost::lexical_cast(line_split[7])); fit_sol.set_dock_transformation( algebra::Transformation3D( algebra::Rotation3D( boost::lexical_cast(dock_rotation_split[0]), boost::lexical_cast(dock_rotation_split[1]), boost::lexical_cast(dock_rotation_split[2]), boost::lexical_cast(dock_rotation_split[3])), algebra::Vector3D( boost::lexical_cast(dock_translation_split[0]), boost::lexical_cast(dock_translation_split[1]), boost::lexical_cast(dock_translation_split[2])))); fit_sol.set_rmsd_to_reference(boost::lexical_cast(line_split[10])); IMP_LOG_VERBOSE("finish parsing line"<get_fit_transformation(), it->get_fitting_score()); } return output; } FittingSolutionRecords convert_transformations_to_multifit_format( const algebra::Transformation3Ds &trans) { FittingSolutionRecords ret; for (unsigned int i=0;i