#include <genesis/population/window/region_window_stream.hpp>
Inherits BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type >.
Stream for Windows representing regions of a genome.
This class allows to iterate a set of regions, each yielded to the caller as a Window. That is, with each step of the iteration of this class, one region (interval) of the input region list is yielded as a Window, containing the data of the input InputStreamIterator
(which is of type DataType
). These regions can for example be genes, linkage blocks, or other genomic intervals of interest. Each can have an arbitrary length, and the can potentially be overlapping or be nested.
The three functors
have to be set prior to the iteration. All other settings are option and/or defaulted to reasonable values. See make_region_window_stream() and make_default_region_window_stream() for helper functions that take care of this for most of our data types.
See BaseWindowStream for more details on the three functors, the template parameters, and general usage examples of the class.
Definition at line 89 of file region_window_stream.hpp.
Public Member Functions | |
RegionWindowStream (InputStreamIterator begin, InputStreamIterator end, std::shared_ptr< GenomeRegionList > region_list) | |
RegionWindowStream (RegionWindowStream &&)=default | |
RegionWindowStream (RegionWindowStream const &)=default | |
virtual | ~RegionWindowStream () override=default |
RegionWindowStream & | operator= (RegionWindowStream &&)=default |
RegionWindowStream & | operator= (RegionWindowStream const &)=default |
bool | skip_empty_regions () const |
self_type & | skip_empty_regions (bool value) |
Public Member Functions inherited from BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type > | |
BaseWindowStream (BaseWindowStream &&)=default | |
BaseWindowStream (BaseWindowStream const &)=default | |
BaseWindowStream (InputStreamIterator begin, InputStreamIterator end) | |
virtual | ~BaseWindowStream ()=default |
self_type & | add_begin_callback (std::function< void()> const &callback) |
Add a callback function that is executed when beginning the iteration. More... | |
self_type & | add_end_callback (std::function< void()> const &callback) |
Add a callback function that is executed when the end of the iteration is reached. More... | |
self_type & | add_on_enter_observer (std::function< void(typename ::genesis::population::Window< typename InputStreamIterator::value_type > const &)> const &observer) |
Add a observer function that is executed once for each window during the iteration, when entering the window during the iteration. More... | |
self_type & | add_on_leave_observer (std::function< void(typename ::genesis::population::Window< typename InputStreamIterator::value_type > const &)> const &observer) |
Add a observer function that is executed once for each window during the iteration, when leaving the window during the iteration. More... | |
Iterator | begin () |
self_type & | clear_callbacks () |
Clear all functions that have been added via add_begin_callback() and add_end_callback(). More... | |
self_type & | clear_observers () |
Clear all functions that are executed on incrementing to the next element. More... | |
Iterator | end () |
BaseWindowStream & | operator= (BaseWindowStream &&)=default |
BaseWindowStream & | operator= (BaseWindowStream const &)=default |
Public Types | |
using | base_type = BaseWindowStream< InputStreamIterator, DataType > |
using | const_reference = value_type const & |
using | Entry = typename Window::Entry |
using | InputType = typename InputStreamIterator::value_type |
using | iterator_category = std::input_iterator_tag |
using | pointer = value_type * |
using | reference = value_type & |
using | self_type = RegionWindowStream< InputStreamIterator, DataType > |
using | value_type = Window |
using | Window = ::genesis::population::Window< DataType > |
Public Types inherited from BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type > | |
using | const_reference = value_type const & |
using | DataType = typename InputStreamIterator::value_type |
using | InputStreamType = InputStreamIterator |
using | InputType = typename InputStreamIterator::value_type |
using | iterator_category = std::input_iterator_tag |
using | pointer = value_type * |
using | reference = value_type & |
using | self_type = BaseWindowStream< InputStreamIterator, DataType, typename ::genesis::population::Window< typename InputStreamIterator::value_type > > |
using | value_type = typename ::genesis::population::Window< typename InputStreamIterator::value_type > |
Public Attributes | |
friend | DerivedIterator |
Public Attributes inherited from BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type > | |
std::function< std::string(InputType const &)> | chromosome_function |
Functor that yields the current chromosome, given the input stream data. More... | |
std::function< DataType(InputType const &)> | entry_input_function |
Functor to convert from the underlying input stream 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 stream data. More... | |
Classes | |
class | DerivedIterator |
Internal iterator that produces Windows. More... | |
Protected Member Functions | |
std::unique_ptr< typename BaseWindowStream< InputStreamIterator, DataType >::BaseIterator > | get_begin_iterator_ () override final |
Get the begin iterator. More... | |
std::unique_ptr< typename BaseWindowStream< InputStreamIterator, DataType >::BaseIterator > | get_end_iterator_ () override final |
Get the end iterator. More... | |
Protected Member Functions inherited from BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type > | |
BaseWindowStream ()=default | |
|
inline |
Definition at line 732 of file region_window_stream.hpp.
|
overridevirtualdefault |
|
default |
|
default |
|
inlinefinaloverrideprotectedvirtual |
Get the begin iterator.
Needs to be implemented by the derived class, to give the correct derived BaseIterator instance.
Implements BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type >.
Definition at line 778 of file region_window_stream.hpp.
|
inlinefinaloverrideprotectedvirtual |
Get the end iterator.
Needs to be implemented by the derived class, to give the correct derived BaseIterator instance.
Implements BaseWindowStream< InputStreamIterator, typename InputStreamIterator::value_type >.
Definition at line 787 of file region_window_stream.hpp.
|
default |
|
default |
|
inline |
Definition at line 766 of file region_window_stream.hpp.
|
inline |
Definition at line 760 of file region_window_stream.hpp.
using base_type = BaseWindowStream<InputStreamIterator, DataType> |
Definition at line 98 of file region_window_stream.hpp.
using const_reference = value_type const& |
Definition at line 108 of file region_window_stream.hpp.
using Entry = typename Window::Entry |
Definition at line 101 of file region_window_stream.hpp.
using InputType = typename InputStreamIterator::value_type |
Definition at line 102 of file region_window_stream.hpp.
using iterator_category = std::input_iterator_tag |
Definition at line 104 of file region_window_stream.hpp.
using pointer = value_type* |
Definition at line 106 of file region_window_stream.hpp.
using reference = value_type& |
Definition at line 107 of file region_window_stream.hpp.
using self_type = RegionWindowStream<InputStreamIterator, DataType> |
Definition at line 97 of file region_window_stream.hpp.
using value_type = Window |
Definition at line 105 of file region_window_stream.hpp.
using Window = ::genesis::population::Window<DataType> |
Definition at line 100 of file region_window_stream.hpp.
friend DerivedIterator |
Definition at line 754 of file region_window_stream.hpp.