22 #include <core/types.hh>
27 #include <core/chemical/ResidueTypeSet.fwd.hh>
28 #include <core/chemical/ChemicalManager.hh>
30 #include <protocols/filters/Filter.fwd.hh>
33 #include <protocols/contact_map/ContactMap.hh>
35 #include <core/pose/Pose.hh>
37 #include <core/import_pose/pose_stream/util.hh>
38 #include <core/import_pose/pose_stream/MetaPoseInputStream.hh>
42 #include <basic/options/keys/in.OptionKeys.gen.hh>
43 #include <basic/options/keys/contactMap.OptionKeys.gen.hh>
56 std::string current_region =
"";
59 protocols::moves::Movers_map movers;
60 protocols::filters::Filters_map filters;
63 if ( region_def ==
"" ) {
64 std::ostringstream oss;
65 oss <<
"1-" << pose.n_residue();
66 region_def = oss.str();
69 while ( region_def !=
"" ) {
71 using namespace basic::options::OptionKeys;
75 if (
pos == std::string::npos ) {
76 current_region = region_def;
79 current_region = region_def.substr(0,
pos);
80 region_def = region_def.substr(
pos+1);
82 pos=current_region.find(
':');
84 if (
pos == std::string::npos ) {
85 tag->setOption(
"region1", current_region);
86 }
else if ( current_region.find(
"ligand=")==std::string::npos ) {
87 tag->setOption(
"region1", current_region.substr(0,
pos));
88 tag->setOption(
"region2", current_region.substr(
pos+1));
90 if ( current_region.find(
"ligand=")>
pos ) {
91 tag->setOption(
"region1", current_region.substr(0,
pos));
92 tag->setOption(
"ligand", current_region.substr(
pos+8));
94 tag->setOption(
"region1", current_region.substr(
pos+1));
95 tag->setOption(
"ligand", current_region.substr(7,
pos-7));
100 tag->setOption(
"distance_cutoff",
option[contactMap::distance_cutoff]());
101 tag->setOption(
"models_per_file", 0);
102 if (
option[contactMap::row_format]() ) tag->setOption(
"row_format",
"true");
103 if (
option[contactMap::distance_matrix]() ) tag->setOption(
"distance_matrix",
"true");
104 cm.parse_my_tag( tag, data, filters , movers, pose);
106 std::string output_prefix(
option[contactMap::prefix]());
107 output_prefix +=current_region;
108 cm.set_output_prefix(output_prefix);
116 int main(
int argc,
char* argv[]) {
120 using namespace core::chemical;
121 using namespace core::import_pose::pose_stream;
123 using namespace basic::options::OptionKeys;
124 using namespace core;
127 OPT(contactMap::prefix);
128 OPT(contactMap::distance_cutoff);
129 OPT(contactMap::region_def);
130 OPT(contactMap::row_format);
131 OPT(contactMap::distance_matrix);
139 OPT(in::file::silent_struct_type);
140 OPT(in::file::residue_type_set);
141 OPT(in::file::extra_res);
142 OPT(in::file::extra_res_fa);
143 OPT(in::file::extra_res_cen);
149 core::chemical::ResidueTypeSetCOP rsd_set =
150 ChemicalManager::get_instance()->residue_type_set(
151 option[in::file::residue_type_set]());
156 MetaPoseInputStream
input( streams_from_cmd_line() );
159 if ( ! input.has_another_pose() ) {
160 tr.
Info <<
"No pose supplied - exiting without further action! "<< std::endl;
165 input.fill_pose(
pose, *rsd_set);
175 while ( input.has_another_pose() ) {
176 input.fill_pose(
pose, *rsd_set);
178 for (
core::Size i=1 ; i <= maps.size(); i++ ) {
183 for (
core::Size i=1 ; i <= maps.size(); i++ ) {
184 maps[i].write_to_file();
190 std::cout <<
"caught exception " << e.
msg() << std::endl;
virtual std::string const msg() const
void init(int argc, char *argv[])
Command line init() version.
std::vector with 1-based indexing
utility::pointer::shared_ptr< Tag > TagOP
rule< Scanner, options_closure::context_t > options
utility::options::OptionCollection option
OptionCollection global.
general-purpose store for any reference-count derived object
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
An object for reading/writing a simple xml-like language.
Program options global and initialization function.
rule< Scanner, tag_closure::context_t > tag
int const silent
Named verbosity levels.