46 #include <basic/Tracer.hh>
48 #include <basic/options/option.hh>
49 #include <basic/options/keys/PCS.OptionKeys.gen.hh>
54 #include <numeric/constants.hh>
57 #include <ObjexxFCL/FArray1D.hh>
63 #include <utility/vector1.hh>
71 using namespace ObjexxFCL;
73 basic::Tracer
TR_pcs_d_p_l(
"protocols.scoring.methods.pcs.PCS_data_per_lanthanides");
74 basic::Tracer
TR_pcs_d(
"protocols.scoring.methods.pcs.PCS_data");
80 filename_(
""), weight_(0)
82 utility_exit_with_message(
"You shouldn't call the empty constructor for PCS_data_per_lanthanides class" );
86 filename_(other.filename_), svd_s_(other.svd_s_), weight_(other.weight_)
128 if (
this != &other ) {
143 utility_exit_with_message(
"You shouldn't call the empty constructor for PCS_data class" );
152 if (
this != &other ) {
178 basic::datacache::CacheableDataOP
192 using namespace core;
214 value_1_4_PI_r5 = FACT_USI_PRECALC_FOR_A_3 / r5;
216 A_line[1] = value_1_4_PI_r5 * (x2 - z2);
217 A_line[2] = value_1_4_PI_r5 * (2.0 * v_x * v_y);
218 A_line[3] = value_1_4_PI_r5 * (2.0 * v_x * v_z);
219 A_line[4] = value_1_4_PI_r5 * (y2 - z2);
220 A_line[5] = value_1_4_PI_r5 * (2.0 * v_y * v_z);
226 for(i = 1; i <=
A_index_.size(); ++i){
227 for(j = 1; j <= 5; ++j){
249 score =
svd_s_.run_score_svd_without_solving();
320 std::cerr <<
"Error: Couldn't find residue " << res << std::endl;
321 std::cerr <<
"Numbering residue within Rosetta match the sequence provided as input" << std::endl;
322 std::cerr <<
"Make sure the numbering between the sequence and the PseudocontactShift (npc) input file match" << std::endl;
323 utility_exit_with_message(
"Check your pdb and PseudocontactShift (npc) input file");
328 std::cerr <<
"Error: Couldn't find the atom " << at <<
" in residue " << res << std::endl;
329 std::cerr <<
"Numbering residue within Rosetta match the sequence provided as input" << std::endl;
330 std::cerr <<
"Make sure the numbering between the sequence and the PseudocontactShift (npc) input file match" << std::endl;
331 std::cerr <<
"Use only PCS for the backbone for abinitio." << std::endl;
332 std::cerr <<
"only N, CA, C, O, CB, H and CEN" << std::endl;
334 utility_exit_with_message(
"Check your pdb and PseudocontactShift (npc) input file");
354 const FArray1D< core::Real > &
377 if ((*it).atom_name() == P_l_d.
atom_name()){
477 filename_(filename), svd_s_(basic::svd::SVD_Solver(PCS_d_l_a.
size(), 5)), weight_(weight)
479 using namespace core;
480 using namespace basic::options;
481 using namespace basic::options::OptionKeys;
486 n_pcs_ = PCS_d_l_a.size();
493 svd_s_ = basic::svd::SVD_Solver(M,
N);
501 for (i = 1; i <= PCS_d_l_a.size(); ++i){
508 svd_s_.set_vector_b(vec_temp);
516 for (i = 1; i <= PCS_d_l_a.size(); ++i){
526 if( option[ basic::options::OptionKeys::PCS::normalization_id ].user() ){
527 core::Size norma_id (option[ basic::options::OptionKeys::PCS::normalization_id ]());
531 TR_pcs_d_p_l <<
"Using Normalization '1': " <<
normalization_1_ <<
". Normalize each data set by SQRT( SUM( PCScalc(i)^2 ) ) " << std::endl;
541 TR_pcs_d_p_l <<
"Using Normalization '3': " <<
normalization_3_ <<
". Normalize each data set by SQRT( SUM( PCScalc(i)^2 ) / N) " << std::endl;
546 TR_pcs_d_p_l <<
"Normalization '"<< norma_id <<
"' id not recognized " << std::endl;
547 utility_exit_with_message(
"You should use a valid normalization id ('1' or '2' or '3')");
553 TR_pcs_d_p_l <<
"Normalization NOT used in calculations " << std::endl;
570 std::map< std::string, PCS_file_data >::iterator it;
581 for ( it = P_f_a_d.begin(); it != P_f_a_d.end(); ++it ) {
582 filename = it->first;
585 n_lanthanides_ = n_lanthanides_ + 1;
586 TR_pcs_d <<
"Filename " << filename <<std::endl;
595 for ( it2 = PCS_d_l_a.begin(); it2 != PCS_d_l_a.end(); ++it2 ){
596 P_l_d_temp = &(*it2);
597 index = where_is_line(*P_l_d_temp);
599 PCS_data_line_all_spin_.push_back(*it2);
600 n_pcs_spin_ = n_pcs_spin_ + 1;
608 PCS_data_per_lanthanides_all_.push_back(P_d_p_l);
610 TR_pcs_d <<
"Total spin independent: " << n_pcs_spin_ << std::endl;
612 A_all_.resize(n_pcs_spin_);
613 for(i = 1; i <= n_pcs_spin_; i++){
614 (A_all_[i]).resize(5);
616 X_all_.resize(n_pcs_spin_);
617 Y_all_.resize(n_pcs_spin_);
618 Z_all_.resize(n_pcs_spin_);
622 std::map< std::string, PCS_file_data >::iterator it;
633 for ( it = P_f_a_d.begin(); it != P_f_a_d.end(); ++it ) {
634 filename = it->first;
637 n_lanthanides_ = n_lanthanides_ + 1;
638 TR_pcs_d <<
"Filename " << filename <<std::endl;
645 for ( it2 = file_PCS_d_l_a.begin(); it2 != file_PCS_d_l_a.end(); ++it2 ){
646 bool use_residue =
false;
648 if ( it2->residue_num() > exclude_residues.size() ) {
651 if ( exclude_residues[it2->residue_num()] == false ) {
656 if (use_residue ==
true) {
657 PCS_d_l_a.push_back(*it2);
664 for ( it2 = PCS_d_l_a.begin(); it2 != PCS_d_l_a.end(); ++it2 ){
665 P_l_d_temp = &(*it2);
666 index = where_is_line(*P_l_d_temp);
668 PCS_data_line_all_spin_.push_back(*it2);
669 n_pcs_spin_ = n_pcs_spin_ + 1;
677 PCS_data_per_lanthanides_all_.push_back(P_d_p_l);
679 TR_pcs_d <<
"Total spin independent: " << n_pcs_spin_ << std::endl;
681 A_all_.resize(n_pcs_spin_);
682 for(i = 1; i <= n_pcs_spin_; i++){
683 (A_all_[i]).resize(5);
685 X_all_.resize(n_pcs_spin_);
686 Y_all_.resize(n_pcs_spin_);
687 Z_all_.resize(n_pcs_spin_);
693 return (n_lanthanides_);
715 out <<
"n independent spins in total: " << P_d.
n_pcs_spin_ << std::endl;
726 out << std::setprecision(4) << std::endl;
727 out <<
" Filename : " << PCS_d_p_l.
get_filename() << std::endl;
728 out <<
" Number of pcs : " << PCS_d_p_l.
get_n_pcs() << std::endl;
729 out <<
" b vector (pcs values) : " << std::endl;
731 for ( i = 1; i <= PCS_d_p_l.
get_n_pcs(); ++i){
732 out <<
" " << std::setw(4) << i <<
":"<< std::setw(10) <<PCS_d_p_l.
fstyle_b_(i) << std::endl;
736 out <<
" A_index : " << std::endl;
737 for ( i = 1; i <= PCS_d_p_l.
get_n_pcs(); ++i){
738 out <<
" " << std::setw(4) << i <<
":" << std::setw(4) <<PCS_d_p_l.
A_index_[i];
743 out <<
" Matrix A:"<< std::endl;
744 for( i = 1; i <= PCS_d_p_l.
n_pcs_ ; ++i ){
745 out <<
" " << std::setw(4) << i <<
":";
746 for (j = 1; j <= 5; ++j){
747 out <<
" " << std::setw(12) << PCS_d_p_l.
fstyle_A_( i, j);