NCBI C++ ToolKit
writedb_volume.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: writedb_volume.cpp 97110 2022-06-21 14:00:37Z fongah2 $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Kevin Bealer
27  *
28  */
29 
30 /// @file writedb_volume.cpp
31 /// Implementation for the CWriteDB_Volume class.
32 /// class for WriteDB.
33 #include <ncbi_pch.hpp>
34 #include "writedb_volume.hpp"
36 #include <iostream>
37 #include <cmath>
38 
40 
41 /// Include C++ std library symbols.
43 
45  bool protein,
46  const string & title,
47  const string & date,
48  int index,
49  Uint8 max_file_size,
50  Uint8 max_letters,
51  EIndexType indices,
52  EBlastDbVersion dbver,
53  Uint8 oid_masks)
54  : m_DbName (dbname),
55  m_Protein (protein),
56  m_Title (title),
57  m_Date (date),
58  m_Index (index),
59  m_Indices (indices),
60  m_DbVersion (dbver),
61  m_OidMasks (oid_masks),
62  m_OID (0),
63  m_Open (true)
64 {
66 
68  protein,
69  title,
70  date,
71  index,
72  max_file_size,
73  dbver));
74 
76  protein,
77  index,
78  max_file_size));
79 
81  protein,
82  index,
83  max_file_size,
84  max_letters));
85 
87  bool sparse =
89 
90  if (m_Protein) {
92  dbname,
93  protein,
94  index,
95  max_file_size,
96  false));
97  }
98 
100  dbname,
101  protein,
102  index,
103  max_file_size,
104  false));
105  if(m_DbVersion != eBDB_Version5) {
107  dbname,
108  protein,
109  index,
110  max_file_size,
111  sparse));
112  }
115  dbname,
116  protein,
117  index,
118  max_file_size,
119  false));
120  }
121 
124  dbname,
125  protein,
126  index,
127  max_file_size,
128  false));
129  }
130 
132  protein,
133  index,
134  max_file_size));
135  }
136 
139  protein,
140  index,
141  max_file_size,
143  }
144 }
145 
147 {
148  if (m_Open) {
149  Close();
150  }
151 }
152 
153 bool CWriteDB_Volume::WriteSequence(const string & seq,
154  const string & ambig,
155  const string & binhdr,
156  const TIdList & idlist,
157  int pig,
158  int hash,
159  const TBlobList & blobs,
160  int maskcol_id)
161 {
162  // Zero is a legal hash value, but we should not be computing the
163  // hash value if there is no corresponding ISAM file.
164 
165  _ASSERT((! hash) || m_HashIsam.NotEmpty());
166 
167  if (! (seq.size() && binhdr.size())) {
169  eArgErr,
170  "Error: Cannot find CBioseq or deflines.");
171  }
172 
173  _ASSERT(m_Open);
174 
175  int length = (m_Protein
176  ? (int) seq.size()
177  : x_FindNuclLength(seq));
178 
179  bool overfull = false;
180 
181  if (! (m_Idx->CanFit() &&
182  m_Hdr->CanFit((int)binhdr.size()) &&
183  m_Seq->CanFit((int)(seq.size() + ambig.size()), length))) {
184  overfull = true;
185  }
186 
187  if (m_Indices != CWriteDB::eNoIndex) {
188 
189  int num = (int)idlist.size();
190 
191 
192  if (! ( (m_AccIsam.Empty() || m_AccIsam->CanFit(num)) &&
193  m_GiIsam->CanFit(num) &&
194  (m_TraceIsam.Empty() || m_TraceIsam->CanFit(num)))) {
195  overfull = true;
196  }
197 
198  if (m_Protein && (! m_PigIsam->CanFit(1))) {
199  overfull = true;
200  }
201 
202  if (m_HashIsam.NotEmpty() && (! m_HashIsam->CanFit(1))) {
203  overfull = true;
204  }
205  }
206 
207 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
208  (!defined(NCBI_COMPILER_MIPSPRO)) )
209  for(int blob_i = 0; blob_i < (int) blobs.size(); blob_i++) {
210  _ASSERT(blob_i / 2 < (int) m_Columns.size());
211 
212  if (! m_Columns[blob_i / 2]->CanFit(blobs[blob_i]->Size())) {
213  overfull = true;
214  break;
215  }
216  }
217 #endif
218 
219  // Exception - if volume has no data, ignore the file size limits;
220  // otherwise there would be either a hard failure or an infinite
221  // recursion of building empty volumes. Building a volume that's
222  // too big is considered preferable to either of these outcomes.
223 
224  if (m_OID && overfull) {
225  return false;
226  }
227 
228  // check the uniqueness of id
229  if (m_Indices != CWriteDB::eNoIndex) {
230  set<string>::size_type orig_size = m_IdSet.size();
231  string id;
232  pair<set<string>::iterator, bool > rv;
233  CSeq_id::TLabelFlags label_flags =
235  ITERATE(TIdList, iter, idlist) {
236  id = kEmptyStr;
237  (*iter)->GetLabel(&id, CSeq_id::eDefault, label_flags);
238  rv = m_IdSet.insert(id);
239  if((rv.second == false) && (!(*iter)->IsLocal())) {
240  CNcbiOstrstream msg;
241  msg << "Error: Duplicate seq_ids are found: " << endl << id << endl;
243  }
244  }
245 
246  if(m_IdSet.size() == orig_size) {
247  CNcbiOstrstream msg;
248  msg << "Error: Duplicate seq_ids are found: " << endl
249  << id << endl;
251  }
252  }
253 
254  unsigned int off_hdr(0), off_seq(0), off_amb(0);
255 
256  m_Hdr->AddSequence(binhdr, off_hdr);
257 
258  if (m_Protein) {
259  m_Seq->AddSequence(seq, off_seq, length);
260  m_Idx->AddSequence((int) seq.size(), off_hdr, off_seq);
261  } else {
262  m_Seq->AddSequence(seq, ambig, off_seq, off_amb, length);
263  m_Idx->AddSequence(length, off_hdr, off_seq, off_amb);
264  }
265 
266  if (m_Indices != CWriteDB::eNoIndex) {
267  if(m_AccIsam.NotEmpty()) m_AccIsam->AddIds(m_OID, idlist);
268  m_GiIsam->AddIds(m_OID, idlist);
269 
270  TGi gi = INVALID_GI;
271  ITERATE(TIdList, iter, idlist) {
272  const CSeq_id & seqid = **iter;
273  if (seqid.IsGi()) {
274  gi = seqid.GetGi();
275  break;
276  }
277  }
278  m_GiIndex->AddGi(gi);
279 
280  if (m_Protein && pig) {
281  m_PigIsam->AddPig(m_OID, pig);
282  }
283 
284  if (m_TraceIsam.NotEmpty()) {
285  m_TraceIsam->AddIds(m_OID, idlist);
286  }
287 
288  if (m_HashIsam.NotEmpty()) {
290  }
291  }
292 
293  if (m_ExModelList.NotEmpty()) {
294  size_t model_id_count = 0;
295  size_t num_accs = 0;
296  ITERATE(TIdList, id, idlist) {
297  if ((*id)->IsGi()) {
298  continue;
299  }
300  if ((*id)->IdentifyAccession() & CSeq_id::fAcc_predicted) {
301  model_id_count ++;
302  }
303  num_accs ++;
304  }
305  if(model_id_count == num_accs) {
307  }
308  }
309 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
310  (!defined(NCBI_COMPILER_MIPSPRO)) )
311  for(int col_i = 0; col_i < (int)m_Columns.size(); col_i++) {
312  _ASSERT(col_i * 2 < (int) blobs.size());
313  if (col_i == maskcol_id) {
314  m_Columns[col_i]->AddBlob(*blobs[col_i * 2], *blobs[col_i * 2 + 1]);
315  } else {
316  m_Columns[col_i]->AddBlob(*blobs[col_i * 2]);
317  }
318  }
319 #endif
320 
321  m_OID ++;
322 
323  return true;
324 }
325 
326 int CWriteDB_Volume::x_FindNuclLength(const string & seq)
327 {
328  _ASSERT(! m_Protein);
329  _ASSERT(seq.size());
330 
332 }
333 
335 {
336  if (m_Open) {
337  m_Open = false;
338 
339  // close each file.
340  m_Idx->Close();
341  m_Hdr->Close();
342  m_Seq->Close();
343 
344  if (m_Indices != CWriteDB::eNoIndex) {
345  if (m_Protein) {
346  m_PigIsam->Close();
347  }
348  m_GiIsam->Close();
350  m_GiIndex->Close();
351 
352  if (m_TraceIsam.NotEmpty()) {
353  m_TraceIsam->Close();
354  }
355 
356  if (m_HashIsam.NotEmpty()) {
357  m_HashIsam->Close();
358  }
359  m_IdSet.clear();
360  }
361  }
362 
363  if (m_ExModelList.NotEmpty()) {
365  }
366 
367 
368 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
369  (!defined(NCBI_COMPILER_MIPSPRO)) )
371  (**iter).Close();
372  }
373 #endif
374 }
375 
377 {
378  _ASSERT(! m_Open);
380 
381  // rename all files to 'single volume' notation.
382  m_Idx->RenameSingle();
383  m_Hdr->RenameSingle();
384  m_Seq->RenameSingle();
385 
386  if (m_Indices != CWriteDB::eNoIndex) {
387  if (m_Protein) {
389  }
393 
394  if (m_TraceIsam.NotEmpty()) {
396  }
397 
398  if (m_HashIsam.NotEmpty()) {
400  }
401  }
402 
403  if (m_ExModelList.NotEmpty()) {
405  }
406 
407 
408 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
409  (!defined(NCBI_COMPILER_MIPSPRO)) )
411  (**iter).RenameSingle();
412  }
413 #endif
414 }
415 
416 
417 void CWriteDB_Volume::RenameFileIndex(unsigned int num_digits)
418 {
419  _ASSERT(! m_Open);
420  m_Idx->RenameFileIndex(num_digits);
421  m_Hdr->RenameFileIndex(num_digits);
422  m_Seq->RenameFileIndex(num_digits);
423 
424  if (log10(m_Index) +1 < num_digits) {
425  string index_filename = m_Idx->GetFilename();
426  size_t t = index_filename.find_last_of(".");
427  m_VolName = index_filename.substr(0, t);
428  }
429 
430  if (m_Indices != CWriteDB::eNoIndex) {
431  if (m_Protein) {
432  m_PigIsam->RenameFileIndex(num_digits);
433  }
434  m_GiIsam->RenameFileIndex(num_digits);
435  if(m_AccIsam.NotEmpty()) m_AccIsam->RenameFileIndex(num_digits);
436  m_GiIndex->RenameFileIndex(num_digits);
437 
438  if (m_TraceIsam.NotEmpty()) {
439  m_TraceIsam->RenameFileIndex(num_digits);
440  }
441 
442  if (m_HashIsam.NotEmpty()) {
443  m_HashIsam->RenameFileIndex(num_digits);
444  }
445  }
446 
447  if (m_ExModelList.NotEmpty()) {
448  m_ExModelList->RenameFileIndex(num_digits);
449  }
450 
451 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
452  (!defined(NCBI_COMPILER_MIPSPRO)) )
454  (**iter).RenameFileIndex(num_digits);
455  }
456 #endif
457 }
458 
459 
460 
461 void CWriteDB_Volume::ListFiles(vector<string> & files) const
462 {
463  files.push_back(m_Idx->GetFilename());
464  files.push_back(m_Hdr->GetFilename());
465  files.push_back(m_Seq->GetFilename());
466 
467  if (m_AccIsam.NotEmpty()) {
468  m_AccIsam->ListFiles(files);
469  }
470 
471  if (m_GiIsam.NotEmpty()) {
472  m_GiIsam->ListFiles(files);
473  }
474 
475  if (m_PigIsam.NotEmpty()) {
476  m_PigIsam->ListFiles(files);
477  }
478 
479  if (m_TraceIsam.NotEmpty()) {
480  m_TraceIsam->ListFiles(files);
481  }
482 
483  if (m_HashIsam.NotEmpty()) {
484  m_HashIsam->ListFiles(files);
485  }
486 
487  if (m_GiIndex.NotEmpty()) {
488  files.push_back(m_GiIndex->GetFilename());
489  }
490 
491  if (m_ExModelList.NotEmpty()) {
492  files.push_back(m_ExModelList->GetFilename());
493  }
494 
495 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
496  (!defined(NCBI_COMPILER_MIPSPRO)) )
497  ITERATE(vector< CRef<CWriteDB_Column> >, iter, m_Columns) {
498  (**iter).ListFiles(files, true);
499  }
500 #endif
501 }
502 
503 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
504  (!defined(NCBI_COMPILER_MIPSPRO)) )
505 int CWriteDB_Volume::CreateColumn(const string & title,
506  const TColumnMeta & meta,
507  Uint8 max_sz,
508  bool mbo)
509 {
510  int col_id = m_Columns.size();
511 
512  string extn(m_Protein ? "p??" : "n??");
513 
514  if (col_id >= 36) {
516  eArgErr,
517  "Error: Cannot have more than 36 columns.");
518  }
519 
520  extn[1] = "abcdefghijklmnopqrstuvwxyz0123456789"[col_id];
521 
522  string extn2 = extn;
523  string extn3 = extn;
524 
525  extn[2] = 'a';
526  extn2[2] = 'b';
527  extn3[2] = 'c';
528 
529  CRef<CWriteDB_Column> new_col
531  extn,
532  extn2,
533  m_Index,
534  title,
535  meta,
536  max_sz));
537 
538  /* For support of multiple byte orders */
539  if (mbo) new_col->AddByteOrder(m_DbName,
540  extn3,
541  m_Index,
542  max_sz);
543 
544  // If the OID is not zero, then add all the blank records for the
545  // prior OIDs to the new column.
546 
547  CBlastDbBlob blank;
548 
549  for(int j = 0; j < m_OID; j++) {
550  if (mbo) new_col->AddBlob(blank, blank);
551  else new_col->AddBlob(blank);
552  }
553 
554  m_Columns.push_back(new_col);
555 
556  return col_id;
557 }
558 
560  const string & key,
561  const string & value)
562 {
563  if ((col_id < 0) || (col_id >= (int) m_Columns.size())) {
564  NCBI_THROW(CWriteDBException, eArgErr,
565  "Error: provided column ID is not valid");
566  }
567 
568  m_Columns[col_id]->AddMetaData(key, value);
569 }
570 #endif
571 
573  bool protein,
574  int index,
575  Uint8 max_fsize,
576  EOidMaskType mask_type)
577  : CWriteDB_File (dbname, SeqDB_GetOidMaskFileExt(protein, mask_type), index, max_fsize, false),
578  m_Type(mask_type), m_TotalOids(0), m_Map(NULL), m_MapSize(0) { }
579 
581 {
582  const uint32_t BITWIDTH = 8U * sizeof(uint8_t);
583  m_MapSize = (size_t) ((num_oids - 1U) / BITWIDTH + 1U);
584 
585  if (m_Map != NULL) {
586  NCBI_THROW(CWriteDBException, eArgErr, "Bit map exists");
587  }
588 
589  try {
590  m_Map = new uint8_t[m_MapSize];
591  }
592  catch (CException & e) {
593  NCBI_THROW(CWriteDBException, eArgErr, "Error allocatong memory for bit map");
594  }
595 
596  memset(m_Map, 0xFF, m_MapSize);
597 
598  // Define bitmask.
599  const int BITSHIFT = 3;
600  const uint32_t BITMASK = (1U << BITSHIFT) - 1U; // 0b111 = 0x7
601 
602  // Get address of mask and its allocated length in bytes.
603  uint8_t* mask = (uint8_t*) m_Map;
604 
605  // For each oid in the set...
606  ITERATE(vector<uint32_t>, oid, m_OidList) {
607 
608  // Calculate byte offset into mask.
609  size_t offset = *oid >> BITSHIFT;
610 
611  // Check for overrun of the mask memory.
612  if (offset >= m_MapSize) {
613  // Bail out.
614  NCBI_THROW(CWriteDBException, eArgErr, "overrun of mask memory");
615  }
616 
617  // Create byte mask.
618  // First oid of each group of 8 gets MSB (bit 7),
619  // and last of 8 gets LSB (bit 0).
620  uint8_t mask_bit = (uint8_t) (1U << (7U - (*oid & BITMASK)));
621 
622  // OR byte mask into mask array.
624  mask[offset] &=(~mask_bit);
625  }
626  }
627 
628 }
629 
631 {
632  // Write max oid in big-endian form to mask file.
633  uint32_t max_oid = m_TotalOids - 1U;
634  Create();
635  WriteInt4(max_oid); // This api writes Big Endian
636  Write((char *) m_Map, m_MapSize);
637 }
638 
640 
641  Int4 num_oids = m_OidList.size();
642 
643  LOG_POST(Info << "Num of excluded oids" << num_oids);
644  if (!m_TotalOids ){
645  LOG_POST(Info<< "No oid list created for mode " << m_Type);
646  return;
647  }
650 }
651 
653 
ncbi::TMaskedQueryRegions mask
`Blob' Class for SeqDB (and WriteDB).
Definition: seqdbblob.hpp:56
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CRef –.
Definition: ncbiobj.hpp:618
CWriteDBException.
CWriteDB_Column class.
CWriteDB_IndexFile class.
unsigned int WriteInt4(int data)
Write an Int4 (in bigendian order) to the file.
const string & GetFilename() const
Get the current filename for this file.
virtual void RenameFileIndex(unsigned int num_digits)
void Create()
Create and open the file.
void Close()
Close the file, flushing any remaining data to disk.
static string MakeShortName(const string &base, int index)
Construct the short name for a volume.
unsigned int Write(const CTempString &data)
Write contents of a string to the file.
virtual void RenameSingle()
Rename this file, disincluding the volume index.
CWriteDB_GiIndex class.
void AddGi(TGi gi)
This class builds the volume header file (phr or nhr).
void AddSequence(const string &binhdr, unsigned int &offset)
Add binary header data to this file.
bool CanFit(int size)
Returns true if the specified amount of data would fit.
This class builds the volume index file (pin or nin).
void AddSequence(int length, unsigned int hdr, unsigned int seq)
Add a sequence to a protein index file (pin).
bool CanFit()
Returns true if another sequence can fit into the file.
CWriteDB_Isam class.
void AddHash(int oid, int hash)
Set a sequence's hash value.
bool CanFit(int num)
Tests whether there is room for a given number of IDs.
void ListFiles(vector< string > &files) const
List Filenames.
void AddPig(int oid, int pig)
Set PIG for a protein sequence.
void AddIds(int oid, const TIdList &ids)
Add sequence IDs to the index file.
void RenameSingle()
Rename files to single-volume names.
void Close()
Flush data to disk and close all associated files.
void RenameFileIndex(unsigned int num_digits)
void x_CreateBitMap(int num_oids)
void x_Flush()
This should flush any unwritten data to disk.
void Close(int total_oids)
Total num of oids in db or vol.
void AddOid(int oid)
CWriteDB_OidList(const string &dbname, bool protein, int index, Uint8 max_fsize, EOidMaskType mask_type)
vector< uint32_t > m_OidList
EOidMaskType m_Type
bool CanFit(int size, int letters)
Returns true if the specified amount of data would fit.
void AddSequence(const string &sequence, unsigned int &offset, int length)
Add a protein sequence to this file.
~CWriteDB_Volume()
Destructor.
Uint8 m_OidMasks
Oid masks.
vector< CRef< CSeq_id > > TIdList
Type used for lists of identifiers.
void RenameSingle()
Rename all volumes files to single-volume names.
void AddColumnMetaData(int col_id, const string &key, const string &value)
Add meta data to a column.
void RenameFileIndex(unsigned int num_digits)
set< string > m_IdSet
Included Seq_ids.
CRef< CWriteDB_Isam > m_PigIsam
PIG index (ppi+ppd, protein only).
CRef< CWriteDB_OidList > m_ExModelList
string m_VolName
Database name plus version (if used).
CRef< CWriteDB_HeaderFile > m_Hdr
Header file (phr / nhr).
CWriteDB_Volume(const string &dbname, bool protein, const string &title, const string &date, int index, Uint8 max_file_size, Uint8 max_letters, EIndexType indices, EBlastDbVersion dbver=eBDB_Version5, Uint8 oid_masks=EOidMaskType::fNone)
Build a database volume.
const int & GetOID() const
Get the current OID of the volume.
bool m_Open
True if user can still append sequences.
vector< CRef< CBlastDbBlob > > TBlobList
Type used for lists of identifiers.
CRef< CWriteDB_Isam > m_HashIsam
Hash index (phi+phd or nhi+nhd).
CRef< CWriteDB_Isam > m_AccIsam
Accession index (psi+psd / nsi+nsd).
CRef< CWriteDB_Isam > m_TraceIsam
Trace ID index (pti+ptd or nti+ntd).
EBlastDbVersion m_DbVersion
Blast DB version.
int m_OID
Next assigned OID.
int CreateColumn(const string &title, const TColumnMeta &meta, Uint8 max_sz, bool mbo=true)
Create a new database column.
int m_Index
Index of this volume (1 based).
bool WriteSequence(const string &seq, const string &ambig, const string &binhdr, const TIdList &ids, int pig, int hash, const TBlobList &blobs, int maskcol_id=-1)
Add a sequence to this volume.
CRef< CWriteDB_Isam > m_GiIsam
GI index (pni+pnd / nni+nnd).
CRef< CWriteDB_GiIndex > m_GiIndex
OID->GI lookup (pgx or ngx).
CRef< CWriteDB_SequenceFile > m_Seq
Sequence file (psq / nsq).
bool m_Protein
True for protein; false for nucleotide.
int x_FindNuclLength(const string &seq)
Compute base-length of compressed nucleotide sequence.
EIndexType m_Indices
Indices are sparse, full, or disabled.
void Close()
Close the volume.
CRef< CWriteDB_IndexFile > m_Idx
Index file (pin / nin).
string m_DbName
Base name of the database.
vector< CRef< CWriteDB_Column > > m_Columns
Database columns.
void ListFiles(vector< string > &files) const
List all files associated with this volume.
EIndexType
Whether and what kind of indices to build.
Definition: writedb.hpp:104
@ eAddHash
Add an index from sequence hash to OID.
Definition: writedb.hpp:126
@ eSparseIndex
Use only simple accessions in the string index.
Definition: writedb.hpp:109
@ eNoIndex
Build a database without any indices.
Definition: writedb.hpp:106
@ eAddTrace
OR this in to add an index for trace IDs.
Definition: writedb.hpp:115
Definition: set.hpp:45
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
void clear()
Definition: set.hpp:153
size_type size() const
Definition: set.hpp:132
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
int offset
Definition: replacements.h:160
unsigned char uint8_t
Uint4 uint32_t
#define INVALID_GI
Definition: ncbimisc.hpp:1089
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NULL
Definition: ncbistd.hpp:225
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
int TLabelFlags
Definition: Seq_id.hpp:625
@ fLabel_UpperCase
Upper case label, with special encoding for PDB chain-ids.
Definition: Seq_id.hpp:620
@ fLabel_Default
default options - always show the version
Definition: Seq_id.hpp:623
@ fAcc_predicted
Definition: Seq_id.hpp:254
@ eDefault
default is to show type + content
Definition: Seq_id.hpp:611
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
uint64_t Uint8
8-byte (64-bit) unsigned integer
Definition: ncbitype.h:105
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
TGi GetGi(void) const
Get the variant data.
Definition: Seq_id_.hpp:889
bool IsGi(void) const
Check if variant Gi is selected.
Definition: Seq_id_.hpp:883
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6929
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
EIPRangeType t
Definition: ncbi_localip.c:101
T log10(T x_)
const string SeqDB_GetOidMaskFileExt(bool db_is_protein, EOidMaskType t)
EBlastDbVersion
BLAST database version.
Definition: seqdbcommon.hpp:51
@ eBDB_Version5
Definition: seqdbcommon.hpp:53
EOidMaskType
@ fExcludeModel
#define uint8_t
Definition: config.h:54
Definition: _hash_fun.h:40
#define _ASSERT
static bool ambig(char c)
Defines exception class for WriteDB.
int WriteDB_FindSequenceLength(bool protein, const string &seq)
Compute length of sequence from raw packing.
@ eGi
GI Index.
@ eTrace
Trace ID Index.
@ eAcc
Accession (string) Index.
@ ePig
Protein Identifier Group.
@ eHash
Hash Index.
USING_SCOPE(std)
Include C++ std library symbols.
Code for database volume construction.
Modified on Sun Jul 21 04:17:43 2024 by modify_doxy.py rev. 669887