NCBI C++ ToolKit
|
Search Toolkit Book for CBamIndex
#include <sra/readers/bam/bamindex.hpp>
Public Types | |
typedef vector< SBamIndexRefIndex > | TRefs |
Public Types inherited from SBamIndexDefs | |
enum | ESearchMode { eSearchByOverlap , eSearchByStart } |
enum | EIndexLevel : uint8_t { kMinLevel = 0 , kLevel0 = kMinLevel , kLevel1 = kLevel0+1 , kMaxLevel = kBAI_depth } |
typedef uint32_t | TBin |
typedef uint8_t | TIndexLevel |
typedef uint8_t | TShift |
Private Attributes | |
string | m_FileName |
TRefs | m_Refs |
Uint8 | m_UnmappedCount |
Uint8 | m_TotalReadBytes |
double | m_TotalReadSeconds |
Additional Inherited Members | |
Public Attributes inherited from SBamIndexParams | |
bool | is_CSI |
TShift | min_shift |
TIndexLevel | depth |
Static Public Attributes inherited from SBamIndexDefs | |
static const TBin | kMaxBinNumber = 0 |
static const TIndexLevel | kMinBinIndexLevel = 0 |
static const TShift | kLevelStepBinShift = 3 |
static const TShift | kBAI_min_shift = 14 |
static const TIndexLevel | kBAI_depth = 5 |
Definition at line 446 of file bamindex.hpp.
typedef vector<SBamIndexRefIndex> CBamIndex::TRefs |
Definition at line 463 of file bamindex.hpp.
CBamIndex::CBamIndex | ( | ) |
Definition at line 1168 of file bamindex.cpp.
Definition at line 1176 of file bamindex.cpp.
References Read().
CBamIndex::~CBamIndex | ( | ) |
Definition at line 1185 of file bamindex.cpp.
|
inline |
Definition at line 739 of file bamindex.hpp.
References CollectEstimatedCoverage(), and SBamIndexParams::GetMaxIndexLevel().
|
inline |
Definition at line 731 of file bamindex.hpp.
References CollectEstimatedCoverage(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 714 of file bamindex.hpp.
References CollectEstimatedCoverage(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 725 of file bamindex.hpp.
References CollectEstimatedCoverage().
vector< uint64_t > CBamIndex::CollectEstimatedCoverage | ( | size_t | ref_index, |
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1482 of file bamindex.cpp.
References SBamIndexRefIndex::CollectEstimatedCoverage(), and GetRef().
Referenced by CBam2Seq_graph::CollectEstimatedCoverage(), CollectEstimatedCoverage(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 746 of file bamindex.hpp.
References SBamIndexRefIndex::EstimateDataSizeByAlnStartPos(), and GetRef().
Definition at line 454 of file bamindex.hpp.
References m_FileName.
Referenced by CBamRawDb::GetIndexName().
|
inline |
Definition at line 751 of file bamindex.hpp.
References m_TotalReadBytes, and m_TotalReadSeconds.
Referenced by CBamRawDb::GetEstimatedSecondsPerByte(), and CBamRawDb::Open().
const SBamIndexRefIndex & CBamIndex::GetRef | ( | size_t | ref_index | ) | const |
Definition at line 1363 of file bamindex.cpp.
References GetRefCount(), m_Refs, and NCBI_THROW.
Referenced by CBamFileRangeSet::AddRanges(), CollectEstimatedCoverage(), CBamRawDb::EstimateDataSizeByAlnStartPos(), EstimateDataSizeByAlnStartPos(), GetTotalFileRange(), and CBamRefSeqInfo::x_LoadRangesEstimated().
|
inline |
Definition at line 468 of file bamindex.hpp.
References m_Refs.
Referenced by GetRef(), and SetLengthFromHeader().
Definition at line 464 of file bamindex.hpp.
References m_Refs.
CBGZFRange CBamIndex::GetTotalFileRange | ( | size_t | ref_index | ) | const |
Definition at line 1386 of file bamindex.cpp.
|
inline |
Definition at line 546 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 524 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | const CBamHeader & | header, |
const string & | ref_name, | ||
const CSeq_id & | seq_id, | ||
const string & | annot_name, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1429 of file bamindex.cpp.
References CBamHeader::GetRefIndex(), CBamHeader::GetRefLength(), MakeEstimatedCoverageAnnot(), and NCBI_THROW_FMT.
|
inline |
Definition at line 536 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 507 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 485 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | const CBamHeader & | header, |
const string & | ref_name, | ||
const string & | seq_id, | ||
const string & | annot_name, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1416 of file bamindex.cpp.
Referenced by MakeEstimatedCoverageAnnot(), CBam2GraphApp::ProcessFile(), and CBam2GraphApp::ProcessSrz().
|
inline |
Definition at line 497 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 619 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 599 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | size_t | ref_index, |
const CSeq_id & | seq_id, | ||
const string & | annot_name, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1471 of file bamindex.cpp.
References kInvalidSeqPos, and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 610 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 697 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 675 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | size_t | ref_index, |
const CSeq_id & | seq_id, | ||
const string & | annot_name, | ||
TSeqPos | ref_length, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1491 of file bamindex.cpp.
References b, CollectEstimatedCoverage(), SBamIndexParams::GetBinSize(), i, kInvalidSeqPos, max(), min(), CSeq_graph_Base::SetA(), CByte_graph_Base::SetAxis(), CSeq_graph_Base::SetComp(), CSeq_annot_Base::SetData(), CSeq_graph_Base::SetGraph(), CSeq_graph_Base::SetLoc(), CByte_graph_Base::SetMax(), CByte_graph_Base::SetMin(), CSeq_graph_Base::SetNumval(), CByte_graph_Base::SetValues(), sx_SetTitle(), and uint32_t.
|
inline |
Definition at line 687 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 584 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 564 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | size_t | ref_index, |
const string & | seq_id, | ||
const string & | annot_name, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1460 of file bamindex.cpp.
References kInvalidSeqPos, and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 575 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 658 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
|
inline |
Definition at line 636 of file bamindex.hpp.
References MakeEstimatedCoverageAnnot(), and SBamIndexParams::ToIndexLevel().
CRef< CSeq_annot > CBamIndex::MakeEstimatedCoverageAnnot | ( | size_t | ref_index, |
const string & | seq_id, | ||
const string & | annot_name, | ||
TSeqPos | ref_length, | ||
TIndexLevel | min_index_level, | ||
TIndexLevel | max_index_level | ||
) | const |
Definition at line 1447 of file bamindex.cpp.
References MakeEstimatedCoverageAnnot().
|
inline |
Definition at line 648 of file bamindex.hpp.
References SBamIndexParams::GetMaxIndexLevel(), and MakeEstimatedCoverageAnnot().
void CBamIndex::Read | ( | CNcbiIstream & | in | ) |
Definition at line 1250 of file bamindex.cpp.
References buf, SBamIndexParams::depth, ERR_POST, in(), SBamIndexParams::is_CSI, SBamIndexDefs::kBAI_depth, SBamIndexDefs::kBAI_min_shift, kIndexMagicBAI, kIndexMagicLength, m_Refs, m_UnmappedCount, min(), SBamIndexParams::min_shift, NCBI_THROW_FMT, NStr::PrintableString(), s_Read(), s_ReadInt32(), s_ReadUInt32(), s_ReadUInt64(), and Warning().
void CBamIndex::Read | ( | const char * | buffer_ptr, |
size_t | buffer_size | ||
) |
Definition at line 1303 of file bamindex.cpp.
References buffer_size, SBamIndexParams::depth, ERR_POST, CZipCompression::fGZip, CCompressionStream::fOwnProcessor, CRWStreambuf::fOwnReader, i, SBamIndexParams::is_CSI, SBamIndexDefs::kBAI_depth, SBamIndexDefs::kBAI_min_shift, kGZipMagic, kGZipMagicLength, kIndexMagicBAI, kIndexMagicLength, m_Refs, m_UnmappedCount, SBamUtil::MakeUint4(), SBamUtil::MakeUint8(), SBamIndexParams::min_shift, NCBI_THROW_FMT, NStr::PrintableString(), Read(), s_Read(), and Warning().
Definition at line 1190 of file bamindex.cpp.
References data, CStopWatch::Elapsed(), CStopWatch::eStart, CBamDb::GetDebugLevel(), LOG_POST, m_FileName, m_Refs, m_TotalReadBytes, m_TotalReadSeconds, m_UnmappedCount, ReadVDBFile(), ncbi::grid::netcache::search::fields::size, and sw.
Referenced by CBamIndex(), CBamRawDb::Open(), CBam2GraphApp::ProcessSrz(), and Read().
void CBamIndex::SetLengthFromHeader | ( | const CBamHeader & | header | ) |
Definition at line 1373 of file bamindex.cpp.
References CBamHeader::GetRef(), CBamHeader::GetRefCount(), GetRefCount(), i, SBamHeaderRefInfo::m_Length, m_Refs, and NCBI_THROW_FMT.
Referenced by CBamRawDb::Open().
|
private |
Definition at line 757 of file bamindex.hpp.
Referenced by GetFileName(), and Read().
|
private |
Definition at line 758 of file bamindex.hpp.
Referenced by GetRef(), GetRefCount(), GetRefs(), Read(), and SetLengthFromHeader().
|
private |
Definition at line 760 of file bamindex.hpp.
Referenced by GetReadStatistics(), and Read().
|
private |
Definition at line 761 of file bamindex.hpp.
Referenced by GetReadStatistics(), and Read().
|
private |
Definition at line 759 of file bamindex.hpp.
Referenced by Read().