/** This is the program for computation of radius of gyration from SAXS profiles. */ #include #include #include #include #include #include #include #include namespace po = boost::program_options; int main(int argc, char **argv) { // output arguments for (int i = 0; i < argc; i++) std::cerr << argv[i] << " "; std::cerr << std::endl; float end_q_rg = 1.3; po::options_description desc("Usage: \ ... ..."); desc.add_options() ("help", "Any number of input PDBs and profiles is supported. \ Each PDB will be fitted against each profile.") ("input-files", po::value< std::vector >(), "input PDB and profile files") ("end_q_rg,q*rg", po::value(&end_q_rg)->default_value(1.3), "end q*rg value for rg computation, q*rg files, pdb_files, dat_files; if (vm.count("input-files")) { files = vm["input-files"].as< std::vector >(); } if(vm.count("help") || files.size() == 0) { std::cout << desc << "\n"; return 0; } // 1. read pdbs and profiles, prepare particles IMP::Model *model = new IMP::Model(); std::vector particles_vec; std::vector exp_profiles; for(unsigned int i=0; i(get_by_type(mhd, IMP::atom::ATOM_TYPE)); if(particles.size() > 0) { // pdb file pdb_files.push_back(files[i]); particles_vec.push_back(particles); std::cout << particles.size() << " atoms were read from PDB file " << files[i] << std::endl; } } catch(IMP::ValueException e) { // not a pdb file // B. try as dat file IMP::saxs::Profile *profile = new IMP::saxs::Profile(files[i]); if(profile->size() == 0) { std::cerr << "can't parse input file " << files[i] << std::endl; return 1; } else { dat_files.push_back(files[i]); exp_profiles.push_back(profile); std::cout << "Profile read from file " << files[i] << " size = " << profile->size() << std::endl; } } } // 2. compute rg for input profiles for(unsigned int i=0; iradius_of_gyration(end_q_rg); std::cout << dat_files[i] << " Rg= " << rg << std::endl; } // 3. compute rg for input pdbs for(unsigned int i=0; i