1 #ifndef SRA__READER__SRA__SNPREAD__HPP
2 #define SRA__READER__SRA__SNPREAD__HPP
198 return m_Seq_id_Handle;
206 return m_SeqPos + m_PageCount*page_size;
209 return m_RowId + m_PageCount;
214 m_PageSets.back().GetRowIdEnd());
241 return m_SeqMapBySeq_id;
248 return m_TrackMapByName;
251 TTrackInfoList::const_iterator FindTrack(
const string& name)
const;
252 TSeqInfoList::const_iterator FindSeq(
const string& accession,
int version);
253 TSeqInfoList::const_iterator FindSeq(
const CSeq_id_Handle& seq_id);
255 TSeqPos GetPageSize(
void)
const;
256 TSeqPos GetOverviewZoom(
void)
const;
257 TSeqPos GetCoverageZoom(
void)
const;
325 return seq - GetSeqInfoList().begin();
328 return track - GetTrackInfoList().begin();
331 return TVDBRowId(x_GetSeqVDBIndex(seq) + 1);
334 return TVDBRowId(x_GetTrackVDBIndex(track) + 1);
337 void x_Update(TSeqInfoList::const_iterator seq);
339 x_GetPageVDBRowRange(TSeqInfoList::const_iterator seq);
340 TVDBRowId x_GetGraphVDBRowId(TSeqInfoList::const_iterator seq,
341 TTrackInfoList::const_iterator track);
428 return GetDb().x_GetTrackVDBRowId(m_Iter);
431 return GetDb().x_GetTrackVDBIndex(m_Iter);
440 return GetInfo().m_Name;
446 return GetFilter().m_Filter;
449 return GetFilter().m_FilterMask;
501 return m_Iter->GetMainSeq_id();
504 return m_Iter->GetMainSeq_id_Handle();
508 return m_Iter->m_SeqLength;
511 bool IsCircular(
void)
const;
514 return GetDb().GetPageSize();
517 return GetDb().GetOverviewZoom();
520 return GetDb().GetCoverageZoom();
522 TSeqPos GetMaxSNPLength(
void)
const;
527 Uint8 GetSNPCount(
void)
const;
531 return GetDb().x_GetSeqVDBRowId(m_Iter);
534 return GetDb().x_GetSeqVDBIndex(m_Iter);
537 return GetDb().x_GetPageVDBRowRange(m_Iter);
540 return GetDb().x_GetGraphVDBRowId(m_Iter, m_TrackIter);
547 fNoCoverageGraph = 1<<3,
548 fNoOverviewGraph = 1<<4,
549 fOnlySNPFeat = fNoCoverageGraph | fNoOverviewGraph,
552 fOverviewWithZoomAlways = 1<<5,
553 fOverviewWithZoomNever = 1<<6,
559 TFlags
flags = fDefaultFlags)
const;
562 const string& annot_name,
563 TFlags
flags = fDefaultFlags)
const;
565 TFlags
flags = fDefaultFlags)
const;
570 const string& annot_name,
571 TFlags
flags = fDefaultFlags)
const;
573 TFlags
flags = fDefaultFlags)
const;
577 TFlags
flags = fDefaultFlags)
const;
579 TFlags
flags = fDefaultFlags)
const;
582 const string& annot_name,
584 TFlags
flags = fDefaultFlags)
const;
587 TFlags
flags = fDefaultFlags)
const;
589 TFlags
flags = fDefaultFlags)
const;
591 const string& annot_name,
592 TFlags
flags = fDefaultFlags)
const;
596 TFlags
flags = fDefaultFlags)
const;
599 GetSplitInfoAndVersion(
const string& base_name,
600 TFlags
flags = fDefaultFlags)
const;
602 GetChunkForVersion(
const string& base_name,
607 return m_Db.GetNCObject();
623 const TInfo& GetInfo()
const;
676 return m_SearchRange;
683 return GetRefIter().GetSeqId();
686 return GetRefIter().GetSeqIdHandle();
690 return GetDb().GetPageSize();
693 return m_CurrPagePos;
701 return m_CurrPageRowId;
712 m_SeqIter.SetTrack(track);
799 return m_SearchRange;
803 return GetDb().GetPageSize();
806 return m_CurrPagePos;
814 return m_CurrPageRowId;
817 Uint4 GetTotalValue(
void)
const;
822 return m_Db.GetNCObject();
828 void x_ReportInvalid(
const char* method)
const;
831 x_ReportInvalid(method);
887 static char GetFeatSubtypeChar(EFeatSubtype subtype);
888 static CTempString GetFeatSubtypeString(EFeatSubtype subtype);
898 return GetPageIter().GetRefIter();
902 return GetPageIter().GetSeqId();
905 return GetPageIter().GetSeqIdHandle();
908 return GetPageIter().GetSearchRange();
911 return GetPageIter().GetSearchMode();
915 return m_CurRange.GetFrom();
918 return m_CurRange.GetLength();
922 eFeatIdPrefix_none = 0,
923 eFeatIdPrefix_rs = 1,
926 Uint4 GetFeatIdPrefix(
void)
const;
927 Uint8 GetFeatId(
void)
const;
929 TFilter GetBitfield(
void)
const;
930 void GetBitfieldOS(vector<char>& octet_stream)
const;
935 return GetBitfield();
939 GetBitfieldOS(codes);
943 fIncludeAlleles = 1<<0,
945 fIncludeBitfield = 1<<2,
946 fIncludeQualityCodes = fIncludeBitfield,
947 fIncludeNeighbors = 1<<3,
948 fIncludeSubtype = 1<<4,
949 fUseSharedObjects = 1<<8,
950 fDefaultFlags = ( fIncludeAlleles |
963 return GetPageIter().GetDb();
970 return GetPageIter().GetPageRowId();
974 TSeqPos x_GetLength(
void)
const;
978 void x_ReportInvalid(
const char* method)
const;
981 x_ReportInvalid(method);
992 EExcluded x_Excluded(
void);
994 void x_SetFilter(
const SSelector& sel);
995 void x_InitPage(
void);
1000 return GetPageIter().x_GetSeqIter();
AutoPtr< SCreateCache > m_CreateCache
TVDBRowId m_GraphBaseRowId
const CSNPDb_Impl::SFeatTableCursor & Cur(void) const
CSNPDbFeatIterator & operator++(void)
CSNPDb_Impl & GetDb(void) const
DECLARE_OPERATOR_BOOL(m_CurrFeatId< m_FirstBadFeatId)
TVDBRowId m_FirstBadFeatId
ESearchMode GetSearchMode(void) const
COpenRange< TSeqPos > m_CurRange
pair< TVDBRowId, size_t > TExtraRange
void x_Init(const CSNPDb &snp_db)
TSeqPos GetSNPLength(void) const
TVDBRowId GetPageRowId(void) const
const CSNPDbSeqIterator & GetRefIter(void) const
TSeqPos GetSNPPosition(void) const
CRef< CSNPDb_Impl::SGraphTableCursor > m_Graph
map< CTempString, CRef< CUser_field > > TUserFieldCache
CRef< CSNPDb_Impl::SExtraTableCursor > m_Extra
void x_CheckValid(const char *method) const
CSNPDb_Impl::TSeqInfoList::const_iterator x_GetSeqIter() const
const CRange< TSeqPos > & GetSearchRange(void) const
CSeq_id_Handle GetSeqIdHandle(void) const
CSNPDbPageIterator m_PageIter
CRef< CSNPDb_Impl::SFeatTableCursor > m_Feat
DECLARE_SAFE_FLAGS_TYPE(EFlags, TFlags)
Uint8 GetQualityCodes(void) const
CRef< CObject_id > TObjectIdCache
void x_ReportInvalid(const char *method) const
void GetQualityCodes(vector< char > &codes) const
CRef< CSeq_id > GetSeqId(void) const
const CSNPDbPageIterator & GetPageIter(void) const
TSeqPos GetPagePos(void) const
TVDBRowId GetGraphRowId(void) const
TVDBRowId m_CurrPageRowId
CSNPDb_Impl & GetDb(void) const
TSeqPos GetPageSize(void) const
const CRange< TSeqPos > & GetSearchRange(void) const
CRef< CSNPDb_Impl::SGraphTableCursor > m_Cur
DECLARE_OPERATOR_BOOL(m_CurrPagePos !=kInvalidSeqPos)
CSNPDbGraphIterator & operator++(void)
const CSNPDb_Impl::SGraphTableCursor & Cur(void) const
void x_CheckValid(const char *method) const
CRange< TSeqPos > m_SearchRange
CRange< TSeqPos > GetPageRange(void) const
TVDBRowId GetPageRowId(void) const
CSeq_id_Handle GetSeqIdHandle(void) const
TSeqPos GetPageSize(void) const
TSeqPos GetPagePos(void) const
CSNPDbPageIterator & operator++(void)
const CSNPDb_Impl::SPageTableCursor & Cur(void) const
ESearchMode GetSearchMode(void) const
TVDBRowId m_LastGraphRowId
CSNPDb_Impl::TSeqInfoList::const_iterator x_GetSeqIter() const
void SetTrack(const CSNPDbTrackIterator &track)
CRange< TVDBRowId > x_GetPageVDBRowRange() const
CSNPDbSeqIterator m_SeqIter
const CRange< TSeqPos > & GetSearchRange(void) const
CSNPDb_Impl::TTrackInfoList::const_iterator x_GetTrackIter() const
CRef< CSeq_id > GetSeqId(void) const
CSNPDb_Impl & GetDb(void) const
CRange< TSeqPos > GetPageRange(void) const
void x_CheckValid(const char *method) const
CRef< CSNPDb_Impl::SPageTableCursor > m_Cur
TVDBRowId m_CurrPageRowId
CRange< TSeqPos > m_SearchRange
const CSNPDbSeqIterator & GetRefIter(void) const
TVDBRowId x_GetSeqVDBRowId() const
TVDBRowId x_GetTrackVDBRowId() const
CRef< CSNPDb_Impl::SGraphTableCursor > m_GraphCur
DECLARE_OPERATOR_BOOL(m_CurrPagePos< m_SearchRange.GetToOpen())
TVDBRowId x_GetGraphVDBRowId() const
const SFilter & GetFilter() const
TList::const_iterator m_Iter
const TList & GetList() const
const TInfo * operator->(void) const
TSeqPos GetSeqLength(void) const
CSNPDb_Impl::TTrackInfoList::const_iterator m_TrackIter
CRef< CSeq_id > GetSeqId(void) const
vector< CRef< CSeq_annot > > TAnnotSet
TSeqPos GetCoverageZoom(void) const
TSeqPos GetOverviewZoom(void) const
const TInfo & operator*(void) const
TSeqPos GetPageSize(void) const
CSNPDb_Impl & GetDb(void) const
const CSeq_id_Handle & GetSeqIdHandle(void) const
TVDBRowId GetVDBRowId(void) const
const TInfo & GetInfo() const
TVDBRowId GetGraphVDBRowId() const
CSNPDb_Impl::TSeqInfoList TList
DECLARE_SAFE_FLAGS_TYPE(EFlags, TFlags)
CRange< TVDBRowId > GetPageVDBRowRange(void) const
DECLARE_OPERATOR_BOOL(m_Db &&m_Iter !=GetList().end())
TList::const_iterator x_GetSeqIter() const
size_t GetVDBSeqIndex(void) const
CSNPDb_Impl::TTrackInfoList::const_iterator x_GetTrackIter() const
CSNPDb_Impl & GetDb(void) const
const TInfo & operator*(void) const
TFilter GetFilterMask(void) const
CSNPDbTrackIterator & operator++(void)
TList::const_iterator m_Iter
TVDBRowId GetVDBRowId(void) const
const SFilter & GetFilter(void) const
size_t GetVDBTrackIndex(void) const
CSNPDbTrackIterator(void)
const string & GetName(void) const
TFilter GetFilterBits(void) const
const TInfo * operator->(void) const
CSNPDb_Impl::TTrackInfoList TList
const TList & GetList() const
DECLARE_OPERATOR_BOOL(m_Db &&m_Iter !=GetList().end())
CVDBObjectCache< SGraphTableCursor > m_Graph
map< CSeq_id_Handle, size_t > TSeqInfoMapBySeq_id
const CVDBTable & ExtraTable(void)
TTrackInfoMapByName m_TrackMapByName
const TTrackInfoMapByName & GetTrackInfoMapByName(void) const
map< TVDBRowId, TVDBRowId > TSeq2PageMap
const CVDBTable & PageTable(void)
const string & GetDbPath(void) const
const TTrackInfoList & GetTrackInfoList(void) const
TVDBRowId x_GetSeqVDBRowId(TSeqInfoList::const_iterator seq) const
vector< SSeqInfo > TSeqInfoList
const CVDBTable & FeatTable(void)
const TSeqInfoList & GetSeqInfoList(void) const
TTrackInfoList m_TrackList
TSeqPos GetOverviewZoom(void) const
const CVDBTable & SeqTable(void)
TSeqPos GetCoverageZoom(void) const
size_t x_GetTrackVDBIndex(TTrackInfoList::const_iterator track) const
map< string, size_t > TTrackInfoMapByName
CVDBObjectCache< SExtraTableCursor > m_Extra
CVDBObjectCache< SFeatTableCursor > m_Feat
CVDBTableIndex m_SeqAccIndex
CVDBObjectCache< SSeqTableCursor > m_Seq
size_t x_GetSeqVDBIndex(TSeqInfoList::const_iterator seq) const
TSeq2PageMap m_Seq2PageMap
TVDBRowId x_GetTrackVDBRowId(TTrackInfoList::const_iterator track) const
const TSeqInfoMapBySeq_id & GetSeqInfoMapBySeq_id(void) const
CVDBObjectCache< SPageTableCursor > m_Page
vector< STrackInfo > TTrackInfoList
const CVDBTable & GraphTable(void)
TSeqInfoMapBySeq_id m_SeqMapBySeq_id
size_t GetTrackCount() const
CSNPDb(CSNPDb_Impl *impl)
CSNPDb(CVDBMgr &mgr, CTempString path_or_acc)
TSeqPos GetCoverageZoom() const
TSeqPos GetOverviewZoom() const
namespace ncbi::objects::
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
objects::CSeqFeatData::ESubtype GetFeatSubtype(const string &feat_type)
CObject & operator=(const CObject &src) THROWS_NONE
Assignment operator.
TObjectType & GetObject(void)
Get object.
TObjectType & GetNCObject(void) const
Get object.
uint32_t Uint4
4-byte (32-bit) unsigned integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define NCBI_SRAREAD_EXPORT
range(_Ty, _Ty) -> range< _Ty >
const string version
version string
double value_type
The numeric datatype used by the parser.
Multi-threading – mutexes; rw-locks; semaphore.
DECLARE_SAFE_FLAGS(CSNPDbSeqIterator::EFlags)
#define row(bind, expected)
TSeqPos GetSeqPosEnd(TSeqPos page_size) const
TVDBRowId GetRowIdEnd(void) const
vector< SPageSet > TPageSets
CRange< TVDBRowId > GetPageVDBRowRange() const
const CSeq_id_Handle & GetMainSeq_id_Handle(void) const
const CRef< CSeq_id > & GetMainSeq_id(void) const
CSeq_id_Handle m_Seq_id_Handle
SFilter(TFilter filter, TFilter filter_mask=TFilter(-1))
bool Matches(TFilter bits) const
void SetFilter(TFilter filter, TFilter filter_mask=TFilter(-1))
SSelector(ESearchMode search_mode, const SFilter &filter=SFilter())
SSelector & SetFilter(const SFilter &filter)
SSelector & SetNoFilter(void)
SSelector(const SFilter &filter=SFilter())
SSelector & SetFilter(TFilter filter, TFilter filter_mask=TFilter(-1))
@ eFeatSubtypeChar_insertion
@ eFeatSubtypeChar_identity
@ eFeatSubtypeChar_unknown
@ eFeatSubtypeChar_multi_nucleotide_variation
@ eFeatSubtypeChar_deletion
@ eFeatSubtypeChar_single_nucleotide_variation
@ eFeatSubtypeChar_inversion
@ eFeatSubtypeChar_deletion_insertion
@ eFeatSubtype_deletion_insertion
@ eFeatSubtype_multi_nucleotide_variation
@ eFeatSubtype_single_nucleotide_variation