A class to iterate through one or more variant files at a time, enabling access to a stream of Superlocus. More...
#include <SuperlocusIterator.hpp>
Public Member Functions | |
SuperlocusIterator (uint32_t extend3Mers=4, uint32_t extendBases=0) | |
Creates an empty SuperlocusIterator, with the given parameter values. | |
void | setVariantFile (VariantFileIterator &iter) |
Initialize the SuperlocusIterator to process one file. | |
void | setVariantFiles (VariantFileIterator &iterA, VariantFileIterator &iterB) |
Initialize the SuperlocusIterator to process two files. | |
void | setVariantFiles (const std::vector< VariantFileIterator * > iters) |
Initialize the SuperlocusIterator to process any number of files. | |
void | skipToVariant (const reference::Range &range, const std::string &alleleSeq) |
Skip to the next variant in a stream. | |
void | seekFirst () |
Do the initial seek, in the case where you're iterating via ++. | |
bool | eof () const |
Returns true if this SuperlocusIterator is at end of file. | |
const Superlocus & | operator* () const |
Returns the Superlocus referred to by this iterator. | |
const Superlocus * | operator-> () const |
Returns the Superlocus referred to by this iterator. | |
reference::Location | getPrecedingRefStart () const |
Returns the beginning of pure reference call upstream of the current superlocus, or a location at or greater than the start of the current superlocus if the call upstream of the superlocus is not a pure reference. | |
SuperlocusIterator & | operator++ () |
Moves to the next Superlocus. |
A class to iterate through one or more variant files at a time, enabling access to a stream of Superlocus.
Example:
VariantFileIterator locItA(crr), locItB(crr); locItA.open(variantFileNameA_); locItB.open(variantFileNameB_); SuperlocusIterator slIt; for(slIt.setVariantFiles(locItA, locItB); !slIt.eof(); ++slIt) { const Superlocus& sl = *slIt; Range range = sl.getRange(); }
cgatools::variants::SuperlocusIterator::SuperlocusIterator | ( | uint32_t | extend3Mers = 4 , |
|
uint32_t | extendBases = 0 | |||
) |
Creates an empty SuperlocusIterator, with the given parameter values.
extend3Mers | Always extend superloci to the right and left by the given number of distinct reference 3-mers. | |
extendBases | Always extend superloci to the right and left by at least the given number of bases. |
reference::Location cgatools::variants::SuperlocusIterator::getPrecedingRefStart | ( | ) | const [inline] |
Returns the beginning of pure reference call upstream of the current superlocus, or a location at or greater than the start of the current superlocus if the call upstream of the superlocus is not a pure reference.
void cgatools::variants::SuperlocusIterator::skipToVariant | ( | const reference::Range & | range, | |
const std::string & | alleleSeq | |||
) |
Skip to the next variant in a stream.
The variants must stream in reference order.