multovl  1.3
Multiple overlaps of genomic regions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | List of all members
multovl::BasePipeline Class Referenceabstract

#include "basepipeline.hh"

Inheritance diagram for multovl::BasePipeline:
multovl::Pipeline multovl::prob::ProbPipeline multovl::ClassicPipeline multovl::prob::ParProbPipeline

Classes

struct  Input
 

Public Member Functions

 BasePipeline ()
 Default init of a BasePipeline object.
 
bool run ()
 
const Errorserrors () const
 

Protected Types

typedef std::vector< Inputinput_seq_t
 

Protected Member Functions

virtual unsigned int read_input ()=0
 
virtual unsigned int detect_overlaps ()=0
 
virtual bool write_output ()=0
 
bool set_optpimpl (MultovlOptbase *optp)
 
MultovlOptbaseopt_pimpl ()
 
virtual MultovlOptbaseopt_ptr ()=0
 
const input_seq_t & inputs () const
 
input_seq_t & inputs ()
 
void add_error (const std::string &prefix, const std::string &what)
 Adds an error message.
 
void add_all_errors (const Errors &other)
 
void add_warning (const std::string &prefix, const std::string &what)
 Adds a warning message.
 
void clear_errors ()
 Clears the errors.
 

Detailed Description

Abstract class that provides a framework for detecting multiple overlaps. Running a Multovl program involves the following steps: read input, do the work, write output. The Pipeline subclasses implement variations on this theme, such as reading from files vs databases, running the Multovl algorithm on one CPU or in parallel, estimating the probabilities of random overlaps etc. The BasePipeline class lays the foundation by providing a means of storing input track metadata, error handling and a run() method with optional timing information.

Member Function Documentation

void multovl::BasePipeline::add_all_errors ( const Errors other)
inlineprotected

Adds the full contents of another Errors object

Parameters
otheranother Errors object to be merged
virtual unsigned int multovl::BasePipeline::detect_overlaps ( )
protectedpure virtual

Detects the overlaps. Pure virtual.

Returns
the total number of overlaps found.

Implemented in multovl::prob::ProbPipeline, multovl::prob::ParProbPipeline, and multovl::Pipeline.

const Errors& multovl::BasePipeline::errors ( ) const
inline
Returns
const access to the internal error/warning object.
const input_seq_t& multovl::BasePipeline::inputs ( ) const
inlineprotected
Returns
const access to the input records
input_seq_t& multovl::BasePipeline::inputs ( )
inlineprotected
Returns
non-const access to the input records
MultovlOptbase* multovl::BasePipeline::opt_pimpl ( )
inlineprotected
Returns
access to the option-handling pointer itself
virtual MultovlOptbase* multovl::BasePipeline::opt_ptr ( )
protectedpure virtual
Returns
access to the option-handling object.

Implemented in multovl::prob::ProbPipeline, multovl::ClassicPipeline, and multovl::prob::ParProbPipeline.

virtual unsigned int multovl::BasePipeline::read_input ( )
protectedpure virtual

Reads the input tracks. Pure virtual.

Returns
the number of tracks successfully read, 0 on error.

Implemented in multovl::prob::ProbPipeline, and multovl::ClassicPipeline.

bool multovl::BasePipeline::run ( )

Go through the whole analysis.

Returns
true on success, false if something went wrong.
bool multovl::BasePipeline::set_optpimpl ( MultovlOptbase optp)
protected

Sets the option handling object (invoke in ctor) but only if the pimpl was NULL.

Parameters
optppointer to an appropriate option handling object instance.
Returns
/true/ on success, /false/ if opt_ptr() != NULL.
virtual bool multovl::BasePipeline::write_output ( )
protectedpure virtual

Writes the results somewhere. Pure virtual. Implementations must make sure each overlap region and the corresponding ancestry information are properly written. This method is not run when timing is requested.

Returns
true if all went well, false on errors.

Implemented in multovl::prob::ProbPipeline, and multovl::ClassicPipeline.


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