/** * \file CrossLink \brief * * Copyright 2007-2013 IMP Inventors. All rights reserved. * */ #include "CrossLink.h" #include int read_cross_link_file(const std::string& file_name, std::vector& cross_links) { std::ifstream s(file_name.c_str()); if(!s) { IMP_THROW("Can't find cross links file " << file_name, IOException); } CrossLink cl; while(s >> cl) cross_links.push_back(cl); return cross_links.size(); } void write_cross_link_file(const std::string& file_name, const std::vector& cross_links, bool include_actual_distance) { std::ofstream ofile(file_name.c_str()); for(unsigned int i=0; i>(std::istream& s, CrossLink& cl) { s >> cl.residue_number1_ >> cl.chain_id1_ >> cl.residue_number2_ >> cl.chain_id2_ >> cl.min_distance_ >> cl.max_distance_; if(cl.chain_id1_ == '-') cl.chain_id1_ = ' '; if(cl.chain_id2_ == '-') cl.chain_id2_ = ' '; return s; }