A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/scoreblk__unit__test_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/blast/unit_tests/api/scoreblk_unit_test.cpp Source File

58 using namespace ncbi

;

69

query_v.push_back(*qsl);

81  prog

, strand_opt, blast_msg);

83

BOOST_REQUIRE(m->empty());

88

BOOST_REQUIRE(rv == 0);

93

BOOST_REQUIRE(status == 0);

99

BOOST_REQUIRE_EQUAL(-3, (

int

) sbp->

loscore

);

100

BOOST_REQUIRE_EQUAL(1, (

int

) sbp->

hiscore

);

101

BOOST_REQUIRE_EQUAL(-3, (

int

) sbp->

penalty

);

102

BOOST_REQUIRE_EQUAL(1, (

int

) sbp->

reward

);

105

BOOST_REQUIRE(sbp ==

NULL

);

114

query_v.push_back(*qsl);

126  prog

, strand_opt, blast_msg);

128

BOOST_REQUIRE(m->empty());

133

BOOST_REQUIRE(rv == 0);

138

BOOST_REQUIRE(status == 0);

144

BOOST_REQUIRE_EQUAL(-4, (

int

) sbp->

loscore

);

145

BOOST_REQUIRE_EQUAL(11, (

int

) sbp->

hiscore

);

148

BOOST_REQUIRE(sbp ==

NULL

);

153  const string

kPhiPattern(

"EVALNAEGWQSSG"

);

154  const string

kMatrix(

"BLOSUM45"

);

155  const int

kGapOpenBad = 16;

156  const int

kGapOpenGood = 14;

157  const int

kGapExtend = 2;

158  const string

kErrorMsg(

"The combination 16 for gap opening cost"

);

159  const double

kPhiLambda = 0.199;

160  const double

kPhiK = 0.040;

165

query_v.push_back(*qsl);

179  prog

, strand_opt, blast_msg);

181

BOOST_REQUIRE(m->empty());

186

BOOST_REQUIRE(rv == 0);

189

scoring_opts->

gap_open

= kGapOpenBad;

202

BOOST_REQUIRE_EQUAL(-1, (

int

)status);

204

BOOST_REQUIRE(sbp ==

NULL

);

206

BOOST_REQUIRE(!

strncmp

(kErrorMsg.c_str(), blast_message->

message

,

212

scoring_opts->

gap_open

= kGapOpenGood;

219

BOOST_REQUIRE_EQUAL(0, (

int

) status);

224

BOOST_REQUIRE(sbp->

kbp_gap

[0]->

K

== kPhiK);

225

BOOST_REQUIRE(sbp->

kbp_gap

[0]->

H

> 0);

226

BOOST_REQUIRE(sbp->

kbp

[0]->

Lambda

== kPhiLambda);

227

BOOST_REQUIRE(sbp->

kbp

[0]->

K

== kPhiK);

228

BOOST_REQUIRE(sbp->

kbp

[0]->

H

> 0);

231

BOOST_REQUIRE(sbp ==

NULL

);

239

pair<TSeqPos, TSeqPos> range(start, stop);

242

query_v.push_back(*qsl);

254  prog

, strand_opt, blast_msg);

256

BOOST_REQUIRE(m->empty());

261

BOOST_REQUIRE(rv == 0);

269

BOOST_REQUIRE(filter_maskloc ==

NULL

);

275

scoring_opts, kProgram, &sbp,

280

BOOST_REQUIRE_EQUAL(0, (

int

) status);

281

BOOST_REQUIRE(blast_message !=

NULL

);

287

BOOST_REQUIRE_EQUAL(-4, (

int

) sbp->

loscore

);

288

BOOST_REQUIRE_EQUAL(11, (

int

) sbp->

hiscore

);

291

BOOST_REQUIRE(blast_message ==

NULL

);

293

BOOST_REQUIRE(sbp ==

NULL

);

311

BOOST_REQUIRE_EQUAL(0, (

int

)

BLAST_Nint

(100000*stdrfp->

prob

[2]));

312

BOOST_REQUIRE_EQUAL(0, (

int

)

BLAST_Nint

(100000*stdrfp->

prob

[21]));

314

BOOST_REQUIRE_EQUAL(3856, (

int

)

BLAST_Nint

(100000*stdrfp->

prob

[6]));

315

BOOST_REQUIRE_EQUAL(2243, (

int

)

BLAST_Nint

(100000*stdrfp->

prob

[12]));

316

BOOST_REQUIRE_EQUAL(3216, (

int

)

BLAST_Nint

(100000*stdrfp->

prob

[22]));

319

BOOST_REQUIRE(stdrfp ==

NULL

);

334  const int

num_real_bases = 4;

336  for

(

int

index=0; index<num_real_bases; index++)

337

BOOST_REQUIRE_EQUAL(25, (

int

)(100*stdrfp->

prob

[index]));

339  for

(

int

index=num_real_bases; index<sbp.

alphabet_size

; index++)

340

BOOST_REQUIRE_EQUAL(0, (

int

)(100*stdrfp->

prob

[index]));

343

BOOST_REQUIRE(stdrfp ==

NULL

);

386

BOOST_REQUIRE_EQUAL(0, (

int

) status);

387

BOOST_REQUIRE_EQUAL(

false

, (

bool

) sbp->

round_down

);

388

BOOST_REQUIRE_CLOSE(1.32, kbp->

Lambda

, 0.001);

389

BOOST_REQUIRE_CLOSE(0.57, kbp->

K

, 0.001);

390

BOOST_REQUIRE_CLOSE(-0.562, kbp->

logK

, 0.1);

391

BOOST_REQUIRE(error_msg.

Get

() ==

NULL

);

399

BOOST_REQUIRE_CLOSE(1.3, alpha, 0.001);

400

BOOST_REQUIRE_CLOSE(-1.0, beta, 0.001);

412

BOOST_REQUIRE_EQUAL(0, (

int

) status);

413

BOOST_REQUIRE_EQUAL(

false

, (

bool

) sbp->

round_down

);

415

BOOST_REQUIRE_EQUAL(sbp->

kbp_ideal

->

K

, kbp->

K

);

417

BOOST_REQUIRE(error_msg.

Get

() ==

NULL

);

425

BOOST_REQUIRE_EQUAL(0.0, beta);

439

BOOST_REQUIRE_EQUAL(0, (

int

) status);

440

BOOST_REQUIRE_EQUAL(

false

, (

bool

) sbp->

round_down

);

441

BOOST_REQUIRE_CLOSE(0.132, kbp->

Lambda

, 0.001);

442

BOOST_REQUIRE_CLOSE(0.57, kbp->

K

, 0.001);

443

BOOST_REQUIRE_CLOSE(-0.562, kbp->

logK

, 0.1);

457

BOOST_REQUIRE_EQUAL(0, (

int

) status);

458

BOOST_REQUIRE_EQUAL(

true

, (

bool

) sbp->

round_down

);

459

BOOST_REQUIRE_CLOSE(0.675, kbp->

Lambda

, 0.001);

460

BOOST_REQUIRE_CLOSE(0.62, kbp->

K

, 0.001);

461

BOOST_REQUIRE_CLOSE(-0.478036, kbp->

logK

, 0.001);

462

BOOST_REQUIRE(error_msg.

Get

() ==

NULL

);

476

BOOST_REQUIRE_EQUAL(1, (

int

) status);

477

BOOST_REQUIRE(!

strncmp

(

"Gap existence and extension values 3 and 2 are not supported for substitution scores 4 and -5"

,

492

BOOST_REQUIRE_EQUAL(1, (

int

) status);

493

BOOST_REQUIRE(!

strncmp

(

"Gap existence and extension values 1 and 3 are not supported for substitution scores 1 and -2"

,

504

BOOST_REQUIRE_EQUAL(0.0, beta);

514

BOOST_REQUIRE_EQUAL(-1, (

int

) status);

515

BOOST_REQUIRE(!

strcmp

(

"Substitution scores 2 and -1 are not supported"

,

525

BOOST_REQUIRE_EQUAL(0.0, beta);

535

BOOST_REQUIRE_EQUAL(-2.0, beta);

538

BOOST_REQUIRE(kbp ==

NULL

);

Contains C++ wrapper classes to structures in algo/blast/core as well as some auxiliary functions to ...

#define sfree(x)

Safe free a pointer: belongs to a higher level header.

Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...

Declares the BLAST exception class.

void BlastSetUp_MaskQuery(BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, const BlastMaskLoc *filter_maskloc, EBlastProgramType program_number)

Masks the sequence given a BlastMaskLoc.

BlastMaskLoc * BlastMaskLocFree(BlastMaskLoc *mask_loc)

Deallocate memory for a BlastMaskLoc structure as well as the BlastSeqLoc's pointed to.

BlastMaskLoc * BlastMaskLocNew(Int4 total)

Allocate memory for a BlastMaskLoc.

BlastSeqLoc * BlastSeqLocNew(BlastSeqLoc **head, Int4 from, Int4 to)

Create and initialize a new sequence interval.

Blast_Message * Blast_MessageFree(Blast_Message *blast_msg)

Deallocates message memory.

Definitions which are dependant on the NCBI C++ Object Manager.

Int2 BlastScoringOptionsNew(EBlastProgramType program, BlastScoringOptions **options)

Allocate memory for BlastScoringOptions and fill with default values.

BlastScoringOptions * BlastScoringOptionsFree(BlastScoringOptions *options)

Deallocate memory for BlastScoringOptions.

Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.

EBlastProgramType

Defines the engine's notion of the different applications of the BLAST algorithm.

Utilities initialize/setup BLAST.

Int2 BlastSetup_ScoreBlkInit(BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, const BlastScoringOptions *scoring_options, EBlastProgramType program_number, BlastScoreBlk **sbpp, double scale_factor, Blast_Message **blast_message, GET_MATRIX_PATH get_path)

Initializes the score block structure.

Int2 Blast_ScoreBlkMatrixInit(EBlastProgramType program_number, const BlastScoringOptions *scoring_options, BlastScoreBlk *sbp, GET_MATRIX_PATH get_path)

Initializes the substitution matrix in the BlastScoreBlk according to the scoring options specified.

Definitions and prototypes used by blast_stat.c to calculate BLAST statistics.

BlastScoreBlk * BlastScoreBlkFree(BlastScoreBlk *sbp)

Deallocates BlastScoreBlk as well as all associated structures.

Int2 Blast_GetNuclAlphaBeta(Int4 reward, Int4 penalty, Int4 gap_open, Int4 gap_extend, Blast_KarlinBlk *kbp, Boolean gapped_calculation, double *alpha, double *beta)

Extract the alpha and beta settings for these substitution and gap scores.

Blast_ResFreq * Blast_ResFreqFree(Blast_ResFreq *rfp)

Deallocates Blast_ResFreq and prob0 element.

Blast_KarlinBlk * Blast_KarlinBlkNew(void)

Callocs a Blast_KarlinBlk.

Blast_KarlinBlk * Blast_KarlinBlkFree(Blast_KarlinBlk *kbp)

Deallocates the KarlinBlk.

Int2 Blast_ResFreqStdComp(const BlastScoreBlk *sbp, Blast_ResFreq *rfp)

Calculates residues frequencies given a standard distribution.

Int2 Blast_KarlinBlkNuclGappedCalc(Blast_KarlinBlk *kbp, Int4 gap_open, Int4 gap_extend, Int4 reward, Int4 penalty, Blast_KarlinBlk *kbp_ungap, Boolean *round_down, Blast_Message **error_return)

Retrieves Karlin-Altschul parameters from precomputed tables, given the substitution and gap scores.

Blast_ResFreq * Blast_ResFreqNew(const BlastScoreBlk *sbp)

Allocates a new Blast_ResFreq structure and fills in the prob element based upon the contents of sbp.

Int2 Blast_ScoreBlkKbpIdealCalc(BlastScoreBlk *sbp)

Calculates the Karlin-Altschul parameters assuming standard residue compositions for the query and su...

BlastScoreBlk * BlastScoreBlkNew(Uint1 alphabet, Int4 number_of_contexts)

Allocates and initializes BlastScoreBlk.

Definitions of special type used in BLAST.

@ eBlastn

Nucl-Nucl (traditional blastn)

@ eBlastp

Protein-Protein.

BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)

Wrapper class for BLAST_SequenceBlk .

Encapsulates ALL the BLAST algorithm's options.

Wrapper class for BlastQueryInfo .

Wrapper class for BlastScoreBlk .

Wrapper class for BlastScoringOptions .

Wrapper class for Blast_Message .

static CTestObjMgr & Instance()

typedef for the messages for an entire BLAST search, which could be comprised of multiple query seque...

void SetPHIPattern(const char *pattern, bool is_dna)

#define BLASTAA_SIZE

Size of aminoacid alphabet.

void Reset(Blast_Message *p=NULL)

void SetupQueries(TSeqLocVector &queries, BlastQueryInfo *qinfo, BLAST_SequenceBlk **seqblk, EBlastProgramType prog, objects::ENa_strand strand_opt, TSearchMessages &messages)

Populates BLAST_SequenceBlk with sequence data for use in CORE BLAST.

objects::ENa_strand GetStrandOption() const

#define BLASTNA_SEQ_CODE

Identifies the blastna alphabet, for use in blast only.

static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)

Creates an options handle object configured with default options for the requested program,...

CBlastOptions & SetOptions()

Returns a reference to the internal options class which this object is a handle for.

EBlastProgramType GetProgramType() const

Returns the CORE BLAST notion of program type.

const CBlastOptions & GetOptions() const

Return the object which this object is a handle for.

char * BlastFindMatrixPath(const char *matrix_name, Boolean is_prot)

Returns the path to a specified matrix.

void SetupQueryInfo(TSeqLocVector &queries, EBlastProgramType prog, objects::ENa_strand strand_opt, BlastQueryInfo **qinfo)

Allocates the query information structure and fills the context offsets, in case of multiple queries,...

Blast_Message * Get() const

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

int16_t Int2

2-byte (16-bit) signed integer

ENa_strand

strand of nucleic acid

@ eNa_strand_both

in forward orientation

Magic spell ;-) needed for some weird compilers... very empiric.

int strncmp(const char *str1, const char *str2, size_t count)

int strcmp(const char *str1, const char *str2)

Prototypes for portable math library (ported from C Toolkit)

long BLAST_Nint(double x)

Nearest integer.

#define TRUE

bool replacment for C indicating true.

#define FALSE

bool replacment for C indicating false.

BOOST_AUTO_TEST_SUITE(psiblast_iteration)

BOOST_AUTO_TEST_CASE(GetScoreBlockNucl)

vector< SSeqLoc > TSeqLocVector

Vector of sequence locations.

Structure for keeping the query masking information.

BlastSeqLoc ** seqloc_array

Array of masked locations.

Structure used for scoring calculations.

Boolean protein_alphabet

TRUE if alphabet_code is for a protein alphabet (e.g., ncbistdaa etc.), FALSE for nt.

Blast_KarlinBlk ** kbp

Karlin-Altschul parameters.

Blast_KarlinBlk ** kbp_gap

K-A parameters for gapped alignments.

Boolean round_down

Score must be rounded down to nearest even score if odd.

Int2 alphabet_start

numerical value of 1st letter.

Int2 alphabet_size

size of alphabet.

Uint1 alphabet_code

NCBI alphabet code.

Int4 penalty

penalty for mismatch in blastn.

Blast_KarlinBlk * kbp_ideal

Ideal values (for query with average database composition).

Blast_KarlinBlk ** kbp_gap_std

K-A parameters for std (not position-based) alignments.

Blast_KarlinBlk ** kbp_std

K-A parameters for ungapped alignments.

Int4 reward

reward for match in blastn.

Scoring options block Used to produce the BlastScoreBlk structure This structure may be needed for lo...

Int2 penalty

Penalty for a mismatch.

Int4 gap_open

Extra penalty for starting a gap.

Int4 gap_extend

Penalty for each gap residue.

Int2 reward

Reward for a match.

char * matrix

Name of the matrix containing all scores: needed for finding neighboring words.

Used to hold a set of positions, mostly used for filtering.

Structure to hold the Karlin-Altschul parameters.

double K

K value used in statistics.

double Lambda

Lambda value used in statistics.

double H

H value used in statistics.

double logK

natural log of K value used in statistics

Structure to hold the a message from the core of the BLAST engine.

char * message

User message to be saved.

Stores the letter frequency of a sequence or database.

Uint1 alphabet_code

indicates alphabet.

double * prob

letter probs, (possible) non-zero offset.

Utility stuff for more convenient using of Boost.Test library.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4