cgatools::variants::SuperlocusIterator Class Reference

A class to iterate through one or more variant files at a time, enabling access to a stream of Superlocus. More...

#include <SuperlocusIterator.hpp>

List of all members.

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 Superlocusoperator* () const
 Returns the Superlocus referred to by this iterator.
const Superlocusoperator-> () 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.
SuperlocusIteratoroperator++ ()
 Moves to the next Superlocus.

Detailed Description

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();
 }

Constructor & Destructor Documentation

cgatools::variants::SuperlocusIterator::SuperlocusIterator ( uint32_t  extend3Mers = 4,
uint32_t  extendBases = 0 
)

Creates an empty SuperlocusIterator, with the given parameter values.

Parameters:
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.

Member Function Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated by  doxygen 1.6.2