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

Go to the SVN repository for this file.

1 /* $Id: blast_options_builder.cpp 94718 2021-09-02 13:45:48Z fongah2 $
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: Kevin Bealer
27 *
28 * ===========================================================================
29 */
30 
31 /// @file blast_options_builder.cpp
32 /// Defines the CBlastOptionsBuilder class
33 
34 #include <ncbi_pch.hpp>
37 
38 /** @addtogroup AlgoBlast
39  *
40  * @{
41  */
42 
45 BEGIN_SCOPE(blast)
46 
48 CBlastOptionsBuilder(const string & program,
49  const string & service,
50  CBlastOptions::EAPILocality locality,
51  bool ignore_unsupported_options)
52  : m_Program (program),
53  m_Service (service),
54  m_PerformCulling (false),
55  m_HspRangeMax (0),
56  m_QueryRange (TSeqRange::GetEmpty()),
57  m_Locality (locality),
58  m_IgnoreUnsupportedOptions(ignore_unsupported_options),
59  m_ForceMbIndex (false)
60 {
61 }
62 
64 CBlastOptionsBuilder::ComputeProgram(const string & program,
65  const string & service)
66 {
67  string p = program;
68  string s = service;
69 
70  NStr::ToLower(p);
71  NStr::ToLower(s);
72 
73  // a. is there a program for phiblast?
74  // b. others, like disco?
75 
76  bool found = false;
77 
78  if (p == "blastp") {
79  if (s == "rpsblast") {
80  p = "rpsblast";
81  found = true;
82  } else if (s == "psi") {
83  p = "psiblast";
84  found = true;
85  } else if (s == "phi") {
86  // phi is just treated as a blastp here
87  found = true;
88  } else if (s == "delta_blast") {
89  p = "deltablast";
90  found = true;
91  }
92  else if (s == "indexed") {
93  found = true;
94  }
95  } else if (p == "blastn") {
96  if (s == "megablast") {
97  p = "megablast";
98  found = true;
99  }
100  if (s == "vecscreen") {
101  p = "vecscreen";
102  found = true;
103  }
104  if ((s == "sra") || (s == "wgs") || (s=="indexed")) {
105  found = true;
106  }
107  } else if (p == "tblastn") {
108  if (s == "rpsblast") {
109  p = "rpstblastn";
110  found = true;
111  } else if (s == "psi") {
112  p = "psitblastn";
113  found = true;
114  }
115  if ((s == "sra") || (s == "wgs")) {
116  found = true;
117  }
118  } else if (p == "tblastx") {
119  found = true;
120  } else if (p == "blastx") {
121  if (s == "rpsblast") {
122  p = "rpstblastn";
123  found = true;
124  }
125  }
126 
127  if (!found && !(s=="plain" || s=="multi_blast")) {
128  string msg = "Unsupported combination of program (";
129  msg += program;
130  msg += ") and service (";
131  msg += service;
132  msg += ").";
133 
134  NCBI_THROW(CBlastException, eInvalidArgument, msg);
135  }
136 
137  return ProgramNameToEnum(p);
138 }
139 
142  objects::CBlast4_parameter & p)
143 {
144  const CBlast4_value & v = p.GetValue();
145 
146  // Note that this code does not attempt to detect or repair
147  // inconsistencies; since this request has already been processed
148  // by SplitD, the results are assumed to be correct, for now.
149  // This will remain so unless options validation code becomes
150  // available, in which case it could be used by this code. This
151  // could be considered as a potential "to-do" item.
152 
153  if (! p.CanGetName() || p.GetName().empty()) {
155  eInvalidArgument,
156  "Option has no name.");
157  }
158 
159  string nm = p.GetName();
160 
161  bool found = true;
162 
163  // This switch is not really necessary. I wanted to break things
164  // up for human consumption. But as long as I'm doing that, I may
165  // as well use a performance-friendly paragraph marker.
166 
167  CBlastOptions & bo = opts.SetOptions();
168 
169  switch(nm[0]) {
170  case 'B':
173  } else if (CBlast4Field::Get(eBlastOpt_BestHitOverhang).Match(p)) {
174  bo.SetBestHitOverhang(v.GetReal());
175  } else {
176  found = false;
177  }
178  break;
179 
180  case 'C':
183  bo.SetCompositionBasedStats(adjmode);
184  } else if (CBlast4Field::Get(eBlastOpt_Culling).Match(p)) {
187  bo.SetCullingLimit(v.GetInteger());
189  opts.SetCutoffScore(v.GetInteger());
190  } else {
191  found = false;
192  }
193  break;
194 
195  case 'D':
198  } else if (CBlast4Field::Get(eBlastOpt_DbLength).Match(p)) {
199  opts.SetDbLength(v.GetBig_integer());
214  } else {
215  found = false;
216  }
217  break;
218 
219  case 'E':
223  m_EntrezQuery = v.GetString();
225  || p.GetName() == "EvalueThreshold") {
226  if (v.IsReal()) {
227  opts.SetEvalueThreshold(v.GetReal());
228  } else if (v.IsCutoff() && v.GetCutoff().IsE_value()) {
230  } else {
231  string msg = "EvalueThreshold has unsupported type.";
232  NCBI_THROW(CBlastException, eInvalidArgument, msg);
233  }
234  } else {
235  found = false;
236  }
237  break;
238 
239  case 'F':
241  opts.SetFilterString(v.GetString().c_str(), true); /* NCBI_FAKE_WARNING */
242  } else if (CBlast4Field::Get(eBlastOpt_FinalDbSeq).Match(p)) {
243  m_FinalDbSeq = v.GetInteger();
244  } else if (CBlast4Field::Get(eBlastOpt_FirstDbSeq).Match(p)) {
245  m_FirstDbSeq = v.GetInteger();
246  } else if (CBlast4Field::Get(eBlastOpt_ForceMbIndex).Match(p)) {
248  } else {
249  found = false;
250  }
251  break;
252 
253  case 'G':
256  } else if (CBlast4Field::Get(eBlastOpt_GapOpeningCost).Match(p)) {
258  } else if (CBlast4Field::Get(eBlastOpt_GiList).Match(p)) {
259  #ifdef NCBI_STRICT_GI
260  const list<int>& int_list = v.GetInteger_list();
261  list<TGi> gi_list;
262  ITERATE ( list<int>, it, int_list ) {
263  Uint4 gi_v = (Uint4) *it;
264  gi_list.push_back(GI_FROM(Uint4, gi_v));
265  }
266  m_GiList = gi_list;
267  #elif defined(NCBI_INT8_GI)
268  if(v.IsBig_integer_list()) {
270  }
271  else {
272  const list<int>& int_list = v.GetInteger_list();
273  list<TGi> gi_list;
274  ITERATE ( list<int>, it, int_list ) {
275  Uint4 gi_v = (Uint4) *it;
276  gi_list.push_back(GI_FROM(Uint4, gi_v));
277  }
278  m_GiList = gi_list;
279  }
280  #else
282  #endif
286  bo.SetGapTrigger(v.GetReal());
288  bo.SetGapXDropoff(v.GetReal());
293  (v.GetInteger()));
294  } else {
295  found = false;
296  }
297  break;
298 
299  case 'H':
301  opts.SetHitlistSize(v.GetInteger());
304  } else {
305  found = false;
306  }
307  break;
308 
309  case 'I':
314  } else {
315  found = false;
316  }
317  break;
318 
319  case 'L':
321  {
322  if (!m_IgnoreQueryMasks)
323  {
324  _ASSERT(v.IsQuery_mask());
325  CRef<CBlast4_mask> refMask(new CBlast4_mask);
326  refMask->Assign(v.GetQuery_mask());
327 
328  if (!m_QueryMasks.Have())
329  {
330  TMaskList listEmpty;
331  m_QueryMasks = listEmpty;
332  }
333  m_QueryMasks.GetRef().push_back(refMask);
334  }
335  } else if (CBlast4Field::Get(eBlastOpt_LongestIntronLength).Match(p)) {
337  } else {
338  found = false;
339  }
340  break;
341 
342  case 'M':
345  } else if (CBlast4Field::Get(eBlastOpt_MBTemplateType).Match(p)) {
347  } else if (CBlast4Field::Get(eBlastOpt_MatchReward).Match(p)) {
348  bo.SetMatchReward(v.GetInteger());
349  } else if (CBlast4Field::Get(eBlastOpt_MatrixName).Match(p)) {
350  bo.SetMatrixName(v.GetString().c_str());
351  } else if (CBlast4Field::Get(eBlastOpt_MatrixTable).Match(p)) {
352  // This is no longer used.
353  } else if (CBlast4Field::Get(eBlastOpt_MismatchPenalty).Match(p)) {
355  } else if (CBlast4Field::Get(eBlastOpt_MaskAtHash).Match(p)) {
356  bo.SetMaskAtHash(v.GetBoolean());
357  } else if (CBlast4Field::Get(eBlastOpt_MbIndexName).Match(p)) {
358  m_MbIndexName = v.GetString();
359  } else if (CBlast4Field::Get(eBlastOpt_MaxHspsPerSubject).Match(p)) {
361  }
362  else {
363  found = false;
364  }
365  break;
366 
367  case 'O':
370  } else {
371  found = false;
372  }
373  break;
374 
375  case 'N':
377  #ifdef NCBI_STRICT_GI
378  const list<int>& int_list = v.GetInteger_list();
379  list<TGi> gi_list;
380  ITERATE ( list<int>, it, int_list ) {
381  Uint4 gi_v = (Uint4) *it;
382  gi_list.push_back(GI_FROM(Uint4, gi_v));
383  }
384  m_NegativeGiList = gi_list;
385  #elif defined(NCBI_INT8_GI)
386  if (v.IsBig_integer_list()) {
388  }
389  else {
390  const list<int>& int_list = v.GetInteger_list();
391  list<TGi> gi_list;
392  ITERATE ( list<int>, it, int_list ) {
393  Uint4 gi_v = (Uint4) *it;
394  gi_list.push_back(GI_FROM(Uint4, gi_v));
395  }
396  m_NegativeGiList = gi_list;
397  }
398  #else
400  #endif
401  }
403 #ifdef NCBI_STRICT_TAX_ID
404  const list<int>& int_list = v.GetInteger_list();
405  list<TTaxId> taxid_list;
406  ITERATE(list<int>, it, int_list) {
407  taxid_list.push_back(TAX_ID_FROM(int, *it));
408  }
409  m_NegativeTaxidList = taxid_list;
410 #else
412 #endif
413  } else {
414  found = false;
415  }
416  break;
417 
418  case 'P':
419  if (CBlast4Field::Get(eBlastOpt_PHIPattern).Match(p)) {
420  if (v.GetString() != "") {
421  bool is_na = !! Blast_QueryIsNucleotide(bo.GetProgramType());
422  bo.SetPHIPattern(v.GetString().c_str(), is_na);
423  }
424  } else if (CBlast4Field::Get(eBlastOpt_PercentIdentity).Match(p)) {
425  opts.SetPercentIdentity(v.GetReal());
426  } else if (CBlast4Field::Get(eBlastOpt_PseudoCount).Match(p)) {
427  bo.SetPseudoCount(v.GetInteger());
428  } else {
429  found = false;
430  }
431  break;
432 
433  case 'Q':
436  }else if (CBlast4Field::Get(eBlastOpt_QueryCovHspPerc).Match(p)) {
437  opts.SetQueryCovHspPerc(v.GetReal());
438  } else {
439  found = false;
440  }
441  break;
442 
443  case 'R':
446  } else if (CBlast4Field::Get(eBlastOpt_RepeatFilteringDB).Match(p)) {
447  bo.SetRepeatFilteringDB(v.GetString().c_str());
448  } else if (CBlast4Field::Get(eBlastOpt_RequiredStart).Match(p)) {
450  } else if (CBlast4Field::Get(eBlastOpt_RequiredEnd).Match(p)) {
452  } else {
453  found = false;
454  }
455  break;
456 
457  case 'S':
459  // These encodings use the same values.
460  ENa_strand strand = (ENa_strand) v.GetStrand_type();
461  bo.SetStrandOption(strand);
463  bo.SetSegFiltering(v.GetBoolean());
476  } else {
477  found = false;
478  }
479  break;
480 
481  case 'T':
483 #ifdef NCBI_STRICT_TAX_ID
484  const list<int>& int_list = v.GetInteger_list();
485  list<TTaxId> taxid_list;
486  ITERATE(list<int>, it, int_list) {
487  taxid_list.push_back(TAX_ID_FROM(int, *it));
488  }
489  m_TaxidList = taxid_list;
490 #else
492 #endif
493  } else {
494  found = false;
495  }
496  break;
497  case 'U':
498  if (CBlast4Field::Get(eBlastOpt_GappedMode).Match(p)) {
499  // Notes: (1) this is the inverse of the corresponding
500  // blast4 concept (2) blast4 always returns this option
501  // regardless of whether the value matches the default.
502 
503  opts.SetGappedMode(! v.GetBoolean());
504  } else if (CBlast4Field::Get(eBlastOpt_UnifiedP).Match(p)) {
505  bo.SetUnifiedP(v.GetInteger());
506  } else if (CBlast4Field::Get(eBlastOpt_SubjectBestHit).Match(p)) {
507  bo.SetSubjectBestHit();
508  } else {
509  found = false;
510  }
511  break;
512 
513  case 'W':
516  } else if (CBlast4Field::Get(eBlastOpt_WindowSize).Match(p)) {
517  opts.SetWindowSize(v.GetInteger());
518  } else if (CBlast4Field::Get(eBlastOpt_WordSize).Match(p)) {
519  bo.SetWordSize(v.GetInteger());
520  } else if (CBlast4Field::Get(eBlastOpt_WordThreshold).Match(p)) {
522  } else {
523  found = false;
524  }
525  break;
526 
527  default:
528  found = false;
529  }
530 
531  if (! found) {
533  return;
534 
535  string msg = "Internal: Error processing option [";
536  msg += nm;
537  msg += "] type [";
538  msg += NStr::IntToString((int) v.Which());
539  msg += "].";
540 
542  eServiceNotAvailable,
543  msg);
544  }
545 }
546 
547 void
549  const TValueList * L)
550 {
551  if ( !L ) {
552  return;
553  }
554 
555  ITERATE(TValueList, iter, *L) {
556  CBlast4_parameter & p = *const_cast<CBlast4_parameter*>(& **iter);
557  x_ProcessOneOption(opts, p);
558  }
559 }
560 
562 {
563  CBlastOptions & bo = boh.SetOptions();
564 
565  if (m_PerformCulling) {
567  }
568  if (m_ForceMbIndex) {
570  }
571 }
572 
573 /// Finder class for matching CBlast4_parameter
575 {
577  : m_Target2Find(CBlast4Field::Get(opt_idx)) {}
579  return rhs.NotEmpty() ? m_Target2Find.Match(*rhs) : false;
580  }
581 private:
583 };
584 
585 EProgram
587  EProgram program,
588  const string & program_string)
589 {
590  if ( !L ) {
591  return program;
592  }
593 
594  // PHI-BLAST pattern trumps all other options
595  if (find_if(L->begin(), L->end(),
597  switch(program) {
598  case ePHIBlastn:
599  case eBlastn:
600  _TRACE("Adjusting program to phiblastn");
601  return ePHIBlastn;
602 
603  case ePHIBlastp:
604  case eBlastp:
605  _TRACE("Adjusting program to phiblastp");
606  return ePHIBlastp;
607 
608  default:
609  {
610  string msg = "Incorrect combination of option (";
612  msg += ") and program (";
613  msg += program_string;
614  msg += ")";
615 
617  eServiceNotAvailable,
618  msg);
619  }
620  break;
621  }
622  }
623 
624  ITERATE(TValueList, iter, *L) {
625  CBlast4_parameter & p = const_cast<CBlast4_parameter&>(**iter);
626  const CBlast4_value & v = p.GetValue();
627 
629  if (v.GetInteger() != 0) {
630  _TRACE("Adjusting program to discontiguous Megablast");
631  return eDiscMegablast;
632  }
633  } else if (CBlast4Field::Get(eBlastOpt_Web_StepNumber).Match(p) ||
637  ) {
638  // FIXME: should we handle DELTA-BLAST here too?
639  _TRACE("Adjusting program to psiblast");
640  return ePSIBlast;
641  }
642  }
643 
644  return program;
645 }
646 
647 /// Convenience function to merge all lists into one object to facilitate
648 /// invoking AdjustProgram
649 static void
650 s_MergeCBlast4_parameters(const objects::CBlast4_parameters* aopts,
651  const objects::CBlast4_parameters* popts,
652  const objects::CBlast4_parameters* fopts,
653  objects::CBlast4_parameters& retval)
654 {
655  retval.Set().clear();
656  if (aopts) {
657  retval.Set().insert(retval.Set().end(), aopts->Get().begin(), aopts->Get().end());
658  }
659  if (popts) {
660  retval.Set().insert(retval.Set().end(), popts->Get().begin(), popts->Get().end());
661  }
662  if (fopts) {
663  retval.Set().insert(retval.Set().end(), fopts->Get().begin(), fopts->Get().end());
664  }
665 }
666 
668 GetSearchOptions(const objects::CBlast4_parameters * aopts,
669  const objects::CBlast4_parameters * popts,
670  const objects::CBlast4_parameters* fopts,
671  string *task_name)
672 {
674  objects::CBlast4_parameters all_params;
675  s_MergeCBlast4_parameters(aopts, popts, fopts, all_params);
676  program = AdjustProgram(&all_params.Get(), program, m_Program);
677 
678  // Using eLocal allows more of the options to be returned to the user.
679 
682 
683  if (task_name != NULL)
684  *task_name = EProgramToTaskName(program);
685 
686  m_IgnoreQueryMasks = false;
687  x_ProcessOptions(*cboh, (aopts == NULL ? 0 : &aopts->Get()));
688 
690  x_ProcessOptions(*cboh, (popts == NULL ? 0 : &popts->Get()));
691 
692  x_ApplyInteractions(*cboh);
693 
694  return cboh;
695 }
696 
698 {
699  return m_EntrezQuery.Have();
700 }
701 
703 {
704  return m_EntrezQuery.Get();
705 }
706 
708 {
709  return m_FirstDbSeq.Have();
710 }
711 
713 {
714  return m_FirstDbSeq.Get();
715 }
716 
718 {
719  return m_FinalDbSeq.Have();
720 }
721 
723 {
724  return m_FinalDbSeq.Get();
725 }
726 
728 {
729  return m_GiList.Have();
730 }
731 
733 {
734  return m_GiList.Get();
735 }
736 
738 {
740 }
741 
743 {
744  return m_DbFilteringAlgorithmId.Get();
745 }
746 
748 {
750 }
751 
753 {
755 }
756 
758 {
759  return m_SubjectMaskingType.Have();
760 }
761 
763 {
764  return m_SubjectMaskingType.Get();
765 }
766 
767 
769 {
770  return m_NegativeGiList.Have();
771 }
772 
774 {
775  return m_NegativeGiList.Get();
776 }
777 
779 {
780  return m_QueryMasks.Have();
781 }
782 
785 {
786  return m_QueryMasks.Get();
787 }
788 
790 {
792 }
793 
795 {
796  return m_TaxidList.Have();
797 }
798 
800 {
801  return m_TaxidList.Get();
802 }
803 
805 {
806  return m_NegativeTaxidList.Have();
807 }
808 
810 {
811  return m_NegativeTaxidList.Get();
812 }
813 
814 
815 END_SCOPE(blast)
817 
818 /* @} */
ESubjectMaskingType
Define the possible subject masking types.
Definition: blast_def.h:235
EBlastPrelimGapExt
The algorithm to be used for preliminary gapped extensions.
EBlastTbackExt
The algorithm to be used for final gapped extensions with traceback.
Declares the CBlastOptionsBuilder class.
Boolean Blast_QueryIsNucleotide(EBlastProgramType p)
Returns true if the query is nucleotide.
Definition: blast_program.c:43
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
Definition: blast_types.hpp:56
@ eBlastn
Nucl-Nucl (traditional blastn)
Definition: blast_types.hpp:58
@ ePHIBlastn
Nucleotide PHI BLAST.
Definition: blast_types.hpp:70
@ eBlastp
Protein-Protein.
Definition: blast_types.hpp:59
@ ePHIBlastp
Protein PHI BLAST.
Definition: blast_types.hpp:69
@ ePSIBlast
PSI Blast.
Definition: blast_types.hpp:67
@ eDiscMegablast
Nucl-Nucl using discontiguous megablast.
Definition: blast_types.hpp:66
#define false
Definition: bool.h:36
Field properties for options in a Blast4 parameter list.
Definition: names.hpp:164
bool Match(const CBlast4_parameter &p) const
Match field name and type to parameter.
Definition: names.cpp:365
const string & GetName() const
Get field name (key).
Definition: names.cpp:355
static CBlast4Field & Get(EBlastOptIdx opt)
Definition: names.cpp:44
CBlast4_mask –.
Definition: Blast4_mask.hpp:66
CBlast4_parameter –.
CBlast4_value –.
Defines BLAST error codes (user errors included)
Class to build CBlastOptionsHandle from blast4 ASN objects.
Handle to the options to the BLAST algorithm.
Encapsulates ALL the BLAST algorithm's options.
CRef –.
Definition: ncbiobj.hpp:618
Exception class for the CRemoteBlast class.
ECompoAdjustModes
An collection of constants that specify all permissible modes of composition adjustment.
void SetPHIPattern(const char *pattern, bool is_dna)
int GetFirstDbSeq()
Get the OID range start point.
int m_HspRangeMax
How much culling to do.
void SetInclusionThreshold(double u)
void SetCompositionBasedStats(ECompoAdjustModes mode)
SOptional< int > m_DbFilteringAlgorithmId
The GI list (or none).
string m_Service
Service value for blast4 protocol.
void SetEvalueThreshold(double eval)
Sets EvalueThreshold.
void SetStrandOption(objects::ENa_strand s)
SOptional< list< TTaxId > > m_TaxidList
The tax id list (or none).
SOptional< string > m_EntrezQuery
The entreq query to use (or none).
void SetPseudoCount(int u)
SOptional< string > m_DbFilteringAlgorithmKey
bool HaveFirstDbSeq()
Check whether an OID range start point is specified.
void x_ProcessOneOption(CBlastOptionsHandle &opts, objects::CBlast4_parameter &p)
Apply the value of one option to the CBlastOptionsHandle.
objects::CBlast4_parameters::Tdata TValueList
List of name/value pairs.
int GetDbFilteringAlgorithmId()
Get the database filtering algorithm ID.
void SetQueryCovHspPerc(double p)
Sets QueryCovHspPerc.
void x_ProcessOptions(CBlastOptionsHandle &opts, const TValueList *L)
Apply the value of all options to the CBlastOptionsHandle.
void SetDbLength(Int8 len)
Sets DbLength.
SOptional< list< TGi > > m_NegativeGiList
The negative GI list (or none).
TSeqRange m_QueryRange
The range to restrict the query sequence(s)
void SetGapExtnAlgorithm(EBlastPrelimGapExt a)
void SetWindowMaskerTaxId(int taxid)
Sets the tax id to select an appropriate windowmasker database Conversion algorithm from tax id to da...
bool HaveNegativeTaxidList()
Check whether a negative tax id list is specified.
void SetOutOfFrameMode(bool m=true)
void SetDomainInclusionThreshold(double th)
SOptional< int > m_FirstDbSeq
The first OID to process (or none).
void SetDustFilteringLinker(int m)
static EProgram ComputeProgram(const string &program, const string &service)
Compute the EProgram value to use for this search.
void SetSegFilteringHicut(double m)
list< TGi > GetNegativeGiList()
Get the negative GI list.
void SetGapOpeningCost(int g)
ESubjectMaskingType GetSubjectMaskingType()
void SetQueryGeneticCode(int gc)
void SetEffectiveSearchSpace(Int8 eff)
Sets EffectiveSearchSpace.
void SetRepeatFilteringDB(const char *db)
Sets the repeat filtering database to use.
void SetGapTracebackAlgorithm(EBlastTbackExt a)
void SetIgnoreMsaMaster(bool val)
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
void SetWordThreshold(double w)
Sets WordThreshold.
bool HaveGiList()
Check whether a GI list is specified.
CBlastOptions & SetOptions()
Returns a reference to the internal options class which this object is a handle for.
void SetGapExtensionCost(int e)
SOptional< list< TGi > > m_GiList
The GI list (or none).
static void s_MergeCBlast4_parameters(const objects::CBlast4_parameters *aopts, const objects::CBlast4_parameters *popts, const objects::CBlast4_parameters *fopts, objects::CBlast4_parameters &retval)
Convenience function to merge all lists into one object to facilitate invoking AdjustProgram.
void SetSumStatisticsMode(bool m=true)
void SetUnifiedP(int u=0)
list< TTaxId > GetTaxidList()
Get the Tax list.
SOptional< ESubjectMaskingType > m_SubjectMaskingType
void SetUseIndex(bool use_index=true, const string &index_name="", bool force_index=false, bool old_style_index=false)
void SetDustFilteringWindow(int m)
void SetMismatchPenalty(int p)
bool HaveEntrezQuery()
Check whether an Entrez query is specified.
void SetGapXDropoffFinal(double x)
bool m_ForceMbIndex
Should loading of the megablast BLAST DB index be required?
list< TTaxId > GetNegativeTaxidList()
Get the negative tax id list.
TMaskList GetQueryMasks()
Get the query masks.
void SetMatrixName(const char *matrix)
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
static EProgram AdjustProgram(const TValueList *L, EProgram program, const string &program_string)
Adjust the EProgram based on option values.
void SetHitlistSize(int s)
Sets HitlistSize.
bool HasDbFilteringAlgorithmKey()
Check whether a database filtering algorithm key is specified.
void SetBestHitOverhang(double overhang)
void SetGapXDropoff(double x)
void SetWordSize(int ws)
SOptional< int > m_FinalDbSeq
The last OID to process (or none).
CBlastOptions::EAPILocality m_Locality
API Locality of resulting options.
void SetWindowSize(int ws)
Sets WindowSize.
int GetFinalDbSeq()
Get the OID range end point.
void SetSegFilteringLocut(double m)
list< TGi > GetGiList()
Get the GI list.
string EProgramToTaskName(EProgram p)
Convert a EProgram enumeration value to a task name (as those used in the BLAST command line binaries...
Definition: blast_aux.cpp:676
bool HasSubjectMaskingType()
Get Subject Maksing Type (soft/hard)
void SetIgnoreUnsupportedOptions(bool ignore)
Set the 'ignore unsupported options' flag.
SBlast4ParamFinder(EBlastOptIdx opt_idx)
T & GetRef()
Get the reference to the stored value.
bool m_IgnoreQueryMasks
Indicated that query masks have already been collected.
string m_Program
Program value for blast4 protocol.
void SetMBTemplateType(unsigned char type)
SOptional< TMaskList > m_QueryMasks
The query masking locations.
void SetGapTrigger(double g)
void SetDbGeneticCode(int gc)
void SetMBTemplateLength(unsigned char len)
void SetFilterString(const char *f, bool clear=true)
Sets FilterString.
CRef< CBlastOptionsHandle > GetSearchOptions(const objects::CBlast4_parameters *aopts, const objects::CBlast4_parameters *popts, const objects::CBlast4_parameters *fopts, string *task_name=NULL)
Build and return options as a CBlastOptionsHandle.
list< CRef< objects::CBlast4_mask > > TMaskList
List of Blast4 masks.
void SetMaskAtHash(bool val=true)
void SetBestHitScoreEdge(double score_edge)
void SetDustFilteringLevel(int m)
bool HaveNegativeGiList()
Check whether a negative GI list is specified.
EProgram ProgramNameToEnum(const std::string &program_name)
Map a string into an element of the ncbi::blast::EProgram enumeration (except eBlastProgramMax).
Definition: blast_aux.cpp:757
void SetDustFiltering(bool val=true)
void SetSegFiltering(bool val=true)
string m_MbIndexName
Which megablast BLAST DB index name to load.
void SetSegFilteringWindow(int m)
void x_ApplyInteractions(CBlastOptionsHandle &boh)
Apply values directly to BlastOptions object.
void SetGappedMode(bool m=true)
Sets GappedMode.
string GetEntrezQuery()
Get the Entrez query.
SOptional< list< TTaxId > > m_NegativeTaxidList
The negative tax id list (or none).
void SetPercentIdentity(double p)
Sets PercentIdentity.
void SetCutoffScore(int s)
Sets CutoffScore.
void SetSmithWatermanMode(bool m=true)
string GetDbFilteringAlgorithmKey()
Get the database filtering algorithm key.
bool operator()(const CRef< CBlast4_parameter > &rhs)
void SetLongestIntronLength(int l)
for linking HSPs with uneven gaps
bool m_PerformCulling
Whether to perform culling.
bool HasDbFilteringAlgorithmId()
Check whether a database filtering algorithm ID is specified.
bool HaveQueryMasks()
Check whether query masks are specified.
void SetMaxHspsPerSubject(int m)
void SetCullingLimit(int s)
bool m_IgnoreUnsupportedOptions
Should this class quietly ignore unsupported options.
bool Have()
Check whether the value has been set.
bool HaveFinalDbSeq()
Check whether an OID range end point is specified.
void SetRepeatFiltering(bool val=true)
Turns on repeat filtering using the default repeat database, namely kDefaultRepeatFilterDb.
void SetMatchReward(int r)
#define GI_FROM(T, value)
Definition: ncbimisc.hpp:1086
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define TAX_ID_FROM(T, value)
Definition: ncbimisc.hpp:1111
#define NULL
Definition: ncbistd.hpp:225
#define _TRACE(message)
Definition: ncbidbg.hpp:122
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
TThisType & SetToOpen(position_type toOpen)
Definition: range.hpp:175
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define USING_SCOPE(ns)
Use the specified namespace.
Definition: ncbistl.hpp:78
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
static string & ToLower(string &str)
Convert string to lower case – string& version.
Definition: ncbistr.cpp:405
TBig_integer GetBig_integer(void) const
Get the variant data.
const TCutoff & GetCutoff(void) const
Get the variant data.
bool IsQuery_mask(void) const
Check if variant Query_mask is selected.
TInteger GetInteger(void) const
Get the variant data.
const TValue & GetValue(void) const
Get the Value member data.
TBoolean GetBoolean(void) const
Get the variant data.
bool IsBig_integer_list(void) const
Check if variant Big_integer_list is selected.
E_Choice Which(void) const
Which variant is currently selected.
const TBig_integer_list & GetBig_integer_list(void) const
Get the variant data.
const TString & GetString(void) const
Get the variant data.
TReal GetReal(void) const
Get the variant data.
const TInteger_list & GetInteger_list(void) const
Get the variant data.
bool IsCutoff(void) const
Check if variant Cutoff is selected.
const TQuery_mask & GetQuery_mask(void) const
Get the variant data.
bool IsE_value(void) const
Check if variant E_value is selected.
TStrand_type GetStrand_type(void) const
Get the variant data.
TE_value GetE_value(void) const
Get the variant data.
bool IsReal(void) const
Check if variant Real is selected.
void SetFrom(TFrom value)
Assign a value to From data member.
Definition: Range_.hpp:231
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
const TYPE & Get(const CNamedParameterList *param)
EBlastOptIdx
Index of remote BLAST options.
Definition: names.hpp:55
@ eBlastOpt_WordThreshold
Definition: names.hpp:57
@ eBlastOpt_EntrezQuery
Definition: names.hpp:128
@ eBlastOpt_MismatchPenalty
Definition: names.hpp:101
@ eBlastOpt_Web_StepNumber
Definition: names.hpp:152
@ eBlastOpt_CompositionBasedStats
Definition: names.hpp:114
@ eBlastOpt_SubjectBestHit
Definition: names.hpp:127
@ eBlastOpt_NegativeTaxidList
Definition: names.hpp:143
@ eBlastOpt_QueryGeneticCode
Definition: names.hpp:76
@ eBlastOpt_DbLength
Definition: names.hpp:106
@ eBlastOpt_WordSize
Definition: names.hpp:59
@ eBlastOpt_SegFilteringHicut
Definition: names.hpp:72
@ eBlastOpt_HitlistSize
Definition: names.hpp:85
@ eBlastOpt_FilterString
Definition: names.hpp:63
@ eBlastOpt_StrandOption
Definition: names.hpp:75
@ eBlastOpt_RequiredEnd
Definition: names.hpp:139
@ eBlastOpt_QueryCovHspPerc
Definition: names.hpp:92
@ eBlastOpt_GapXDropoffFinal
Definition: names.hpp:82
@ eBlastOpt_DustFilteringLevel
Definition: names.hpp:66
@ eBlastOpt_OutOfFrameMode
Definition: names.hpp:105
@ eBlastOpt_MBTemplateLength
Definition: names.hpp:61
@ eBlastOpt_BestHitOverhang
Definition: names.hpp:122
@ eBlastOpt_CullingLimit
Definition: names.hpp:88
@ eBlastOpt_TaxidList
Definition: names.hpp:142
@ eBlastOpt_PercentIdentity
Definition: names.hpp:91
@ eBlastOpt_SegFilteringWindow
Definition: names.hpp:70
@ eBlastOpt_IgnoreMsaMaster
Definition: names.hpp:123
@ eBlastOpt_Culling
Definition: names.hpp:126
@ eBlastOpt_WindowMaskerTaxId
Definition: names.hpp:118
@ eBlastOpt_GapExtensionCost
Definition: names.hpp:103
@ eBlastOpt_GapOpeningCost
Definition: names.hpp:102
@ eBlastOpt_DbFilteringAlgorithmKey
Definition: names.hpp:133
@ eBlastOpt_WindowSize
Definition: names.hpp:77
@ eBlastOpt_MatchReward
Definition: names.hpp:100
@ eBlastOpt_MaskAtHash
Definition: names.hpp:64
@ eBlastOpt_MaxHspsPerSubject
Definition: names.hpp:87
@ eBlastOpt_SmithWatermanMode
Definition: names.hpp:115
@ eBlastOpt_SegFiltering
Definition: names.hpp:69
@ eBlastOpt_GapExtnAlgorithm
Definition: names.hpp:84
@ eBlastOpt_EvalueThreshold
Definition: names.hpp:89
@ eBlastOpt_MatrixTable
Definition: names.hpp:137
@ eBlastOpt_RepeatFilteringDB
Definition: names.hpp:74
@ eBlastOpt_LCaseMask
Definition: names.hpp:136
@ eBlastOpt_MatrixName
Definition: names.hpp:98
@ eBlastOpt_Web_RunPsiBlast
Definition: names.hpp:150
@ eBlastOpt_NegativeGiList
Definition: names.hpp:138
@ eBlastOpt_DomainInclusionThreshold
Definition: names.hpp:124
@ eBlastOpt_BestHitScoreEdge
Definition: names.hpp:121
@ eBlastOpt_LongestIntronLength
Definition: names.hpp:94
@ eBlastOpt_HspRangeMax
Definition: names.hpp:135
@ eBlastOpt_DustFilteringLinker
Definition: names.hpp:68
@ eBlastOpt_ForceMbIndex
Definition: names.hpp:119
@ eBlastOpt_GapTrigger
Definition: names.hpp:83
@ eBlastOpt_DbFilteringAlgorithmId
Definition: names.hpp:132
@ eBlastOpt_FinalDbSeq
Definition: names.hpp:129
@ eBlastOpt_DustFiltering
Definition: names.hpp:65
@ eBlastOpt_DbGeneticCode
Definition: names.hpp:109
@ eBlastOpt_FirstDbSeq
Definition: names.hpp:130
@ eBlastOpt_RepeatFiltering
Definition: names.hpp:73
@ eBlastOpt_SegFilteringLocut
Definition: names.hpp:71
@ eBlastOpt_MBTemplateType
Definition: names.hpp:62
@ eBlastOpt_GapXDropoff
Definition: names.hpp:81
@ eBlastOpt_GiList
Definition: names.hpp:131
@ eBlastOpt_GappedMode
Definition: names.hpp:95
@ eBlastOpt_PseudoCount
Definition: names.hpp:112
@ eBlastOpt_EffectiveSearchSpace
Definition: names.hpp:108
@ eBlastOpt_SumStatisticsMode
Definition: names.hpp:93
@ eBlastOpt_RequiredStart
Definition: names.hpp:140
@ eBlastOpt_PHIPattern
Definition: names.hpp:110
@ eBlastOpt_MbIndexName
Definition: names.hpp:120
@ eBlastOpt_GapTracebackAlgorithm
Definition: names.hpp:113
@ eBlastOpt_SubjectMaskingType
Definition: names.hpp:134
@ eBlastOpt_DustFilteringWindow
Definition: names.hpp:67
@ eBlastOpt_CutoffScore
Definition: names.hpp:90
@ eBlastOpt_InclusionThreshold
Definition: names.hpp:111
@ eBlastOpt_UnifiedP
Definition: names.hpp:116
Declares the CRemoteBlast class.
Finder class for matching CBlast4_parameter.
#define _ASSERT
#define const
Definition: zconf.h:230
Modified on Thu Feb 29 12:19:16 2024 by modify_doxy.py rev. 669887