yat  0.21pre
Classes | Public Member Functions | Friends | List of all members
theplu::yat::omic::BamReadIterator Class Reference

class to iterate through a InBamFile More...

#include <yat/omic/BamReadIterator.h>

Inheritance diagram for theplu::yat::omic::BamReadIterator:

Public Member Functions

 BamReadIterator (void)
 Contructs end of file iterator.
 
 BamReadIterator (InBamFile &in)
 
 BamReadIterator (InBamFile &in, int32_t tid, int32_t start, int32_t end)
 
 BamReadIterator (InBamFile &in, int32_t tid, int32_t start=0)
 
 BamReadIterator (InBamFile &in, const BamRegion &region)
 
 BamReadIterator (InBamFile &in, const std::vector< BamRegion > &regions)
 

Friends

class boost::iterator_core_access
 

Detailed Description

class to iterate through a InBamFile

Iterator is a single pass Input Iterator which means iterator can only be used read bam file. If creating two iterators working on the same InBamFile, the iterators are not independent of each other. Incrementing one, the behaviour of the other is undefined.

Iterator can either be constructed to iterate over entire bam file or if a region is specified only over that region. When no more elements are available, iterator turns into a end-of-file iterator and is no longer dereferencable.

See also
InBamFile
Since
New in yat 0.10

Constructor & Destructor Documentation

◆ BamReadIterator() [1/5]

theplu::yat::omic::BamReadIterator::BamReadIterator ( InBamFile in)
explicit

Creates an iterator pointing to first BamRead in InBamFile.

Parameters
infile to iterate over

◆ BamReadIterator() [2/5]

theplu::yat::omic::BamReadIterator::BamReadIterator ( InBamFile in,
int32_t  tid,
int32_t  start,
int32_t  end 
)

Iterator that walks over specified region. Iterator iterates over all BamReads in file in that overlap with specified region and then it turns into an end-of-region iterator.

This function requires an index file is available, see InBamFile::index().

All reads iterated over overlap with defined region, in other words, iter->tid == tid; iter->pos() < end and iter->end()

start

Parameters
infile to iterate over
tidsegment (chromosome) to iterate over
startleft most position of specified region
endright most position of specified region
See also
For use with large chromosomes for with int32_t is not sufficient, see BamReadIterator(InBamFile&, const BamRegion&);

◆ BamReadIterator() [3/5]

theplu::yat::omic::BamReadIterator::BamReadIterator ( InBamFile in,
int32_t  tid,
int32_t  start = 0 
)

Iterator that walks from tid:start to end of chromosome and then it turns into an end-of-region iterator.

This function requires an index file is available, see InBamFile::index().

All reads iterated over overlap with defined region, in other words, iter->tid == tid; iter->end() > start

Parameters
infile to iterate over
tidsegment (chromosome) to iterate over
startleft most position of specified region
Since
New in yat 0.15
See also
For use with large chromosomes for with int32_t is not sufficient, see BamReadIterator(InBamFile&, const BamRegion&);

◆ BamReadIterator() [4/5]

theplu::yat::omic::BamReadIterator::BamReadIterator ( InBamFile in,
const BamRegion region 
)

Iterator that walks over specified region. Iterator iterates over all BamReads in file in that overlap with specified region and then it turns into an end-of-region iterator.

This function requires an index file is available, see InBamFile::index().

All reads iterated over overlap with defined region, in other words, iter->tid == tid; iter->pos() < end and iter->end()

start

Parameters
infile to iterate over
regiondefining the genomic region
Since
New in yat 0.21

◆ BamReadIterator() [5/5]

theplu::yat::omic::BamReadIterator::BamReadIterator ( InBamFile in,
const std::vector< BamRegion > &  regions 
)

Create an iterator that can be used to iterate over reads from multiple regions. The reads are iterated over in a sorted fashion and reads are not multiple times even if regions is sorted and/or have overlapping regions.

Since
New in yat 0.21

The documentation for this class was generated from the following file:

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14