20 #include <utility/exit.hh>
26 #include <utility/vector1.hh>
44 dynamic_cast< ChemicalShiftSequence * > ( seq1() )
47 dynamic_cast< ChemicalShiftSequence * > ( seq2() )
50 runtime_assert( pos1 <= prof1->length() );
51 runtime_assert( pos2 <= prof2->length() );
52 runtime_assert( prof1->prof_row(pos1).size() == prof2->prof_row(pos2).size() );
61 Real const a(2),
b(4);
63 Size n_aa( prof1->prof_row(pos1).size() );
66 for (
Size i = 1; i <= n_aa; ++i ) {
67 Real const & q_shift( prof1->prof_row(pos1)[i] );
68 Real const & v_shift( prof2->prof_row(pos2)[i] );
69 Real const & v_sigma( prof2->sigma(pos2,i) );
72 Real sig_diff(std::abs((q_shift - v_shift) / v_sigma ));
73 Real sigmoid_diff( 1 / ( 1 + exp((a*sig_diff)-b) ) );
83 score += sigmoid_diff;
88 score = ( score / count ) * n_aa;