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; }
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; }
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; }