NCBI C++ ToolKit
magicblast_options.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef ALGO_BLAST_API___MAGIC_BLAST_OPTIONS__HPP
2 #define ALGO_BLAST_API___MAGIC_BLAST_OPTIONS__HPP
3 
4 /* $Id: magicblast_options.hpp 81797 2018-04-04 18:25:26Z boratyng $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Greg Boratyn
30  *
31  */
32 
33 /// @file blast_mapper_options.hpp
34 /// Declares the CMagicBlastOptionsHandle class.
35 
37 
38 /** @addtogroup AlgoBlast
39  *
40  * @{
41  */
42 
44 BEGIN_SCOPE(blast)
45 
46 /// Handle to the nucleotide mapping options to the BLAST algorithm.
47 ///
48 /// Adapter class for nucleotide-nucleotide BLAST comparisons.
49 /// Exposes an interface to allow manipulation the options that are relevant to
50 /// this type of search.
51 ///
52 ///
53 
55  public CBlastOptionsHandle
56 {
57 public:
58 
59  /// Creates object with default options set
61 
62  /// Create Options Handle from Existing CBlastOptions Object
64 
65  /// Sets Defaults
66  virtual void SetDefaults();
67 
68  virtual void SetRNAToGenomeDefaults();
69  virtual void SetRNAToRNADefaults();
70  virtual void SetGenomeToGenomeDefaults();
71 
72  /******************* Lookup table options ***********************/
73 
74  /// Return db filtering option for the lookup table
75  ///
76  /// The filtering removes from lookup table words that are frequent in the
77  /// database.
78  /// @return If true, words that are frequent in the dabase will be removed
79  bool GetLookupDbFilter() const { return m_Opts->GetLookupDbFilter(); }
80 
81  /// Set db filtering option for the lookup table
82  ///
83  /// The filtering removes from lookup table words that are frequent in the
84  /// database.
85  /// @param b If true, words that are frequent in the dabase will be removed
86  /// from the lookup table
87  void SetLookupDbFilter(bool b) { m_Opts->SetLookupDbFilter(b); }
88 
89  /// Get maximum word count for lookup table word masking by database
90  /// frequency
91  Uint1 GetMaxDbWordCount(void) const { return m_Opts->GetMaxDbWordCount(); }
92 
93  /// Set maximum word count for lookup table word masking by database
94  /// frequency
95  void SetMaxDbWordCount(Uint1 num) { m_Opts->SetMaxDbWordCount(num); }
96 
97  /// Return number of words skipped betweem collected ones when creating
98  /// a lookup table
99  int GetLookupTableStride() const { return m_Opts->GetLookupTableStride(); }
100 
101  /// Set lookup table stride: number of words skipped between collected ones
102  /// when creating a lookup table
103  /// @param s lookup table stride [in]
104  void SetLookupTableStride(int s) { m_Opts->SetLookupTableStride(s); }
105 
106 
107  /******************* Query setup options ************************/
108 
109  /// Return true if query quality filtering is on
111  { return m_Opts->GetReadQualityFiltering(); }
112 
113  /// Turn on/off query quaility filtering with default parameters
114  void SetReadQualityFiltering(bool val = true)
115  { m_Opts->SetReadQualityFiltering(val); }
116 
117  /// Get maximum fraction of ambiguous bases for query quality filtering
118  double GetMaxFractionAmbiguous() const
119  { return m_Opts->GetReadMaxFractionAmbiguous(); }
120 
121  /// Get maximum fraction of ambiguous bases for query quality filtering
122  void SetMaxFractionAmbiguous(double val)
123  { m_Opts->SetReadMaxFractionAmbiguous(val); }
124 
125  /// Get mininum dimer entropy for query quality filtering
126  int GetMinDimerEntropy() const { return m_Opts->GetReadMinDimerEntropy(); }
127 
128  /// Set minimum dimer entropy for query quality filtering
129  void SetMinDimerEntropy(int val) { m_Opts->SetReadMinDimerEntropy(val); }
130 
131 
132  /******************* Initial word options ***********************/
133 
134  /// Return word size
135  int GetWordSize() const { return m_Opts->GetWordSize(); }
136 
137  /// Set word size
138  /// @param w word size [in]
139  void SetWordSize(int w) { m_Opts->SetWordSize(w); }
140 
141  /******************* Gapped extension options *******************/
142 
143  /// Return x-dropoff parameter for gapped alignment
144  int GetGapXDropoff() const { return m_Opts->GetGapXDropoff(); }
145 
146  /// Set x-dropoff parameter for gapped alignment
147  /// @param d x-dropoff value [in]
148  void SetGapXDropoff(int d) { m_Opts->SetGapXDropoff(d); }
149 
150  /************************ Scoring options ************************/
151 
152  /// Returns mismatch penalty
153  int GetMismatchPenalty() const { return m_Opts->GetMismatchPenalty(); }
154 
155  /// Sets mismatch penalty
156  /// @param p mismatch penalty [in]
157  void SetMismatchPenalty(int p) { m_Opts->SetMismatchPenalty(p); }
158 
159  /// Return gap opening cost
160  int GetGapOpeningCost() const { return m_Opts->GetGapOpeningCost(); }
161 
162  /// Set gap opening cost
163  /// @param g gap opening cost [in]
164  void SetGapOpeningCost(int g) { m_Opts->SetGapOpeningCost(g); }
165 
166  /// Return gap extension cost
167  int GetGapExtensionCost() const { return m_Opts->GetGapExtensionCost(); }
168 
169  /// Sets gap extension cost
170  /// @param g gap extension cost [in]
171  void SetGapExtensionCost(int g) { m_Opts->SetGapExtensionCost(g); }
172 
173  /// Return a single alignment cutoff score
174  int GetCutoffScore() const { return m_Opts->GetCutoffScore(); }
175 
176  /// Set a single alignment cutoff score
177  /// @param s cutoff score [in]
178  void SetCutoffScore(int s) { m_Opts->SetCutoffScore(s); }
179 
180  /// Get coefficients for alignment cutoff score as a linear function of
181  /// query length: x[0] + x[1] * length
182  vector<double> GetCutoffScoreCoeffs()
183  { return m_Opts->GetCutoffScoreCoeffs(); }
184 
185  /// Set coefficients for alignment cutoff score as a linear function of
186  /// query length: x[0] + x[1] * length
187  /// @param c function coefficients [in]
188  void SetCutoffScoreCoeffs(const vector<double>& c)
189  { m_Opts->SetCutoffScoreCoeffs(c); }
190 
191  int GetMaxEditDistance() const { return m_Opts->GetMaxEditDistance(); }
192  void SetMaxEditDistance(int e) { m_Opts->SetMaxEditDistance(e); }
193 
194 
195  /************************ Mapping options ************************/
196 
197  /// Are the mapping reads assumed paired
198  /// @returns True if reads are assumed paired, false otherwise
199  bool GetPaired() const { return m_Opts->GetPaired(); }
200 
201  /// Set input reads as paired/not paired
202  /// @param p If true, the input sequences are paired [in]
203  void SetPaired(bool p) { m_Opts->SetPaired(p); }
204 
205  /// Return the splice/unsplice alignments switch value
206  /// @return True if alignments are spliced, false otherwise
207  bool GetSpliceAlignments() const { return m_Opts->GetSpliceAlignments(); }
208 
209  /// Set splicing alignments
210  /// @param s if true alignments will be spliced [in]
211  void SetSpliceAlignments(bool s) { m_Opts->SetSpliceAlignments(s); }
212 
213  /// Get max intron length
214  /// @return Max intron length
215  int GetLongestIntronLength(void) const
216  { return m_Opts->GetLongestIntronLength(); }
217 
218  /// Set max intron length
219  /// @param len Max inrton length
220  void SetLongestIntronLength(int len) {m_Opts->SetLongestIntronLength(len);}
221 
222 
223 protected:
224  /// Set the program and service name for remote blast.
226  {
227 // m_Opts->SetRemoteProgramAndService_Blast3("blastn", "megablast");
228  }
229 
230  /// Overrides LookupTableDefaults for nucleotide options
231  virtual void SetLookupTableDefaults();
232  /// Overrides QueryOptionDefaults for nucleotide options
233  virtual void SetQueryOptionDefaults();
234  /// Overrides InitialWordOptionsDefaults for nucleotide options
235  virtual void SetInitialWordOptionsDefaults();
236  /// Overrides GappedExtensionDefaults for nucleotide options
237  virtual void SetGappedExtensionDefaults();
238  /// Overrides ScoringOptionsDefaults for nucleotide options
239  virtual void SetScoringOptionsDefaults();
240  /// Overrides HitSavingOptionsDefaults for nucleotide options
241  virtual void SetHitSavingOptionsDefaults();
242  /// Overrides EffectiveLengthsOptionsDefaults for nucleotide options
243  virtual void SetEffectiveLengthsOptionsDefaults();
244  /// Overrides SubjectSequenceOptionsDefaults for nucleotide options
245  virtual void SetSubjectSequenceOptionsDefaults();
246 
247 private:
248  /// Disallow copy constructor
250  /// Disallow assignment operator
252 };
253 
254 END_SCOPE(blast)
256 
257 
258 /* @} */
259 
260 
261 #endif /* ALGO_BLAST_API___MAGIC_BLAST_OPTIONS__HPP */
#define NCBI_XBLAST_EXPORT
NULL operations for other cases.
Definition: blast_export.h:65
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
Handle to the options to the BLAST algorithm.
EAPILocality
Enumerates the possible contexts in which objects of this type can be used.
@ eLocal
To be used for running BLAST locally.
Handle to the nucleotide mapping options to the BLAST algorithm.
int GetMismatchPenalty() const
Returns mismatch penalty.
void SetMaxDbWordCount(Uint1 num)
Set maximum word count for lookup table word masking by database frequency.
vector< double > GetCutoffScoreCoeffs()
Get coefficients for alignment cutoff score as a linear function of query length: x[0] + x[1] * lengt...
void SetLookupTableStride(int s)
Set lookup table stride: number of words skipped between collected ones when creating a lookup table.
int GetLongestIntronLength(void) const
Get max intron length.
int GetLookupTableStride() const
Return number of words skipped betweem collected ones when creating a lookup table.
void SetCutoffScoreCoeffs(const vector< double > &c)
Set coefficients for alignment cutoff score as a linear function of query length: x[0] + x[1] * lengt...
bool GetPaired() const
Are the mapping reads assumed paired.
CMagicBlastOptionsHandle & operator=(const CMagicBlastOptionsHandle &rhs)
Disallow assignment operator.
void SetWordSize(int w)
Set word size.
CMagicBlastOptionsHandle(const CMagicBlastOptionsHandle &rhs)
Disallow copy constructor.
virtual void SetRemoteProgramAndService_Blast3()
Set the program and service name for remote blast.
int GetGapXDropoff() const
Return x-dropoff parameter for gapped alignment.
int GetWordSize() const
Return word size.
void SetPaired(bool p)
Set input reads as paired/not paired.
Uint1 GetMaxDbWordCount(void) const
Get maximum word count for lookup table word masking by database frequency.
void SetMinDimerEntropy(int val)
Set minimum dimer entropy for query quality filtering.
void SetLongestIntronLength(int len)
Set max intron length.
void SetMaxFractionAmbiguous(double val)
Get maximum fraction of ambiguous bases for query quality filtering.
int GetGapExtensionCost() const
Return gap extension cost.
bool GetReadQualityFiltering() const
Return true if query quality filtering is on.
void SetLookupDbFilter(bool b)
Set db filtering option for the lookup table.
double GetMaxFractionAmbiguous() const
Get maximum fraction of ambiguous bases for query quality filtering.
void SetSpliceAlignments(bool s)
Set splicing alignments.
void SetGapXDropoff(int d)
Set x-dropoff parameter for gapped alignment.
int GetGapOpeningCost() const
Return gap opening cost.
void SetMismatchPenalty(int p)
Sets mismatch penalty.
int GetMinDimerEntropy() const
Get mininum dimer entropy for query quality filtering.
void SetCutoffScore(int s)
Set a single alignment cutoff score.
bool GetSpliceAlignments() const
Return the splice/unsplice alignments switch value.
void SetGapExtensionCost(int g)
Sets gap extension cost.
bool GetLookupDbFilter() const
Return db filtering option for the lookup table.
int GetCutoffScore() const
Return a single alignment cutoff score.
void SetReadQualityFiltering(bool val=true)
Turn on/off query quaility filtering with default parameters.
void SetGapOpeningCost(int g)
Set gap opening cost.
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
#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
int len
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
Modified on Sat Apr 13 11:50:45 2024 by modify_doxy.py rev. 669887