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/aascan__unit__test_8cpp_source.html below:

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

63 using namespace ncbi

;

67 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \ 68  (!defined(NCBI_COMPILER_MIPSPRO)) ) 105

unique_ptr<SSeqLoc> ssl

119

BOOST_REQUIRE_EQUAL(0, status);

121

query_sequence.

length

- 2);

122

BOOST_REQUIRE_EQUAL(0, status);

124

BOOST_REQUIRE(query_blk !=

NULL

);

125

BOOST_REQUIRE(query_blk->

sequence

[0] != 0);

126

BOOST_REQUIRE(query_blk->

sequence

[query_blk->

length

- 1] != 0);

138  CSeq_id

subject_id(

"gi|7481886"

);

140

unique_ptr<SSeqLoc> subject_ssl

155

BOOST_REQUIRE_EQUAL(0, status);

158

subj_sequence.

length

- 2);

159

BOOST_REQUIRE_EQUAL(0, status);

162

full_range.

left

= 0;

165

BOOST_REQUIRE_EQUAL(0, status);

167

BOOST_REQUIRE(subject_blk !=

NULL

);

168

BOOST_REQUIRE(subject_blk->

sequence

[0] != 0);

169

BOOST_REQUIRE(subject_blk->

sequence

[subject_blk->

length

- 1] != 0);

178

BOOST_REQUIRE_EQUAL(0, status);

184

BOOST_REQUIRE_EQUAL(0, status);

189

BOOST_REQUIRE_EQUAL(0, status);

199

BOOST_REQUIRE_EQUAL(0, status);

204

BOOST_REQUIRE(sbp !=

NULL

);

207

BOOST_REQUIRE_EQUAL(0, status);

220

BOOST_REQUIRE_EQUAL(0, status);

229

BOOST_REQUIRE(offset_pairs !=

NULL

);

245  sfree

(offset_pairs);

253  Int4

query_length = query_blk->length;

254  Int4

subject_length = subject_blk->length;

265

BOOST_REQUIRE(scansub !=

NULL

);

269

scan_range[2] = subject_blk->length - lut->

word_length

;

271  while

(scan_range[1] < scan_range[2])

273

hits = scansub(lookup_wrap_ptr,

299

BOOST_REQUIRE(offset_pairs[0].qs_offsets.s_off > s_off);

306  for

(

int i

= 1;

i

< hits;

i

++)

308

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.q_off <

309

(

Uint4

)(query_length-2));

310

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.s_off <

311

(

Uint4

)(subject_length-2));

313  if

(offset_pairs[

i

].qs_offsets.s_off ==

314

offset_pairs[

i

-1].qs_offsets.s_off)

316

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.q_off >

317

offset_pairs[

i

-1].qs_offsets.q_off);

321

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.s_off >

322

offset_pairs[

i

-1].qs_offsets.s_off);

326

s_off = offset_pairs[hits-1].qs_offsets.s_off;

327

BOOST_REQUIRE((

Int4

)s_off < scan_range[1]);

333  Int4

hits, found_hits, expected_hits;

337

found_hits = expected_hits = 0;

343

BOOST_REQUIRE(scansub !=

NULL

);

350

scan_range[2] = subject_blk->length - lut->

word_length

;

352  while

(scan_range[1] < scan_range[2])

354

hits = scansub(lookup_wrap_ptr,

361

expected_hits += hits;

366

scan_range[2] = subject_blk->length - lut->

word_length

;

370  while

(scan_range[1] < scan_range[2])

372

hits = scansub(lookup_wrap_ptr,

377

BOOST_REQUIRE(hits <= new_max_size);

381

BOOST_REQUIRE_EQUAL(found_hits, expected_hits);

386  Int4

subject_length = subject_blk->length;

388  Int4

found_hits, expected_hits;

391

found_hits = expected_hits = 0;

397

BOOST_REQUIRE(scansub !=

NULL

);

399  SSeqRange

ranges2scan[] = { {0, 501}, {700, 1001}, {subject_length, subject_length} };

400  const size_t

kNumRanges = (

sizeof

(ranges2scan)/

sizeof

(*ranges2scan));

407  while

(scan_range[1] < scan_range[2])

409

hits = scansub(lookup_wrap_ptr,

419  for

(

int i

= 0;

i

< hits;

i

++) {

420  const Uint4

s_off = offset_pairs[

i

].qs_offsets.s_off;

421  bool

hit_found =

FALSE

;

422  for

(

size_t

j = 0; j < kNumRanges; j++) {

423  if

( s_off >= (

Uint4

)ranges2scan[j].left &&

424

s_off < (

Uint4

)ranges2scan[j].right ) {

429

BOOST_REQUIRE( hit_found );

436  Int4

query_length = query_blk->length;

437  Int4

subject_length = subject_blk->length;

439  Int4

found_hits, expected_hits;

442

found_hits = expected_hits = 0;

448

BOOST_REQUIRE(scansub !=

NULL

);

455

scan_range[2] = subject_blk->length - lut->

word_length

;

457  while

(scan_range[1] < scan_range[2])

459

hits = scansub(lookup_wrap_ptr,

468  for

(

int i

= 0;

i

< hits;

i

++)

470  Uint1

*qres = query_blk->sequence + offset_pairs[

i

].qs_offsets.q_off;

472

subject_blk->sequence + offset_pairs[

i

].qs_offsets.s_off;

473  Int4

score = sbp->matrix->data[qres[0]][sres[0]] +

474

sbp->matrix->data[qres[1]][sres[1]] +

475

sbp->matrix->data[qres[2]][sres[2]];

476  Boolean

exact = (sres[0] == qres[0]) &&

477

(sres[1] == qres[1]) &&

478

(sres[2] == qres[2]);

504  for

(

int i

= 0;

i

< (query_length - 2);

i

++)

506  Uint1

*w = query_blk->sequence;

507  Uint1

*s = subject_blk->sequence;

508  Int4

*p0 = sbp->matrix->data[w[

i

]];

509  Int4

*p1 = sbp->matrix->data[w[

i

+1]];

510  Int4

*p2 = sbp->matrix->data[w[

i

+2]];

512  for

(

int

j = 0; j < (subject_length - 2); j++)

514  Int4

score = p0[s[j]] + p1[s[j+1]] + p2[s[j+2]];

515  Uint1

different = (w[

i

] ^ s[j]) |

516

(w[

i

+1] ^ s[j+1]) |

523

BOOST_REQUIRE_EQUAL(found_hits, expected_hits);

546

unique_ptr<SSeqLoc> ssl

560

BOOST_REQUIRE_EQUAL(0, status);

562

query_sequence.

length

- 2);

563

BOOST_REQUIRE_EQUAL(0, status);

572  CSeq_id

subject_id(

"APX54983.1"

);

574

unique_ptr<SSeqLoc> subject_ssl

589

BOOST_REQUIRE_EQUAL(0, status);

592

subj_sequence.

length

- 2);

593

BOOST_REQUIRE_EQUAL(0, status);

596

full_range.

left

= 0;

599

BOOST_REQUIRE_EQUAL(0, status);

605

BOOST_REQUIRE_EQUAL(0, status);

611

BOOST_REQUIRE_EQUAL(0, status);

616

BOOST_REQUIRE_EQUAL(0, status);

626

BOOST_REQUIRE_EQUAL(0, status);

631

BOOST_REQUIRE(sbp !=

NULL

);

634

BOOST_REQUIRE_EQUAL(0, status);

647

BOOST_REQUIRE_EQUAL(0, status);

656

BOOST_REQUIRE(offset_pairs !=

NULL

);

671  sfree

(offset_pairs);

679  Int4

query_length = query_blk->length;

680  Int4

subject_length = subject_blk->length;

691

BOOST_REQUIRE(scansub !=

NULL

);

695

scan_range[2] = subject_blk->length - lut->

word_length

;

697  while

(scan_range[1] < scan_range[2])

699

hits = scansub(lookup_wrap_ptr,

725

BOOST_REQUIRE(offset_pairs[0].qs_offsets.s_off > s_off);

732  for

(

int i

= 1;

i

< hits;

i

++)

734

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.q_off <

735

(

Uint4

)(query_length-2));

736

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.s_off <

737

(

Uint4

)(subject_length-2));

739  if

(offset_pairs[

i

].qs_offsets.s_off ==

740

offset_pairs[

i

-1].qs_offsets.s_off)

742

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.q_off >

743

offset_pairs[

i

-1].qs_offsets.q_off);

747

BOOST_REQUIRE(offset_pairs[

i

].qs_offsets.s_off >

748

offset_pairs[

i

-1].qs_offsets.s_off);

752

s_off = offset_pairs[hits-1].qs_offsets.s_off;

753

BOOST_REQUIRE((

Int4

)s_off < scan_range[1]);

759  Int4

query_length = query_blk->length;

760  Int4

subject_length = subject_blk->length;

769

BOOST_REQUIRE(scansub !=

NULL

);

776

scan_range[2] = subject_blk->length - lut->

word_length

;

778  while

(scan_range[1] < scan_range[2])

780

hits = scansub(lookup_wrap_ptr, subject_blk, offset_pairs,

GetOffsetArraySize

(lookup_wrap_ptr), scan_range);

786

BOOST_REQUIRE_EQUAL(found_hits, 2098);

791  Int4

subject_length = subject_blk->length;

793  Int4

found_hits, expected_hits;

796

found_hits = expected_hits = 0;

801

BOOST_REQUIRE(scansub !=

NULL

);

803  SSeqRange

ranges2scan[] = { {0, 501}, {700, 1001}, {subject_length, subject_length} };

804  const size_t

kNumRanges = (

sizeof

(ranges2scan)/

sizeof

(*ranges2scan));

811  while

(scan_range[1] < scan_range[2])

813

hits = scansub(lookup_wrap_ptr,

823  for

(

int i

= 0;

i

< hits;

i

++) {

824  const Uint4

s_off = offset_pairs[

i

].qs_offsets.s_off;

825  bool

hit_found =

FALSE

;

826  for

(

size_t

j = 0; j < kNumRanges; j++) {

827  if

( s_off >= (

Uint4

)ranges2scan[j].left &&

828

s_off < (

Uint4

)ranges2scan[j].right ) {

833

BOOST_REQUIRE( hit_found );

int compare_offsets(const void *x, const void *y)

BOOST_AUTO_TEST_CASE(ScanOffsetTest)

Declares the CBl2Seq (BLAST 2 Sequences) class.

Routines for creating protein BLAST lookup tables.

Routines for creating protein BLAST lookup tables.

void BlastChooseProteinScanSubject(LookupTableWrap *lookup_wrap)

Choose the most appropriate function to scan through protein subject sequences.

Int4(* TAaScanSubjectFunction)(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *s_range)

Generic prototype for nucleotide subject scanning routines.

union BlastOffsetPair BlastOffsetPair

This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...

#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 ...

BlastSeqLoc * BlastSeqLocFree(BlastSeqLoc *loc)

Deallocate all BlastSeqLoc objects in a chain.

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

Create and initialize a new sequence interval.

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

#define BLAST_GAP_OPEN_PROT

Protein gap costs are the defaults for the BLOSUM62 scoring matrix.

Int2 BLAST_FillScoringOptions(BlastScoringOptions *options, EBlastProgramType program, Boolean greedy_extension, Int4 penalty, Int4 reward, const char *matrix, Int4 gap_open, Int4 gap_extend)

Fill non-default values in the BlastScoringOptions structure.

#define BLAST_GAP_EXTN_PROT

cost to extend a gap.

Int2 BlastScoringOptionsNew(EBlastProgramType program, BlastScoringOptions **options)

Allocate memory for BlastScoringOptions and fill with default values.

Int2 BLAST_FillLookupTableOptions(LookupTableOptions *options, EBlastProgramType program, Boolean is_megablast, double threshold, Int4 word_size)

Allocate memory for lookup table options and fill with default values.

Int2 LookupTableOptionsNew(EBlastProgramType program, LookupTableOptions **options)

Allocate memory for lookup table options and fill with default values.

#define BLAST_WORD_THRESHOLD_BLASTP

neighboring word score thresholds; a threshold of zero means that only query and subject words that m...

@ eAaLookupTable

standard protein (blastp) lookup table

@ eCompressedAaLookupTable

compressed alphabet (blastp) lookup table

BlastScoringOptions * BlastScoringOptionsFree(BlastScoringOptions *options)

Deallocate memory for BlastScoringOptions.

LookupTableOptions * LookupTableOptionsFree(LookupTableOptions *options)

Deallocates memory for LookupTableOptions*.

Utilities initialize/setup BLAST.

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.

BlastScoreBlk * BlastScoreBlkNew(Uint1 alphabet, Int4 number_of_contexts)

Allocates and initializes BlastScoreBlk.

BLAST_SequenceBlk * BlastSequenceBlkFree(BLAST_SequenceBlk *seq_blk)

Deallocate memory for a sequence block.

Int2 BlastSeqBlkSetSeqRanges(BLAST_SequenceBlk *seq_blk, SSeqRange *seq_ranges, Uint4 num_seq_ranges, Boolean copy_seq_ranges, ESubjectMaskingType mask_type)

Sets the seq_range and related fields appropriately in the BLAST_SequenceBlk structure.

Int2 BlastSeqBlkSetSequence(BLAST_SequenceBlk *seq_blk, const Uint1 *sequence, Int4 seqlen)

Stores the sequence in the sequence block structure.

Int2 BlastSeqBlkNew(BLAST_SequenceBlk **retval)

Allocates a new sequence block structure.

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

static CTestObjMgr & Instance()

TSeqPos length

Length of the buffer above (not necessarily sequence length!)

#define BLASTAA_SEQ_CODE

== Seq_code_ncbistdaa

TAutoUint1Ptr data

Sequence data.

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

Returns the path to a specified matrix.

SBlastSequence GetSequence(const objects::CSeq_loc &sl, EBlastEncoding encoding, objects::CScope *scope, objects::ENa_strand strand=objects::eNa_strand_plus, ESentinelType sentinel=eSentinels, std::string *warnings=NULL)

Retrieves a sequence using the object manager.

@ eBlastEncodingProtein

NCBIstdaa.

@ eNoSentinels

Do not use sentinel bytes.

element_type * release(void)

Release will release ownership of pointer to caller.

uint8_t Uint1

1-byte (8-bit) unsigned integer

int32_t Int4

4-byte (32-bit) signed integer

uint32_t Uint4

4-byte (32-bit) unsigned integer

Utility functions for lookup table generation.

Int4 GetOffsetArraySize(LookupTableWrap *lookup)

Determine the size of the offsets arrays to be filled by the ScanSubject function.

LookupTableWrap * LookupTableWrapFree(LookupTableWrap *lookup)

Deallocate memory for the lookup table.

Int2 LookupTableWrapInit(BLAST_SequenceBlk *query, const LookupTableOptions *lookup_options, const QuerySetUpOptions *query_options, BlastSeqLoc *lookup_segments, BlastScoreBlk *sbp, LookupTableWrap **lookup_wrap_ptr, const BlastRPSInfo *rps_info, Blast_Message **error_msg, BlastSeqSrc *seqsrc)

Create the lookup table for all query words.

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

Uint1 Boolean

bool replacment for C

#define TRUE

bool replacment for C indicating true.

#define FALSE

bool replacment for C indicating false.

#define MAX(a, b)

returns larger of a and b.

Defines: CTimeFormat - storage class for time format.

The test fixture to use for all test cases in this file.

LookupTableWrap * lookup_wrap_ptr

BlastScoringOptions * score_options

BLAST_SequenceBlk * subject_blk

BlastOffsetPair * offset_pairs

BLAST_SequenceBlk * query_blk

LookupTableOptions * lookup_options

Structure to hold a sequence.

Uint1 * sequence_start

Start of sequence, usually one byte before sequence as that byte is a NULL sentinel byte.

Uint4 num_seq_ranges

Number of elements in seq_ranges.

Int4 length

Length of sequence.

Uint1 * sequence

Sequence used for search (could be translation).

The basic lookup table structure for blastp searches.

void * scansub_callback

function for scanning subject sequences

Int4 word_length

Length in letters of the full word match required to trigger extension.

The lookup table structure for protein searches using a compressed alphabet.

void * scansub_callback

function for scanning subject sequences

Int4 word_length

Length in letters of the full word match required to trigger extension.

Structure used for scoring calculations.

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

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

BlastScoringOptions * score_options

LookupTableOptions * lookup_options

BLAST_SequenceBlk * subject_blk

CompressedAascanTestFixture()

~CompressedAascanTestFixture()

BLAST_SequenceBlk * query_blk

BlastOffsetPair * offset_pairs

LookupTableWrap * lookup_wrap_ptr

Options needed to construct a lookup table Also needed: query sequence and query length.

Wrapper structure for different types of BLAST lookup tables.

Structure to store sequence data and its length for use in the CORE of BLAST (it's a malloc'ed array ...

A structure containing two integers, used e.g.

Int4 left

left endpoint of range (zero based)

Int4 right

right endpoint of range (zero based)

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

This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...

Uint4 q_off

Query offset.

Uint4 s_off

Subject offset.

struct BlastOffsetPair::@6 qs_offsets

Query/subject offset pair.


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