39 FILE* file = fopen( name,
"r" );
43 std::map<std::string,std::string> options;
47 while (fscanf( file,
"%s %s", key, value ) == 2)
48 options[ key ] = std::string( value );
60 std::map<std::string,std::string> options;
61 options[
"match"] = std::string(
"1");
62 options[
"mm-penalty-min"] = std::string(
"3");
63 options[
"mm-penalty-max"] = std::string(
"3");
64 options[
"N-penalty-min"] = std::string(
"3");
65 options[
"N-penalty-max"] = std::string(
"3");
66 options[
"score-min-const"] = std::string(
"37.0f");
67 options[
"score-min-coeff"] = std::string(
"0.3f");
68 options[
"N-ceil-const"] = std::string(
"2.0f");
69 options[
"N-ceil-coeff"] = std::string(
"0.1f");
70 options[
"read-gap-const"] = std::string(
"11");
71 options[
"read-gap-coeff"] = std::string(
"4");
72 options[
"ref-gap-const"] = std::string(
"11");
73 options[
"ref-gap-coeff"] = std::string(
"4");
74 options[
"gap-free"] = std::string(
"5");
83 std::map<std::string,std::string> options;
84 options[
"match"] = std::string(
"2");
85 options[
"mm-penalty-min"] = std::string(
"2");
86 options[
"mm-penalty-max"] = std::string(
"6");
87 options[
"N-penalty-min"] = std::string(
"1");
88 options[
"N-penalty-max"] = std::string(
"1");
89 options[
"score-min-const"] = std::string(
"0.0f");
90 options[
"score-min-coeff"] = std::string(
"10.0f");
91 options[
"score-min-type"] = std::string(
"log");
92 options[
"N-ceil-const"] = std::string(
"0.0f");
93 options[
"N-ceil-coeff"] = std::string(
"0.15f");
94 options[
"read-gap-const"] = std::string(
"5");
95 options[
"read-gap-coeff"] = std::string(
"3");
96 options[
"ref-gap-const"] = std::string(
"5");
97 options[
"ref-gap-coeff"] = std::string(
"3");
98 options[
"gap-free"] = std::string(
"5");
109 m_score_min(
SimpleFunc::LinearFunc, -0.6f, -0.6f ),
110 m_n_ceil_const( 0.0f ),
111 m_n_ceil_coeff( 0.15f ),
112 m_read_gap_const( 5 ),
113 m_read_gap_coeff( 3 ),
114 m_ref_gap_const( 5 ),
115 m_ref_gap_coeff( 3 ),
131 const std::map<std::string,std::string>& options,
133 m_score_min( min_score_function(options) ),
134 m_n_ceil_const(
float_option( options,
"N-ceil-const", 0.0f ) ),
135 m_n_ceil_coeff(
float_option( options,
"N-ceil-coeff", 0.15f ) ),
136 m_read_gap_const(
int_option( options,
"read-gap-const", 5 ) ),
137 m_read_gap_coeff(
int_option( options,
"read-gap-coeff", 3 ) ),
138 m_ref_gap_const(
int_option( options,
"ref-gap-const", 5 ) ),
139 m_ref_gap_coeff(
int_option( options,
"ref-gap-coeff", 3 ) ),
140 m_gap_free(
int_option( options,
"gap-free", 5 ) ),
141 m_match( match_cost(options) ),
142 m_mmp( mm_cost(options) ),
143 m_np( n_cost(options) ),
144 m_monotone( m_match(0) == 0 ),
154 if (strcmp( type.c_str(),
"log" ) == 0)
156 else if (strcmp( type.c_str(),
"sqrt" ) == 0)
165 SimpleFunc SmithWatermanScoringScheme<MMCost,NCost>::min_score_function(
const std::map<std::string,std::string>& options)
168 func_type(
string_option( options,
"score-min-type",
"linear" ) ),
175 typename SmithWatermanScoringScheme<MMCost,NCost>::MatchCost SmithWatermanScoringScheme<MMCost,NCost>::match_cost(
const std::map<std::string,std::string>& options)
177 const int match_cost =
int_option( options,
"match", 0 );
178 return MatchCost( match_cost, match_cost );
183 MMCost SmithWatermanScoringScheme<MMCost,NCost>::mm_cost(
const std::map<std::string,std::string>& options)
185 const int mmp_min =
int_option( options,
"mm-penalty-min", 2 );
186 const int mmp_max =
int_option( options,
"mm-penalty-max", 6 );
187 return MMCost( mmp_min, mmp_max );
192 NCost SmithWatermanScoringScheme<MMCost,NCost>::n_cost(
const std::map<std::string,std::string>& options)
194 const int np_min =
int_option( options,
"N-penalty-min", 1 );
195 const int np_max =
int_option( options,
"N-penalty-max", 1 );
196 return NCost( np_min, np_max );