NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CGumbelParamsOptions Class Reference

Search Toolkit Book for CGumbelParamsOptions

Input parameters for Gumbel parameters calculation. More...

#include <algo/blast/gumbel_params/gumbel_params.hpp>

+ Inheritance diagram for CGumbelParamsOptions:
+ Collaboration diagram for CGumbelParamsOptions:

Public Types

typedef vector< double > TFrequencies
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1, eAllocFillZero, eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef CAtomicCounter TCounter
 Counter type is CAtomiCounter. More...
 
typedef TCounter::TValue TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CGumbelParamsOptions (void)
 Create empty options object. More...
 
 CGumbelParamsOptions (const CGeneralScoreMatrix *smatrix, const vector< double > &seq1_residue_probs, const vector< double > &seq2_residue_rpobs)
 Create options with given score matrix and residue probabilities. More...
 
 CGumbelParamsOptions (const CGumbelParamsOptions &options)
 Copy constructor. More...
 
void SetGapOpening (Int4 g_open)
 Set the value of gap opening penalty. More...
 
Int4 GetGapOpening (void) const
 Get gap opening penalty. More...
 
void SetGapExtension (Int4 g_exten)
 Set gap extention penalty. More...
 
Int4 GetGapExtension (void) const
 Get gap extention penalty. More...
 
void SetLambdaAccuracy (double lambda_err)
 Set relative error threshold for lambda parameter calculation for gapped aligmment. More...
 
double GetLambdaAccuracy (void) const
 Get relative error threshold for lambda parameter calculation for gapped aligmment. More...
 
void SetKAccuracy (double k_err)
 Set relative error threshold for K parameter calculation for gapped alignment. More...
 
double GetKAccuracy (void) const
 Get relative error threshold for K parameter calculation for gapped alignment. More...
 
void SetGapped (bool gapped)
 Set gapped/gapless regime. More...
 
bool GetGapped (void) const
 Get gapped/gapless regime. More...
 
void SetScoreMatrix (const CGeneralScoreMatrix &smatrix)
 Set score matrix. More...
 
void SetScoreMatrix (const CRef< CGeneralScoreMatrix > &smatrix)
 Set score matrix. More...
 
const Int4 ** GetScoreMatrix (void) const
 Get score matrix. More...
 
void SetSeq1ResidueProbs (const TFrequencies &probs)
 Set residue probabilities for sequence 1. More...
 
const TFrequenciesGetSeq1ResidueProbs (void) const
 Get sequence 1 residue probabilities. More...
 
void SetSeq2ResidueProbs (const TFrequencies &probs)
 Set residue probabilities for sequence 2. More...
 
const TFrequenciesGetSeq2ResidueProbs (void) const
 Get sequence 2 residue probabilities. More...
 
void SetMaxCalcTime (double time)
 Set maximum calculation time allowed. More...
 
double GetMaxCalcTime (void) const
 Get maximum calculation time allowed. More...
 
void SetMaxCalcMemory (double mem)
 Set maximum memory allowed for computation. More...
 
double GetMaxCalcMemory (void) const
 Get maximum memory allowed for computation. More...
 
Int4 GetNumResidues (void) const
 Get number of residues in utilized alphabet. More...
 
bool Validate (void)
 Validate parameter values. More...
 
bool IsMessage (void) const
 Check whether there are any error/warning messages. More...
 
const vector< string > & GetMessages (void) const
 Get error/warning messages. More...
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Protected Member Functions

void x_Init (void)
 
Int4 x_GetScore (Uint4 i, Uint4 j) const
 Get socre matrix value for i-th and j-th residues. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

Int4 m_GapOpening
 Gap opening penalty. More...
 
Int4 m_GapExtension
 Gap extension penalty. More...
 
double m_LambdaAccuracy
 Desired accuracy for lambda computation only for gapped aligmment. More...
 
double m_KAccuracy
 Desired accuracy for parameter K computation only for gapped alignment. More...
 
bool m_IsGapped
 Gapped/gapless regime, true for gapped, false for gapless. More...
 
CConstRef< CGeneralScoreMatrixm_ScoreMatrix
 Scoring matrix. More...
 
TFrequencies m_Seq1ResidueProbs
 Residue frequencies for sequence 1. More...
 
TFrequencies m_Seq2ResidueProbs
 Residue frequencies for sequence 2. More...
 
Int4 m_NumResidues
 Number of residues in alphabet. More...
 
double m_MaxCalcTime
 Maximum allowed calculation time. More...
 
double m_MaxCalcMemory
 Maximum allowed calculation memory. More...
 
vector< stringm_Messages
 Warning messages. More...
 

Private Member Functions

CGumbelParamsOptionsoperator= (const CGumbelParamsOptions &)
 Forbid assignment operator. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
static NCBI_NORETURN void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_NORETURN void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Detailed Description

Input parameters for Gumbel parameters calculation.

Definition at line 52 of file gumbel_params.hpp.

Member Typedef Documentation

typedef vector<double> CGumbelParamsOptions::TFrequencies

Definition at line 55 of file gumbel_params.hpp.

Constructor & Destructor Documentation

CGumbelParamsOptions::CGumbelParamsOptions ( void  )

Create empty options object.

Definition at line 55 of file gumbel_params.cpp.

References x_Init().

CGumbelParamsOptions::CGumbelParamsOptions ( const CGeneralScoreMatrix smatrix,
const vector< double > &  seq1_residue_probs,
const vector< double > &  seq2_residue_rpobs 
)

Create options with given score matrix and residue probabilities.

Parameters
smatrixScore matrix values [in]
seq1_residue_probsResidue probabilities for sequence 1 [in]
seq2_residue_probsResidue probabilities for sequence 2 [in]

The score matrix can be non-symmetric

Definition at line 60 of file gumbel_params.cpp.

References m_NumResidues, m_ScoreMatrix, m_Seq1ResidueProbs, m_Seq2ResidueProbs, CConstRef< C, Locker >::Reset(), and x_Init().

CGumbelParamsOptions::CGumbelParamsOptions ( const CGumbelParamsOptions options)

Copy constructor.

Parameters
optionsOptions object [in]

Definition at line 73 of file gumbel_params.cpp.

Member Function Documentation

Int4 CGumbelParamsOptions::GetGapExtension ( void  ) const
inline

Get gap extention penalty.

Returns
Gap extension penalty

Definition at line 102 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

Int4 CGumbelParamsOptions::GetGapOpening ( void  ) const
inline

Get gap opening penalty.

Returns
Gap opening penalty

Definition at line 92 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

bool CGumbelParamsOptions::GetGapped ( void  ) const
inline

Get gapped/gapless regime.

Returns
true if gapped, false otherwise

Definition at line 147 of file gumbel_params.hpp.

Referenced by CGumbelParamsCalc::Run().

double CGumbelParamsOptions::GetKAccuracy ( void  ) const
inline

Get relative error threshold for K parameter calculation for gapped alignment.

Returns
Relative error threshold for K parameter calculation

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 135 of file gumbel_params.hpp.

Referenced by alp_data::alp_data().

double CGumbelParamsOptions::GetLambdaAccuracy ( void  ) const
inline

Get relative error threshold for lambda parameter calculation for gapped aligmment.

Returns
Relative error threshold for lambda calculation

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 119 of file gumbel_params.hpp.

Referenced by alp_data::alp_data().

double CGumbelParamsOptions::GetMaxCalcMemory ( void  ) const
inline

Get maximum memory allowed for computation.

Returns
Memory limit

Definition at line 234 of file gumbel_params.hpp.

Referenced by alp_data::alp_data().

double CGumbelParamsOptions::GetMaxCalcTime ( void  ) const
inline

Get maximum calculation time allowed.

Returns
Maximum calculation time

Since the gapless calculation is also run during the gapped calculation (only for a and alpha ungapped parameters) it means that the total calculation time is equal to time(gapless calculation)+time(gapped calculation). Typically gapless calculation is quick but sometimes may take time. The program sets maximum allowed calculation time for gapless calculation as 0.5*(total maximum time). If the result is not received during this time then the program reports an error (throw an exception). After successful ungapped calculation the program calculates during the remaining available time and uses it for the gapped calculation. If the user requests gapless calculation only (m_IsGapped=false) then the program uses total allowed calculation time for the gapless calculation. If there is no result during this time then the program generates an error.

Definition at line 224 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

const vector<string>& CGumbelParamsOptions::GetMessages ( void  ) const
inline

Get error/warning messages.

Warning messages can be generated by the Validate() function if parameters are within their domains but their values are non-typical or can result in increased inaccuracies

Returns
List of error/warning messages

Definition at line 264 of file gumbel_params.hpp.

Referenced by CGumbelParamsApplication::Run().

Int4 CGumbelParamsOptions::GetNumResidues ( void  ) const
inline

Get number of residues in utilized alphabet.

Returns
Number of residues

Definition at line 239 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

const Int4** CGumbelParamsOptions::GetScoreMatrix ( void  ) const
inline

Get score matrix.

Returns
Pointer to score matrix

Definition at line 162 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

const TFrequencies& CGumbelParamsOptions::GetSeq1ResidueProbs ( void  ) const
inline

Get sequence 1 residue probabilities.

Returns
Residue probabilities for sequence 1

Definition at line 175 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

const TFrequencies& CGumbelParamsOptions::GetSeq2ResidueProbs ( void  ) const
inline

Get sequence 2 residue probabilities.

Returns
Residue probabilities for sequence 2

Definition at line 187 of file gumbel_params.hpp.

Referenced by alp_data::alp_data(), and CGumbelParamsCalc::Run().

bool CGumbelParamsOptions::IsMessage ( void  ) const
inline

Check whether there are any error/warning messages.

Returns
True if there are messages, false otherwise

Definition at line 255 of file gumbel_params.hpp.

CGumbelParamsOptions& CGumbelParamsOptions::operator= ( const CGumbelParamsOptions )
private

Forbid assignment operator.

void CGumbelParamsOptions::SetGapExtension ( Int4  g_exten)
inline

Set gap extention penalty.

Parameters
g_extenGap extension penalty [in]

Definition at line 97 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetGapOpening ( Int4  g_open)
inline

Set the value of gap opening penalty.

Parameters
g_openGap opening penalty [in]

Definition at line 87 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetGapped ( bool  gapped)
inline

Set gapped/gapless regime.

Parameters
gappedRegime (gapped if true, gapless otherwise) [in]

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 142 of file gumbel_params.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetKAccuracy ( double  k_err)
inline

Set relative error threshold for K parameter calculation for gapped alignment.

Parameters
k_errRelative error threshold [in]

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 127 of file gumbel_params.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetLambdaAccuracy ( double  lambda_err)
inline

Set relative error threshold for lambda parameter calculation for gapped aligmment.

Parameters
lambda_errRelative error threshold [in]

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 110 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetMaxCalcMemory ( double  mem)
inline

Set maximum memory allowed for computation.

Parameters
Memorylimit [in]

Definition at line 229 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetMaxCalcTime ( double  time)
inline

Set maximum calculation time allowed.

Parameters
timeMaximum calculation time [in]

Since the gapless calculation is also run during the gapped calculation (only for a and alpha ungapped parameters) it means that the total calculation time is equal to time(gapless calculation)+time(gapped calculation). Typically gapless calculation is quick but sometimes may take time. The program sets maximum allowed calculation time for gapless calculation as 0.5*(total maximum time). If the result is not received during this time then the program reports an error (throw an exception). After successful ungapped calculation the program calculates during the remaining available time and uses it for the gapped calculation. If the user requests gapless calculation only (m_IsGapped=false) then the program uses total allowed calculation time for the gapless calculation. If there is no result during this time then the program generates an error.

Definition at line 206 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptionsFactory::CreateBasicOptions(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), CGumbelParamsApplication::Run(), and s_CalcGumbelParams().

void CGumbelParamsOptions::SetScoreMatrix ( const CGeneralScoreMatrix smatrix)

Set score matrix.

Parameters
smatrixScore matrix values [in]

Definition at line 212 of file gumbel_params.cpp.

References m_ScoreMatrix, and CConstRef< C, Locker >::Reset().

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetScoreMatrix ( const CRef< CGeneralScoreMatrix > &  smatrix)

Set score matrix.

Parameters
smatrixScore matrix [in]

Definition at line 217 of file gumbel_params.cpp.

References CRef< C, Locker >::GetNonNullPointer(), m_NumResidues, m_ScoreMatrix, and CConstRef< C, Locker >::Reset().

void CGumbelParamsOptions::SetSeq1ResidueProbs ( const TFrequencies probs)
inline

Set residue probabilities for sequence 1.

Parameters
probsResidue probabilities [in]

Definition at line 168 of file gumbel_params.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

void CGumbelParamsOptions::SetSeq2ResidueProbs ( const TFrequencies probs)
inline

Set residue probabilities for sequence 2.

Parameters
probsResidue probabilities [in]

Definition at line 181 of file gumbel_params.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsOptionsFactory::CreateStandard20AAOptions(), and CGumbelParamsApplication::Run().

bool CGumbelParamsOptions::Validate ( void  )

Validate parameter values.

Exception is thrown if options do not pass validation. False is returned if there are warnings.

Returns
True if options passed validation and false if there are warnings

Definition at line 88 of file gumbel_params.cpp.

References abs, fabs, CGeneralScoreMatrix::GetNumResidues(), CGeneralScoreMatrix::GetScore(), i, ITERATE, kMaxScore, m_GapExtension, m_GapOpening, m_KAccuracy, m_LambdaAccuracy, m_MaxCalcMemory, m_MaxCalcTime, m_Messages, m_NumResidues, m_ScoreMatrix, m_Seq1ResidueProbs, m_Seq2ResidueProbs, NCBI_THROW, and result.

Referenced by BOOST_AUTO_TEST_CASE(), CGumbelParamsApplication::Run(), and s_CalcGumbelParams().

Int4 CGumbelParamsOptions::x_GetScore ( Uint4  i,
Uint4  j 
) const
inlineprotected

Get socre matrix value for i-th and j-th residues.

Definition at line 270 of file gumbel_params.hpp.

void CGumbelParamsOptions::x_Init ( void  )
protected

Member Data Documentation

Int4 CGumbelParamsOptions::m_GapExtension
protected

Gap extension penalty.

Definition at line 284 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

Int4 CGumbelParamsOptions::m_GapOpening
protected

Gap opening penalty.

Definition at line 281 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

bool CGumbelParamsOptions::m_IsGapped
protected

Gapped/gapless regime, true for gapped, false for gapless.

For gapless regime calculation accuracy for all parameters is always 1e-06 m_LambdaAccuracy and m_KAccuary are not used.

Definition at line 297 of file gumbel_params.hpp.

Referenced by x_Init().

double CGumbelParamsOptions::m_KAccuracy
protected

Desired accuracy for parameter K computation only for gapped alignment.

Definition at line 292 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

double CGumbelParamsOptions::m_LambdaAccuracy
protected

Desired accuracy for lambda computation only for gapped aligmment.

Definition at line 288 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

double CGumbelParamsOptions::m_MaxCalcMemory
protected

Maximum allowed calculation memory.

Definition at line 315 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

double CGumbelParamsOptions::m_MaxCalcTime
protected

Maximum allowed calculation time.

Definition at line 312 of file gumbel_params.hpp.

Referenced by Validate(), and x_Init().

vector<string> CGumbelParamsOptions::m_Messages
protected

Warning messages.

Definition at line 318 of file gumbel_params.hpp.

Referenced by Validate().

Int4 CGumbelParamsOptions::m_NumResidues
protected

Number of residues in alphabet.

Definition at line 309 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptions(), SetScoreMatrix(), Validate(), and x_Init().

CConstRef<CGeneralScoreMatrix> CGumbelParamsOptions::m_ScoreMatrix
protected

Scoring matrix.

Definition at line 300 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptions(), SetScoreMatrix(), and Validate().

TFrequencies CGumbelParamsOptions::m_Seq1ResidueProbs
protected

Residue frequencies for sequence 1.

Definition at line 303 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptions(), and Validate().

TFrequencies CGumbelParamsOptions::m_Seq2ResidueProbs
protected

Residue frequencies for sequence 2.

Definition at line 306 of file gumbel_params.hpp.

Referenced by CGumbelParamsOptions(), and Validate().


The documentation for this class was generated from the following files:
Modified on Wed Apr 26 17:45:19 2017 by modify_doxy.py rev. 533848