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

NCBI C++ ToolKit: src/objtools/blast/seqdb_writer/unit_test/writedb_lmdb_unit_test.cpp Source File

32 #define NCBI_TEST_APPLICATION 37 #include <boost/current_function.hpp> 42 #include <unordered_map> 44 #ifndef SKIP_DOXYGEN_PROCESSING 53  const string

base_name =

"tmp_lmdb"

;

57  const int

kNumVols = 4;

59

vector<string> vol_names;

60

vector<blastdb::TOid> vol_num_oids;

61  for

(

unsigned int

k=0; k < kNumVols; k++) {

63

vol_num_oids.push_back(k*1234);

69

list< CRef<CSeq_id> > ids = source_db.

GetSeqIDs

(

i

);

78  for

(

int

j=0; j < (

i

% 5 + 1); j++) {

86

vector<string> test_neg_accs;

91

vector<string> test_accs;

92

vector<blastdb::TOid> test_oids;

93

list< CRef<CSeq_id> > ids = source_db.

GetSeqIDs

(

i

);

100

test_accs.push_back((*itr)->GetSeqIdString(

true

));

101

test_accs.push_back((*itr)->GetSeqIdString(

false

));

103

test_db.

GetOids

(test_accs, test_oids);

104  for

(

unsigned int

j=0; j < test_accs.size(); j++) {

105

BOOST_REQUIRE_EQUAL(test_oids[j],

i

);

110

vector<blastdb::TOid> neg_oids;

112

BOOST_REQUIRE_EQUAL(neg_oids.size(), 65);

115

vector<string> test_vol_names;

116

vector<blastdb::TOid> test_vol_num_oids;

118  for

(

unsigned int

k=0; k < kNumVols; k++) {

119

BOOST_REQUIRE_EQUAL(test_vol_num_oids[k], vol_num_oids[k]);

120

BOOST_REQUIRE_EQUAL(test_vol_names[k], vol_names[k]);

124

vector<blastdb::TOid> tax_oids;

127

vector<TTaxId> rv_tax_ids;

129  for

(

unsigned int i

=0;

i

< tax_ids.

size

();

i

++) {

130

BOOST_REQUIRE_EQUAL(tax_oids[

i

] % 5, 4);

134

BOOST_REQUIRE_EQUAL(tax_oids.size(), 0);

140  for

(

unsigned int i

=0;

i

< rv_tax_ids.size();

i

++) {

141

BOOST_REQUIRE((tax_oids[

i

] % 5 < 2));

151  const string

base_name =

"tmp_lmdb"

;

155  const int

kNumVols = 4;

157

vector<string> vol_names;

158

vector<blastdb::TOid> vol_num_oids;

159  for

(

unsigned int

k=0; k < kNumVols; k++) {

161

vol_num_oids.push_back(k*1234);

167

list< CRef<CSeq_id> > ids = source_db.

GetSeqIDs

(

i

);

176  for

(

int

j=0; j < (

i

% 5 + 1); j++) {

177  t

.insert(taxids[j]);

184

vector<string> test_neg_accs;

189

vector<string> test_accs;

190

vector<blastdb::TOid> test_oids;

191

list< CRef<CSeq_id> > ids = source_db.

GetSeqIDs

(

i

);

195  if

((*itr)->IsGi()) {

198

test_accs.push_back((*itr)->GetSeqIdString(

true

));

199

test_accs.push_back((*itr)->GetSeqIdString(

false

));

201

test_db.

GetOids

(test_accs, test_oids);

202  for

(

unsigned int

j=0; j < test_accs.size(); j++) {

203

BOOST_REQUIRE_EQUAL(test_oids[j],

i

);

208

vector<blastdb::TOid> neg_oids;

210

BOOST_REQUIRE_EQUAL(neg_oids.size(), 65);

213

vector<string> test_vol_names;

214

vector<blastdb::TOid> test_vol_num_oids;

216  for

(

unsigned int

k=0; k < kNumVols; k++) {

217

BOOST_REQUIRE_EQUAL(test_vol_num_oids[k], vol_num_oids[k]);

218

BOOST_REQUIRE_EQUAL(test_vol_names[k], vol_names[k]);

222

vector<blastdb::TOid> tax_oids;

225

vector<TTaxId> rv_tax_ids;

227  for

(

unsigned int i

=0;

i

< tax_ids.

size

();

i

++) {

228

BOOST_REQUIRE_EQUAL(tax_oids[

i

] % 5, 4);

232

BOOST_REQUIRE_EQUAL(tax_oids.size(), 0);

238  for

(

unsigned int i

=0;

i

< rv_tax_ids.size();

i

++) {

239

BOOST_REQUIRE((tax_oids[

i

] % 5 < 2));

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

void GetOids(const vector< string > &accessions, vector< blastdb::TOid > &oids) const

Get OIDs for a vector of string accessions.

void GetOidsForTaxIds(const set< TTaxId > &tax_ids, vector< blastdb::TOid > &oids, vector< TTaxId > &tax_ids_found) const

Get Oids for Tax Ids list, idenitcal Oids are merged.

void NegativeSeqIdsToOids(const vector< string > &ids, vector< blastdb::TOid > &rv) const

Get Oids excluded from a vector of input accessions An oid only get exlcuded if all its seqids are fo...

void NegativeTaxIdsToOids(const set< TTaxId > &ids, vector< blastdb::TOid > &rv, vector< TTaxId > &tax_ids_found) const

Get Oids to exclude for Tax ids @parm ids Input tax ids to exclude /Output tax ids found.

void GetVolumesInfo(vector< string > &vol_names, vector< blastdb::TOid > &vol_num_oids)

Return info for all volumes.

int GetNumOIDs() const

Returns the size of the (possibly sparse) OID range.

list< CRef< CSeq_id > > GetSeqIDs(int oid) const

Gets a list of sequence identifiers.

This class supports creation of a string accession to integer OID lmdb database.

void InsertVolumesInfo(const vector< string > &vol_names, const vector< blastdb::TOid > &vol_num_oids)

Create volume table This api should only be called once to create vol info for all vols in the db.

int InsertEntries(const list< CRef< CSeq_id >> &seqids, const blastdb::TOid oid)

Add entries in bulk as fetched from CSeqDB::GetSeqIDs.

This class supports creation of tax id list lookup files.

int InsertEntries(const set< TTaxId > &tax_ids, const blastdb::TOid oid)

Add tax id entries in bulk for each oid This api needs to be called in sequential order of OIDs This ...

iterator_bool insert(const value_type &val)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

SStrictId_Tax::TId TTaxId

Taxon id type.

string GetSeqIdString(bool with_version=false) const

Return seqid string with optional version for text seqid type.

static int WorstRank(const CRef< CSeq_id > &id)

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

Convert int to string.

C::value_type FindBestChoice(const C &container, F score_func)

Find the best choice (lowest score) for values in a container.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

BOOST_AUTO_TEST_SUITE(psiblast_iteration)

Defines interface to interact with LMDB files.

string BuildLMDBFileName(const string &basename, bool is_protein, bool use_index=false, unsigned int index=0)

Build the canonical LMDB file name for BLAST databases.

void DeleteLMDBFiles(bool db_is_protein, const string &lmdb_filename)

string GetFileNameFromExistingLMDBFile(const string &lmdb_filename, ELMDBFileType file_type)

Defines `expert' version of CSeqDB interfaces.

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

Defines lmdb implementation of string-key database.

BOOST_AUTO_TEST_CASE(CreateLMDBFile)


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