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

Go to the SVN repository for this file.

1 /* $Id: magicblast_options.cpp 84986 2019-01-04 22:49:43Z 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  * Authors: Greg Boratyn
27  *
28  */
29 
30 /// @file blast_mapper_options.cpp
31 /// Implements the CMagicBlastOptionsHandle class.
32 
33 #include <ncbi_pch.hpp>
34 //#include <algo/blast/core/blast_encoding.h>
36 //#include <objects/seqloc/Na_strand.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);
82  m_Opts->SetDefaultsMode(false);
83 }
84 
85 void
87 {
88  m_Opts->SetDefaultsMode(true);
98 
101  SetLookupDbFilter(false);
102  SetSpliceAlignments(false);
103  SetWordSize(30);
104 
105  m_Opts->SetDefaultsMode(false);
106 }
107 
108 
109 void
111 {
112  m_Opts->SetDefaultsMode(true);
122 
123  SetMismatchPenalty(-4);
125  SetLookupDbFilter(true);
126  SetSpliceAlignments(false);
127  SetWordSize(28);
128 
129  m_Opts->SetDefaultsMode(false);
130 }
131 
132 void
134 {
135  if (getenv("MAPPER_MB_LOOKUP")) {
137  }
138  else {
140  }
145 }
146 
147 
148 void
150 {
152  m_Opts->SetDustFiltering(false);
153  // Masking is used for filtering out poor quality reads which are masked
154  // for the full length. Setting mask at hash to true prevents additional
155  // memory allocation for unmasked queries.
156  m_Opts->SetMaskAtHash(true);
158  SetLookupDbFilter(true);
159  SetPaired(false);
160 }
161 
162 void
164 {
165 }
166 
167 void
169 {
173  SetSpliceAlignments(true);
174  // 0 means that the value will be set to max(-penalty, gap open +
175  // gap extend)
176  SetGapXDropoff(0);
177 }
178 
179 
180 void
182 {
190 
191  // set out-of-frame options to invalid? values
192  m_Opts->SetOutOfFrameMode(false);
194 }
195 
196 void
198 {
199  m_Opts->SetHitlistSize(500);
202  // set some default here, allow INT4MAX to mean infinity
205  // cutoff zero means use adaptive score threshold that depends on query
206  // length
207  SetCutoffScore(0);
208  vector<double> coeffs = {0.0, 0.0};
209  SetCutoffScoreCoeffs(coeffs);
211  SetLongestIntronLength(500000);
212 
213  // do not compute each query's ungapped alignment score threshold to
214  // trigger gapped alignment
215  m_Opts->SetLowScorePerc(0.0);
217 }
218 
219 void
221 {
222  m_Opts->SetDbLength(0);
223  m_Opts->SetDbSeqNum(0);
225 }
226 
227 void
229 {}
230 
231 END_SCOPE(blast)
233 
234 
235 /* @} */
#define BLAST_WORDSIZE_MAPPER
default word size for mapping rna-seq to a genome
Definition: blast_options.h:73
#define BLAST_GAP_EXTN_MAPPER
Definition: blast_options.h:98
@ eJumperWithTraceback
Jumper extension (mapping)
#define BLAST_GAP_OPEN_MAPPER
Definition: blast_options.h:89
#define BLAST_REWARD_MAPPER
#define MAX_DB_WORD_COUNT_MAPPER
Default max frequency for a database word.
#define BLAST_WORD_THRESHOLD_BLASTN
default threshold (blastn)
#define BLAST_EXPECT_VALUE
Default parameters for saving hits.
#define BLAST_PENALTY_MAPPER
@ eMBLookupTable
megablast lookup table (includes both contiguous and discontiguous megablast)
@ eNaHashLookupTable
used for 16-base words
@ eMapper
Jumper alignment for mapping.
Definition: blast_types.hpp:73
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 nucleotide mapping options to the BLAST algorithm.
virtual void SetDefaults()
Sets Defaults.
void SetMaxDbWordCount(Uint1 num)
Set maximum word count for lookup table word masking by database frequency.
void SetStrandOption(objects::ENa_strand s)
virtual void SetInitialWordOptionsDefaults()
Overrides InitialWordOptionsDefaults for nucleotide options.
void SetLookupTableStride(int s)
Set lookup table stride: number of words skipped between collected ones when creating a lookup table.
void SetGapExtnAlgorithm(EBlastPrelimGapExt a)
void SetEvalueThreshold(double eval)
void SetQueryCovHspPerc(double p)
void SetCutoffScoreCoeffs(const vector< double > &c)
Set coefficients for alignment cutoff score as a linear function of query length: x[0] + x[1] * lengt...
void SetOutOfFrameMode(bool m=true)
virtual void SetEffectiveLengthsOptionsDefaults()
Overrides EffectiveLengthsOptionsDefaults for nucleotide options.
void SetWordSize(int w)
Set word size.
void SetHitlistSize(int s)
void SetEffectiveSearchSpace(Int8 eff)
void SetComplexityAdjMode(bool m=true)
void SetFrameShiftPenalty(int p)
CRef< CBlastOptions > m_Opts
Data type this class controls access to.
void SetWordThreshold(double w)
Sets WordThreshold.
void SetDbSeqNum(unsigned int n)
void SetLowScorePerc(double p=0.0)
void SetProgram(EProgram p)
Sets the task this object is best suited for.
virtual void SetRNAToGenomeDefaults()
void SetMatrixName(const char *matrix)
void SetDbLength(Int8 l)
void SetPaired(bool p)
Set input reads as paired/not paired.
virtual void SetGenomeToGenomeDefaults()
void SetPercentIdentity(double p)
void SetLongestIntronLength(int len)
Set max intron length.
void SetLookupDbFilter(bool b)
Set db filtering option for the lookup table.
virtual void SetHitSavingOptionsDefaults()
Overrides HitSavingOptionsDefaults for nucleotide options.
virtual void SetScoringOptionsDefaults()
Overrides ScoringOptionsDefaults for nucleotide options.
virtual void SetQueryOptionDefaults()
Overrides QueryOptionDefaults for nucleotide options.
virtual void SetSubjectSequenceOptionsDefaults()
Overrides SubjectSequenceOptionsDefaults for nucleotide options.
void SetDefaultsMode(bool dmode)
If this is true, remote options will ignore "Set" calls.
void SetSpliceAlignments(bool s)
Set splicing alignments.
void SetGapXDropoff(int d)
Set x-dropoff parameter for gapped alignment.
void SetMaskAtHash(bool val=true)
void SetMismatchPenalty(int p)
Sets mismatch penalty.
void SetDustFiltering(bool val=true)
void SetCutoffScore(int s)
Set a single alignment cutoff score.
void SetMaxMismatches(int m)
void SetGappedMode(bool m=true)
virtual void SetGappedExtensionDefaults()
Overrides GappedExtensionDefaults for nucleotide options.
void SetMaxHspsPerSubject(int m)
CMagicBlastOptionsHandle(EAPILocality locality=CBlastOptions::eLocal)
Creates object with default options set.
void SetMismatchWindow(int w)
void SetGapExtensionCost(int g)
Sets gap extension cost.
void SetLookupTableType(ELookupTableType type)
virtual void SetLookupTableDefaults()
Overrides LookupTableDefaults for nucleotide options.
void SetReadQualityFiltering(bool val=true)
Turn on/off query quaility filtering with default parameters.
void SetGapOpeningCost(int g)
Set gap opening cost.
void SetMaxNumHspPerSequence(int m)
void SetMatchReward(int r)
#define NULL
Definition: ncbistd.hpp:225
#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 INT4_MAX
largest nubmer represented by signed int
Definition: ncbi_std.h:141
#define INT2_MAX
largest number represented by signed (two byte) short
Definition: ncbi_std.h:156
Modified on Wed Apr 17 13:08:21 2024 by modify_doxy.py rev. 669887