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

Go to the SVN repository for this file.

1 /* $Id: blast_nucl_options.cpp 84455 2018-11-09 19:21:54Z 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_nucl_options.cpp
31 /// Implements the CBlastNucleotideOptionsHandle class.
32 
33 #include <ncbi_pch.hpp>
37 #include "blast_setup.hpp"
38 
39 /** @addtogroup AlgoBlast
40  *
41  * @{
42  */
43 
44 
46 BEGIN_SCOPE(blast)
47 
49  : CBlastOptionsHandle(locality)
50 {
51  SetDefaults();
52 }
53 
54 
56  : CBlastOptionsHandle(opt)
57 {
58 }
59 
60 
61 void
63 {
64  m_Opts->SetDefaultsMode(true);
66  m_Opts->SetDefaultsMode(false);
67 }
68 
69 void
71 {
72  m_Opts->SetDefaultsMode(true);
73  m_Opts->SetRemoteProgramAndService_Blast3("blastn", "plain");
75 
77  return;
78  }
79 
82  // NB: Initial word defaults must be set after lookup table defaults,
83  // because default scanning stride depends on the lookup table type.
89  m_Opts->SetDefaultsMode(false);
90 }
91 
92 void
94 {
95  m_Opts->SetDefaultsMode(true);
96  m_Opts->SetRemoteProgramAndService_Blast3("blastn", "vecscreen");
98 
100  return;
101  }
102 
103  // based on VSBlastOptionNew from tools/vecscrn.c
106  m_Opts->SetMaskAtHash(true);
107  m_Opts->SetDustFiltering(true);
112 }
113 
114 void
116 {
117  m_Opts->SetDefaultsMode(true);
118  m_Opts->SetRemoteProgramAndService_Blast3("blastn", "megablast");
120 
122  return;
123  }
126  // NB: Initial word defaults must be set after lookup table defaults,
127  // because default scanning stride depends on the lookup table type.
133  m_Opts->SetDefaultsMode(false);
134 }
135 
136 void
138 {
143 }
144 
145 void
147 {
152 }
153 
154 void
156 {
157  SetDustFiltering(true);
158  SetMaskAtHash(true);
160 }
161 
162 void
164 {
168 }
169 
170 void
172 {
174 }
175 
176 void
178 {
184 }
185 
186 void
188 {
194 }
195 
196 
197 void
199 {
203  SetMatchReward(2);
204  SetMismatchPenalty(-3);
205  SetGappedMode();
206  // Complexity adjusted scoring for RMBlastN -RMH-
207  SetComplexityAdjMode(false);
208 
209  // set out-of-frame options to invalid? values
210  m_Opts->SetOutOfFrameMode(false);
212 }
213 
214 void
216 {
220  SetMatchReward(1);
221  SetMismatchPenalty(-2);
222  SetGappedMode();
223  // Complexity adjusted scoring for RMBlastN -RMH-
224  SetComplexityAdjMode(false);
225 
226  // set out-of-frame options to invalid? values
227  m_Opts->SetOutOfFrameMode(false);
229 }
230 void
232 {
233  SetHitlistSize(500);
236  // set some default here, allow INT4MAX to mean infinity
240  // Default is to show all results. -RMH-
241  SetMaskLevel(101);
242 
243  SetCutoffScore(0); // will be calculated based on evalue threshold,
244  // effective lengths and Karlin-Altschul params in BLAST_Cutoffs_simple
245  // and passed to the engine in the params structure
246 
247  SetLowScorePerc(0);
249 }
250 void
252 {
253  SetHitlistSize(500);
256  // set some default here, allow INT4MAX to mean infinity
260  // Default is to show all results. -RMH-
261  SetMaskLevel(101);
262 
263  SetCutoffScore(0); // will be calculated based on evalue threshold,
264  // effective lengths and Karlin-Altschul params in BLAST_Cutoffs_simple
265  // and passed to the engine in the params structure
266 
267  SetLowScorePerc(0);
268 
270 }
271 
272 void
274 {
275  SetDbLength(0);
276  SetDbSeqNum(0);
278 }
279 
280 void
282 {}
283 
284 END_SCOPE(blast)
286 
287 
288 /* @} */
Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...
Declares the CBlastNucleotideOptionsHandle class.
#define BLAST_GAP_X_DROPOFF_NUCL
default dropoff for non-greedy nucleotide gapped extensions
#define BLAST_GAP_OPEN_MEGABLAST
default gap open penalty (megablast with greedy gapped alignment)
Definition: blast_options.h:87
#define BLAST_WORD_THRESHOLD_MEGABLAST
default threshold (megablast)
#define BLAST_UNGAPPED_X_DROPOFF_NUCL
ungapped dropoff score for blastn (and megablast)
#define BLAST_GAP_EXTN_MEGABLAST
default gap open penalty (megablast) with greedy gapped alignment)
Definition: blast_options.h:95
@ eDynProgScoreOnly
standard affine gapping
@ eGreedyScoreOnly
Greedy extension (megaBlast)
#define BLAST_WORDSIZE_MEGABLAST
default word size (contiguous megablast; for discontig megablast the word size is explicitly overridd...
Definition: blast_options.h:68
#define BLAST_GAP_OPEN_NUCL
default gap open penalty (blastn)
Definition: blast_options.h:86
#define BLAST_GAP_TRIGGER_NUCL
default bit score that will trigger a gapped extension for blastn
#define BLAST_GAP_X_DROPOFF_FINAL_NUCL
default dropoff for nucleotide gapped extensions)
#define BLAST_WORD_THRESHOLD_BLASTN
default threshold (blastn)
#define BLAST_EXPECT_VALUE
Default parameters for saving hits.
#define BLAST_SCAN_RANGE_NUCL
default scan range (blastn)
Definition: blast_options.h:63
#define BLAST_WINDOW_SIZE_NUCL
default window size (blastn)
Definition: blast_options.h:58
#define BLAST_GAP_X_DROPOFF_GREEDY
default dropoff for greedy nucleotide gapped extensions
#define BLAST_GAP_EXTN_NUCL
default gap open penalty (blastn)
Definition: blast_options.h:94
@ eGreedyTbck
Greedy extension (megaBlast)
@ eDynProgTbck
standard affine gapping
#define BLAST_WORDSIZE_NUCL
default word size (blastn)
Definition: blast_options.h:67
@ eNaLookupTable
blastn lookup table
@ eMBLookupTable
megablast lookup table (includes both contiguous and discontiguous megablast)
Internal auxiliary setup classes/functions for C++ BLAST APIs.
@ eVecScreen
Vector screening.
Definition: blast_types.hpp:72
@ eBlastn
Nucl-Nucl (traditional blastn)
Definition: blast_types.hpp:58
@ eMegablast
Nucl-Nucl (traditional megablast)
Definition: blast_types.hpp:65
Handle to the nucleotide-nucleotide options to the BLAST algorithm.
Handle to the options to the BLAST algorithm.
void SetRemoteProgramAndService_Blast3(const string &p, const string &s)
Set the program and service name for remote blast.
EAPILocality
Enumerates the possible contexts in which objects of this type can be used.
@ eRemote
To be used when running BLAST remotely.
void SetLookupTableType(ELookupTableType type)
Sets LookupTableType.
virtual void SetScoringOptionsDefaults()
Overrides ScoringOptionsDefaults for nucleotide options.
void SetEvalueThreshold(double eval)
Sets EvalueThreshold.
virtual void SetLookupTableDefaults()
Overrides LookupTableDefaults for nucleotide options.
virtual void SetMBInitialWordOptionsDefaults()
Overrides MBInitialWordOptionsDefaults for nucleotide options.
virtual void SetMBScoringOptionsDefaults()
Overrides MBScoringOptionsDefaults for nucleotide options.
virtual void SetMBLookupTableDefaults()
Overrides MBLookupTableDefaults for nucleotide options.
void SetQueryCovHspPerc(double p)
Sets QueryCovHspPerc.
void SetDbLength(Int8 len)
Sets DbLength.
EAPILocality GetLocality() const
Return the locality used when the object was created.
void SetEvalueThreshold(double eval)
void SetMatchReward(int r)
Sets MatchReward.
void SetDbSeqNum(unsigned int num)
Sets DbSeqNum.
void SetOutOfFrameMode(bool m=true)
void SetGapTrigger(double g)
Sets GapTrigger.
void SetComplexityAdjMode(bool m=true)
Sets ComplexityAdjMode -RMH-.
void SetGapOpeningCost(int g)
void SetGapExtnAlgorithm(EBlastPrelimGapExt algo)
Sets GapExtnAlgorithm.
void SetEffectiveSearchSpace(Int8 eff)
void SetEffectiveSearchSpace(Int8 eff)
Sets EffectiveSearchSpace.
void SetFrameShiftPenalty(int p)
CRef< CBlastOptions > m_Opts
Data type this class controls access to.
void SetVecScreenDefaults()
Sets default options for VecScreen.
void SetWordThreshold(double w)
Sets WordThreshold.
void SetGapExtensionCost(int e)
void SetGapTracebackAlgorithm(EBlastTbackExt algo)
Sets GapTracebackAlgorithm.
virtual void SetHitSavingOptionsDefaults()
Overrides HitSavingOptionsDefaults for nucleotide options.
virtual void SetEffectiveLengthsOptionsDefaults()
Overrides EffectiveLengthsOptionsDefaults for nucleotide options.
virtual void SetDefaults()
Sets Defaults.
void SetProgram(EProgram p)
Sets the task this object is best suited for.
void SetTraditionalBlastnDefaults()
Sets TraditionalBlastnDefaults.
void SetMismatchPenalty(int p)
Sets MismatchPenalty.
void SetMismatchPenalty(int p)
void SetMaxHspsPerSubject(int m)
Sets MaxHspPerSubjectQueryPair.
virtual void SetSubjectSequenceOptionsDefaults()
Overrides SubjectSequenceOptionsDefaults for nucleotide options.
void SetMatrixName(const char *matrix)
Sets MatrixName.
void SetHitlistSize(int s)
Sets HitlistSize.
virtual void SetGappedExtensionDefaults()
Overrides GappedExtensionDefaults for nucleotide options.
CBlastNucleotideOptionsHandle(EAPILocality locality=CBlastOptions::eLocal)
Creates object with default options set.
void SetXDropoff(double x)
Sets XDropoff.
void SetWindowSize(int ws)
Sets WindowSize.
void SetTraditionalMegablastDefaults()
Sets TraditionalMegablastDefaults.
void SetMinDiagSeparation(int d)
Sets MinDiagSeparation.
virtual void SetInitialWordOptionsDefaults()
Overrides InitialWordOptionsDefaults for nucleotide options.
void SetGapXDropoffFinal(double x)
Sets GapXDropoffFinal.
void SetGapExtensionCost(int e)
Sets GapExtensionCost.
void SetDefaultsMode(bool dmode)
If this is true, remote options will ignore "Set" calls.
void SetGapXDropoff(double x)
Sets GapXDropoff.
void SetMaskAtHash(bool m=true)
Sets MaskAtHash.
void SetLowScorePerc(double p)
Sets low score percentage for ungapped alignments.
void SetWordSize(int ws)
Sets WordSize.
void SetMaskLevel(int ml)
Sets MaskLevel -RMH-.
void SetMaskAtHash(bool val=true)
void SetDustFiltering(bool val)
Enable dust filtering.
void SetDustFiltering(bool val=true)
virtual void SetQueryOptionDefaults()
Overrides QueryOptionDefaults for nucleotide options.
void SetMaxNumHspPerSequence(int m)
Sets MaxNumHspPerSequence.
void SetGappedMode(bool m=true)
Sets GappedMode.
virtual void SetMBHitSavingOptionsDefaults()
Overrides MBHitSavingOptionsDefaults for nucleotide options.
void SetPercentIdentity(double p)
Sets PercentIdentity.
void SetCutoffScore(int s)
Sets CutoffScore.
void SetGapOpeningCost(int g)
Sets GapOpeningCost.
void SetLookupTableStride(Uint4 val)
void SetStrandOption(objects::ENa_strand strand)
Sets StrandOption.
virtual void SetMBGappedExtensionDefaults()
Overrides MBGappedExtensionDefaults for nucleotide options.
void SetMatchReward(int r)
#define NULL
Definition: ncbistd.hpp:225
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#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_both
in forward orientation
Definition: Na_strand_.hpp:68
#define INT2_MAX
largest number represented by signed (two byte) short
Definition: ncbi_std.h:156
Modified on Wed Feb 28 07:14:19 2024 by modify_doxy.py rev. 669887