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

Go to the SVN repository for this file.

1 /* $Id: blast_prot_options.cpp 99148 2023-02-17 18:27:03Z 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  * Authors: Christiam Camacho
27  *
28  */
29 
30 /// @file blast_prot_options.cpp
31 /// Implements the CBlastProteinOptionsHandle class.
32 
33 #include <ncbi_pch.hpp>
37 #include "blast_setup.hpp"
38 
39 
40 /** @addtogroup AlgoBlast
41  *
42  * @{
43  */
44 
45 
47 BEGIN_SCOPE(blast)
48 
50  : CBlastOptionsHandle(locality)
51 {
52  SetDefaults();
53  m_Opts->SetProgram(eBlastp);
54 }
55 
57 
58  m_Opts->SetWordSize(ws);
59  switch (ws) {
60  case 3:
62  break;
63  case 5:
65  break;
66  case 6:
68  break;
69  case 7:
71  break;
72  default:
74  break;
75  }
76 
77  if (ws > 4) {
79  }
80  else {
82  }
83 }
84 
85 void
87 {
91 }
92 
93 void
95 {
96  SetSegFiltering(true);
98 }
99 
100 void
102 {
105 }
106 
107 void
109 {
115 }
116 
117 
118 void
120 {
121  SetMatrixName(BLAST_DEFAULT_MATRIX); // BLOSUM62
124  SetGappedMode();
125 
126  // set invalid values for options that are not applicable
127  m_Opts->SetOutOfFrameMode(false);
129  //m_Opts->SetMatchReward(0);
130  //m_Opts->SetMismatchPenalty(0);
131 }
132 
133 void
135 {
136  SetHitlistSize(500);
140  // set some default here, allow INT4MAX to mean infinity
143 
144  SetCutoffScore(0); // will be calculated based on evalue threshold,
145  // effective lengths and Karlin-Altschul params in BLAST_Cutoffs_simple
146  // and passed to the engine in the params structure
148 }
149 
150 void
152 {
153  SetDbLength(0);
154  SetDbSeqNum(0);
156 }
157 
158 void
160 {}
161 
162 END_SCOPE(blast)
164 
165 
166 /* @} */
Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...
#define BLAST_UNGAPPED_X_DROPOFF_PROT
default dropoff for ungapped extension; ungapped extensions will stop when the score for the extensio...
@ eDynProgScoreOnly
standard affine gapping
#define BLAST_GAP_OPEN_PROT
Protein gap costs are the defaults for the BLOSUM62 scoring matrix.
Definition: blast_options.h:84
#define BLAST_GAP_EXTN_PROT
cost to extend a gap.
Definition: blast_options.h:92
#define BLAST_WORD_THRESHOLD_BLASTP_WD_SZ_6
#define BLAST_DEFAULT_MATRIX
Default matrix name: BLOSUM62.
Definition: blast_options.h:77
#define BLAST_EXPECT_VALUE
Default parameters for saving hits.
#define BLAST_WORD_THRESHOLD_BLASTP_FAST
#define BLAST_WORD_THRESHOLD_BLASTP_WD_SZ_7
#define BLAST_WORD_THRESHOLD_BLASTP
neighboring word score thresholds; a threshold of zero means that only query and subject words that m...
#define BLAST_GAP_TRIGGER_PROT
default bit score that will trigger gapped extension
#define BLAST_GAP_X_DROPOFF_PROT
default dropoff for preliminary gapped extensions
@ eDynProgTbck
standard affine gapping
#define BLAST_WINDOW_SIZE_PROT
Some default values (used when creating blast options block and for command-line program defaults.
Definition: blast_options.h:57
#define BLAST_GAP_X_DROPOFF_FINAL_PROT
default dropoff for the final gapped extension with traceback
#define BLAST_WORDSIZE_PROT
length of word to trigger an extension.
Definition: blast_options.h:66
@ eAaLookupTable
standard protein (blastp) lookup table
@ eCompressedAaLookupTable
compressed alphabet (blastp) lookup table
Declares the CBlastProteinOptionsHandle class.
Internal auxiliary setup classes/functions for C++ BLAST APIs.
@ eBlastp
Protein-Protein.
Definition: blast_types.hpp:59
Handle to the options to the BLAST algorithm.
EAPILocality
Enumerates the possible contexts in which objects of this type can be used.
Handle to the protein-protein options to the BLAST algorithm.
virtual void SetGappedExtensionDefaults()
Overrides GappedExtensionDefaults for protein options.
void SetGapExtensionCost(int e)
Sets GapExtensionCost.
void SetEvalueThreshold(double eval)
Sets EvalueThreshold.
void SetStrandOption(objects::ENa_strand s)
void SetWordThreshold(double wt)
Sets WordThreshold.
virtual void SetHitSavingOptionsDefaults()
Overrides HitSavingOptionsDefaults for protein options.
void SetQueryCovHspPerc(double p)
Sets QueryCovHspPerc.
void SetDbLength(Int8 len)
Sets DbLength.
void SetGapExtnAlgorithm(EBlastPrelimGapExt a)
void SetWordSize(int ws)
Sets WordSize.
virtual void SetEffectiveLengthsOptionsDefaults()
Overrides EffectiveLengthsOptionsDefaults for protein options.
void SetDbSeqNum(unsigned int num)
Sets DbSeqNum.
void SetOutOfFrameMode(bool m=true)
void SetGapTrigger(double g)
Sets GapTrigger.
void SetEffectiveSearchSpace(Int8 eff)
Sets EffectiveSearchSpace.
void SetGapOpeningCost(int g)
Sets GapOpeningCost.
void SetFrameShiftPenalty(int p)
CRef< CBlastOptions > m_Opts
Data type this class controls access to.
void SetGapTracebackAlgorithm(EBlastTbackExt a)
void SetWordThreshold(double w)
Sets WordThreshold.
virtual void SetLookupTableDefaults()
Overrides LookupTableDefaults for protein options.
virtual void SetQueryOptionDefaults()
Overrides QueryOptionDefaults for protein options.
void SetMaxHspsPerSubject(int m)
Sets MaxHspPerSubjectQueryPair.
virtual void SetInitialWordOptionsDefaults()
Overrides InitialWordOptionsDefaults for protein options.
void SetHitlistSize(int s)
Sets HitlistSize.
void SetWordSize(int ws)
void SetWindowSize(int ws)
Sets WindowSize.
void SetMinDiagSeparation(int d)
Sets MinDiagSeparation.
void SetMatrixName(const char *matrix)
Sets MatrixName.
virtual void SetScoringOptionsDefaults()
Overrides ScoringOptionsDefaults for protein options.
void SetGapXDropoffFinal(double x)
Sets GapXDropoffFinal.
void SetXDropoff(double x)
Sets XDropoff.
void SetGapXDropoff(double x)
Sets GapXDropoff.
void SetMaxNumHspPerSequence(int m)
Sets MaxNumHspPerSequence.
void SetGappedMode(bool m=true)
Sets GappedMode.
void SetSegFiltering(bool val)
Enable SEG filtering.
void SetPercentIdentity(double p)
Sets PercentIdentity.
void SetCutoffScore(int s)
Sets CutoffScore.
virtual void SetSubjectSequenceOptionsDefaults()
Overrides SubjectSequenceOptionsDefaults for protein options.
void SetLookupTableType(ELookupTableType type)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#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
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
#define INT2_MAX
largest number represented by signed (two byte) short
Definition: ncbi_std.h:156
Modified on Fri Mar 01 10:04:30 2024 by modify_doxy.py rev. 669887