Ejemplo n.º 1
0
int main(int argc, char **argv) {
  try {
    desc.add_options()
    ("help,h",
     "Print messages about any errors encountered in parsing the pdb file.")
        ("input-file,i", po::value< std::string >(&input),
         "input pdb file");
    po::positional_options_description p;
    p.add("input-file", 1);
    po::variables_map vm;
    po::store(
              po::command_line_parser(argc,
                                      argv).options(desc).positional(p).run(),
              vm);
    po::notify(vm);
    if (vm.count("help") || input.empty()) {
      print_help();
      return 1;
    }
    IMP_NEW(IMP::Model, m, ());
    m->set_log_level(IMP::SILENT);
    IMP::set_log_level(IMP::VERBOSE);
    IMP::atom::Hierarchies inhs;
    IMP_CATCH_AND_TERMINATE(inhs= IMP::atom::read_multimodel_pdb(input, m));
    for (unsigned int i=0; i< inhs.size(); ++i) {
      IMP::atom::add_bonds(inhs[i]);
    }
    return 0;
  } catch (const IMP::Exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
    return 1;
  } catch (const std::exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
  }
}
Ejemplo n.º 2
0
int main(int argc, char **argv) {
  try {
    std::vector<std::string> argcs = IMP::setup_from_argv(
        argc, argv, "Print warnings about pdb file", "input.pdb", -1);

    IMP::set_log_level(IMP::WARNING);
    for (unsigned int i = 0; i < argcs.size(); ++i) {
      IMP_NEW(IMP::Model, m, ());
      m->set_log_level(IMP::SILENT);
      IMP::atom::Hierarchies inhs;
      IMP_CATCH_AND_TERMINATE(inhs =
                                  IMP::atom::read_multimodel_pdb(argcs[i], m));
      for (unsigned int i = 0; i < inhs.size(); ++i) {
        IMP::atom::add_bonds(inhs[i]);
      }
    }
    return 0;
  }
  catch (const IMP::Exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
    return 1;
  }
  catch (const std::exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
  }
}