An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib
An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib
An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
66 CHAPTER 3. A C++ FRAMEWORK FOR HIGH-THROUGHPUT DNA SEQUENCING<br />
Source<br />
data<br />
Pipe<br />
data<br />
Sink<br />
ush<br />
ush<br />
freeze<br />
freeze<br />
thaw<br />
thaw<br />
Signal<br />
Slot<br />
Figure 3.2: Pipeline Connections<br />
1 alignment_source r("in.bam");<br />
alignment_filter_pipe f1(filter1_config);<br />
alignment_filter_pipe f2(filter2_config);<br />
maplist_sink w1("filtered1.maplist");<br />
5 maplist_sink w2("stdout");<br />
// Connect modules.<br />
r | f1 | f2 | w2;<br />
10 f1 | w1;<br />
// Process data <strong>and</strong> finish.<br />
r.dump();<br />
Listing 3.2: Using Processing Modules with the <strong>lib</strong>shore Pipeline API<br />
the same types of function parameters (slots). Calling a signal function passes the respective set<br />
of function parameters to all connected slots in an unspecied order of invocation.<br />
We thereby dene the concept of a Source as a class providing signals named data as well<br />
as flush, <strong>and</strong> further slots labeled freeze <strong>and</strong> thaw. A Sink concept is conversely dened as a<br />
class providing slots named data <strong>and</strong> flush, as well as signals freeze <strong>and</strong> thaw. Furthermore, a<br />
Pipe amalgamates both the Source <strong>and</strong> the Sink concept. Thus dened Pipe processing modules<br />
immediately forward all elements of output data produced in response to ush requests or data<br />
appended the data slot to their respective data signal. A processing pipeline can thus be dened<br />
as a series of connected Pipe elements terminated by Sources <strong>and</strong> Sinks at either end, respectively<br />
(gure 3.2).<br />
A Source or Sink can be realized using respective templates source <strong>and</strong> sink capable of<br />
appropriately transforming Reader <strong>and</strong> Writer objects. A further template pipe is provided for<br />
transformation of objects conforming to both the Reader <strong>and</strong> Writer concepts. For each le<br />
format Reader <strong>and</strong> Writer class, the <strong>lib</strong>rary denes corresponding Source <strong>and</strong> Sink classes by<br />
means of the respective template, which are marked by suxes _source <strong>and</strong> _sink.<br />
Source, Pipe <strong>and</strong> Sink objects can be combined into extensive processing networks through<br />
connection of the appropriate signals <strong>and</strong> slots. To improve the clarity of denition of such<br />
networks, an overload of the pipe operator ( |) is provided for establishing pair-wise module<br />
connections. The code of the processing example can thereby be simplied to a large extent<br />
(listing 3.2). Lines 8 <strong>and</strong> 10 dene the topology of the processing network. The source template