A library for working with phylogenetic and population genetic data.
v0.27.0
SlidingVariantsWindowIterator< ForwardIterator, DataType > Class Template Referencefinal

#include <genesis/population/window/sliding_variants_window_iterator.hpp>

Inherits BaseWindowIterator< ForwardIterator, typename ForwardIterator::value_type >.

Detailed Description

template<class ForwardIterator, class DataType = typename ForwardIterator::value_type>
class genesis::population::SlidingVariantsWindowIterator< ForwardIterator, DataType >

Iterator for sliding Windows of fixed sized intervals over the chromosomes of a genome.

The three functors

have to be set in the class prior to starting the iteration, as well as the width(). All other settings are optional and/or defaulted to reasonable values.

See BaseWindowIterator for more details on the three functors, the template parameters, and general usage examples of the class.

Definition at line 66 of file sliding_variants_window_iterator.hpp.

Public Member Functions

 SlidingVariantsWindowIterator (ForwardIterator begin, ForwardIterator end)
 
 SlidingVariantsWindowIterator (SlidingVariantsWindowIterator &&)=default
 
 SlidingVariantsWindowIterator (SlidingVariantsWindowIterator const &)=default
 
 ~SlidingVariantsWindowIterator ()=default
 
SlidingVariantsWindowIteratoroperator= (SlidingVariantsWindowIterator &&)=default
 
SlidingVariantsWindowIteratoroperator= (SlidingVariantsWindowIterator const &)=default
 
size_t stride () const
 
self_typestride (size_t value)
 Stride of the Window, that is, how many positions to move forward with each iteration. More...
 
size_t width () const
 
self_typewidth (size_t value)
 Width of the Window, that is, the fixed length along the chromosome. More...
 
- Public Member Functions inherited from BaseWindowIterator< ForwardIterator, typename ForwardIterator::value_type >
 BaseWindowIterator (BaseWindowIterator &&)=default
 
 BaseWindowIterator (BaseWindowIterator const &)=default
 
 BaseWindowIterator (ForwardIterator begin, ForwardIterator end)
 
 ~BaseWindowIterator ()=default
 
Iterator begin ()
 
Iterator end ()
 
BaseWindowIteratoroperator= (BaseWindowIterator &&)=default
 
BaseWindowIteratoroperator= (BaseWindowIterator const &)=default
 

Public Types

using base_type = BaseWindowIterator< ForwardIterator, DataType >
 
using const_reference = value_type const &
 
using Entry = typename Window::Entry
 
using InputType = typename ForwardIterator::value_type
 
using iterator_category = std::input_iterator_tag
 
using pointer = value_type *
 
using reference = value_type &
 
using self_type = SlidingVariantsWindowIterator< ForwardIterator, DataType >
 
using value_type = Window
 
using Window = ::genesis::population::Window< DataType >
 
- Public Types inherited from BaseWindowIterator< ForwardIterator, typename ForwardIterator::value_type >
using const_reference = value_type const &
 
using Entry = typename Window::Entry
 
using InputType = typename ForwardIterator::value_type
 
using iterator_category = std::input_iterator_tag
 
using pointer = value_type *
 
using reference = value_type &
 
using self_type = BaseWindowIterator< ForwardIterator, typename ForwardIterator::value_type >
 
using value_type = Window
 
using Window = ::genesis::population::Window< typename ForwardIterator::value_type >
 

Public Attributes

friend DerivedIterator
 
- Public Attributes inherited from BaseWindowIterator< ForwardIterator, typename ForwardIterator::value_type >
std::function< std::string(InputType const &)> chromosome_function
 Functor that yields the current chromosome, given the input iterator data. More...
 
std::function< typename ForwardIterator::value_type(InputType const &)> entry_input_function
 Functor to convert from the underlying input iterator that provides the data to fill the windows to the data that is stored per window. More...
 
friend Iterator
 
std::function< size_t(InputType const &)> position_function
 Functor that yields the current position on the chromosome, given the input iterator data. More...
 

Classes

class  DerivedIterator
 Internal iterator that produces Windows. More...
 

Protected Member Functions

std::unique_ptr< typename BaseWindowIterator< ForwardIterator, DataType >::BaseIterator > get_begin_iterator_ () override final
 
std::unique_ptr< typename BaseWindowIterator< ForwardIterator, DataType >::BaseIterator > get_end_iterator_ () override final
 

Constructor & Destructor Documentation

◆ SlidingVariantsWindowIterator() [1/3]

SlidingVariantsWindowIterator ( ForwardIterator  begin,
ForwardIterator  end 
)
inline

Definition at line 248 of file sliding_variants_window_iterator.hpp.

◆ ~SlidingVariantsWindowIterator()

◆ SlidingVariantsWindowIterator() [2/3]

SlidingVariantsWindowIterator ( SlidingVariantsWindowIterator< ForwardIterator, DataType > const &  )
default

◆ SlidingVariantsWindowIterator() [3/3]

SlidingVariantsWindowIterator ( SlidingVariantsWindowIterator< ForwardIterator, DataType > &&  )
default

Member Function Documentation

◆ get_begin_iterator_()

std::unique_ptr<typename BaseWindowIterator<ForwardIterator, DataType>::BaseIterator> get_begin_iterator_ ( )
inlinefinaloverrideprotectedvirtual

◆ get_end_iterator_()

std::unique_ptr<typename BaseWindowIterator<ForwardIterator, DataType>::BaseIterator> get_end_iterator_ ( )
inlinefinaloverrideprotectedvirtual

◆ operator=() [1/2]

SlidingVariantsWindowIterator& operator= ( SlidingVariantsWindowIterator< ForwardIterator, DataType > &&  )
default

◆ operator=() [2/2]

SlidingVariantsWindowIterator& operator= ( SlidingVariantsWindowIterator< ForwardIterator, DataType > const &  )
default

◆ stride() [1/2]

size_t stride ( ) const
inline

Definition at line 298 of file sliding_variants_window_iterator.hpp.

◆ stride() [2/2]

self_type& stride ( size_t  value)
inline

Stride of the Window, that is, how many positions to move forward with each iteration.

The stride his is the shift towards the next interval, determining how the first and last position in each Window change. It has to be <= width. If stride is set to 0 (default), it is set automatically to the width when starting the iteration.

Definition at line 292 of file sliding_variants_window_iterator.hpp.

◆ width() [1/2]

size_t width ( ) const
inline

Definition at line 280 of file sliding_variants_window_iterator.hpp.

◆ width() [2/2]

self_type& width ( size_t  value)
inline

Width of the Window, that is, the fixed length along the chromosome.

The width has to be > 0. This is the length of the interval, determining the first and last position in each Window.

Definition at line 274 of file sliding_variants_window_iterator.hpp.

Member Typedef Documentation

◆ base_type

using base_type = BaseWindowIterator<ForwardIterator, DataType>

Definition at line 75 of file sliding_variants_window_iterator.hpp.

◆ const_reference

using const_reference = value_type const&

Definition at line 85 of file sliding_variants_window_iterator.hpp.

◆ Entry

using Entry = typename Window::Entry

Definition at line 78 of file sliding_variants_window_iterator.hpp.

◆ InputType

using InputType = typename ForwardIterator::value_type

Definition at line 79 of file sliding_variants_window_iterator.hpp.

◆ iterator_category

using iterator_category = std::input_iterator_tag

Definition at line 81 of file sliding_variants_window_iterator.hpp.

◆ pointer

using pointer = value_type*

Definition at line 83 of file sliding_variants_window_iterator.hpp.

◆ reference

Definition at line 84 of file sliding_variants_window_iterator.hpp.

◆ self_type

using self_type = SlidingVariantsWindowIterator<ForwardIterator, DataType>

Definition at line 74 of file sliding_variants_window_iterator.hpp.

◆ value_type

using value_type = Window

Definition at line 82 of file sliding_variants_window_iterator.hpp.

◆ Window

using Window = ::genesis::population::Window<DataType>

Definition at line 77 of file sliding_variants_window_iterator.hpp.

Member Data Documentation

◆ DerivedIterator

Definition at line 262 of file sliding_variants_window_iterator.hpp.


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