libStatGen Software
1
|
Public Member Functions | |
virtual void | resetIndex () |
Reset the member data for a new index file. | |
SamStatus::Status | readIndex (const char *filename) |
bool | getChunksForRegion (int32_t refID, int32_t start, int32_t end, SortedChunkList &chunkList) |
Get the list of chunks associated with this region. More... | |
uint64_t | getMaxOffset () const |
bool | getReferenceMinMax (int32_t refID, uint64_t &minOffset, uint64_t &maxOffset) const |
Get the minimum and maximum file offsets for the specfied reference ID. More... | |
int32_t | getNumMappedReads (int32_t refID) |
Get the number of mapped reads for this reference id. More... | |
int32_t | getNumUnMappedReads (int32_t refID) |
Get the number of unmapped reads for this reference id. More... | |
void | printIndex (int32_t refID, bool summary=false) |
Print the index information. More... | |
![]() | |
int32_t | getNumRefs () const |
Get the number of references in this index. More... | |
bool | getMinOffsetFromLinearIndex (int32_t refID, uint32_t position, uint64_t &minOffset) const |
Static Public Attributes | |
static const int32_t | UNKNOWN_NUM_READS = -1 |
The number used for an unknown number of reads. | |
static const int32_t | REF_ID_UNMAPPED = -1 |
The number used for the reference id of unmapped reads. | |
static const int32_t | REF_ID_ALL = -2 |
The number used to indicate that all reference ids should be used. | |
Additional Inherited Members | |
![]() | |
static void | getBinsForRegion (uint32_t start, uint32_t end, bool binMap[MAX_NUM_BINS+1]) |
![]() | |
int32_t | n_ref |
std::vector< Reference > | myRefs |
![]() | |
const static uint32_t | MAX_NUM_BINS = 37450 |
const static uint32_t | MAX_POSITION = 536870911 |
const static uint32_t | LINEAR_INDEX_SHIFT = 14 |
Definition at line 31 of file BamIndex.h.
bool BamIndex::getChunksForRegion | ( | int32_t | refID, |
int32_t | start, | ||
int32_t | end, | ||
SortedChunkList & | chunkList | ||
) |
Get the list of chunks associated with this region.
For an entire reference ID, set start and end to -1. To start at the beginning of the region, set start to 0/-1. To go to the end of the region, set end to -1.
Definition at line 218 of file BamIndex.cpp.
References REF_ID_UNMAPPED.
int32_t BamIndex::getNumMappedReads | ( | int32_t | refID | ) |
Get the number of mapped reads for this reference id.
Returns -1 for out of range refIDs.
refID | reference ID for which to extract the number of mapped reads. |
Definition at line 355 of file BamIndex.cpp.
References REF_ID_UNMAPPED.
Referenced by SamFile::getNumMappedReadsFromIndex().
int32_t BamIndex::getNumUnMappedReads | ( | int32_t | refID | ) |
Get the number of unmapped reads for this reference id.
Returns -1 for out of range refIDs.
refID | reference ID for which to extract the number of unmapped reads. |
Definition at line 377 of file BamIndex.cpp.
References REF_ID_UNMAPPED.
Referenced by SamFile::getNumUnMappedReadsFromIndex().
bool BamIndex::getReferenceMinMax | ( | int32_t | refID, |
uint64_t & | minOffset, | ||
uint64_t & | maxOffset | ||
) | const |
Get the minimum and maximum file offsets for the specfied reference ID.
refID | the reference ID to locate in the file. |
minOffset | returns the min file offset for the specified reference |
maxOffset | returns the max file offset for the specified reference |
Definition at line 337 of file BamIndex.cpp.
void BamIndex::printIndex | ( | int32_t | refID, |
bool | summary = false |
||
) |
Print the index information.
refID | reference ID for which to print info for. -1 means print for all references. |
summary | whether or not to just print a summary (defaults to false). The summary just contains summary info for each reference and not every bin/chunk. |
Definition at line 398 of file BamIndex.cpp.
|
virtual |
filename | the bam index file to be read. |
Implements IndexBase.
Definition at line 45 of file BamIndex.cpp.
References StatGenStatus::FAIL_IO, StatGenStatus::FAIL_PARSE, ifclose(), ifopen(), ifread(), resetIndex(), and StatGenStatus::SUCCESS.
Referenced by SamFile::ReadBamIndex().