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

NCBI C++ ToolKit: src/algo/blast/unit_tests/blastdb/bdbloader_unit_test.cpp Source File

49 #ifndef SKIP_DOXYGEN_PROCESSING 61  bool

use_fixed_slice_size,

62  bool

use_remote_blast_db_loader =

false

) {

64  if

(use_remote_blast_db_loader) {

110

BOOST_REQUIRE(bioseq.CanGetInst());

111  switch

(bioseq.GetInst().GetRepr()) {

113

BOOST_REQUIRE(bioseq.GetInst().CanGetSeq_data());

116

BOOST_REQUIRE( !bioseq.GetInst().CanGetSeq_data() );

117

BOOST_REQUIRE( bioseq.GetInst().CanGetExt() );

118

BOOST_REQUIRE( bioseq.GetInst().GetExt().IsDelta() );

129  const string

db(

"nt"

);

130  const bool

is_protein =

false

;

131  const bool

use_fixed_slice_size =

true

;

132  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

138

BOOST_REQUIRE_EQUAL(kLength,

len

);

140

BOOST_REQUIRE_EQUAL(is_protein,

145

BOOST_REQUIRE_EQUAL(kLength, retval->

GetLength

());

164  const CSeq_id

id(

"CAA62188.1"

);

166  const string

db(

"nr"

);

167  const bool

is_protein =

true

;

168  const bool

use_fixed_slice_size =

false

;

169  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

175

BOOST_REQUIRE_EQUAL(kLength,

len

);

177

BOOST_REQUIRE_EQUAL(is_protein,

182

BOOST_REQUIRE_EQUAL(kLength, retval->

GetLength

());

211  const string

db(

"nucl_dbs"

);

212  const bool

is_protein =

false

;

213  const bool

use_fixed_slice_size =

false

;

214  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

220

BOOST_REQUIRE_EQUAL(kLength,

len

);

222

BOOST_REQUIRE_EQUAL(is_protein,

227

BOOST_REQUIRE_EQUAL(kLength, retval->

GetLength

());

249  const string

db(

"9606_genomic"

);

250  const bool

is_protein =

false

;

251  const bool

use_fixed_slice_size =

true

;

252  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

257  const TSeqPos

kLength(61707364);

259

BOOST_REQUIRE_EQUAL(kLength,

len

);

261

BOOST_REQUIRE_EQUAL(is_protein,

265

BOOST_REQUIRE_EQUAL(kRange, kTestRange);

268

BOOST_REQUIRE(sl->

GetId

());

271

BOOST_REQUIRE_EQUAL(is_protein, bh.

IsAa

());

275

BOOST_REQUIRE_EQUAL(kLength, retval->

GetLength

());

281

BOOST_REQUIRE(sv.

size

() == kLength);

287  char

seq_data[] =

"ATTCCAGCCTCTAGGACACAGTGGCAGCCACATAATTGGTATCTCTTAAGGTCCAGCACGAGGTGGAGCACATGGTGGAGAGACAGATGCAGTGACCTGGAACCCAGGAGTGAGGGAGCCAGGACTCAGGCCCAAGGCTCCTGAGAGGCATCTGGCCCTCCCTGCACTGTGCCAGCAGCTTGGAGAACCCACACTCAATGAACGCAGCACTCCACTACCCAGGAAATGCCTTCCTGCCCTCTCCTCATCCCATCCCTGGGCAGGGGACATGCAACTGTCTACAAGGTGCCAAGTACCAGGACAGGAAAGGAAAGACGCCAAAAATCCAGCGCTGCCCTCAGAGAAGGGCAACCACGCAGTCCCCATCTTGGCAAGGAAACACAATTTCCGAGGGAATGGT"

;

288

BOOST_REQUIRE_EQUAL(

sizeof

(seq_data)/

sizeof

(seq_data[0]),

290  for

(

size_t i

= 0;

i

<

buffer

.size();

i

++) {

291  const string

ref(1, seq_data[

i

]);

293  string msg

(

"Unexpected base at position "

);

296

BOOST_REQUIRE_MESSAGE(ref ==

test

,

msg

);

316  const string

db(

"9606_genomic"

);

317  const bool

is_protein =

false

;

318  const bool

use_fixed_slice_size =

false

;

319  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

325  const TSeqPos

kLength(61707364);

326

BOOST_REQUIRE_EQUAL(kLength,

len

);

330

BOOST_REQUIRE_EQUAL(kLength, retval->

GetLength

());

349 class

CGiFinderThread :

public CThread 352

CGiFinderThread(

CRef<CScope>

scope,

const

vector<int>& gis2find)

353

:

m_Scope

(scope), m_Gis2Find(gis2find) {}

355  virtual void

*

Main

() {

357  for

(

TSeqPos i

= 0;

i

< m_Gis2Find.size();

i

++) {

358  int

gi = m_Gis2Find[random.

GetRand

() % m_Gis2Find.size()];

380  const

vector<int>& m_Gis2Find;

383 void

MultiThreadedAccess(

bool

is_remote)

388  const string

db(

"ecoli"

);

389  const bool

is_protein =

true

;

390  const bool

use_fixed_slice_size =

true

;

391  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

395

scope->AddDefaults();

397  typedef

vector< CRef<CGiFinderThread> > TTesterThreads;

399

TTesterThreads the_threads(kNumThreads);

402

the_threads[

i

].Reset(

new

CGiFinderThread(scope, gis));

403

BOOST_REQUIRE(the_threads[

i

].NotEmpty());

412

(*thread)->Join(

reinterpret_cast<void

**

>

(&

result

));

413

BOOST_REQUIRE_EQUAL(0L,

result

);

419

MultiThreadedAccess(

false

);

424

MultiThreadedAccess(

true

);

433  const string

db(

"pataa"

);

434  const bool

is_protein =

true

;

435  const bool

use_fixed_slice_size =

true

;

436  CAutoRegistrar

reg(db, is_protein, use_fixed_slice_size, is_remote);

443

BOOST_REQUIRE( !bh );

static CRef< CScope > m_Scope

User-defined methods of the data storage class.

Data loader implementation that uses the blast databases.

Data loader implementation that uses the blast databases remotely.

void TestCSeq_inst(const CBioseq &bioseq)

This function tests the ways in which the sequence data is populated in a CBioseq loaded by the objec...

void RetrieveLargeNuclSequence(bool is_remote)

void TestDataNotFound(bool is_remote)

void RetrieveLargeProteinWithTimeOut(bool is_remote)

void RetrievePartsOfLargeChromosome(bool is_remote)

BOOST_AUTO_TEST_CASE_TIMEOUT(RetrieveGi555WithTimeOut_Local, 5)

void RetrieveGi555WithTimeOut(bool is_remote)

void RetrieveLargeChromosomeWithTimeOut(bool is_remote)

const time_t kTimeOutLargeProtein

BOOST_AUTO_TEST_CASE(RetrieveGi555WithTimeOut_Local)

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

Auxiliary class to register the BLAST database data loader of choice (information provided in the con...

void RegisterGenbankDataLoader()

CAutoRegistrar(const string &dbname, bool is_protein, bool use_fixed_slice_size, bool use_remote_blast_db_loader=false)

TSeqPos GetLength(void) const

bool IsSetLength(void) const

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const string &dbname="nr", const EDbType dbtype=eUnknown, bool use_fixed_size_slices=true, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

@ eNucleotide

nucleotide database

@ eProtein

protein database

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const string &dbname="nr", const EDbType dbtype=eUnknown, bool use_fixed_size_slices=true, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

#define test(a, b, c, d, e)

unsigned int TSeqPos

Type for sequence locations and lengths.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

TRange GetTotalRange(void) const

const CSeq_id * GetId(void) const

Get the id of the location return NULL if has multiple ids or no id at all.

TSeqPos GetLength(const CSeq_id &id, CScope *scope)

Get sequence length if scope not null, else return max possible TSeqPos.

void ResetHistory(EActionIfLocked action=eKeepIfLocked)

Clean all unused TSEs from the scope's cache and release the memory.

TLoader * GetLoader(void) const

Get pointer to the loader.

static CRef< CObjectManager > GetInstance(void)

Return the existing object manager or create one.

TSeqPos GetSequenceLength(const CSeq_id &id, TGetFlags flags=0)

Get sequence length Return kInvalidSeqPos if sequence is not found.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

void AddDefaults(TPriority pri=kPriority_Default)

Add default data loaders from object manager.

CSeq_inst::TMol GetSequenceType(const CSeq_id &id, TGetFlags flags=0)

Get molecular type of sequence (protein/dna/rna) Return CSeq_inst::eMol_not_set if sequence is not fo...

@ kPriority_NotSet

Deprecated: use kPriority_Default instead.

CConstRef< CBioseq > GetCompleteBioseq(void) const

Get the complete bioseq.

TBioseqCore GetBioseqCore(void) const

Get bioseq core structure.

CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const

Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.

@ eCoding_Iupac

Set coding to printable coding (Iupacna or Iupacaa)

void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const

Fill the buffer string with the sequence data for the interval [start, stop).

TValue GetRand(void)

Get the next random number in the interval [0..GetMax()] (inclusive)

position_type GetLength(void) const

static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)

Convert size_t to string.

virtual void * Main(void)=0

Derived (user-created) class must provide a real thread function.

TTo GetTo(void) const

Get the To member data.

TFrom GetFrom(void) const

Get the From member data.

@ e_Gi

GenInfo Integrated Database.

const TInst & GetInst(void) const

Get the Inst member data.

TLength GetLength(void) const

Get the Length member data.

bool CanGetSeq_data(void) const

Check if it is safe to call GetSeq_data method.

bool CanGetInst(void) const

Check if it is safe to call GetInst method.

@ eRepr_delta

sequence made by changes (delta) to others

@ eRepr_raw

continuous sequence

char * dbname(DBPROCESS *dbproc)

Get name of current database.

Multi-threading – classes, functions, and features.

BOOST_AUTO_TEST_SUITE(psiblast_iteration)

Defines exception class and several constants for SeqDB.

void SeqDB_ReadGiList(const string &fname, vector< CSeqDBGiList::SGiOid > &gis, bool *in_order=0)

Read a text or binary GI list from a file.

static const char * kAccession

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

CRef< objects::CObjectManager > om

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