예제 #1
0
파일: helpers.cpp 프로젝트: apolitis/imp
void read_pdb_ca_atoms(const std::string file_name, IMP::kernel::Particles& particles) {
  IMP::kernel::Model *model = new IMP::kernel::Model();
  IMP::atom::Hierarchy mhd = IMP::atom::read_pdb(file_name, model,
                             new IMP::atom::CAlphaPDBSelector(), true, true);
  particles=IMP::get_as<IMP::kernel::Particles>(get_by_type(mhd, IMP::atom::ATOM_TYPE));
  std::cout << "Number of CA atom particles " << particles.size() << std::endl;
}
예제 #2
0
파일: EMFit.cpp 프로젝트: sirusb/imp
void EMFit::read_pdb_atoms(IMP::kernel::Model* model,
                           const std::string file_name,
                           IMP::kernel::Particles& particles) {
  IMP::atom::Hierarchy mhd = IMP::atom::read_pdb(
      file_name, model, new IMP::atom::NonWaterNonHydrogenPDBSelector(), true,
      true);
  particles = get_by_type(mhd, IMP::atom::ATOM_TYPE);
  std::cout << "Number of atom particles " << particles.size() << std::endl;
}
예제 #3
0
파일: EMFit.cpp 프로젝트: sirusb/imp
float EMFit::compute_volume(const IMP::kernel::Particles& particles) {
  IMP::saxs::FormFactorTable* ft = IMP::saxs::get_default_form_factor_table();
  float volume = 0.0;
  float c = (4.0 / 3.0) * IMP::algebra::PI;
  for (unsigned int pindex = 0; pindex < particles.size(); pindex++) {
    float radius = ft->get_radius(particles[pindex]);
    // volume = 4/3 * pi * r^3
    volume += c * radius * radius * radius;
    // add radius to particle. it is needed later for sampled density map
    IMP::core::XYZR::setup_particle(particles[pindex], radius);
  }
  return volume;
}