use_fixed_slice_size,
83 booluse_remote_blast_db_loader =
false) {
85 if(use_remote_blast_db_loader) {
116 om->GetRegisteredNames(loader_names);
118 om->RevokeDataLoader(*itr);
124 om->RevokeDataLoader(loader_name);
138 const stringdb(
"nt");
139 const boolis_protein(
false);
140 const booluse_fixed_size_slice(
true);
141 const boolis_remote(
true);
143 CAutoRegistrarreg(db, is_protein, use_fixed_size_slice, is_remote);
147BOOST_REQUIRE_EQUAL(1U, loader_names.size());
148BOOST_REQUIRE_EQUAL(
"REMOTE_BLASTDB_ntNucleotide", loader_names.front());
166BOOST_REQUIRE(!handle2);
173 const stringdb(
"9606_genomic");
174 const boolis_protein(
false);
175 const boolis_remote(
true);
181BOOST_REQUIRE_EQUAL(1, loader_names.size());
182BOOST_REQUIRE_EQUAL(
"REMOTE_BLASTDB_9606_genomicNucleotide",
183loader_names.front());
193BOOST_REQUIRE(handle1);
194 const TSeqPoskLength(3084811);
201kExpectedSeqData(
"ATTAACTGCAAATTACACGTATTGAGATGCATAAAAAGCCAAACCCTTGGGATAAAAATCTGAAAAGCTTTAAGAGGAAAAGTCTACCTCCTGAAATGAA");
204BOOST_REQUIRE_EQUAL(kExpectedSeqData,
buffer);
223 const stringdb(
"nt");
224 const boolis_protein(
false);
225 const boolkFixedSliceSize(
true);
226 const boolis_remote(
true);
228 CAutoRegistrarreg_prot(db, is_protein, kFixedSliceSize, is_remote);
239 typedefpair<TGi, CSeq_inst::TLength> TGiLengthPair;
242test_data.push_back(TGiLengthPair(
GI_CONST(405832), 2592));
243test_data.push_back(TGiLengthPair(
GI_CONST(42365), 3326));
244test_data.push_back(TGiLengthPair(
GI_CONST(1274591754), 539));
250BOOST_REQUIRE_EQUAL(ids.size(), test_data.size());
253BOOST_REQUIRE_EQUAL(ids.size(), bhs.size());
255TGiLengthVector::size_type
i= 0;
257BOOST_REQUIRE_EQUAL(bh->GetInst().GetLength(), test_data[
i].second);
260BOOST_REQUIRE_EQUAL(
i, bhs.size());
265 const stringdb(
"nr");
266 const boolis_protein(
true);
267 const boolkFixedSliceSize(
true);
268 const boolis_remote(
true);
270 CAutoRegistrarreg_prot(db, is_protein, kFixedSliceSize, is_remote);
274BOOST_REQUIRE_EQUAL(1, loader_names.size());
275BOOST_REQUIRE_EQUAL(
"REMOTE_BLASTDB_nrProtein", loader_names.front());
277 CAutoRegistrarreg_nucl(db, !is_protein, kFixedSliceSize, is_remote);
278loader_names.clear();
280BOOST_REQUIRE_EQUAL(2, loader_names.size());
281 boolfound_prot(
false), found_nucl(
false);
283 if(*name ==
string(
"REMOTE_BLASTDB_nrNucleotide")) {
286 if(*name ==
string(
"REMOTE_BLASTDB_nrProtein")) {
290BOOST_REQUIRE(found_nucl);
291BOOST_REQUIRE(found_prot);
302BOOST_REQUIRE(handle1);
312BOOST_REQUIRE(handle2);
325 const string dbname(
"nr");
326 const boolis_protein(
true);
327 const booluse_fixed_size_slice(
true);
328 const boolis_remote(
true);
334BOOST_REQUIRE_EQUAL(1, loader_names.size());
335BOOST_REQUIRE_EQUAL(
"REMOTE_BLASTDB_nrProtein", loader_names.front());
344BOOST_REQUIRE(handle1);
352BOOST_REQUIRE(!handle2);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Data loader implementation that uses the blast databases remotely.
Declares the CBlastServices class.
Auxiliary class to register the BLAST database data loader of choice (information provided in the con...
static void RemoveAllDataLoaders()
CAutoRegistrar(const string &dbname, bool is_protein, bool use_fixed_slice_size, bool use_remote_blast_db_loader=false)
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, 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)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
TLoader * GetLoader(void) const
Get pointer to the loader.
void AddDataLoader(const string &loader_name, TPriority pri=kPriority_Default)
Add data loader by name.
TTaxId GetTaxId(const CSeq_id &id, TGetFlags flags=0)
Get taxonomy id of bioseq Return -1 if sequence is not found Return 0 if sequence doesn't have taxono...
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TBioseqHandles GetBioseqHandles(const TIds &ids)
Get bioseq handles for all ids.
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...
vector< CBioseq_Handle > TBioseqHandles
void GetRegisteredNames(TRegisteredNames &names)
Get names of all registered data loaders.
vector< string > TRegisteredNames
vector< CSeq_id_Handle > TIds
@ kPriority_NotSet
Deprecated: use kPriority_Default instead.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
bool State_NoData(void) const
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
const TInst & GetInst(void) const
@ 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).
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
@ e_Gi
GenInfo Integrated Database.
const TInst & GetInst(void) const
Get the Inst member data.
TLength GetLength(void) const
Get the Length member data.
@ eMol_na
just a nucleic acid
char * dbname(DBPROCESS *dbproc)
Get name of current database.
static void RemoteFetchLongNucleotideBioseq(bool fixed_slice_size)
BOOST_AUTO_TEST_CASE(RemoteFetchNucleotideBioseq)
vector< TGiLenPair > TGiLengthVector
Vector containing pairs of gis and their length.
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