NCBI C++ ToolKit
csraread.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef SRA__READER__SRA__CSRAREAD__HPP
2 #define SRA__READER__SRA__CSRAREAD__HPP
3 /* $Id: csraread.hpp 101590 2024-01-09 18:27:59Z vasilche $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Eugene Vasilchenko
29  *
30  * File Description:
31  * Access to cSRA files
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 #include <corelib/ncbiobj.hpp>
37 #include <corelib/ncbimtx.hpp>
38 #include <corelib/atomic_util.hpp>
39 #include <util/range.hpp>
44 #include <map>
45 #include <list>
46 
47 //#include <insdc/sra.h> // for INSDC_coord_one, INSDC_coord_len, INSDC_read_filter
51 
54 
56 class CCSraAlignIterator;
58 class CSeq_entry;
59 class CSeq_annot;
60 class CSeq_align;
61 class CSeq_graph;
62 class CBioseq;
63 class CUser_object;
64 class CUser_field;
65 class IIdMapper;
66 
68 {
69  enum ERefIdType {
72  };
77  };
78  enum EAlignType {
79  fPrimaryAlign = 1<<0,
82  };
84 };
85 
86 
88 {
89 public:
90  CCSraDb_Impl(CVDBMgr& mgr, const string& csra_path,
91  IIdMapper* ref_id_mapper,
92  ERefIdType ref_id_type,
93  const string& sra_id_part);
94  virtual ~CCSraDb_Impl(void);
95 
96  // SRefInfo holds cached refseq information - ids, len, rows
97  struct SRefInfo {
98  string m_Name, m_SeqId;
99  mutable copyable_relaxed_atomic<TSeqPos> m_SeqLength; // actual len will be updated
103  return m_Seq_ids.front();
104  }
105  const CRef<CSeq_id>& GetMainSeq_id(void) const {
106  return m_Seq_ids.front();
107  }
109  return m_Seq_id_Handle;
110  }
111  TVDBRowId m_RowFirst, m_RowLast;
113  vector<TSeqPos> m_AlnOverStarts; // relative to m_RowFirst
114  };
115  typedef list<SRefInfo> TRefInfoList;
118 
119  const TRefInfoList& GetRefInfoList(void) const {
120  return m_RefList;
121  }
123  return m_RefMapByName;
124  }
126  return m_RefMapBySeq_id;
127  }
128 
129  TSeqPos GetRowSize(void) const {
130  return m_RowSize;
131  }
132 
133  typedef vector<string> TSpotGroups;
134  void GetSpotGroups(TSpotGroups& spot_groups);
135 
136  const string& GetCSraPath(void) const {
137  return m_CSraPath;
138  }
139 
140  const string& GetSraIdPart(void) const {
141  return m_SraIdPart;
142  }
143  void SetSraIdPart(const string& s) {
144  m_SraIdPart = s;
145  }
146 
147  CRef<CSeq_id> MakeShortReadId(TVDBRowId id1, INSDC_coord_one id2) const;
148  void SetShortReadId(string& str, TVDBRowId id1, INSDC_coord_one id2) const;
149 
150  bool IsCSRA() const {
151  return m_IsCSRA;
152  }
153 
154 protected:
155  friend class CCSraRefSeqIterator;
156  friend class CCSraAlignIterator;
158 
159  void x_CalcSeqLength(const SRefInfo& info);
160 
161  // SRefTableCursor is helper accessor structure for refseq table
162  struct SRefTableCursor;
163  // SAlnTableCursor is helper accessor structure for align table
164  struct SAlnTableCursor;
165  // SSeqTableCursor is helper accessor structure for sequence table
166  struct SSeqTableCursor;
167  friend struct SSeqTableCursor;
168 
169  // get table accessor object for exclusive access
171  CRef<SAlnTableCursor> Aln(bool is_secondary);
172  CRef<SSeqTableCursor> Seq(void);
173  // return table accessor object for reuse
174  void Put(CRef<SRefTableCursor>& curs);
175  void Put(CRef<SAlnTableCursor>& curs);
176  void Put(CRef<SSeqTableCursor>& curs);
177 
178 protected:
179  void OpenRefTable(void);
180  void OpenAlnTable(bool is_secondary);
181  void OpenSeqTable(void);
182 
183  const CVDBTable& RefTable(void) {
184  const CVDBTable& table = m_RefTable;
185  if ( !table ) {
186  OpenRefTable();
187  }
188  return table;
189  }
190  const CVDBTable& AlnTable(bool is_secondary) {
191  const CVDBTable& table = m_AlnTable[is_secondary];
192  if ( !table ) {
193  OpenAlnTable(is_secondary);
194  }
195  return table;
196  }
197  const CVDBTable& SeqTable(void) {
198  const CVDBTable& table = m_SeqTable;
199  if ( !table ) {
200  OpenSeqTable();
201  }
202  return table;
203  }
204 
205  void x_MakeRefSeq_ids(SRefInfo& info,
206  IIdMapper* ref_id_mapper,
207  int ref_id_type);
208 
209 private:
212  string m_CSraPath;
213  string m_SraIdPart;
214 
218  CVDBTable m_AlnTable[2];
220 
224 
225  bool m_IsCSRA;
226  TSeqPos m_RowSize; // cached size of refseq row in bases
227  TRefInfoList m_RefList; // list of cached refseqs' information
228  TRefInfoMapByName m_RefMapByName; // index for refseq info lookup
229  TRefInfoMapBySeq_id m_RefMapBySeq_id; // index for refseq info lookup
230 };
231 
232 
233 class CCSraDb : public CRef<CCSraDb_Impl>, public SCSraDb_Defs
234 {
235 public:
236  CCSraDb(void)
237  {
238  }
240  CCSraDb(CVDBMgr& mgr,
241  const string& csra_path,
242  IIdMapper* ref_id_mapper = NULL,
243  ERefIdType ref_id_type = eRefId_SEQ_ID);
245  CCSraDb(CVDBMgr& mgr,
246  const string& csra_path,
247  const string& sra_id_part,
248  IIdMapper* ref_id_mapper = NULL,
249  ERefIdType ref_id_type = eRefId_SEQ_ID);
250 
252  static string MakeSraIdPart(EPathInIdType path_in_id_type,
253  const string& dir_path,
254  const string& csra_file);
255 
256  TSeqPos GetRowSize(void) const
257  {
258  return GetObject().GetRowSize();
259  }
260 
262  void GetSpotGroups(TSpotGroups& spot_groups)
263  {
264  GetObject().GetSpotGroups(spot_groups);
265  }
266 };
267 
268 
270 {
271 public:
273  {
274  }
275  CCSraRefSeqIterator(const CCSraDb& csra_db,
276  CCSraDb_Impl::TRefInfoList::const_iterator iter)
277  : m_Db(csra_db),
278  m_Iter(iter)
279  {
280  }
281  explicit CCSraRefSeqIterator(const CCSraDb& csra_db);
283  CCSraRefSeqIterator(const CCSraDb& csra_db, const string& seq_id);
284  enum EByName {
285  eByName
286  };
287  CCSraRefSeqIterator(const CCSraDb& csra_db, const string& name,
288  EByName /*by_name*/);
289  CCSraRefSeqIterator(const CCSraDb& csra_db, const CSeq_id_Handle& seq_id);
290 
291  bool operator!(void) const {
292  return !m_Db || m_Iter == m_Db->GetRefInfoList().end();
293  }
294  operator const void*(void) const {
295  return !*this? 0: this;
296  }
297 
298  const CCSraDb_Impl::SRefInfo& GetInfo(void) const;
299  const CCSraDb_Impl::SRefInfo& operator*(void) const {
300  return GetInfo();
301  }
302  const CCSraDb_Impl::SRefInfo* operator->(void) const {
303  return &GetInfo();
304  }
305 
307  ++m_Iter;
308  return *this;
309  }
310 
311  const string& GetRefSeqId(void) const {
312  return m_Iter->m_SeqId;
313  }
315  return m_Iter->GetMainSeq_id();
316  }
317  const CSeq_id_Handle& GetRefSeq_id_Handle(void) const {
318  return m_Iter->GetMainSeq_id_Handle();
319  }
320  const CBioseq::TId& GetRefSeq_ids(void) const {
321  return m_Iter->m_Seq_ids;
322  }
323 
324  bool IsCircular(void) const;
325 
326  TSeqPos GetSeqLength(void) const;
327 
329  size_t GetRowAlignCount(TVDBRowId row) const;
330 
331  size_t GetAlignCountAtPos(TSeqPos pos, TAlignType type = fAnyAlign) const;
332 
333  CRef<CSeq_graph> GetCoverageGraph(void) const;
334  CRef<CSeq_annot> GetCoverageAnnot(void) const;
335  CRef<CSeq_annot> GetCoverageAnnot(const string& annot_name) const;
336 
337  CRef<CSeq_annot> GetSeq_annot(void) const;
338  CRef<CSeq_annot> GetSeq_annot(const string& annot_name) const;
339 
340  enum ELoadData {
342  eOmitData
343  };
344  CRef<CBioseq> GetRefBioseq(ELoadData load = eLoadData) const;
345  typedef list< CRef<CSeq_literal> > TLiterals;
347  void GetRefLiterals(TLiterals& literals,
348  TRange range,
349  ELoadData load = eLoadData) const;
350 
351  // return array of start position of alignmnets overlapping with each page
352  // return empty array if at most one page overlapping is allowed
353  const vector<TSeqPos>& GetAlnOverStarts(void) const;
354  // return first position that is surely not covered by alignments
355  // with starting position in the argument range
356  TSeqPos GetAlnOverToOpen(TRange range) const;
357 
358  // estimate number of alignments mapped to the reference sequence
359  Uint8 GetEstimatedNumberOfAlignments(void) const;
360 
361 protected:
362  friend class CCSraAlignIterator;
363 
364  CRef<CSeq_annot> x_GetSeq_annot(const string* annot_name) const;
365 
366  static CRef<CSeq_annot> MakeSeq_annot(const string& annot_name);
367 
368  CCSraDb_Impl& GetDb(void) const {
369  return m_Db.GetNCObject();
370  }
371 
372 private:
374  CCSraDb_Impl::TRefInfoList::const_iterator m_Iter;
375 };
376 
377 
379 {
380 public:
381  CCSraAlignIterator(void);
382 
383  enum ESearchMode {
385  eSearchByStart
386  };
387 
389  CCSraAlignIterator(const CCSraDb& csra_db,
390  const string& ref_id,
391  TSeqPos ref_pos,
392  TSeqPos window = 0,
393  ESearchMode search_mode = eSearchByOverlap,
394  TAlignType align_type = fAnyAlign);
395  CCSraAlignIterator(const CCSraDb& csra_db,
396  const CSeq_id_Handle& ref_id,
397  TSeqPos ref_pos,
398  TSeqPos window,
399  ESearchMode search_mode,
400  TAlignType align_type = fAnyAlign);
401  CCSraAlignIterator(const CCSraDb& csra_db,
402  const CSeq_id_Handle& ref_id,
403  TSeqPos ref_pos,
404  TSeqPos window = 0,
405  TAlignType align_type = fAnyAlign);
406  ~CCSraAlignIterator(void);
407 
408  void Reset(void);
410  CCSraAlignIterator& operator=(const CCSraAlignIterator& iter);
411 
412  void Select(TSeqPos ref_pos,
413  TSeqPos window = 0,
414  ESearchMode search_mode = eSearchByOverlap,
415  TAlignType align_type = fAnyAlign);
416 
417  operator const void*(void) const {
418  return m_Error? 0: this;
419  }
420  bool operator!(void) const {
421  return m_Error != 0;
422  }
423 
425  x_Next();
426  return *this;
427  }
428 
429  TVDBRowId GetAlignmentId(void) const;
430 
431  bool IsSecondary(void) const {
432  return m_AlnRowIsSecondary;
433  }
434 
435  CTempString GetRefSeqId(void) const;
436  TSeqPos GetRefSeqPos(void) const {
437  return m_CurRefPos;
438  }
439  TSeqPos GetRefSeqLen(void) const {
440  return m_CurRefLen;
441  }
442  bool GetRefMinusStrand(void) const;
443 
444  int GetMapQuality(void) const;
445 
446  TVDBRowId GetShortId1(void) const;
447  INSDC_coord_one GetShortId2(void) const;
448  TSeqPos GetShortPos(void) const;
449  TSeqPos GetShortLen(void) const;
450 
451  CTempString GetSpotGroup(void) const;
452 
453  bool IsSetName(void) const;
454  CTempString GetName(void) const;
455 
456  INSDC_read_filter GetReadFilter(void) const;
457 
458  CTempString GetCIGAR(void) const;
459  // returns long form of CIGAR
460  CTempString GetCIGARLong(void) const;
461  // GetMismatchRead() returns difference of the short read and reference
462  // sequence. Matching bases are represented as '='.
463  // The short read is reversed to match direction of the reference seq.
464  CTempString GetMismatchRead(void) const;
465  // GetMismatchRaw() returns only mismatched and inserted/mismatched bases.
466  CTempString GetMismatchRaw(void) const;
467  // MakeFullMismatch() generates all mismatched and all inserted bases.
468  void MakeFullMismatch(string& str,
469  CTempString cigar,
470  CTempString mismatch) const;
471 
473  return m_RefIter->GetMainSeq_id();
474  }
475  CRef<CSeq_id> GetShortSeq_id(void) const;
476  CRef<CSeq_id> GetMateShortSeq_id(void) const;
477  CRef<CBioseq> GetShortBioseq(void) const;
478  CRef<CSeq_align> GetMatchAlign(void) const;
479  CRef<CSeq_graph> GetQualityGraph(void) const;
480  CRef<CSeq_annot> GetEmptyMatchAnnot(void) const;
481  CRef<CSeq_annot> GetEmptyMatchAnnot(const string& annot_name) const;
482  CRef<CSeq_annot> GetMatchAnnot(void) const;
483  CRef<CSeq_annot> GetMatchAnnot(const string& annot_name) const;
484  CRef<CSeq_annot> GetQualityGraphAnnot(void) const;
485  CRef<CSeq_annot> GetQualityGraphAnnot(const string& annot_name) const;
486  CRef<CSeq_entry> GetMatchEntry(void) const;
487  CRef<CSeq_entry> GetMatchEntry(const string& annot_name) const;
488  CRef<CSeq_annot> GetSeq_annot(void) const;
489  CRef<CSeq_annot> GetSeq_annot(const string& annot_name) const;
490 
491  static CRef<CSeq_annot> MakeSeq_annot(const string& annot_name);
492  static CRef<CSeq_annot> MakeEmptyMatchAnnot(const string& annot_name);
493  static CRef<CAnnotdesc> MakeMatchAnnotIndicator(void);
494 
495 protected:
497 
498  CCSraDb_Impl& GetDb(void) const {
499  return m_RefIter.GetDb();
500  }
501 
502  CCSraAlignIterator(const CCSraDb& csra_db,
503  TAlignType align_type,
504  TVDBRowId align_row);
505 
506  void x_Settle(void); // skip all non-matching elements
507  void x_Next(void) {
508  ++m_AlnRowCur;
509  x_Settle();
510  }
511 
512  CRef<CSeq_entry> x_GetMatchEntry(const string* annot_name) const;
513  CRef<CSeq_annot> x_GetEmptyMatchAnnot(const string* annot_name) const;
514  CRef<CSeq_annot> x_GetMatchAnnot(const string* annot_name) const;
515  CRef<CSeq_annot> x_GetQualityGraphAnnot(const string* annot_name) const;
516  CRef<CSeq_annot> x_GetSeq_annot(const string* annot_name) const;
517 
520  CRef<CUser_object> x_GetSecondaryIndicator(void) const;
521  CObject_id& x_GetObject_id(const char* name, TObjectIdCache& cache) const;
522  CUser_field& x_AddField(CUser_object& obj,
523  const char* name,
524  TObjectIdCache& cache) const;
525  void x_AddField(CUser_object& obj, const char* name, CTempString value,
526  TObjectIdCache& cache) const;
527  void x_AddField(CUser_object& obj, const char* name, int value,
528  TObjectIdCache& cache) const;
529  void x_AddField(CUser_object& obj, const char* name, CTempString value,
530  TObjectIdCache& id_cache, TUserFieldCache& cache,
531  size_t max_value_length, size_t max_cache_size) const;
532 
533 private:
534  CCSraRefSeqIterator m_RefIter; // refseq selector
535  CRef<CCSraDb_Impl::SRefTableCursor> m_Ref; // VDB ref table accessor
536  CRef<CCSraDb_Impl::SAlnTableCursor> m_Aln; // VDB align table accessor
537 
538  rc_t m_Error; // result of VDB access
539  TSeqPos m_ArgRefPos, m_ArgRefLast; // requested refseq range
540  TSeqPos m_CurRefPos, m_CurRefLen; // current alignment refseq range
541 
542  TVDBRowId m_RefRowNext; // refseq row range
547  const TVDBRowId* m_AlnRowCur; // current refseq row alignments ids
549 
550  struct SCreateCache {
552 
563  CRef<CUser_object> m_ReadFilterIndicator[4];
564  };
566 
567  SCreateCache& x_GetCreateCache(void) const;
568 };
569 
570 
572 {
573 public:
574  enum EClipType {
575  eDefaultClip, // as defined by config
576  eNoClip, // force no clipping
577  eClipByQuality // force clipping
578  };
579 
581  explicit
582  CCSraShortReadIterator(const CCSraDb& csra_db,
583  EClipType clip_type = eDefaultClip);
584  // The last constructor parameter was changed from zero-based mate_index
585  // to one-based read_id to reflect standardization of short read ids
586  // in form gnl|SRA|<SRA accesion>.<Spot id>.<Read id>.
587  CCSraShortReadIterator(const CCSraDb& csra_db,
588  TVDBRowId spot_id,
589  EClipType clip_type = eDefaultClip);
590  CCSraShortReadIterator(const CCSraDb& csra_db,
591  TVDBRowId spot_id,
592  uint32_t read_id,
593  EClipType clip_type = eDefaultClip);
594  ~CCSraShortReadIterator(void);
595 
596  void Reset(void);
598  CCSraShortReadIterator& operator=(const CCSraShortReadIterator& iter);
599 
600  bool Select(TVDBRowId spot_id);
601  bool Select(TVDBRowId spot_id, uint32_t read_id);
602  void SetLastSpotId(TVDBRowId spot_id);
603 
604  operator const void*(void) const {
605  return m_Error? 0: this;
606  }
607  bool operator!(void) const {
608  return m_Error != 0;
609  }
610 
612  x_Next();
613  return *this;
614  }
615 
616  TVDBRowId GetSpotId(void) const {
617  return m_SpotId;
618  }
619  TVDBRowId GetMaxSpotId(void) const {
620  return m_MaxSpotId;
621  }
622  uint32_t GetReadId(void) const {
623  return m_ReadId;
624  }
625  uint32_t GetMaxReadId(void) const {
626  return m_MaxReadId;
627  }
628 
629  // Use GetReadId() instead of GetMateIndex().
630  // Note that GetReadId() is one-based and GetMateIndex() is zero-based.
632  return GetReadId()-1;
633  }
634  // Number of reads in this spot.
635  uint32_t GetReadCount(void) const {
636  return GetMaxReadId();
637  }
638  // Number of biological reads without taking into account any clipping.
639  uint32_t GetMateCount(void) const;
640 
641  CTempString GetSpotGroup(void) const;
642 
643  bool IsSetName(void) const;
644  CTempString GetName(void) const;
645 
646  // Returns true if current read has clipping info that can or does
647  // reduce sequence length.
648  bool HasClippingInfo(void) const;
649  // Returns true if current read is actually clipped by quality.
650  // It can be true only if clipping by quality is on.
651  bool IsClippedByQuality(void) const {
652  return m_ClipByQuality && HasClippingInfo();
653  }
654  // Returns true if current read has actual clipping info that is not
655  // applied because clipping by quality is off.
656  bool ShouldBeClippedByQuality(void) const {
657  return !m_ClipByQuality && HasClippingInfo();
658  }
659 
660  CTempString GetReadData(EClipType clip_type = eDefaultClip) const;
661 
662  TVDBRowId GetShortId1(void) const {
663  return GetSpotId();
664  }
665  uint32_t GetShortId2(void) const {
666  return GetReadId();
667  }
668 
669  bool IsTechnicalRead(void) const;
670 
671  INSDC_read_filter GetReadFilter(void) const;
672 
673  // returns current read range inside spot
675  TOpenRange GetReadRange(EClipType clip_type = eDefaultClip) const;
676 
677  TSeqPos GetShortLen(void) const {
678  return GetReadRange().GetLength();
679  }
680 
681  CRef<CSeq_id> GetShortSeq_id(void) const;
682 
683  // clip coordinate (inclusive)
684  TSeqPos GetClipQualityLeft(void) const;
685  TSeqPos GetClipQualityLength(void) const;
687  {
688  // inclusive
689  return GetClipQualityLeft() + GetClipQualityLength() - 1;
690  }
691 
692  CRef<CSeq_graph> GetQualityGraph(void) const;
693  CRef<CSeq_annot> GetQualityGraphAnnot(void) const;
694  CRef<CSeq_annot> GetQualityGraphAnnot(const string& annot_name) const;
695 
697  fQualityGraph = 1<<0,
698  fDefaultBioseqFlags = 0
699  };
700  typedef int TBioseqFlags;
701  CRef<CBioseq> GetShortBioseq(TBioseqFlags flags = fDefaultBioseqFlags) const;
702 
703  CCSraRefSeqIterator GetRefSeqIter(TSeqPos* ref_pos_ptr = NULL) const;
704  CCSraAlignIterator GetAlignIter() const;
705 
706 protected:
707  CCSraDb_Impl& GetDb(void) const {
708  return m_Db.GetNCObject();
709  }
710 
711  void x_Init(const CCSraDb& csra_db, EClipType clip_type);
712  bool x_ValidRead(void) const;
713  bool x_Settle(bool single_spot = false);
714  bool x_Next(void) {
715  ++m_ReadId;
716  return x_Settle();
717  }
718 
719 
720  void x_GetMaxReadId(void);
721  CTempString x_GetReadData(TOpenRange range) const;
722 
723  CRef<CSeq_annot> x_GetSeq_annot(const string* annot_name) const;
724  CRef<CSeq_annot> x_GetQualityGraphAnnot(const string* annot_name) const;
725  CRef<CSeq_annot> x_GetQualityGraphAnnot(TOpenRange range,
726  const string* annot_name) const;
727  CRef<CSeq_graph> x_GetQualityGraph(TOpenRange range) const;
728 
729 private:
730  CCSraDb m_Db; // refseq selector
731  CRef<CCSraDb_Impl::SSeqTableCursor> m_Seq; // VDB sequence table accessor
732 
739 
740  rc_t m_Error; // result of VDB access
741 };
742 
743 
744 /////////////////////////////////////////////////////////////////////////////
745 // CCSraRefSeqIterator
746 
747 inline
749 CCSraRefSeqIterator::GetSeq_annot(const string& annot_name) const
750 {
751  return x_GetSeq_annot(&annot_name);
752 }
753 
754 
755 inline
758 {
759  return x_GetSeq_annot(0);
760 }
761 
762 
763 /////////////////////////////////////////////////////////////////////////////
764 // CCSraAlignIterator
765 
766 inline
768 CCSraAlignIterator::GetMatchEntry(const string& annot_name) const
769 {
770  return x_GetMatchEntry(&annot_name);
771 }
772 
773 
774 inline
777 {
778  return x_GetMatchEntry(0);
779 }
780 
781 
782 inline
784 CCSraAlignIterator::GetEmptyMatchAnnot(const string& annot_name) const
785 {
786  return x_GetEmptyMatchAnnot(&annot_name);
787 }
788 
789 
790 inline
793 {
794  return x_GetEmptyMatchAnnot(0);
795 }
796 
797 
798 inline
800 CCSraAlignIterator::GetMatchAnnot(const string& annot_name) const
801 {
802  return x_GetMatchAnnot(&annot_name);
803 }
804 
805 
806 inline
809 {
810  return x_GetMatchAnnot(0);
811 }
812 
813 
814 inline
816 CCSraAlignIterator::GetQualityGraphAnnot(const string& annot_name) const
817 {
818  return x_GetQualityGraphAnnot(&annot_name);
819 }
820 
821 
822 inline
825 {
826  return x_GetQualityGraphAnnot(0);
827 }
828 
829 
830 inline
832 CCSraAlignIterator::x_GetSeq_annot(const string* annot_name) const
833 {
834  return m_RefIter.x_GetSeq_annot(annot_name);
835 }
836 
837 
838 inline
840 CCSraAlignIterator::GetSeq_annot(const string& annot_name) const
841 {
842  return x_GetSeq_annot(&annot_name);
843 }
844 
845 
846 inline
849 {
850  return x_GetSeq_annot(0);
851 }
852 
853 
854 inline
856 CCSraAlignIterator::MakeSeq_annot(const string& annot_name)
857 {
858  return CCSraRefSeqIterator::MakeSeq_annot(annot_name);
859 }
860 
861 
862 /////////////////////////////////////////////////////////////////////////////
863 // CCSraShortReadIterator
864 
865 inline
867 CCSraShortReadIterator::GetQualityGraphAnnot(const string& annot_name) const
868 {
869  return x_GetQualityGraphAnnot(&annot_name);
870 }
871 
872 
873 inline
876 {
877  return x_GetQualityGraphAnnot(0);
878 }
879 
880 
883 
884 #endif // SRA__READER__SRA__CSRAREAD__HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Extensions to std::atomic<>
uint32_t rc_t
AutoPtr –.
Definition: ncbimisc.hpp:401
bool operator!(void) const
Definition: csraread.hpp:420
CRef< CSeq_annot > x_GetMatchAnnot(const string *annot_name) const
Definition: csraread.cpp:1789
CRef< CSeq_annot > GetEmptyMatchAnnot(void) const
Definition: csraread.hpp:792
CCSraRefSeqIterator m_RefIter
Definition: csraread.hpp:534
CRef< CObject_id > TObjectIdCache
Definition: csraread.hpp:518
TVDBRowId m_RefRowLast
Definition: csraread.hpp:543
CRef< CSeq_entry > GetMatchEntry(void) const
Definition: csraread.hpp:776
static CRef< CSeq_annot > MakeSeq_annot(const string &annot_name)
Definition: csraread.hpp:856
CCSraDb_Impl & GetDb(void) const
Definition: csraread.hpp:498
CRef< CSeq_id > GetRefSeq_id(void) const
Definition: csraread.hpp:472
CRef< CSeq_annot > GetQualityGraphAnnot(void) const
Definition: csraread.hpp:824
TSeqPos GetRefSeqLen(void) const
Definition: csraread.hpp:439
TVDBRowId m_RefRowNext
Definition: csraread.hpp:542
map< CTempString, CRef< CUser_field > > TUserFieldCache
Definition: csraread.hpp:519
const TVDBRowId * m_AlnRowCur
Definition: csraread.hpp:547
CRef< CSeq_annot > x_GetSeq_annot(const string *annot_name) const
Definition: csraread.hpp:832
CRef< CSeq_annot > GetSeq_annot(void) const
Definition: csraread.hpp:848
TSeqPos GetRefSeqPos(void) const
Definition: csraread.hpp:436
CRef< CSeq_entry > x_GetMatchEntry(const string *annot_name) const
Definition: csraread.cpp:1807
CRef< CCSraDb_Impl::SRefTableCursor > m_Ref
Definition: csraread.hpp:535
CCSraAlignIterator & operator++(void)
Definition: csraread.hpp:424
CRef< CSeq_annot > GetMatchAnnot(void) const
Definition: csraread.hpp:808
TAlignType m_AlignType
Definition: csraread.hpp:546
bool IsSecondary(void) const
Definition: csraread.hpp:431
CRef< CSeq_annot > x_GetQualityGraphAnnot(const string *annot_name) const
Definition: csraread.cpp:1798
CRef< CSeq_annot > x_GetEmptyMatchAnnot(const string *annot_name) const
Definition: csraread.cpp:1765
void x_Next(void)
Definition: csraread.hpp:507
ESearchMode m_SearchMode
Definition: csraread.hpp:545
AutoPtr< SCreateCache > m_CreateCache
Definition: csraread.hpp:565
CRef< CCSraDb_Impl::SAlnTableCursor > m_Aln
Definition: csraread.hpp:536
const TVDBRowId * m_AlnRowEnd
Definition: csraread.hpp:548
CFastMutex m_OverlapMutex
Definition: csraread.hpp:216
const CVDBTable & SeqTable(void)
Definition: csraread.hpp:197
CVDBTable m_RefTable
Definition: csraread.hpp:217
TSeqPos m_RowSize
Definition: csraread.hpp:226
void GetSpotGroups(TSpotGroups &spot_groups)
Definition: csraread.cpp:431
list< SRefInfo > TRefInfoList
Definition: csraread.hpp:115
CVDBObjectCache< SSeqTableCursor > m_Seq
Definition: csraread.hpp:223
const CVDBTable & RefTable(void)
Definition: csraread.hpp:183
TRefInfoList m_RefList
Definition: csraread.hpp:227
vector< string > TSpotGroups
Definition: csraread.hpp:133
bool IsCSRA() const
Definition: csraread.hpp:150
void SetSraIdPart(const string &s)
Definition: csraread.hpp:143
const TRefInfoMapBySeq_id & GetRefInfoMapBySeq_id(void) const
Definition: csraread.hpp:125
TRefInfoMapByName m_RefMapByName
Definition: csraread.hpp:228
CVDBObjectCache< SRefTableCursor > m_Ref
Definition: csraread.hpp:221
const string & GetCSraPath(void) const
Definition: csraread.hpp:136
TRefInfoMapBySeq_id m_RefMapBySeq_id
Definition: csraread.hpp:229
TSeqPos GetRowSize(void) const
Definition: csraread.hpp:129
string m_SraIdPart
Definition: csraread.hpp:213
const CVDBTable & AlnTable(bool is_secondary)
Definition: csraread.hpp:190
const string & GetSraIdPart(void) const
Definition: csraread.hpp:140
CVDBTable m_SeqTable
Definition: csraread.hpp:219
CVDBMgr m_Mgr
Definition: csraread.hpp:210
map< string, TRefInfoList::iterator, PNocase > TRefInfoMapByName
Definition: csraread.hpp:116
string m_CSraPath
Definition: csraread.hpp:212
const TRefInfoList & GetRefInfoList(void) const
Definition: csraread.hpp:119
CFastMutex m_TableMutex
Definition: csraread.hpp:215
map< CSeq_id_Handle, TRefInfoList::iterator > TRefInfoMapBySeq_id
Definition: csraread.hpp:117
const TRefInfoMapByName & GetRefInfoMapByName(void) const
Definition: csraread.hpp:122
CCSraDb(void)
Definition: csraread.hpp:236
CCSraDb_Impl::TSpotGroups TSpotGroups
Definition: csraread.hpp:261
void GetSpotGroups(TSpotGroups &spot_groups)
Definition: csraread.hpp:262
TSeqPos GetRowSize(void) const
Definition: csraread.hpp:256
static string MakeSraIdPart(EPathInIdType path_in_id_type, const string &dir_path, const string &csra_file)
Definition: csraread.cpp:386
const CCSraDb_Impl::SRefInfo & operator*(void) const
Definition: csraread.hpp:299
static CRef< CSeq_annot > MakeSeq_annot(const string &annot_name)
Definition: csraread.cpp:765
CRef< CSeq_annot > GetSeq_annot(void) const
Definition: csraread.hpp:757
CCSraDb_Impl::TRefInfoList::const_iterator m_Iter
Definition: csraread.hpp:374
CCSraRefSeqIterator(const CCSraDb &csra_db, CCSraDb_Impl::TRefInfoList::const_iterator iter)
Definition: csraread.hpp:275
const CBioseq::TId & GetRefSeq_ids(void) const
Definition: csraread.hpp:320
bool operator!(void) const
Definition: csraread.hpp:291
CCSraRefSeqIterator & operator++(void)
Definition: csraread.hpp:306
const string & GetRefSeqId(void) const
Definition: csraread.hpp:311
CRef< CSeq_annot > x_GetSeq_annot(const string *annot_name) const
Definition: csraread.cpp:777
list< CRef< CSeq_literal > > TLiterals
Definition: csraread.hpp:345
const CCSraDb_Impl::SRefInfo * operator->(void) const
Definition: csraread.hpp:302
CRange< TSeqPos > TRange
Definition: csraread.hpp:346
const CSeq_id_Handle & GetRefSeq_id_Handle(void) const
Definition: csraread.hpp:317
CRef< CSeq_id > GetRefSeq_id(void) const
Definition: csraread.hpp:314
CCSraDb_Impl & GetDb(void) const
Definition: csraread.hpp:368
uint32_t GetReadId(void) const
Definition: csraread.hpp:622
COpenRange< TSeqPos > TOpenRange
Definition: csraread.hpp:674
TSeqPos GetClipQualityRight(void) const
Definition: csraread.hpp:686
bool x_Settle(bool single_spot=false)
Definition: csraread.cpp:2071
CCSraShortReadIterator & operator++(void)
Definition: csraread.hpp:611
TVDBRowId GetShortId1(void) const
Definition: csraread.hpp:662
bool IsClippedByQuality(void) const
Definition: csraread.hpp:651
CRef< CSeq_annot > GetQualityGraphAnnot(void) const
Definition: csraread.hpp:875
CRef< CSeq_annot > x_GetQualityGraphAnnot(const string *annot_name) const
Definition: csraread.cpp:2335
TVDBRowId GetSpotId(void) const
Definition: csraread.hpp:616
CCSraDb_Impl & GetDb(void) const
Definition: csraread.hpp:707
uint32_t GetMaxReadId(void) const
Definition: csraread.hpp:625
TVDBRowId GetMaxSpotId(void) const
Definition: csraread.hpp:619
uint32_t GetMateIndex(void) const
Definition: csraread.hpp:631
CRef< CCSraDb_Impl::SSeqTableCursor > m_Seq
Definition: csraread.hpp:731
uint32_t GetReadCount(void) const
Definition: csraread.hpp:635
TSeqPos GetShortLen(void) const
Definition: csraread.hpp:677
uint32_t GetShortId2(void) const
Definition: csraread.hpp:665
bool ShouldBeClippedByQuality(void) const
Definition: csraread.hpp:656
bool operator!(void) const
Definition: csraread.hpp:607
CRef< CSeq_annot > x_GetSeq_annot(const string *annot_name) const
Definition: csraread.cpp:2311
CFastMutex –.
Definition: ncbimtx.hpp:667
CObject –.
Definition: ncbiobj.hpp:180
Definition: Seq_entry.hpp:56
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
General IdMapper interface.
Definition: iidmapper.hpp:48
Include a standard set of the NCBI C++ Toolkit most basic headers.
BEGIN_NAMESPACE(objects)
uint8_t INSDC_read_filter
Definition: csraread.hpp:50
int32_t INSDC_coord_one
Definition: csraread.hpp:48
uint32_t INSDC_coord_len
Definition: csraread.hpp:49
END_NCBI_NAMESPACE
Definition: csraread.hpp:882
END_NAMESPACE(objects)
BEGIN_NCBI_NAMESPACE
Definition: csraread.hpp:52
static uch flags
int GetSeqLength(const CBioseq &bioseq)
Definition: cuSequence.cpp:216
static const char * str(char *buf, int n)
Definition: stats.c:84
Int4 int32_t
unsigned char uint8_t
Uint4 uint32_t
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define NULL
Definition: ncbistd.hpp:225
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
TObjectType & GetObject(void)
Get object.
Definition: ncbiobj.hpp:1011
#define NCBI_DEPRECATED
uint64_t Uint8
8-byte (64-bit) unsigned integer
Definition: ncbitype.h:105
#define NCBI_SRAREAD_EXPORT
Definition: ncbi_export.h:1227
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static CObject_id & x_GetObject_id(CRef< CObject_id > &cache, const char *name)
Definition: snpread.cpp:2608
#define row(bind, expected)
Definition: string_bind.c:73
CRef< CUser_object > m_SecondaryIndicator
Definition: csraread.hpp:562
TObjectIdCache m_ObjectIdTracebacks
Definition: csraread.hpp:557
TUserFieldCache m_UserFieldCacheCigar
Definition: csraread.hpp:560
TUserFieldCache m_UserFieldCacheMismatch
Definition: csraread.hpp:561
CRef< CAnnotdesc > m_MatchAnnotIndicator
Definition: csraread.hpp:551
const CSeq_id_Handle & GetMainSeq_id_Handle(void) const
Definition: csraread.hpp:108
CBioseq::TId m_Seq_ids
Definition: csraread.hpp:100
CSeq_id_Handle m_Seq_id_Handle
Definition: csraread.hpp:101
CRef< CSeq_id > & GetMainSeq_id(void)
Definition: csraread.hpp:102
copyable_relaxed_atomic< TSeqPos > m_SeqLength
Definition: csraread.hpp:99
const CRef< CSeq_id > & GetMainSeq_id(void) const
Definition: csraread.hpp:105
vector< TSeqPos > m_AlnOverStarts
Definition: csraread.hpp:113
EAlignType TAlignType
Definition: csraread.hpp:83
@ ePathInId_config
Definition: csraread.hpp:74
Definition: type.c:6
int64_t TVDBRowId
Definition: vdbread.hpp:80
Modified on Mon Jul 22 05:06:17 2024 by modify_doxy.py rev. 669887