/** * \fileatoms2anchors.cpp * \brief Find an anchor graph segmentation of a protein * * Copyright 2007-2013 IMP Inventors. All rights reserved. **/ #include #include "IMP/em/DensityMap.h" #include "IMP/em/MRCReaderWriter.h" #include "IMP/Model.h" #include "IMP/atom/Hierarchy.h" #include "IMP/atom/pdb.h" #include "IMP/atom/force_fields.h" #include #include #include #include //others #include #include using namespace IMP; namespace { int parse_input(int argc, char *argv[],std::string &pdb_filename, int &num_means,std::string &cmm_filename, std::string &output_pdb_filename,std::string &seg_filename, std::string &txt_filename) { cmm_filename=""; seg_filename=""; txt_filename=""; std::stringstream usage; usage<<"The program segments all CA atoms into K clusters using a GMM " <<"procedure\n\nUsage: atoms2anchors " <<" \n\n"; boost::program_options::options_description optional_params("Allowed options") ,po,ao,required_params("Hideen options"); required_params.add_options() ("pdb",boost::program_options::value(&pdb_filename) ,"the name of the PDB file") ("num",boost::program_options::value(&num_means) ,"number of points that describe the structure") ("output-pdb",boost::program_options::value (&output_pdb_filename),"the output centers as CA atoms ina PDB file"); optional_params.add_options() ("help", usage.str().c_str()) ("cmm",boost::program_options::value(&cmm_filename), "the output centers as points in a CMM file") ("seg",boost::program_options::value(&seg_filename), "print each cluster as a PDB file _i.pdb") ("txt",boost::program_options::value(&txt_filename), "anchors points in txt file format"); boost::program_options::positional_options_description p; p.add("pdb", 1); p.add("num", 1); p.add("output-pdb", 1); boost::program_options::options_description all; all.add(optional_params).add(required_params); boost::program_options::variables_map vm; boost::program_options::store(boost::program_options::command_line_parser( argc, argv).options(all).positional(p).run(),vm); boost::program_options::notify(vm); if (vm.count("help")) { std::cout << optional_params << "\n"; return 1; } if (! (vm.count("pdb")+vm.count("num")+vm.count("output-pdb") == 3)) { std::cout<