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

Go to the SVN repository for this file.

1 /* $Id: sraread.cpp 100806 2023-09-14 14:12:34Z vasilche $
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: Eugene Vasilchenko
27  *
28  * File Description:
29  * Access to SRA files
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
35 
36 #include <klib/rc.h>
37 #include <klib/writer.h>
38 #include <sra/types.h>
39 #include <sra/impl.h>
40 #include <sra/sradb.h>
41 #include <sra/sradb-priv.h>
42 #include <vfs/manager.h>
43 #include <vfs/resolver.h>
44 #include <vfs/path.h>
45 
46 #include <corelib/ncbimtx.hpp>
47 #include <corelib/ncbi_param.hpp>
50 #include <objects/seq/seq__.hpp>
53 #include <sra/error_codes.hpp>
54 
55 #include <cstring>
56 
58 
59 #define NCBI_USE_ERRCODE_X SRAReader
61 
63 
64 class CSeq_entry;
65 
66 
67 DEFINE_SRA_REF_TRAITS(SRAMgr, const);
68 DEFINE_SRA_REF_TRAITS(SRAColumn, const);
69 DEFINE_SRA_REF_TRAITS(SRATable, const);
70 
71 
73  : m_RC(0)
74 {
75 }
76 
77 
79  const CException* prev_exc,
80  EErrCode err_code,
81  const string& message,
82  EDiagSev severity)
83  : CException(info, prev_exc, CException::EErrCode(err_code), message),
84  m_RC(0)
85 {
86  this->x_Init(info, message, prev_exc, severity);
87  this->x_InitErrCode(CException::EErrCode(err_code));
88 }
89 
90 
92  const CException* prev_exc,
93  EErrCode err_code,
94  const string& message,
95  rc_t rc,
96  EDiagSev severity)
97  : CException(info, prev_exc, CException::EErrCode(err_code), message),
98  m_RC(rc)
99 {
100  this->x_Init(info, message, prev_exc, severity);
101  this->x_InitErrCode(CException::EErrCode(err_code));
102 }
103 
104 
106  const CException* prev_exc,
107  EErrCode err_code,
108  const string& message,
109  rc_t rc,
110  const string& param,
111  EDiagSev severity)
112  : CException(info, prev_exc, CException::EErrCode(err_code), message),
113  m_RC(rc),
114  m_Param(param)
115 {
116  this->x_Init(info, message, prev_exc, severity);
117  this->x_InitErrCode(CException::EErrCode(err_code));
118 }
119 
120 
122  const CException* prev_exc,
123  EErrCode err_code,
124  const string& message,
125  rc_t rc,
126  int64_t param,
127  EDiagSev severity)
128  : CException(info, prev_exc, CException::EErrCode(err_code), message),
129  m_RC(rc),
130  m_Param(NStr::Int8ToString(param))
131 {
132  this->x_Init(info, message, prev_exc, severity);
133  this->x_InitErrCode(CException::EErrCode(err_code));
134 }
135 
136 
138  : CException( other),
139  m_RC(other.m_RC),
140  m_Param(other.m_Param)
141 {
142  x_Assign(other);
143 }
144 
145 
147 {
148 }
149 
150 
152 {
153  return new CSraException(*this);
154 }
155 
156 
157 const char* CSraException::GetType(void) const
158 {
159  return "CSraException";
160 }
161 
162 
164 {
165  return typeid(*this) == typeid(CSraException) ?
166  x_GetErrCode() : CException::GetErrCode();
167 }
168 
169 
170 const char* CSraException::GetErrCodeString(void) const
171 {
172  switch (GetErrCode()) {
173  case eOtherError: return "eOtherError";
174  case eNullPtr: return "eNullPtr";
175  case eAddRefFailed: return "eAddRefFailed";
176  case eInvalidArg: return "eInvalidArg";
177  case eInitFailed: return "eInitFailed";
178  case eNotFound: return "eNotFound";
179  case eInvalidState: return "eInvalidState";
180  case eInvalidIndex: return "eInvalidIndex";
181  case eNotFoundDb: return "eNotFoundDb";
182  case eNotFoundTable: return "eNotFoundTable";
183  case eNotFoundColumn: return "eNotFoundColumn";
184  case eNotFoundValue: return "eNotFoundValue";
185  case eDataError: return "eDataError";
186  case eNotFoundIndex: return "eNotFoundIndex";
187  case eProtectedDb: return "eProtectedDb";
188  case eTimeout: return "eTimeout";
189  default: return CException::GetErrCodeString();
190  }
191 }
192 
193 
194 ostream& operator<<(ostream& out, const CSraRcFormatter& rc)
195 {
196  char buffer[1024];
197  size_t error_len;
198  RCExplain(rc.GetRC(), buffer, sizeof(buffer), &error_len);
199  out << "0x" << hex << rc.GetRC() << dec << ": " << buffer;
200  return out;
201 }
202 
203 
204 void CSraException::ReportExtra(ostream& out) const
205 {
206  if ( m_RC ) {
208  }
209  if ( !m_Param.empty() ) {
210  if ( m_RC ) {
211  out << ": ";
212  }
213  out << m_Param;
214  }
215 }
216 
217 
218 void CSraException::ReportError(const char* msg, rc_t rc)
219 {
220  ERR_POST_X(1, msg<<": "<<CSraRcFormatter(rc));
221 }
222 
223 
225 {
226  if ( GetRCTarget(rc) == rcTimeout && GetRCState(rc) == rcExhausted ) {
227  return true;
228  }
229  /*
230  if ( rc == SILENT_RC(rcVFS, rcQuery, rcExecuting, rcString, rcInsufficient) ) {
231  return true;
232  }
233  */
234  return false;
235 }
236 
237 
239 {
240 }
241 
242 
243 CSraPath::CSraPath(const string& /*rep_path*/, const string& /*vol_path*/)
244 {
245 }
246 
247 
248 NCBI_PARAM_DECL(string, SRA, REP_PATH);
249 NCBI_PARAM_DEF(string, SRA, REP_PATH, "");
250 
251 
252 NCBI_PARAM_DECL(string, SRA, VOL_PATH);
253 NCBI_PARAM_DEF(string, SRA, VOL_PATH, "");
254 
255 
257 {
258  return NCBI_PARAM_TYPE(SRA, REP_PATH)::GetDefault();
259 }
260 
261 
263 {
264  return NCBI_PARAM_TYPE(SRA, VOL_PATH)::GetDefault();
265 }
266 
267 
269 
270 
271 void CSraPath::AddRepPath(const string& rep_path)
272 {
273 }
274 
275 
276 void CSraPath::AddVolPath(const string& vol_path)
277 {
278 }
279 
280 
281 string CSraPath::FindAccPath(const string& acc) const
282 {
283  string ret;
284  ret.resize(128);
285  rc_t rc;
286  {{
287  CFastMutexGuard guard(sx_PathMutex);
288  //rc = SRAPathFind(*this, acc.c_str(), &ret[0], ret.size());
289  VFSManager* mgr;
290  rc = VFSManagerMake(&mgr);
291  if (rc == 0) {
292  rc_t rc2;
293  VResolver* res;
294  rc = VFSManagerGetResolver(mgr, &res);
295  if (rc == 0) {
296  VPath* accPath;
297  rc = VFSManagerMakePath(mgr, &accPath, acc.c_str());
298  if (rc == 0)
299  {
300  const VPath* resolvedPath;
301  rc = VResolverQuery(res, eProtocolHttp, accPath, &resolvedPath, NULL, NULL);
302  if (rc == 0)
303  {
304  String s;
305  VPathGetPath(resolvedPath, &s);
306  ret.assign(s.addr, s.len);
307  rc2 = VPathRelease(resolvedPath);
308  if (rc == 0)
309  rc = rc2;
310  }
311  rc2 = VPathRelease(accPath);
312  if (rc == 0)
313  rc = rc2;
314  }
315  rc2 = VResolverRelease(res);
316  if (rc == 0)
317  rc = rc2;
318  }
319  rc2 = VFSManagerRelease(mgr);
320  if (rc == 0)
321  rc = rc2;
322  }
323  }}
324  if ( rc ) {
325  CHECK_VDB_TIMEOUT_FMT("Cannot find acc path: "<<acc, rc);
327  "Cannot find acc path", rc, acc);
328  }
329  SIZE_TYPE eol_pos = ret.find('\0');
330  if ( eol_pos != NPOS ) {
331  ret.resize(eol_pos);
332  }
333  return ret;
334 }
335 
336 
338  : m_Path(null),
339  m_Trim(trim == eTrim)
340 {
341  x_Init();
342 }
343 
344 
345 CSraMgr::CSraMgr(const string& /*rep_path*/, const string& /*vol_path*/,
346  ETrim trim)
347  : m_Path(null),
348  m_Trim(trim == eTrim)
349 {
350  x_Init();
351 }
352 
353 
355 {
356 }
357 
358 
359 void CSraMgr::x_Init(void)
360 {
361  if ( rc_t rc = SRAMgrMakeRead(x_InitPtr()) ) {
362  *x_InitPtr() = 0;
363  NCBI_THROW2(CSraException, eInitFailed,
364  "Cannot open SRAMgr", rc);
365  }
366 }
367 
368 
370 {
371  if ( !m_Path ) {
372  CFastMutexGuard guard(sx_PathMutex);
373  if ( !m_Path ) {
374  m_Path = CSraPath();
375  }
376  }
377  return m_Path;
378 }
379 
380 
381 string CSraMgr::FindAccPath(const string& acc) const
382 {
383  return GetPath().FindAccPath(acc);
384 }
385 
386 
387 spotid_t CSraMgr::GetSpotInfo(const string& sra, CSraRun& run)
388 {
389  SIZE_TYPE dot = sra.find('.');
390  string acc;
391  spotid_t spot_id = 0;
392  if ( dot == NPOS ) {
393  NCBI_THROW3(CSraException, eInvalidArg,
394  "No spot id specified",
395  RC(rcApp, rcFunctParam, rcDecoding, rcParam, rcIncomplete),
396  sra);
397  }
398  else {
399  acc = sra.substr(0, dot);
400  spot_id = NStr::StringToUInt(sra.substr(dot+1));
401  }
402  if ( !run || run.GetAccession() != acc ) {
403  run = CSraRun(*this, acc);
404  }
405  return spot_id;
406 }
407 
408 
410  CSraRun& run)
411 {
412  return run.GetSpotEntry(GetSpotInfo(sra, run));
413 }
414 
415 
417 {
418  CSraRun run;
419  return GetSpotEntry(sra, run);
420 }
421 
422 
424  : m_Error(0), m_Data(0), m_Bitoffset(0), m_Bitlen(0), m_Len(0)
425 {
426  m_Error = SRAColumnRead(col, id, &m_Data, &m_Bitoffset, &m_Bitlen);
427  if ( !m_Error ) {
428  if ( m_Bitoffset ) {
429  m_Error = RC(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported);
430  }
431  else {
432  uint64_t len = (m_Bitlen+7)>>3;
433 #if SIZEOF_SIZE_T == 4
434  m_Len = size_t(len);
435  if ( m_Len != len ) {
436  m_Error = RC(rcApp, rcColumn, rcDecoding, rcSize, rcUnsupported);
437  }
438 #else
439  m_Len = len;
440 #endif
441  }
442  }
443  if ( m_Error && check_rc == eCheckRc ) {
444  NCBI_THROW3(CSraException, eNotFoundValue, "Cannot read value",
446  }
447 }
448 
449 
450 void CSraRun::Init(CSraMgr& mgr, const string& acc)
451 {
452  m_Acc = acc;
453  m_Trim = mgr.GetTrim();
454  x_DoInit(mgr, acc);
455 }
456 
457 
458 void CSraRun::x_DoInit(CSraMgr& mgr, const string& acc)
459 {
460  if ( rc_t rc = SRAMgrOpenTableRead(mgr, x_InitPtr(), "%.*s",
461  int(acc.size()), acc.data()) ) {
462  *x_InitPtr() = 0;
463  CHECK_VDB_TIMEOUT_FMT("Cannot open run read: "<<acc, rc);
464  NCBI_THROW3(CSraException, eNotFoundDb,
465  "Cannot open run read", rc, acc);
466  }
467  m_Name.Init(*this, "NAME", vdb_ascii_t);
468  m_Read.Init(*this, "READ", insdc_fasta_t);
469  m_Qual.Init(*this, "QUALITY", ncbi_qual1_t);
470  m_SDesc.Init(*this, "SPOT_DESC", sra_spot_desc_t);
471  m_RDesc.Init(*this, "READ_DESC", sra_read_desc_t);
472  m_TrimStart.TryInitRc(*this, "TRIM_START", "INSDC:coord:zero");
473 }
474 
475 
477  const char* name, const char* type)
478 {
479  return SRATableOpenColumnRead(run, x_InitPtr(), name, type);
480 }
481 
482 
483 void CSraColumn::Init(const CSraRun& run,
484  const char* name, const char* type)
485 {
486  if ( rc_t rc = TryInitRc(run, name, type) ) {
487  *x_InitPtr() = 0;
488  CHECK_VDB_TIMEOUT_FMT("Cannot get SRA column: "<<name, rc);
489  NCBI_THROW3(CSraException, eInitFailed,
490  "Cannot get SRA column", rc, name);
491  }
492 }
493 
494 
496 {
497  CRef<CSeq_entry> entry;
498 
499  CSraStringValue name(m_Name, spot_id);
500 
501  entry = new CSeq_entry();
502  CBioseq_set& seqset = entry->SetSet();
503  seqset.SetLevel(0);
504  seqset.SetClass(seqset.eClass_other);
505 
506  CSraValueFor<SRASpotDesc> sdesc(m_SDesc, spot_id);
507  TSeqPos trim_start = m_Trim && m_TrimStart?
509  TSeqPos trim_end = sdesc->clip_qual_right;
510 
511  CSraValueFor<SRAReadDesc> rdesc(m_RDesc, spot_id);
512  CSraStringValue read(m_Read, spot_id);
513  CSraBytesValue qual(m_Qual, spot_id);
514  int seq_count = 0;
515  string id_start = GetAccession()+'.'+NStr::NumericToString(spot_id)+'.';
516  for ( int r = 0; r < sdesc->num_reads; ++r ) {
517  if ( rdesc[r].type != SRA_READ_TYPE_BIOLOGICAL ) {
518  continue;
519  }
520  TSeqPos len = rdesc[r].seg.len;
521  if ( len == 0 ) {
522  continue;
523  }
524  TSeqPos start = rdesc[r].seg.start;
525  TSeqPos end = start + len;
526  if ( m_Trim ) {
527  start = max(start, trim_start);
528  end = min(end, trim_end);
529  if ( start >= end ) {
530  continue;
531  }
532  len = end - start;
533  }
534 
535  CRef<CSeq_entry> seq_entry(new CSeq_entry);
536  CBioseq& seq = seq_entry->SetSeq();
537 
538  CRef<CSeq_id> id(new CSeq_id);
539  id->SetGeneral().SetDb("SRA");
540  id->SetGeneral().SetTag().SetStr(id_start+NStr::UIntToString(r+1));
541  seq.SetId().push_back(id);
542 
543  {{
544  CRef<CSeqdesc> desc(new CSeqdesc);
545  desc->SetTitle(name.Value());
546  seq.SetDescr().Set().push_back(desc);
547  }}
548  {{
549  CSeq_inst& inst = seq.SetInst();
550  inst.SetRepr(inst.eRepr_raw);
551  inst.SetMol(inst.eMol_na);
552  inst.SetLength(len);
553  inst.SetSeq_data().SetIupacna().Set()
554  .assign(read.data()+start, len);
555  }}
556  {{
557  CRef<CSeq_annot> annot(new CSeq_annot);
558  CRef<CSeq_graph> graph(new CSeq_graph);
559  annot->SetData().SetGraph().push_back(graph);
560  graph->SetTitle("Phred Quality");
561  graph->SetLoc().SetWhole(*id);
562  graph->SetNumval(len);
563  CByte_graph& bytes = graph->SetGraph().SetByte();
564  bytes.SetAxis(0);
565  CByte_graph::TValues& values = bytes.SetValues();
566  values.reserve(len);
567  int min = kMax_Int;
568  int max = kMin_Int;
569  for ( size_t i = 0; i < len; ++i ) {
570  int v = qual[start+i];
571  values.push_back(v);
572  if ( v < min ) {
573  min = v;
574  }
575  if ( v > max ) {
576  max = v;
577  }
578  }
579  bytes.SetMin(min);
580  bytes.SetMax(max);
581 
582  seq.SetAnnot().push_back(annot);
583  }}
584 
585  seqset.SetSeq_set().push_back(seq_entry);
586  ++seq_count;
587  }
588  switch ( seq_count ) {
589  case 0:
590  entry.Reset();
591  break;
592  case 1:
593  entry = seqset.GetSeq_set().front();
594  break;
595  }
596  return entry;
597 }
598 
599 
601  uint8_t read_id) const
602 {
603  CSraValueFor<SRASpotDesc> sdesc(m_SDesc, spot_id);
604  if ( read_id == 0 || read_id > sdesc->num_reads ) {
606  }
607  return CSeq_inst::eMol_na;
608 }
609 
610 
612  uint8_t read_id) const
613 {
614  CSraValueFor<SRASpotDesc> sdesc(m_SDesc, spot_id);
615  if ( read_id == 0 || read_id > sdesc->num_reads ) {
616  return kInvalidSeqPos;
617  }
618  TSeqPos trim_start = m_Trim && m_TrimStart?
620  TSeqPos trim_end = sdesc->clip_qual_right;
621  CSraValueFor<SRAReadDesc> rdesc(m_RDesc, spot_id);
622  size_t r = read_id-1;
623  TSeqPos len = rdesc[r].seg.len;
624  if ( len == 0 ) {
625  return kInvalidSeqPos;
626  }
627  TSeqPos start = rdesc[r].seg.start;
628  TSeqPos end = start + len;
629  if ( m_Trim ) {
630  start = max(start, trim_start);
631  end = min(end, trim_end);
632  if ( start >= end ) {
633  return kInvalidSeqPos;
634  }
635  len = end - start;
636  }
637  return len;
638 }
639 
640 
void x_Assign(CObject_id &dst, const CObject_id &src)
Definition: Seq_id.cpp:203
#define NCBI_THROW3(exc_cls, err_code, msg, extra1, extra2)
uint32_t rc_t
CByte_graph –.
Definition: Byte_graph.hpp:66
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.
Definition: ncbidiag.hpp:65
Definition: Seq_entry.hpp:56
CSeq_entry(void)
Definition: Seq_entry.hpp:125
rc_t TryInitRc(const CSraRun &run, const char *name, const char *type)
Definition: sraread.cpp:476
void Init(const CSraRun &run, const char *name, const char *type)
Definition: sraread.cpp:483
EErrCode
Error types that corelib can generate.
Definition: exception.hpp:83
@ eNotFoundValue
DB value not found.
Definition: exception.hpp:95
@ eProtectedDb
DB is protected.
Definition: exception.hpp:98
@ eDataError
VDB data is incorrect.
Definition: exception.hpp:96
@ eAddRefFailed
AddRef failed.
Definition: exception.hpp:86
@ eNotFoundColumn
DB column not found.
Definition: exception.hpp:94
@ eInvalidArg
Invalid argument error.
Definition: exception.hpp:87
@ eNullPtr
Null pointer error.
Definition: exception.hpp:85
@ eNotFoundDb
DB main file not found.
Definition: exception.hpp:92
@ eTimeout
timeout, re-try logic is recommended
Definition: exception.hpp:99
@ eNotFound
Data not found.
Definition: exception.hpp:89
@ eInitFailed
Initialization failed.
Definition: exception.hpp:88
@ eNotFoundTable
DB table not found.
Definition: exception.hpp:93
@ eNotFoundIndex
VDB index not found.
Definition: exception.hpp:97
@ eInvalidState
State of object is invalid for the operation.
Definition: exception.hpp:90
@ eInvalidIndex
Invalid index for array-like retrieval.
Definition: exception.hpp:91
~CSraException(void) noexcept
Definition: sraread.cpp:146
int TErrCode
Translate from the error code value to its string representation.
Definition: exception.hpp:138
virtual const char * GetType(void) const
Definition: sraread.cpp:157
static void ReportError(const char *msg, rc_t rc)
Definition: sraread.cpp:218
virtual TErrCode GetErrCode(void) const
Definition: sraread.cpp:163
virtual const char * GetErrCodeString(void) const
Translate from the error code value to its string representation.
Definition: sraread.cpp:170
CSraException(void)
Constructor.
Definition: sraread.cpp:72
static bool IsTimeout(rc_t rc)
Definition: sraread.cpp:224
virtual void ReportExtra(ostream &out) const
Report "non-standard" attributes.
Definition: sraread.cpp:204
string m_Param
Definition: exception.hpp:171
virtual const CException * x_Clone(void) const
Helper clone method.
Definition: sraread.cpp:151
void x_Init(void)
Definition: sraread.cpp:359
bool GetTrim(void) const
Definition: sraread.hpp:122
string FindAccPath(const string &acc) const
Definition: sraread.cpp:381
CRef< CSeq_entry > GetSpotEntry(const string &sra)
Definition: sraread.cpp:416
CSraPath & GetPath(void) const
Definition: sraread.cpp:369
CSraPath m_Path
Definition: sraread.hpp:134
spotid_t GetSpotInfo(const string &sra, CSraRun &run)
Definition: sraread.cpp:387
CSraMgr(ETrim trim=eNoTrim)
Definition: sraread.cpp:337
static void RegisterFunctions(void)
Definition: sraread.cpp:354
static string GetDefaultVolPath(void)
Definition: sraread.cpp:262
void AddRepPath(const string &rep_path)
Definition: sraread.cpp:271
CSraPath(void)
Definition: sraread.cpp:238
static string GetDefaultRepPath(void)
Definition: sraread.cpp:256
string FindAccPath(const string &acc) const
Definition: sraread.cpp:281
void AddVolPath(const string &vol_path)
Definition: sraread.cpp:276
rc_t GetRC(void) const
Definition: sdk.hpp:54
TObject ** x_InitPtr(void)
Definition: sdk.hpp:175
void x_DoInit(CSraMgr &mgr, const string &acc)
Definition: sraread.cpp:458
CSraColumn m_SDesc
Definition: sraread.hpp:187
CSraColumn m_Qual
Definition: sraread.hpp:186
bool m_Trim
Definition: sraread.hpp:183
CSraColumn m_Read
Definition: sraread.hpp:185
void Init(CSraMgr &mgr, const string &acc)
Definition: sraread.cpp:450
string m_Acc
Definition: sraread.hpp:182
const string & GetAccession(void) const
Definition: sraread.hpp:169
CSraColumn m_Name
Definition: sraread.hpp:184
CSraColumn m_TrimStart
Definition: sraread.hpp:189
TSeqPos GetSequenceLength(spotid_t spot_id, uint8_t read_id) const
Definition: sraread.cpp:611
CSraColumn m_RDesc
Definition: sraread.hpp:188
CSeq_inst::TMol GetSequenceType(spotid_t spot_id, uint8_t read_id) const
Definition: sraread.cpp:600
CRef< CSeq_entry > GetSpotEntry(spotid_t spot_id) const
Definition: sraread.cpp:495
const char * data(void) const
Definition: sraread.hpp:232
string Value(void) const
Definition: sraread.hpp:244
const TValue & Value(void) const
Definition: sraread.hpp:260
bitsz_t m_Bitoffset
Definition: sraread.hpp:218
const void * m_Data
Definition: sraread.hpp:217
bitsz_t m_Bitlen
Definition: sraread.hpp:219
CSraValue(const CSraColumn &col, spotid_t id, ECheckRc check_rc=eCheckRc)
Definition: sraread.cpp:423
size_t m_Len
Definition: sraread.hpp:220
rc_t m_Error
Definition: sraread.hpp:216
NStr –.
Definition: ncbistr.hpp:243
std::ofstream out("events_result.xml")
main entry point for tests
Uint8 uint64_t
Int8 int64_t
unsigned char uint8_t
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
@ null
Definition: ncbimisc.hpp:646
#define NULL
Definition: ncbistd.hpp:225
char *LIBCALL Int8ToString(Nlm_Int8 value, char *str, size_t str_size)
Definition: ncbistr.hpp:420
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
Definition: ncbidiag.hpp:550
EDiagSev
Severity level for the posted diagnostics.
Definition: ncbidiag.hpp:650
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
#define NCBI_THROW2(exception_class, err_code, message, extra)
Throw exception with extra parameter.
Definition: ncbiexpt.hpp:1754
EErrCode
Error types that an application can generate.
Definition: ncbiexpt.hpp:884
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
Definition: ncbi_param.hpp:149
#define kMin_Int
Definition: ncbi_limits.h:183
#define kMax_Int
Definition: ncbi_limits.h:184
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
#define NPOS
Definition: ncbistr.hpp:133
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
Definition: ncbistr.hpp:5109
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
Definition: ncbistr.cpp:642
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
void SetMin(TMin value)
Assign a value to Min data member.
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Seq_graph_.hpp:784
vector< char > TValues
Definition: Byte_graph_.hpp:89
void SetNumval(TNumval value)
Assign a value to Numval data member.
TValues & SetValues(void)
Assign a value to Values data member.
void SetGraph(TGraph &value)
Assign a value to Graph data member.
Definition: Seq_graph_.cpp:250
void SetMax(TMax value)
Assign a value to Max data member.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
Definition: Seq_graph_.cpp:224
void SetAxis(TAxis value)
Assign a value to Axis data member.
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
void SetLevel(TLevel value)
Assign a value to Level data member.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
void SetClass(TClass value)
Assign a value to Class data member.
TSeq & SetSeq(void)
Select the variant.
Definition: Seq_entry_.cpp:108
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
TId & SetId(void)
Assign a value to Id data member.
Definition: Bioseq_.hpp:296
TTitle & SetTitle(void)
Select the variant.
Definition: Seqdesc_.hpp:1039
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
Definition: Bioseq_.hpp:372
void SetInst(TInst &value)
Assign a value to Inst data member.
Definition: Bioseq_.cpp:86
EMol
molecule class in living organism
Definition: Seq_inst_.hpp:108
void SetDescr(TDescr &value)
Assign a value to Descr data member.
Definition: Bioseq_.cpp:65
void SetRepr(TRepr value)
Assign a value to Repr data member.
Definition: Seq_inst_.hpp:574
void SetLength(TLength value)
Assign a value to Length data member.
Definition: Seq_inst_.hpp:668
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
Definition: Seq_inst_.cpp:130
void SetMol(TMol value)
Assign a value to Mol data member.
Definition: Seq_inst_.hpp:621
@ eRepr_raw
continuous sequence
Definition: Seq_inst_.hpp:94
@ eMol_not_set
> cdna = rna
Definition: Seq_inst_.hpp:109
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
Definition of all error codes used in SRA C++ support libraries.
int i
int len
static void hex(unsigned char c)
Definition: mdb_dump.c:56
static MDB_envinfo info
Definition: mdb_load.c:37
Multi-threading – mutexes; rw-locks; semaphore.
T max(T x_, T y_)
T min(T x_, T y_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static pcre_uint8 * buffer
Definition: pcretest.c:1051
@ eNotFound
Not found.
#define CHECK_VDB_TIMEOUT_FMT(msg, rc)
Definition: exception.hpp:186
NCBI_DEFINE_ERR_SUBCODE_X(1)
DEFINE_STATIC_FAST_MUTEX(sx_PathMutex)
NCBI_PARAM_DECL(string, SRA, REP_PATH)
ostream & operator<<(ostream &out, const CSraRcFormatter &rc)
Definition: sraread.cpp:194
DEFINE_SRA_REF_TRAITS(SRAMgr, const)
NCBI_PARAM_DEF(string, SRA, REP_PATH, "")
int64_t spotid_t
Definition: sraread.hpp:43
Definition: type.c:6
Modified on Sun Apr 14 05:25:46 2024 by modify_doxy.py rev. 669887