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

Instances of the Region class represent regions on a sequence. They have first and last coordinates, strand information and a name. More...

#include "region.hh"

Inheritance diagram for multovl::Region:
multovl::AncestorRegion multovl::MultiRegion

Public Member Functions

 Region ()
 Inits to empty (makes sense when using as input buffer)
 
 Region (unsigned int f, unsigned int l, char s, const std::string &nm)
 
virtual ~Region ()
 empty virtual dtor
 
void set_coords (unsigned int f, unsigned int l)
 
void strand (char s)
 Sets the strand.
 
std::string name (const std::string &nm)
 
const unsigned int & first () const
 Returns the first coordinate.
 
const unsigned int & last () const
 Returns the last coordinate.
 
const unsigned int & length () const
 Returns the length.
 
bool is_empty () const
 Zero-length regions are considered empty.
 
const char & strand () const
 Returns the strand information.
 
const std::string & name () const
 Returns the name of the region.
 
bool equal_pos (const Region &rhs) const
 
bool operator== (const Region &rhs) const
 
bool operator< (const Region &rhs) const
 

Friends

class boost::serialization::access
 

Detailed Description

Instances of the Region class represent regions on a sequence. They have first and last coordinates, strand information and a name.

Constructor & Destructor Documentation

multovl::Region::Region ( unsigned int  f,
unsigned int  l,
char  s,
const std::string &  nm 
)

Inits to contain the genomic region with positions [f..l], strand /s/, name /nm/. Enforces the invariance f<=l If f>l, then the values are swapped silently.

Parameters
fthe first position of the region
lthe last position of the region
sthe strand indicator. Anything else than '+' or '-' will be converted to '.'
nmthe feature name for the region Note: the parameters f,l,s will be fixed for the lifetime of the object.

Member Function Documentation

bool multovl::Region::equal_pos ( const Region rhs) const
inline
Returns
true if the positions of /*this/ and /other/ are the same, strand information is not considered.
std::string multovl::Region::name ( const std::string &  nm)

Changes the name of the region

Returns
old name.
bool multovl::Region::operator< ( const Region rhs) const

Ordering. Sorted on first,last coords, strand ('+' < '-' < '.') and the name (lexicographically).

bool multovl::Region::operator== ( const Region rhs) const
inline

Equality. All fields must be equal. Equality. Positions and strands must be equal.

void multovl::Region::set_coords ( unsigned int  f,
unsigned int  l 
)

Sets the coordinates. Enforces f<=l. Sets the length as well.


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