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

Go to the SVN repository for this file.

1 /* $Id: asn_cache_test.cpp 93317 2021-03-31 17:53:04Z mozese2 $
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  * Authors: Mike Diccucio Cheinan Marks
27  *
28  * File Description:
29  * Test reading from the ID ASN.1 Cache.
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbiapp.hpp>
35 #include <corelib/ncbienv.hpp>
36 #include <corelib/ncbiargs.hpp>
37 #include <corelib/ncbifile.hpp>
40 #include <objects/seq/Bioseq.hpp>
41 
42 #include <serial/serial.hpp>
43 #include <serial/objostr.hpp>
44 #include <serial/iterator.hpp>
45 
49 
51 #include <objmgr/scope.hpp>
52 #include <objmgr/bioseq_handle.hpp>
53 #include <objmgr/impl/tse_info.hpp>
55 
58 #include <objects/seq/Seq_inst.hpp>
59 #include <objects/seq/Seq_ext.hpp>
62 
63 #include <random>
64 
65 
66 
69 
70 static const CBioseq::TId &s_GetSeqIds(const vector<CSeq_id_Handle> &handles){
71  static CBioseq::TId ids;
72  ids.clear();
73  ITERATE(vector<CSeq_id_Handle>, it, handles)
74  ids.push_back(CRef<CSeq_id>(const_cast<CSeq_id*>(it->GetSeqId().GetNonNullPointer())));
75  return ids;
76 }
77 
78 static bool s_SameIds(const CBioseq::TId &ids1, const CBioseq::TId &ids2)
79 {
80  if(ids1.size() != ids2.size())
81  return false;
82  ITERATE(CBioseq::TId, it1, ids1){
83  CRef<CSeq_id> matching_id;
84  ITERATE(CBioseq::TId, it2, ids2)
85  if((*it2)->Match(**it1)){
86  matching_id = *it2;
87  break;
88  }
89  if(!matching_id)
90  return false;
91  }
92  return true;
93 }
94 
95 /////////////////////////////////////////////////////////////////////////////
96 // CAsnCacheTestApplication::
97 
98 
100 {
101 private:
102  virtual void Init(void);
103  virtual int Run(void);
104  virtual void Exit(void);
105 
106 private: //member functions
107 
108  bool x_FindAnnotated(const CSeq_entry& entry);
109 
110 
111 };
112 
113 
114 /////////////////////////////////////////////////////////////////////////////
115 // Init test for all different types of arguments
116 
117 
119 {
120  // Create command-line argument descriptions class
121  unique_ptr<CArgDescriptions> arg_desc(new CArgDescriptions);
122 
123  // Specify USAGE context
124  arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
125  "CArgDescriptions demo program");
126 
127  arg_desc->AddKey("cache", "ASNCache",
128  "Path to ASN.1 cache",
130 
131  arg_desc->AddDefaultKey("i", "AccessionList",
132  "List of accessions to retrieve",
134  "-");
135 
136  arg_desc->AddDefaultKey("o", "OutputFile",
137  "File to place ASN seq-entries in",
139  "-");
140 
141  arg_desc->AddFlag("test-loader", "Test use of the ASN cache data loader");
142 
143  arg_desc->AddFlag("raw", "Test raw retrieval only");
144  arg_desc->AddFlag("text", "Use ASN.1 text output");
145  arg_desc->AddFlag("find-annotated", "Find annotated accessions");
146  arg_desc->AddFlag("dump-GP-7574", "Dump comments and seq-descs");
147  arg_desc->AddFlag("dump-GP-8763", "Dump qualifiers");
148  arg_desc->AddFlag("dump-proteins", "Dump protein seqs");
149  arg_desc->AddFlag("no-serialize", "Do not reserialize the ASN.1");
150  arg_desc->AddFlag("random-order", "Retrieve sequences in random order");
151  arg_desc->AddFlag("test-warm", "Retrieve sequences twice, to check differences between cold-cache and warm-cache times");
152 
153  arg_desc->AddFlag("indexonly", "Print the index entry only, do not fetch the blob." );
154 
155  arg_desc->AddFlag("idonly", "Verify that ID information in the cache is available and accurate for the listed accessions." );
156  arg_desc->AddFlag("verify-ids", "Verify that ID information in the cache is available and accurate for the listed accessions." );
157  arg_desc->SetDependency("raw", CArgDescriptions::eExcludes, "indexonly");
158  arg_desc->SetDependency("verify-ids", CArgDescriptions::eExcludes, "raw");
159  arg_desc->SetDependency("verify-ids", CArgDescriptions::eExcludes, "indexonly");
160  arg_desc->SetDependency("test-loader", CArgDescriptions::eExcludes, "raw");
161  arg_desc->SetDependency("test-loader", CArgDescriptions::eExcludes, "indexonly");
162  arg_desc->SetDependency("idonly", CArgDescriptions::eExcludes, "raw");
163  arg_desc->SetDependency("idonly", CArgDescriptions::eExcludes, "indexonly");
164  arg_desc->SetDependency("idonly", CArgDescriptions::eExcludes, "verify-ids");
165  arg_desc->SetDependency("no-serialize", CArgDescriptions::eExcludes, "indexonly");
166  arg_desc->SetDependency("text", CArgDescriptions::eExcludes, "raw");
167  arg_desc->SetDependency("text", CArgDescriptions::eExcludes, "indexonly");
168  arg_desc->SetDependency("text", CArgDescriptions::eExcludes, "idonly");
169  arg_desc->SetDependency("text", CArgDescriptions::eExcludes, "no-serialize");
170 
171  arg_desc->AddFlag("get-multiple",
172  "If several entries match the specified id, get all of "
173  "them, not only latest one");
174  arg_desc->SetDependency("get-multiple", CArgDescriptions::eExcludes, "idonly");
175  arg_desc->SetDependency("get-multiple", CArgDescriptions::eExcludes, "test-loader");
176 
177  // Setup arg.descriptions for this application
178  SetupArgDescriptions(arg_desc.release());
179 }
180 
181 
182 
184 {
185  // Get arguments
186  const CArgs& args = GetArgs();
187  CNcbiOstream& ostr = args["o"].AsOutputFile();
188  CNcbiIstream& istr = args["i"].AsInputFile();
189 
190  bool readIndexOnly = args[ "indexonly" ];
191  bool raw = args["raw"];
192  bool serialize = !args["no-serialize"];
193  bool verify_ids = args["verify-ids"];
194  bool getIdOnly = args["idonly"];
195  bool multiple = args["get-multiple"];
196 
197  vector< CConstRef<CSeq_entry> > entries;
198  vector< CDataLoader::TIds > id_sets;
199  vector< CSeq_id_Handle > ids;
200 
201  unique_ptr<CObjectOStream> os;
202 
203  string line;
204  while (NcbiGetlineEOL(istr, line)) {
205  if (line.empty() || line[0] == '#') {
206  continue;
207  }
208  try {
209  CSeq_id id(line);
210  ids.push_back(CSeq_id_Handle::GetHandle(id));
211  }
212  catch (CException& e) {
213  LOG_POST(Error << "failed to convert "
214  << line << " to a SeqId: " << e.what());
215  }
216  }
217 
218  if (serialize) {
219  if(getIdOnly) {
220  id_sets.reserve(ids.size());
221  }
222  else {
223  entries.reserve(ids.size());
224  }
225  }
226 
227 
228  CRef<CDataLoader> loader;
229  CRef<CAsnCache> cache;
231  CRef<CScope> m_LocalCacheScope;
232 
233  if(args["test-loader"]){
234  loader.Reset(CAsnCache_DataLoader::TDbMaker(args["cache"].AsString()).CreateLoader());
235  source.Reset(new CDataSource(*loader));
236  } else
237  cache.Reset(new CAsnCache(args["cache"].AsString()));
238  if(args["dump-proteins"]){
239  m_LocalCacheScope.Reset(new CScope (*CObjectManager::GetInstance()));
240  string cache_path = args["cache"].AsString();
242  string loader_name = CAsnCache_DataLoader::GetLoaderNameFromArgs(cache_path);
243  if ( CObjectManager::GetInstance()->FindDataLoader(loader_name ) ) {
244  loader_name = CObjectManager::GetInstance()->FindDataLoader(loader_name )->GetName() ;
245  } else {
246  }
247  m_LocalCacheScope->AddDataLoader(loader_name );
248  }
249 
250 
251  int num_cycles = args["test-warm"] ? 2 : 1;
252  size_t count_failed = 0;
253 
254  for(int cycle = 0; cycle < num_cycles; cycle++){
255  if (args["random-order"]) {
256  shuffle(ids.begin(), ids.end(), default_random_engine());
257  }
258 
259  size_t count = 0;
260  CStopWatch sw;
261  sw.Start();
262 
263  ITERATE(vector<CSeq_id_Handle>, id_it, ids){
264  try {
265  if ( readIndexOnly ) {
266  vector<CAsnIndex::SIndexInfo> info;
267 
268  if (multiple) {
269  cache->GetMultipleIndexEntries( *id_it, info);
270  } else {
271  info.resize(1);
272  cache->GetIndexEntry( *id_it, info[0]);
273  }
274 
275  ITERATE (vector<CAsnIndex::SIndexInfo>, info_it, info) {
276  ostr << *info_it << endl;
277  }
278  } else if (raw) {
279  vector<CAsnCache::TBuffer> buffer(multiple ? 0 : 1);
280  bool success = multiple ? cache->GetMultipleRaw(*id_it, buffer)
281  : cache->GetRaw(*id_it, buffer[0]);
282  if (success) {
283  if(serialize && cycle == 0) {
284  ITERATE (vector<CAsnCache::TBuffer>, buf_it, buffer) {
285  ostr.write((const char*)&(*buf_it)[0],
286  buf_it->size());
287  }
288  }
289  } else {
290  LOG_POST(Error << "failed to retrieve: "
291  << id_it->GetSeqId()->AsFastaString());
292  ++count_failed;
293  }
294  } else if (getIdOnly) {
295  CDataLoader::TIds id_set;
296  if(loader)
297  loader->GetIds(*id_it, id_set);
298  else
299  cache->GetSeqIds(*id_it, id_set);
300  if(id_set.empty()) {
301  LOG_POST(Error << "failed to retrieve: "
302  << id_it->GetSeqId()->AsFastaString());
303  ++count_failed;
304  } else if(serialize && cycle==0)
305  id_sets.push_back(id_set);
306  } else {
307  vector< CRef<CSeq_entry> > entries_for_id;
308  if (multiple) {
309  entries_for_id = cache->GetMultipleEntries(*id_it);
310  } else if (loader) {
311  entries_for_id.push_back(CRef<CSeq_entry>(const_cast<CSeq_entry *>
312  ((*loader->GetRecords(*id_it, CDataLoader::eBioseq).begin())->GetCompleteTSE().GetPointer())));
313  } else {
314  entries_for_id.push_back(cache->GetEntry(*id_it));
315  }
316  ITERATE (vector< CRef<CSeq_entry> >, entry_it, entries_for_id) {
317  CRef<CSeq_entry> entry = *entry_it;
318  if(args["find-annotated"]) {
319  bool is_annotated = x_FindAnnotated(*entry);
320  CDataLoader::TIds id_set;
321  if(loader) {
322  loader->GetIds(*id_it, id_set);
323  }
324  else {
325  cache->GetSeqIds(*id_it, id_set);
326  }
327  cout<<"is_annotated" << "\t"
328  << "original" << "\t"
329  << *id_it << "\t"
330  << boolalpha << is_annotated << endl;
331  ITERATE(CDataLoader::TIds, id_it, id_set) {
332  cout<<"is_annotated" << "\t"
333  << "alias" << "\t"
334  << *id_it << "\t"
335  << boolalpha << is_annotated << endl;
336  }
337  }
338  if(entry && args["dump-GP-7574"]) {
339  cerr << *id_it << endl;
340  for(CTypeConstIterator<CSeqdesc> desc(*entry); desc; ++desc) {
341  switch ( desc->Which() ) {
342  case CSeqdesc::e_User:
343  case CSeqdesc::e_Comment:
344  cout << MSerial_AsnText << *desc;
345  break;
346  default: break;
347  }
348  }
349  }
350  if(entry && args["dump-GP-8763"]) {
351  cerr << *id_it << endl; bool first=true;
352  for(CTypeConstIterator<CGb_qual> desc(*entry); desc; ++desc) {
353  if(desc->GetQual() == "inference" ||
354  desc->GetQual() == "experiment"
355  ) {
356  if(first) { cout << *id_it << endl; } first=false;
357  cout << MSerial_AsnText << *desc;
358  }
359  }
360  }
361 
362 
363  if(entry && args["dump-proteins"]) {
364  for(CTypeConstIterator<CSeq_feat> feat(*entry); feat; ++feat) {
365  if( feat->GetData().Which() == CSeqFeatData::e_Cdregion &&
366  feat->IsSetProduct() ) {
367  CSeq_id_Handle idh = CSeq_id_Handle::GetHandle(*feat->GetProduct().GetId());
368  CBioseq_Handle bsh = m_LocalCacheScope->GetBioseqHandle(idh);
369  if( bsh.CanGetInst() ) {
370  if (
371  bsh.GetInst().IsSetExt() &&
372  bsh.GetInst().GetExt().IsDelta() ) {
374  if( (*delta)->IsLoc() ) {
375  idh = CSeq_id_Handle::GetHandle( *(*delta)->GetLoc().GetId() );
376  break;
377  }
378  }
379  }
380  } else {
381  LOG_POST(Warning<<"Can't get seqinst for " << idh);
382  }
383  cout << *id_it << "\t"
384  << idh << endl;
385  //unique_ptr<CBestPigMapper> m_mapper
386  }
387  }
388  }
389  if (entry) {
390  if (serialize && cycle==0) {
391  if( ! args["find-annotated"])
392  entries.push_back(entry);
393  }
394  if(verify_ids){
395  CDataLoader::TIds retrieved_ids;
396  if(loader)
397  loader->GetIds(*id_it, retrieved_ids);
398  else
399  cache->GetSeqIds(*id_it, retrieved_ids);
400  if(retrieved_ids.empty()){
401  LOG_POST(Error << "failed to retrieve ids for: "
402  << id_it->GetSeqId()->AsFastaString());
403  ++count_failed;
404  } else if(!s_SameIds(s_GetSeqIds(retrieved_ids), ExtractBioseq(entry, *id_it)->GetId()))
405  {
406  LOG_POST(Error << "Mismatched ids for: "
407  << id_it->GetSeqId()->AsFastaString() << ": retrieved:");
408  ITERATE(vector<CSeq_id_Handle>, it, retrieved_ids)
409  LOG_POST(Error << it->GetSeqId()->AsFastaString());
410  LOG_POST(Error << "IDs in entry:");
411  ITERATE(CBioseq::TId, it, ExtractBioseq(entry, *id_it)->GetId())
412  LOG_POST(Error << (*it)->AsFastaString());
413  ++count_failed;
414  } else
415  LOG_POST(Info << "Succesfully retrieved " << retrieved_ids.size()
416  << " ids for " << id_it->GetSeqId()->AsFastaString());
417  }
418  } else {
419  LOG_POST(Error << "failed to retrieve: "
420  << id_it->GetSeqId()->AsFastaString());
421  ++count_failed;
422  }
423  }
424  }
425 
426  ++count;
427  }
428  catch (CException& e) {
429  LOG_POST(Error << "failed to retrieve "
430  << line << ": " << e.what());
431  }
432  }
433 
434  double e = sw.Elapsed();
435  LOG_POST(Error << "done cycle " << cycle+1 << ", " << count << " seqs / " << e << " seconds = "
436  << count / e << " seqs/sec ("
437  << count_failed << " failed to retrieve)");
438  }
439  if(args["dump-proteins"]) { return count_failed; }
440  if(serialize) {
441  if(getIdOnly){
442  ITERATE(vector< CDataLoader::TIds >, it, id_sets){
443  ITERATE(CDataLoader::TIds, id_it, *it){
444  if(id_it != it->begin())
445  ostr << ", ";
446  ostr << id_it->GetSeqId()->AsFastaString();
447  }
448  ostr << endl;
449  }
450  } else {
451  if (args["text"]) {
452  os.reset(CObjectOStream::Open(eSerial_AsnText, ostr));
453  } else {
454  os.reset(CObjectOStream::Open(eSerial_AsnBinary, ostr));
455  }
456  ITERATE(vector< CConstRef<CSeq_entry> >, it, entries)
457  *os << **it;
458  }
459  }
460 
461  return count_failed;
462 }
463 
465 {
466  return
467  ( entry.IsSeq() && entry.GetSeq().IsSetAnnot() ) ||
468  ( entry.IsSet() && entry.GetSet().IsSetAnnot() );
469 
470 }
471 
472 /////////////////////////////////////////////////////////////////////////////
473 // Cleanup
474 
475 
477 {
478  SetDiagStream(0);
479 }
480 
481 
482 /////////////////////////////////////////////////////////////////////////////
483 // MAIN
484 
485 
486 int main(int argc, const char* argv[])
487 {
488  // Execute main application function
489  return CAsnCacheTestApplication().AppMain(argc, argv);
490 }
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Contains the class definiton for CAsnCache, the main client class for accessing the ASN cache data.
USING_SCOPE(objects)
static bool s_SameIds(const CBioseq::TId &ids1, const CBioseq::TId &ids2)
static const CBioseq::TId & s_GetSeqIds(const vector< CSeq_id_Handle > &handles)
int main(int argc, const char *argv[])
USING_NCBI_SCOPE
CConstRef< objects::CBioseq > ExtractBioseq(CConstRef< objects::CSeq_entry > entry, const objects::CSeq_id_Handle &id)
CArgDescriptions –.
Definition: ncbiargs.hpp:541
CArgs –.
Definition: ncbiargs.hpp:379
virtual int Run(void)
Run the application.
virtual void Init(void)
Initialize the application.
bool x_FindAnnotated(const CSeq_entry &entry)
virtual void Exit(void)
Cleanup on application exit.
static string GetLoaderNameFromArgs(void)
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const string &db_path, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
CAsnCache is used by clients to access the ASN cache data.
Definition: asn_cache.hpp:61
vector< CRef< objects::CSeq_entry > > GetMultipleEntries(const objects::CSeq_id_Handle &id)
Definition: asn_cache.cpp:159
bool GetMultipleRaw(const objects::CSeq_id_Handle &id, vector< TBuffer > &buffer)
Definition: asn_cache.cpp:149
bool GetRaw(const objects::CSeq_id_Handle &id, TBuffer &buffer)
Return the raw blob in an unformatted buffer.
Definition: asn_cache.cpp:143
bool GetIndexEntry(const objects::CSeq_id_Handle &id, CAsnIndex::SIndexInfo &info)
Get the full ASN cache index entry.
Definition: asn_cache.cpp:164
CRef< objects::CSeq_entry > GetEntry(const objects::CSeq_id_Handle &id)
Return a blob as a CSeq_entry object.
Definition: asn_cache.cpp:154
bool GetMultipleIndexEntries(const objects::CSeq_id_Handle &id, vector< CAsnIndex::SIndexInfo > &info)
Definition: asn_cache.cpp:170
bool GetSeqIds(const objects::CSeq_id_Handle &id, vector< objects::CSeq_id_Handle > &all_ids, bool cheap_only=true)
Return the set of seq-ids associated with a given ID.
Definition: asn_cache.cpp:124
CBioseq_Handle –.
CScope –.
Definition: scope.hpp:92
Definition: Seq_entry.hpp:56
CStopWatch –.
Definition: ncbitime.hpp:1938
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
const_iterator begin() const
Definition: set.hpp:135
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
Definition: ncbiapp.cpp:305
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
Definition: ncbiapp.cpp:819
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
Definition: ncbiapp.cpp:1195
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ eExcludes
One argument excludes another.
Definition: ncbiargs.hpp:957
@ eInputFile
Name of file (must exist and be readable)
Definition: ncbiargs.hpp:595
@ eOutputFile
Name of file (must be writable)
Definition: ncbiargs.hpp:596
#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
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
Definition: ncbidiag.cpp:8083
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
@ eSerial_AsnText
ASN.1 text.
Definition: serialdef.hpp:73
@ eSerial_AsnBinary
ASN.1 binary.
Definition: serialdef.hpp:74
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
Definition: objostr.cpp:126
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
void AddDataLoader(const string &loader_name, TPriority pri=kPriority_Default)
Add data loader by name.
Definition: scope.cpp:510
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
vector< CSeq_id_Handle > TIds
string GetName(void) const
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CDataLoader * FindDataLoader(const string &loader_name) const
Try to find a registered data loader by name.
virtual void GetIds(const CSeq_id_Handle &idh, TIds &ids)
Request for a list of all Seq-ids of a sequence.
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
@ eBioseq
main blob with complete bioseq
bool CanGetInst(void) const
const TInst & GetInst(void) const
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
Definition: ncbitime.hpp:2776
void Start(void)
Start the timer.
Definition: ncbitime.hpp:2765
size_t serialize(const BV &bv, unsigned char *buf, bm::word_t *temp_block=0, unsigned serialization_flags=0)
Saves bitvector into memory.
Definition: bmserial.h:3071
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
bool IsSeq(void) const
Check if variant Seq is selected.
Definition: Seq_entry_.hpp:257
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
Definition: Bioseq_.hpp:354
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
Definition: Seq_inst_.hpp:826
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
bool IsDelta(void) const
Check if variant Delta is selected.
Definition: Seq_ext_.hpp:336
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_inst_.hpp:838
const TDelta & GetDelta(void) const
Get the variant data.
Definition: Seq_ext_.cpp:180
const Tdata & Get(void) const
Get the member data.
Definition: Delta_ext_.hpp:164
list< CRef< CDelta_seq > > Tdata
Definition: Delta_ext_.hpp:89
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
@ e_Comment
a more extensive comment
Definition: Seqdesc_.hpp:117
static CStopWatch sw
static MDB_envinfo info
Definition: mdb_load.c:37
const CharType(& source)[N]
Definition: pointer.h:1149
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Int4 delta(size_t dimension_, const Int4 *score_)
The Object manager core.
static pcre_uint8 * buffer
Definition: pcretest.c:1051
static wxAcceleratorEntry entries[3]
Modified on Fri Apr 12 17:14:51 2024 by modify_doxy.py rev. 669887