;
69query_v.push_back(*qsl);
81 prog, strand_opt, blast_msg);
83BOOST_REQUIRE(m->empty());
88BOOST_REQUIRE(rv == 0);
93BOOST_REQUIRE(status == 0);
99BOOST_REQUIRE_EQUAL(-3, (
int) sbp->
loscore);
100BOOST_REQUIRE_EQUAL(1, (
int) sbp->
hiscore);
101BOOST_REQUIRE_EQUAL(-3, (
int) sbp->
penalty);
102BOOST_REQUIRE_EQUAL(1, (
int) sbp->
reward);
105BOOST_REQUIRE(sbp ==
NULL);
114query_v.push_back(*qsl);
126 prog, strand_opt, blast_msg);
128BOOST_REQUIRE(m->empty());
133BOOST_REQUIRE(rv == 0);
138BOOST_REQUIRE(status == 0);
144BOOST_REQUIRE_EQUAL(-4, (
int) sbp->
loscore);
145BOOST_REQUIRE_EQUAL(11, (
int) sbp->
hiscore);
148BOOST_REQUIRE(sbp ==
NULL);
153 const stringkPhiPattern(
"EVALNAEGWQSSG");
154 const stringkMatrix(
"BLOSUM45");
155 const intkGapOpenBad = 16;
156 const intkGapOpenGood = 14;
157 const intkGapExtend = 2;
158 const stringkErrorMsg(
"The combination 16 for gap opening cost");
159 const doublekPhiLambda = 0.199;
160 const doublekPhiK = 0.040;
165query_v.push_back(*qsl);
179 prog, strand_opt, blast_msg);
181BOOST_REQUIRE(m->empty());
186BOOST_REQUIRE(rv == 0);
189scoring_opts->
gap_open= kGapOpenBad;
202BOOST_REQUIRE_EQUAL(-1, (
int)status);
204BOOST_REQUIRE(sbp ==
NULL);
206BOOST_REQUIRE(!
strncmp(kErrorMsg.c_str(), blast_message->
message,
212scoring_opts->
gap_open= kGapOpenGood;
219BOOST_REQUIRE_EQUAL(0, (
int) status);
224BOOST_REQUIRE(sbp->
kbp_gap[0]->
K== kPhiK);
225BOOST_REQUIRE(sbp->
kbp_gap[0]->
H> 0);
226BOOST_REQUIRE(sbp->
kbp[0]->
Lambda== kPhiLambda);
227BOOST_REQUIRE(sbp->
kbp[0]->
K== kPhiK);
228BOOST_REQUIRE(sbp->
kbp[0]->
H> 0);
231BOOST_REQUIRE(sbp ==
NULL);
239pair<TSeqPos, TSeqPos> range(start, stop);
242query_v.push_back(*qsl);
254 prog, strand_opt, blast_msg);
256BOOST_REQUIRE(m->empty());
261BOOST_REQUIRE(rv == 0);
269BOOST_REQUIRE(filter_maskloc ==
NULL);
275scoring_opts, kProgram, &sbp,
280BOOST_REQUIRE_EQUAL(0, (
int) status);
281BOOST_REQUIRE(blast_message !=
NULL);
287BOOST_REQUIRE_EQUAL(-4, (
int) sbp->
loscore);
288BOOST_REQUIRE_EQUAL(11, (
int) sbp->
hiscore);
291BOOST_REQUIRE(blast_message ==
NULL);
293BOOST_REQUIRE(sbp ==
NULL);
311BOOST_REQUIRE_EQUAL(0, (
int)
BLAST_Nint(100000*stdrfp->
prob[2]));
312BOOST_REQUIRE_EQUAL(0, (
int)
BLAST_Nint(100000*stdrfp->
prob[21]));
314BOOST_REQUIRE_EQUAL(3856, (
int)
BLAST_Nint(100000*stdrfp->
prob[6]));
315BOOST_REQUIRE_EQUAL(2243, (
int)
BLAST_Nint(100000*stdrfp->
prob[12]));
316BOOST_REQUIRE_EQUAL(3216, (
int)
BLAST_Nint(100000*stdrfp->
prob[22]));
319BOOST_REQUIRE(stdrfp ==
NULL);
334 const intnum_real_bases = 4;
336 for(
intindex=0; index<num_real_bases; index++)
337BOOST_REQUIRE_EQUAL(25, (
int)(100*stdrfp->
prob[index]));
339 for(
intindex=num_real_bases; index<sbp.
alphabet_size; index++)
340BOOST_REQUIRE_EQUAL(0, (
int)(100*stdrfp->
prob[index]));
343BOOST_REQUIRE(stdrfp ==
NULL);
386BOOST_REQUIRE_EQUAL(0, (
int) status);
387BOOST_REQUIRE_EQUAL(
false, (
bool) sbp->
round_down);
388BOOST_REQUIRE_CLOSE(1.32, kbp->
Lambda, 0.001);
389BOOST_REQUIRE_CLOSE(0.57, kbp->
K, 0.001);
390BOOST_REQUIRE_CLOSE(-0.562, kbp->
logK, 0.1);
391BOOST_REQUIRE(error_msg.
Get() ==
NULL);
399BOOST_REQUIRE_CLOSE(1.3, alpha, 0.001);
400BOOST_REQUIRE_CLOSE(-1.0, beta, 0.001);
412BOOST_REQUIRE_EQUAL(0, (
int) status);
413BOOST_REQUIRE_EQUAL(
false, (
bool) sbp->
round_down);
415BOOST_REQUIRE_EQUAL(sbp->
kbp_ideal->
K, kbp->
K);
417BOOST_REQUIRE(error_msg.
Get() ==
NULL);
425BOOST_REQUIRE_EQUAL(0.0, beta);
439BOOST_REQUIRE_EQUAL(0, (
int) status);
440BOOST_REQUIRE_EQUAL(
false, (
bool) sbp->
round_down);
441BOOST_REQUIRE_CLOSE(0.132, kbp->
Lambda, 0.001);
442BOOST_REQUIRE_CLOSE(0.57, kbp->
K, 0.001);
443BOOST_REQUIRE_CLOSE(-0.562, kbp->
logK, 0.1);
457BOOST_REQUIRE_EQUAL(0, (
int) status);
458BOOST_REQUIRE_EQUAL(
true, (
bool) sbp->
round_down);
459BOOST_REQUIRE_CLOSE(0.675, kbp->
Lambda, 0.001);
460BOOST_REQUIRE_CLOSE(0.62, kbp->
K, 0.001);
461BOOST_REQUIRE_CLOSE(-0.478036, kbp->
logK, 0.001);
462BOOST_REQUIRE(error_msg.
Get() ==
NULL);
476BOOST_REQUIRE_EQUAL(1, (
int) status);
477BOOST_REQUIRE(!
strncmp(
"Gap existence and extension values 3 and 2 are not supported for substitution scores 4 and -5",
492BOOST_REQUIRE_EQUAL(1, (
int) status);
493BOOST_REQUIRE(!
strncmp(
"Gap existence and extension values 1 and 3 are not supported for substitution scores 1 and -2",
504BOOST_REQUIRE_EQUAL(0.0, beta);
514BOOST_REQUIRE_EQUAL(-1, (
int) status);
515BOOST_REQUIRE(!
strcmp(
"Substitution scores 2 and -1 are not supported",
525BOOST_REQUIRE_EQUAL(0.0, beta);
535BOOST_REQUIRE_EQUAL(-2.0, beta);
538BOOST_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