NCBI C++ ToolKit
gumbel_params_unit_test.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: gumbel_params_unit_test.cpp 52086 2011-11-28 15:07:12Z boratyng $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Greg Boratyn
27 *
28 * File Description:
29 * Unit tests for Gumbel parameters calculation library.
30 *
31 *
32 * ===========================================================================
33 */
34 
35 #include <ncbi_pch.hpp>
36 #include <corelib/ncbicfg.h>
37 
41 
42 // This macro should be defined before inclusion of test_boost.hpp in all
43 // "*.cpp" files inside executable except one. It is like function main() for
44 // non-Boost.Test executables is defined only in one *.cpp file - other files
45 // should not include it. If NCBI_BOOST_NO_AUTO_TEST_MAIN will not be defined
46 // then test_boost.hpp will define such "main()" function for tests.
47 //
48 // Usually if your unit tests contain only one *.cpp file you should not
49 // care about this macro at all.
50 //
51 //#undef NCBI_BOOST_NO_AUTO_TEST_MAIN
52 
53 
54 // This header must be included before all Boost.Test headers
55 #include <corelib/test_boost.hpp>
56 
57 #ifndef SKIP_DOXYGEN_PROCESSING
58 
59 
61 USING_SCOPE(blast);
62 
63 static CRef<CGeneralScoreMatrix> s_ReadScoreMatrix(const string& filename)
64 {
65  CNcbiIfstream istr(filename.c_str());
66  BOOST_REQUIRE(istr);
67  vector<Int4> scores;
68  while (!istr.eof()) {
69  Int4 val;
70  istr >> val;
71  scores.push_back(val);
72  }
74  return smat;
75 }
76 
77 static void s_ReadResidueProbs(const string& filename,
78  vector<double>& probs)
79 {
80  probs.clear();
81 
82  CNcbiIfstream istr(filename.c_str());
83  BOOST_REQUIRE(istr);
84  while (!istr.eof()) {
85  double val;
86  istr >> val;
87  probs.push_back(val);
88  }
89 }
90 
91 static void s_ReadRandParams(const string& filename,
93 {
94 
95  CNcbiIfstream istr(filename.c_str());
96  BOOST_REQUIRE(istr);
97 
98  Int4 param_val;
99 
100  istr >> param_val;
101  params->SetRandomSeed(param_val);
102 
103  int num_params;
104 
105  istr >> num_params;
106  vector<Int4>& fs_prelim = params->SetFirstStagePrelimReNumbers();
107  for(int i=0;i < num_params && !istr.eof();i++) {
108  istr >> param_val;
109  fs_prelim.push_back(param_val);
110  }
111 
112  istr >> num_params;
113  vector<Int4>& prelim = params->SetPrelimReNumbers();
114  for(int i=0;i < num_params && !istr.eof();i++) {
115  istr >> param_val;
116  prelim.push_back(param_val);
117  }
118 
119  istr >> num_params;
120  vector<Int4>& killing = params->SetPrelimReNumbersKilling();
121  for(int i=0;i < num_params && !istr.eof();i++) {
122  istr >> param_val;
123  killing.push_back(param_val);
124  }
125 
126  istr >> param_val;
127  params->SetTotalReNumber(param_val);
128 
129  istr >> param_val;
130  params->SetTotalReNumberKilling(param_val);
131 }
132 
137 {
138  double mult = NCBI_GetCheckTimeoutMult();
139  opts->SetMaxCalcTime(time * mult);
140  BOOST_REQUIRE(opts->Validate());
142  if (params.Empty()) {
143  calc.Reset(new CGumbelParamsCalc(opts));
144  }
145  else {
146  calc.Reset(new CGumbelParamsCalc(opts, params));
147  }
148 
149  try {
150  calc->Run();
151  }
152  catch (CGumbelParamsException& e) {
154  BOOST_REQUIRE_MESSAGE(false, (string)"Time out with threshold "
155  + NStr::DoubleToString(time) + "s and "
156  "multiplier " + NStr::DoubleToString(mult));
157  }
158  }
159 
160  return calc->GetResult();
161 }
162 
163 
164 BOOST_AUTO_TEST_CASE(TestGumbelParamsOptionsFactory)
165 {
166  // Options created by CGumbelParamsOptionsFactory pass validation
167  // and do not cause errors in computation
170  // make sure that the unit test does not fail because time limit is exceeded
172  BOOST_REQUIRE(!result.Empty());
173 
175  CRef<CGeneralScoreMatrix> smat = s_ReadScoreMatrix("data/blosum62.txt");
176  vector<double> probs;
177  s_ReadResidueProbs("data/freqs.txt", probs);
178  opts->SetScoreMatrix(smat);
179  opts->SetSeq1ResidueProbs(probs);
180  opts->SetSeq2ResidueProbs(probs);
181  // make sure that the unit test does not fail because time limit is exceeded
182 
183  result = s_CalcGumbelParams(opts, 2.0);
184  BOOST_REQUIRE(!result.Empty());
185 }
186 
187 // Checks whether CGumbelParamsOptions::Validate() throws or reports warning
188 // when it should
189 BOOST_AUTO_TEST_CASE(TestValidateGumbelParamsOptions)
190 {
191  // Incorrect number of elements in residue probabilities array for seq1
192  // does not pass validation
195  opts->SetSeq1ResidueProbs(vector<double>(1));
196  BOOST_REQUIRE_THROW(opts->Validate(), CGumbelParamsException);
197 
198  // Incorrect number of elements in residue probabilities array for seq2
199  // does not pass validation
201  opts->SetSeq2ResidueProbs(vector<double>(1));
202  BOOST_REQUIRE_THROW(opts->Validate(), CGumbelParamsException);
203 
204  // Incorrect size of the score matrix does not pass validation
208  opts->SetScoreMatrix(smat);
209  BOOST_REQUIRE_THROW(opts->Validate(), CGumbelParamsException);
210 
212  vector<double> probs = opts->GetSeq1ResidueProbs();
213  vector<double> probs_test(probs);
214 
215  // Residue probabilities must be positive or zero
216  probs_test[2] = -0.1;
217  opts->SetSeq1ResidueProbs(probs_test);
218  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
219  opts->SetSeq1ResidueProbs(probs);
220  opts->SetSeq2ResidueProbs(probs_test);
221  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
222  opts->SetSeq2ResidueProbs(probs);
223 
224  // Sum of residue probabilities must be equal (roughly) to 1.
225  // Difference of 0.2 is currently allowed due to rounding
226  probs_test[2] = probs[2] + 0.2;
227  opts->SetSeq1ResidueProbs(probs_test);
228  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
229  opts->SetSeq1ResidueProbs(probs);
230  opts->SetSeq2ResidueProbs(probs_test);
231  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
232  opts->SetSeq2ResidueProbs(probs);
233 
234 
235  Int4 orig_param_val;
236  double orig_param_d;
238 
239  // Gap panelty < 0 does not pass validation
240  orig_param_val = opts->GetGapOpening();
241  opts->SetGapOpening(-1);
242  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
243  opts->SetGapOpening(orig_param_val);
244 
245  // Gap extension < 0 does not pass validation
246  orig_param_val = opts->GetGapExtension();
247  opts->SetGapExtension(-1);
248  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
249  opts->SetGapExtension(orig_param_val);
250 
251  // Lambda accuracy < 0 does not pass validation
252  orig_param_d = opts->GetLambdaAccuracy();
253  opts->SetLambdaAccuracy(-1.0);
254  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
255  opts->SetLambdaAccuracy(orig_param_d);
256 
257  // K accuracy < 0 does not pass validation
258  orig_param_d = opts->GetKAccuracy();
259  opts->SetKAccuracy(-1.0);
260  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
261  opts->SetKAccuracy(orig_param_d);
262 
263  // Max calculation time < 0 does not pass validation
264  orig_param_d = opts->GetMaxCalcTime();
265  opts->SetMaxCalcTime(-1.0);
266  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
267  opts->SetMaxCalcTime(orig_param_d);
268 
269  // Max calculation memory < 0 does not pass validation
270  orig_param_d = opts->GetMaxCalcMemory();
271  opts->SetMaxCalcMemory(-1.0);
272  BOOST_CHECK_THROW(opts->Validate(), CGumbelParamsException);
273  opts->SetMaxCalcMemory(orig_param_d);
274 
275  // Warnings
276 
277  // Lambda accuracy out of the range 0.001 - 0.01 generates a warning
278  // message
279  orig_param_d = opts->GetLambdaAccuracy();
280  opts->SetLambdaAccuracy(0.0001);
281  BOOST_CHECK(!opts->Validate());
282  BOOST_CHECK(opts->IsMessage());
283  BOOST_CHECK(opts->GetMessages().size() > 0);
284  opts->SetLambdaAccuracy(orig_param_d);
285 
286  // K accuracy out of the range 0.001 - 0.01 generates a warning message
287  orig_param_d = opts->GetKAccuracy();
288  opts->SetLambdaAccuracy(0.0001);
289  BOOST_CHECK(!opts->Validate());
290  BOOST_CHECK(opts->IsMessage());
291  BOOST_CHECK(opts->GetMessages().size() > 0);
292  opts->SetKAccuracy(orig_param_d);
293 
294  // Max calculation time < 1.0 generates a warning message
295  orig_param_d = opts->GetMaxCalcTime();
296  opts->SetMaxCalcTime(0.1);
297  BOOST_CHECK(!opts->Validate());
298  BOOST_CHECK(opts->IsMessage());
299  BOOST_CHECK(opts->GetMessages().size() > 0);
300  opts->SetMaxCalcTime(orig_param_d);
301 
302  // Max allowed memory < 1.0 generates a warning message
303  orig_param_d = opts->GetMaxCalcMemory();
304  opts->SetMaxCalcMemory(0.1);
305  BOOST_CHECK(!opts->Validate());
306  BOOST_CHECK(opts->IsMessage());
307  BOOST_CHECK(opts->GetMessages().size() > 0);
308  opts->SetMaxCalcMemory(orig_param_d);
309 }
310 
311 
312 // Checks whether CGumbelScorePValuesOptions::Validate() throws or reports
313 // warnigns when it should
314 BOOST_AUTO_TEST_CASE(TestValidateScorePValuesOptions)
315 {
318 
319  // make sure that the unit test does not fail because time limit is exceeded
320  CRef<CGumbelParamsResult> gp_result = s_CalcGumbelParams(gp_opts, 2.0);
321  BOOST_REQUIRE(!gp_result.Empty());
322 
323  // Reasonable options pass validation
325  200, 300,
326  gp_result));
327  BOOST_REQUIRE(opts->Validate());
328 
329  // Options object cannot be created with empty gumbel params result
330  BOOST_REQUIRE_THROW(opts.Reset(new CScorePValuesOptions(100, 200, 200, 300,
333 
334  // Min score > Max score does not pass validation
335  opts.Reset(new CScorePValuesOptions(200, 150, 200, 300, gp_result));
336  BOOST_REQUIRE_THROW(opts->Validate(), CScorePValuesException);
337 
338  // Sequence 1 length <= 0 does not pass validation
339  opts.Reset(new CScorePValuesOptions(100, 200, -200, 300, gp_result));
340  BOOST_REQUIRE_THROW(opts->Validate(), CScorePValuesException);
341 
342  // Sequence 2 length <= 0 does not pass validation
343  opts.Reset(new CScorePValuesOptions(100, 200, 200, -300, gp_result));
344  BOOST_REQUIRE_THROW(opts->Validate(), CScorePValuesException);
345 }
346 
347 
348 // Check Gumbel params and compare with the reference file
349 static void s_CheckGumbelParams(const SGumbelParams& gumbel_params,
350  const string& file)
351 {
352  // Gumbel parameters errors are positive
353  BOOST_REQUIRE(gumbel_params.lambda_error >= 0.0);
354  BOOST_REQUIRE(gumbel_params.K_error >= 0.0);
355  BOOST_REQUIRE(gumbel_params.C_error > 0.0);
356  BOOST_REQUIRE(gumbel_params.sigma_error >= 0.0);
357  BOOST_REQUIRE(gumbel_params.alpha_i_error >= 0.0);
358  BOOST_REQUIRE(gumbel_params.alpha_j_error >= 0.0);
359  BOOST_REQUIRE(gumbel_params.ai_error >= 0.0);
360  BOOST_REQUIRE(gumbel_params.aj_error >= 0.0);
361 
362  // compare Gumbel parameters values with reference
363  CNcbiIfstream istr_g(file.c_str());
364  BOOST_REQUIRE(istr_g.is_open());
365 
366  double target;
367 
368  istr_g >> target;
369  BOOST_CHECK_CLOSE(target, gumbel_params.lambda, 0.001);
370 
371  istr_g >> target;
372  BOOST_CHECK_CLOSE(target, gumbel_params.lambda_error, 0.001);
373 
374  istr_g >> target;
375  BOOST_CHECK_CLOSE(target, gumbel_params.K, 0.001);
376 
377  istr_g >> target;
378  BOOST_CHECK_CLOSE(target, gumbel_params.K_error, 0.001);
379 
380  istr_g >> target;
381  BOOST_CHECK_CLOSE(target, gumbel_params.C, 0.001);
382 
383  istr_g >> target;
384  BOOST_CHECK_CLOSE(target, gumbel_params.C_error, 0.001);
385 
386  istr_g >> target;
387  BOOST_CHECK_CLOSE(target, gumbel_params.sigma, 0.001);
388 
389  istr_g >> target;
390  BOOST_CHECK_CLOSE(target, gumbel_params.sigma_error, 0.001);
391 
392  istr_g >> target;
393  BOOST_CHECK_CLOSE(target, gumbel_params.alpha_i, 0.001);
394 
395  istr_g >> target;
396  BOOST_CHECK_CLOSE(target, gumbel_params.alpha_i_error, 0.001);
397 
398  istr_g >> target;
399  BOOST_CHECK_CLOSE(target, gumbel_params.alpha_j, 0.001);
400 
401  istr_g >> target;
402  BOOST_CHECK_CLOSE(target, gumbel_params.alpha_j_error, 0.001);
403 
404  istr_g >> target;
405  BOOST_CHECK_CLOSE(target, gumbel_params.ai, 0.001);
406 
407  istr_g >> target;
408  BOOST_CHECK_CLOSE(target, gumbel_params.ai_error, 0.001);
409 
410  istr_g >> target;
411  BOOST_CHECK_CLOSE(target, gumbel_params.aj, 0.001);
412 
413  istr_g >> target;
414  BOOST_CHECK_CLOSE(target, gumbel_params.aj_error, 0.001);
415 
416  istr_g.close();
417 
418 }
419 
420 // Check p-values and compare with the referece file
421 void s_CheckPValues(const CRef<CScorePValues> pv, const string& filename)
422 {
423  BOOST_REQUIRE(!pv.Empty());
424 
425  const vector<CScorePValues::TPValue>& pvalues = pv->GetPValues();
426  const vector<CScorePValues::TPValue>& errors = pv->GetErrors();
427 
428  // P-values and errors arrays are of the same length
429  BOOST_REQUIRE_EQUAL(pvalues.size(), errors.size());
430 
431  // P-values and errors are positive
432  for (size_t i=0;i < pvalues.size();i++) {
433  BOOST_REQUIRE(pvalues[i] >= 0.0);
434  BOOST_REQUIRE(errors[i] >= 0.0);
435  }
436 
437  // Compare p-values and error to the reference values
438  CNcbiIfstream istr_pv(filename.c_str());
439  BOOST_REQUIRE(istr_pv.is_open());
440  for (size_t j=0;j < pvalues.size();j++) {
441 
442  double target;
443 
444  BOOST_REQUIRE(!istr_pv.eof());
445 
446  istr_pv >> target;
447  BOOST_REQUIRE_CLOSE(pvalues[j], target, 1.0);
448 
449  istr_pv >> target;
450  BOOST_REQUIRE_CLOSE(errors[j], target, 1.0);
451  }
452 }
453 
454 
455 // Test calculation of Gumbel Parameters and Pvalues for Gapless alignment
456 BOOST_AUTO_TEST_CASE(TestGumbelParamsAndPvaluesCalcForGaplessAlignment)
457 {
458  // create gumbel params options
461 
462  // set score matrix and backgroud residue frequencies
463  CRef<CGeneralScoreMatrix> smat = s_ReadScoreMatrix("data/blosum62.txt");
464  vector<double> probs;
465  s_ReadResidueProbs("data/freqs.txt", probs);
466  opts->SetScoreMatrix(smat);
467  opts->SetSeq1ResidueProbs(probs);
468  opts->SetSeq2ResidueProbs(probs);
469  opts->SetKAccuracy(0.005);
470 
471  // set gapless alignment
472  opts->SetGapped(false);
473 
474  BOOST_REQUIRE(opts->Validate());
475 
476  // set score boundaries and sequence lengths for pvalues calculation
477  const int min_score = 245;
478  const int max_score = 255;
479  const int seq_len = 200;
480 
481  // calculate Gumbel parameters
483 
484  // Template input parameters always produce result
485  BOOST_REQUIRE(!result.Empty());
486 
487  const CGumbelParamsResult::SSbsArrays& sbs_arrays
488  = result->GetSbsArrays();
489 
490  // All sbs arrays in gumbel parameters results are of the same length
491  size_t ref_size = sbs_arrays.lambda_sbs.size();
492  BOOST_REQUIRE_EQUAL(sbs_arrays.K_sbs.size(), ref_size);
493  BOOST_REQUIRE_EQUAL(sbs_arrays.C_sbs.size(), ref_size);
494  BOOST_REQUIRE_EQUAL(sbs_arrays.sigma_sbs.size(), ref_size);
495  BOOST_REQUIRE_EQUAL(sbs_arrays.alpha_i_sbs.size(), ref_size);
496  BOOST_REQUIRE_EQUAL(sbs_arrays.alpha_j_sbs.size(), ref_size);
497  BOOST_REQUIRE_EQUAL(sbs_arrays.ai_sbs.size(), ref_size);
498  BOOST_REQUIRE_EQUAL(sbs_arrays.aj_sbs.size(), ref_size);
499 
500  const SGumbelParams& gumbel_params = result->GetGumbelParams();
501 
502  // check Gumbel parameters values and compare with reference
503  s_CheckGumbelParams(gumbel_params, "data/gumbel_params_gapless.txt");
504 
505  // compute score p-values
506  CRef<CScorePValuesOptions> pv_opts(new CScorePValuesOptions(min_score,
507  max_score, seq_len, seq_len, result));
508 
509  BOOST_REQUIRE(pv_opts->Validate());
510  CScorePValuesCalc pv_calc(pv_opts);
511  CRef<CScorePValues> pv = pv_calc.Run();
512 
513  // check p-values and compare with reference
514  s_CheckPValues(pv, "data/pvalues_gapless.txt");
515 }
516 
517 
518 // TO DO: Add a test for detecting linear regime - by catching exception
519 
520 BOOST_AUTO_TEST_CASE(TestGumbelParamsAndPvaluesCalcForGappedAlignment)
521 {
522  // Calculation results for template input sets correspond to template
523  // output
526 
527  CRef<CGeneralScoreMatrix> smat = s_ReadScoreMatrix("data/blosum62.txt");
528  vector<double> probs;
529  s_ReadResidueProbs("data/freqs.txt", probs);
530  opts->SetScoreMatrix(smat);
531  opts->SetSeq1ResidueProbs(probs);
532  opts->SetSeq2ResidueProbs(probs);
533  opts->SetKAccuracy(0.005);
534 
535  opts->SetGapped(true);
536 
537  BOOST_REQUIRE(opts->Validate());
538 
539  // Range boundaries and sequence length for score p-values calculation
540  const int min_score = 245;
541  const int max_score = 255;
542  const int seq_len = 200;
543 
544  for (int i=0;i < 8;i++) {
545  string param_file = (string)"data/rand_params_" + NStr::IntToString(i)
546  + ".txt";
547  string target_file = (string)"data/gumbel_params_gapped_"
548  + NStr::IntToString(i) + ".txt";
549  string pv_target_file = (string)"data/pvalues_gapped_"
550  + NStr::IntToString(i) + ".txt";
551 
553  params(new CGumbelParamsRandDiagnostics());
554 
555  s_ReadRandParams(param_file, params);
556 
558 
559  // Template input parameters always produce result
560  BOOST_REQUIRE(!result.Empty());
561 
562  const CGumbelParamsResult::SSbsArrays& sbs_arrays
563  = result->GetSbsArrays();
564 
565  // All sbs arrays in gumbel parameters results are of the same length
566  size_t ref_size = sbs_arrays.lambda_sbs.size();
567  BOOST_REQUIRE_EQUAL(sbs_arrays.K_sbs.size(), ref_size);
568  BOOST_REQUIRE_EQUAL(sbs_arrays.C_sbs.size(), ref_size);
569  BOOST_REQUIRE_EQUAL(sbs_arrays.sigma_sbs.size(), ref_size);
570  BOOST_REQUIRE_EQUAL(sbs_arrays.alpha_i_sbs.size(), ref_size);
571  BOOST_REQUIRE_EQUAL(sbs_arrays.alpha_j_sbs.size(), ref_size);
572  BOOST_REQUIRE_EQUAL(sbs_arrays.ai_sbs.size(), ref_size);
573  BOOST_REQUIRE_EQUAL(sbs_arrays.aj_sbs.size(), ref_size);
574 
575  // Gumbel parameters errors are positive
576  const SGumbelParams& gp = result->GetGumbelParams();
577  BOOST_REQUIRE(gp.lambda_error >= 0.0);
578  BOOST_REQUIRE(gp.K_error >= 0.0);
579  BOOST_REQUIRE(gp.C_error > 0.0);
580  BOOST_REQUIRE(gp.sigma_error >= 0.0);
581  BOOST_REQUIRE(gp.alpha_i_error >= 0.0);
582  BOOST_REQUIRE(gp.alpha_j_error >= 0.0);
583  BOOST_REQUIRE(gp.ai_error >= 0.0);
584  BOOST_REQUIRE(gp.aj_error >= 0.0);
585 
586  // Check Gumbel params and compare with reference
587  s_CheckGumbelParams(result->GetGumbelParams(), target_file);
588 
589  // Compute score p-values
590  CRef<CScorePValuesOptions> pv_opts(new CScorePValuesOptions(min_score,
591  max_score, seq_len, seq_len, result));
592 
593  // Gumbel params result passes p-values options validation
594  BOOST_REQUIRE(pv_opts->Validate());
595  CScorePValuesCalc pv_calc(pv_opts);
596  CRef<CScorePValues> pv = pv_calc.Run();
597 
598  // Checl p-values and compare with rewference
599  s_CheckPValues(pv, pv_target_file);
600 
601  }
602 }
603 
604 
605 #endif /* SKIP_DOXYGEN_PROCESSING */
Score matrix that can take any value.
Wrapper for Gumbel parameter calculation.
static CRef< CGumbelParamsOptions > CreateStandard20AAOptions(CGeneralScoreMatrix::EScoreMatrixName smat=CGeneralScoreMatrix::eBlosum62)
Creates standard options with score matrix and residue frequenceis for 20 aa alphabet.
static CRef< CGumbelParamsOptions > CreateBasicOptions(void)
Creates standard options with no score matrix or resiudie frequencies.
Options that control random values used in internal parts of Gumbel parameter calculation for gapped ...
vector< Int4 > & SetPrelimReNumbers(void)
Set preliminary realizations numbers.
vector< Int4 > & SetFirstStagePrelimReNumbers(void)
Set first stage preliminary realizations numbers.
void SetTotalReNumber(Int4 num)
Set total realizations number.
void SetRandomSeed(Uint4 val)
Set random seed.
void SetTotalReNumberKilling(Int4 num)
Set total realizations number killing.
vector< Int4 > & SetPrelimReNumbersKilling(void)
Set perliminary realizations numbers killing array.
CRef –.
Definition: ncbiobj.hpp:618
Wrapper for P-values calculation.
Definition: pvalues.hpp:193
CRef< CScorePValues > Run(void)
Calculate P-values.
Definition: pvalues.cpp:106
Input parameters for P-values calculation.
Definition: pvalues.hpp:50
const vector< TPValue > & GetPValues(void) const
Get p-values.
Definition: pvalues.hpp:169
const vector< TPValue > & GetErrors(void) const
Get errors for p-values calculation.
Definition: pvalues.hpp:179
string
Definition: cgiapp.hpp:687
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
Definition: ncbistr.hpp:5186
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5083
void s_CheckPValues(const CRef< CScorePValues > pv, const string &filename)
USING_SCOPE(blast)
static void s_CheckGumbelParams(const SGumbelParams &gumbel_params, const string &file)
BOOST_AUTO_TEST_CASE(TestGumbelParamsOptionsFactory)
static CRef< CGeneralScoreMatrix > s_ReadScoreMatrix(const string &filename)
static void s_ReadRandParams(const string &filename, CRef< CGumbelParamsRandDiagnostics > params)
static CRef< CGumbelParamsResult > s_CalcGumbelParams(CRef< CGumbelParamsOptions > opts, double time, CRef< CGumbelParamsRandDiagnostics > params=CRef< CGumbelParamsRandDiagnostics >())
static void s_ReadResidueProbs(const string &filename, vector< double > &probs)
FILE * file
int i
Defines access to miscellaneous global configuration settings.
double NCBI_GetCheckTimeoutMult(void)
Get multiplier for timeouts which depends on speed of the machine and tools application is running un...
Gumbel parameters and estimation errors.
Utility stuff for more convenient using of Boost.Test library.
else result
Definition: token2.c:20
Modified on Fri Dec 01 04:46:29 2023 by modify_doxy.py rev. 669887