コード例 #1
0
ファイル: EMFit.cpp プロジェクト: sirusb/imp
void EMFit::output(std::string out_file_name, std::string out_pdb_file_name) {
  std::ofstream out_file(out_file_name.c_str());
  out_file << "receptorPdb (str) " << rec_file_name_ << std::endl;
  out_file << "ligandPdb (str) " << lig_file_name_ << std::endl;
  FitResult::print_header(out_file);
  out_file.setf(std::ios::fixed, std::ios::floatfield);
  out_file.setf(std::ios::right, std::ios::adjustfield);

  IMP::algebra::Vector3Ds lig_points;
  IMP::saxs::get_coordinates(lig_particles_, lig_points);
  for (unsigned int i = 0; i < fit_results_.size(); i++) {
    out_file << fit_results_[i] << std::endl;
  }
  out_file.close();
  if (fit_results_.size() == 1) {  // output PDB
    IMP::algebra::Transformation3D tr = fit_results_[0].get_map_trans();
    IMP::kernel::Particles ps = rec_particles_;
    ps.insert(ps.end(), lig_particles_.begin(), lig_particles_.end());
    // transform
    for (IMP::kernel::Particles::iterator it = ps.begin(); it != ps.end();
         it++) {
      IMP::core::XYZ d(*it);
      d.set_coordinates(tr * d.get_coordinates());
    }
    // output
    std::ofstream out_file2(out_pdb_file_name.c_str());
    IMP::kernel::ParticlesTemp pst = ps;
    IMP::atom::write_pdb(pst, out_file2);
    out_file2.close();
  }
}
コード例 #2
0
ファイル: helpers.cpp プロジェクト: apolitis/imp
void transform(IMP::kernel::Particles& ps, IMP::algebra::Transformation3D& t) {
  for(IMP::kernel::Particles::iterator it = ps.begin(); it != ps.end(); it++) {
    IMP::core::XYZ d(*it);
    d.set_coordinates(t * d.get_coordinates());
  }
}