use_fixed_slice_size,
62 booluse_remote_blast_db_loader =
false) {
64 if(use_remote_blast_db_loader) {
110BOOST_REQUIRE(bioseq.CanGetInst());
111 switch(bioseq.GetInst().GetRepr()) {
113BOOST_REQUIRE(bioseq.GetInst().CanGetSeq_data());
116BOOST_REQUIRE( !bioseq.GetInst().CanGetSeq_data() );
117BOOST_REQUIRE( bioseq.GetInst().CanGetExt() );
118BOOST_REQUIRE( bioseq.GetInst().GetExt().IsDelta() );
129 const stringdb(
"nt");
130 const boolis_protein =
false;
131 const booluse_fixed_slice_size =
true;
132 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
138BOOST_REQUIRE_EQUAL(kLength,
len);
140BOOST_REQUIRE_EQUAL(is_protein,
145BOOST_REQUIRE_EQUAL(kLength, retval->
GetLength());
164 const CSeq_idid(
"CAA62188.1");
166 const stringdb(
"nr");
167 const boolis_protein =
true;
168 const booluse_fixed_slice_size =
false;
169 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
175BOOST_REQUIRE_EQUAL(kLength,
len);
177BOOST_REQUIRE_EQUAL(is_protein,
182BOOST_REQUIRE_EQUAL(kLength, retval->
GetLength());
211 const stringdb(
"nucl_dbs");
212 const boolis_protein =
false;
213 const booluse_fixed_slice_size =
false;
214 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
220BOOST_REQUIRE_EQUAL(kLength,
len);
222BOOST_REQUIRE_EQUAL(is_protein,
227BOOST_REQUIRE_EQUAL(kLength, retval->
GetLength());
249 const stringdb(
"9606_genomic");
250 const boolis_protein =
false;
251 const booluse_fixed_slice_size =
true;
252 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
257 const TSeqPoskLength(61707364);
259BOOST_REQUIRE_EQUAL(kLength,
len);
261BOOST_REQUIRE_EQUAL(is_protein,
265BOOST_REQUIRE_EQUAL(kRange, kTestRange);
268BOOST_REQUIRE(sl->
GetId());
271BOOST_REQUIRE_EQUAL(is_protein, bh.
IsAa());
275BOOST_REQUIRE_EQUAL(kLength, retval->
GetLength());
281BOOST_REQUIRE(sv.
size() == kLength);
287 charseq_data[] =
"ATTCCAGCCTCTAGGACACAGTGGCAGCCACATAATTGGTATCTCTTAAGGTCCAGCACGAGGTGGAGCACATGGTGGAGAGACAGATGCAGTGACCTGGAACCCAGGAGTGAGGGAGCCAGGACTCAGGCCCAAGGCTCCTGAGAGGCATCTGGCCCTCCCTGCACTGTGCCAGCAGCTTGGAGAACCCACACTCAATGAACGCAGCACTCCACTACCCAGGAAATGCCTTCCTGCCCTCTCCTCATCCCATCCCTGGGCAGGGGACATGCAACTGTCTACAAGGTGCCAAGTACCAGGACAGGAAAGGAAAGACGCCAAAAATCCAGCGCTGCCCTCAGAGAAGGGCAACCACGCAGTCCCCATCTTGGCAAGGAAACACAATTTCCGAGGGAATGGT";
288BOOST_REQUIRE_EQUAL(
sizeof(seq_data)/
sizeof(seq_data[0]),
290 for(
size_t i= 0;
i<
buffer.size();
i++) {
291 const stringref(1, seq_data[
i]);
293 string msg(
"Unexpected base at position ");
296BOOST_REQUIRE_MESSAGE(ref ==
test,
msg);
316 const stringdb(
"9606_genomic");
317 const boolis_protein =
false;
318 const booluse_fixed_slice_size =
false;
319 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
325 const TSeqPoskLength(61707364);
326BOOST_REQUIRE_EQUAL(kLength,
len);
330BOOST_REQUIRE_EQUAL(kLength, retval->
GetLength());
349 classCGiFinderThread :
public CThread 352CGiFinderThread(
CRef<CScope>scope,
constvector<int>& gis2find)
353:
m_Scope(scope), m_Gis2Find(gis2find) {}
355 virtual void*
Main() {
357 for(
TSeqPos i= 0;
i< m_Gis2Find.size();
i++) {
358 intgi = m_Gis2Find[random.
GetRand() % m_Gis2Find.size()];
380 constvector<int>& m_Gis2Find;
383 voidMultiThreadedAccess(
boolis_remote)
388 const stringdb(
"ecoli");
389 const boolis_protein =
true;
390 const booluse_fixed_slice_size =
true;
391 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
395scope->AddDefaults();
397 typedefvector< CRef<CGiFinderThread> > TTesterThreads;
399TTesterThreads the_threads(kNumThreads);
402the_threads[
i].Reset(
newCGiFinderThread(scope, gis));
403BOOST_REQUIRE(the_threads[
i].NotEmpty());
412(*thread)->Join(
reinterpret_cast<void**
>(&
result));
413BOOST_REQUIRE_EQUAL(0L,
result);
419MultiThreadedAccess(
false);
424MultiThreadedAccess(
true);
433 const stringdb(
"pataa");
434 const boolis_protein =
true;
435 const booluse_fixed_slice_size =
true;
436 CAutoRegistrarreg(db, is_protein, use_fixed_slice_size, is_remote);
443BOOST_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