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

Option handling for the file-based multovl tools. More...

#include "probopts.hh"

Inheritance diagram for multovl::prob::ProbOpts:
multovl::MultovlOptbase multovl::Polite multovl::prob::ParProbOpts

Public Types

typedef std::vector< std::string > filenames_t
 

Public Member Functions

 ProbOpts ()
 Initialize.
 
const std::string & free_file () const
 
const filenames_t & fixed_files () const
 
unsigned int fixed_filecnt () const
 
bool file_is_fixed (const std::string &filename) const
 
filenames_t shuffle_files () const
 
unsigned int reshufflings () const
 
unsigned int random_seed () const
 
bool progress () const
 
virtual std::string param_str () const
 
virtual std::ostream & print_help (std::ostream &out) const
 
- Public Member Functions inherited from multovl::MultovlOptbase
unsigned int minmult () const
 
unsigned int maxmult () const
 
bool solitary () const
 
bool nointrack () const
 
unsigned int ovlen () const
 
bool uniregion () const
 
bool timing () const
 
virtual std::ostream & print_version (std::ostream &out) const
 
- Public Member Functions inherited from multovl::Polite
void process_commandline (int argc, char *argv[])
 
bool parse_check (int argc, char *argv[])
 
std::vector< std::string > pos_opts () const
 
bool error_status () const
 
std::string error_messages () const
 
bool version_needed () const
 
bool help_needed () const
 

Protected Member Functions

virtual bool check_variables ()
 
- Protected Member Functions inherited from multovl::MultovlOptbase
virtual std::ostream & version_info (std::ostream &out) const
 
- Protected Member Functions inherited from multovl::Polite
 Polite (const std::string &descr="Options")
 
template<typename Opttype >
void add_option (const std::string &name, Opttype *optvarp, const Opttype &defval, const std::string &descr, const char nm= '\0')
 
void add_bool_switch (const std::string &name, bool *varp, const std::string &descr, const char nm= '\0')
 
template<typename Opttype >
void add_mandatory_option (const std::string &name, const std::string &descr, const char nm= '\0')
 
bool perform_parsing (int argc, char *argv[])
 
bool option_seen (const std::string &optnm) const
 
template<typename Opttype >
Opttype fetch_value (const std::string &optnm) const
 
void add_error (const std::string &msg)
 
void error_reset ()
 Reset the error status to "no error".
 

Detailed Description

Option handling for the file-based multovl tools.

Member Function Documentation

virtual bool multovl::prob::ProbOpts::check_variables ( )
protectedvirtual

Derived classes must override this method so that first an appropriate base class version is invoked to process the base class' commandline variables and then additional processing must be done on the derived class' variables if /true/ was returned, like this:-

bool DerivedOpts::check_variables()
{
        bool ok = BaseOpts::check_variables();  // don't invoke Polite::check_variables() !
        if (ok) {
                // e.g. check some variables here
                if (option_seen("opt") > 0)
                {
                        int opt = fetch_value<int>("opt");
                        if (opt < 1) opt = 1;
                        // ...
                        ok = true;
                }
                else
                {
                    add_error("opt must be present");
                    ok = false;
  }
        }
        return ok;
}

Reimplemented from multovl::MultovlOptbase.

Reimplemented in multovl::prob::ParProbOpts.

bool multovl::prob::ProbOpts::file_is_fixed ( const std::string &  filename) const
Returns
true if /filename/ is a fixed file
unsigned int multovl::prob::ProbOpts::fixed_filecnt ( ) const
inline

Convenience method to see whether fixed files have been defined at all.

Returns
the number of fixed files, 0 if none has been specified
const filenames_t& multovl::prob::ProbOpts::fixed_files ( ) const
inline
Returns
a vector of input file names that are to be held "fixed" (no shuffling).
const std::string& multovl::prob::ProbOpts::free_file ( ) const
inline
Returns
the name of the free regions file
virtual std::ostream& multovl::prob::ProbOpts::print_help ( std::ostream &  out) const
virtual

Prints help, using the facilities provided by boost::program_options

Parameters
outthis is the stream the help text is printed to.
Returns
/out/ is returned here

Reimplemented from multovl::Polite.

Reimplemented in multovl::prob::ParProbOpts.

bool multovl::prob::ProbOpts::progress ( ) const
inline
Returns
true if the user requested an ASCII progress bar display
unsigned int multovl::prob::ProbOpts::random_seed ( ) const
inline
Returns
the random number generator seed
unsigned int multovl::prob::ProbOpts::reshufflings ( ) const
inline
Returns
the number of reshufflings requested
filenames_t multovl::prob::ProbOpts::shuffle_files ( ) const
inline
Returns
a vector of input file names that are to be reshuffled.

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