9 #include <basic/Tracer.hh>
18 #include <basic/options/option.hh>
19 #include <basic/options/keys/OptionKeys.hh>
22 #include <basic/options/keys/remodel.OptionKeys.gen.hh>
23 #include <basic/options/keys/run.OptionKeys.gen.hh>
54 #include <ObjexxFCL/FArray1D.hh>
72 #include <utility/io/izstream.hh>
76 #include <utility/vector1.hh>
93 while((cutAt = (
int)str.find_first_of(delim)) !=
int(str.npos) ) {
95 results.push_back(str.substr(0,cutAt));
97 str = str.substr(cutAt+1);
99 if(str.length() > 0) {
100 results.push_back(str);
105 has_design_info_ =
false;
106 design_neighbor =
false;
108 natro_movemap_.set_chi(
true);
115 using namespace basic::options;
116 using namespace basic::options::OptionKeys;
122 TR_REMODEL <<
"can't find blueprint file for remodel!" << std::endl;
124 utility::io::izstream data(filename.c_str());
126 TR_REMODEL <<
"Can't open blueprint file " << filename << std::endl;
127 utility::exit(EXIT_FAILURE, __FILE__, __LINE__);
134 std::ostringstream oss;
136 oss <<
"NATRO" << std::endl;
137 oss <<
"start" << std::endl;
142 while (getline( data, line)){
152 bool mark_start =
false;
153 while (getline( data, line)){
154 std::istringstream line_stream(line);
155 std::vector<std::string> split_info;
156 std::ostringstream oss_switch;
157 this->splitString(line_stream.str(),
" ", split_info);
160 if (split_info[0].
at(0) ==
'#'){
185 line.
sstype = split_info[2];
188 if (split_info[1].
at(0) ==
'#' || split_info[2].
at(0) ==
'#') {
189 std::ostringstream err_message;
190 err_message <<
"ERROR: comment marker '#' cannot be in residue or ss column at line:\n";
191 err_message << line_stream.str();
192 utility::exit(__FILE__, __LINE__, err_message.str());
195 if (split_info.size() > 3){
197 if (split_info[3].
at(0) ==
'#'){
201 for (std::vector<std::string>::iterator it=split_info.begin(),
end=split_info.end(); it !=
end ; it++){
202 if ((*it).substr(0,3) ==
"CST"){
203 TR_REMODEL <<
"constraint found " << *it << std::endl;
207 if ((*it).substr(0,3) ==
"DM_"){
208 disulfMobileRange.push_back(line.
index);
209 if (disulfMobileRange.size() > 2){
210 std::ostringstream err_message;
211 err_message <<
"ERROR: Disulfide mobile range assigment contains " << disulfMobileRange.size() <<
" elements." << std::endl;
212 utility::exit(__FILE__, __LINE__, err_message.str());
215 if ((*it).substr(0,3) ==
"DS_"){
216 disulfLandingRange.push_back(line.
index);
217 if (disulfLandingRange.size() > 2){
218 std::ostringstream err_message;
219 err_message <<
"ERROR: Disulfide landing range assigment contains " << disulfLandingRange.size() <<
" elements." << std::endl;
220 utility::exit(__FILE__, __LINE__, err_message.str());
228 bool design_info =
false;
229 int info_count = (
int) split_info.size() - 3;
232 for (
int i = 3; i< (
int)split_info.size(); i++){
233 if (split_info[i].substr(0,3) ==
"CST" || split_info[i].substr(0,3) ==
"DM_" || split_info[i].substr(0,3) ==
"DS_"){
238 if ( info_count > 0){
244 if (basic::options::option[ OptionKeys::run::chain].user()) {
245 std::string const chain (basic::options::option[ OptionKeys::run::chain]);
246 oss << line.
index <<
" " << chain <<
" " ;
249 oss << line.
index <<
" _ " ;
254 for (
int i = 3; i< (
int)split_info.size(); i++){
255 if (split_info[i].substr(0,3) !=
"CST" && split_info[i].substr(0,3) !=
"DM_" && split_info[i].substr(0,3) !=
"DS_"){
256 oss << split_info[i] <<
" " ;
257 oss_switch << split_info[i];
259 if (split_info[i].substr(0,5) ==
"PIKAA"){
265 for (
int j = 0; j < (
int)split_info[i].
size();++j){
269 char one_letter_name = split_info[i].substr(j,1).c_str()[0];
271 TR_REMODEL <<
" design position to " << one_letter_name <<
" " << aa << std::endl;
277 if ( split_info[i] ==
"NATRO"){
278 TR_REMODEL <<
"NATRO movemap setup: turning off chi move for refinement stage: " << line.
index << std::endl;
279 natro_movemap_.set_chi(line.
index,
false);
288 if (option[ OptionKeys::remodel::repeat_structure].user()){
289 for (
int rep = 1; rep< option[ OptionKeys::remodel::repeat_structure ]; rep++){
291 if (basic::options::option[ OptionKeys::run::chain].user()) {
292 std::string const chain (basic::options::option[ OptionKeys::run::chain]);
293 oss << line.
index + length*rep <<
" " << chain <<
" " ;
296 oss << line.
index + length*rep <<
" _ " ;
298 for (
int i = 3; i< (
int)split_info.size(); i++){
299 if (split_info[i].substr(0,3) !=
"CST"){
300 oss << split_info[i] <<
" " ;
308 if (oss_switch.str() !=
""){
310 has_design_info_ =
true;
315 this->parsed_string_for_resfile = oss.str();
356 this->blueprint.push_back(line);
359 std::cout <<
"manual design info" << std::endl << this->parsed_string_for_resfile << std::endl;
362 if ( has_design_info_ ){
367 std::vector<protocols::forge::remodel::LineObject>::iterator iter;
368 for ( iter = this->blueprint.begin(); iter != this->blueprint.end(); iter++) {
369 this->sequence.append(iter->resname);
370 this->ss.append(iter->sstype);
373 translateDSSP_ABEGO(this->ss, this->
abego);
376 TR_REMODEL <<
"sequence: " << std::endl << this->sequence << std::endl;
377 TR_REMODEL <<
"sstype : " << std::endl << this->ss << std::endl;
385 bool abego_switch =
false;
386 found_idx = ss.find_first_of(
"abgoABGO");
387 if (found_idx == std::string::npos){
388 std::cout <<
"SS based assignment found" << std::endl;
389 }
else if (found_idx != std::string::npos){
391 std::cout <<
"ABEGO based assignment found" << std::endl;
396 found_idx = ss.find_first_of(
"abegoABEGO");
397 for (
core::Size idx = 0; idx < ss.length(); idx++){
398 if (ss[idx] ==
'A' || ss[idx] ==
'a'){
399 trans_ss.push_back(
'H');
401 else if (ss[idx] ==
'B' || ss[idx] ==
'b'){
402 trans_ss.push_back(
'E');
404 else if (ss[idx] ==
'E' || ss[idx] ==
'e'){
405 trans_ss.push_back(
'L');
407 else if (ss[idx] ==
'G' || ss[idx] ==
'g'){
408 trans_ss.push_back(
'L');
410 else if (ss[idx] ==
'O' || ss[idx] ==
'o'){
411 trans_ss.push_back(
'L');
413 else if (ss[idx] ==
'.'){
414 trans_ss.push_back(
'.');
418 trans_ss.push_back(ss[idx]);
431 for (
int i = 0; i < (
int)ss.size(); i++){
432 int idx = this->blueprint[i].original_index;
433 char const * ss_chars = ss.c_str();
434 if (ss_chars[i] !=
'.'){
435 dssp_updated_ss.append(1, ss_chars[i]);
438 dssp_updated_ss.append(1, dsspSS(idx));
442 std::transform(dssp_updated_ss.begin(), dssp_updated_ss.end(), dssp_updated_ss.begin(), ::toupper);
443 TR_REMODEL <<
"dssp_updated_ss: lengths = " << dssp_updated_ss.length() << std::endl << dssp_updated_ss << std::endl;
450 insertionSize = (
int)insertPose.total_residue();
452 ObjexxFCL::FArray1D_char dsspSS((
int)insertPose.total_residue());
454 for (
int i = 1; i <= (
int)dsspSS.size(); i++){
455 insertionSS.push_back(dsspSS(i));
457 std::cout <<
"insertion SS: " << insertionSS << std::endl;