Loading...
Searching...
No Matches
NonOverlapRegions Class Reference

This class contains a list of non-overlapping regions. More...

`#include <NonOverlapRegions.h>`

## Public Member Functions

void | add (const char *chrom, int32_t start, int32_t end)
| End position is not included in the region.
bool | inRegion (const char *chrom, int32_t pos)
| Return whether or not the position was found within a region.

## Friends

class | NonOverlapRegionsTest

## Detailed Description

This class contains a list of non-overlapping regions.

When regions are added that overlap, it merges them. After adding regions, you can check to see if a position is found in one of the regions. It is designed to work fastest if you make calls in sequential order.

Definition at line 83 of file NonOverlapRegions.h.

## Constructor & Destructor Documentation

## NonOverlapRegions()

NonOverlapRegions::NonOverlapRegions | ( |  | ) |

Definition at line 23 of file NonOverlapRegions.cpp.

: myRegions()
{
}

## ~NonOverlapRegions()

NonOverlapRegions::~NonOverlapRegions | ( |  | ) |

Definition at line 29 of file NonOverlapRegions.cpp.

{
myRegions.clear();
}

## Member Function Documentation

## add()

void NonOverlapRegions::add | ( | const char * | chrom,
|  | int32_t | start,
|  | int32_t | end )

End position is not included in the region.

If this region overlaps another region(s), they will be merged into one region.

Definition at line 35 of file NonOverlapRegions.cpp.

{
// Add the region.
myRegions[chrom].add(start, end);
}

## inRegion()

bool NonOverlapRegions::inRegion | ( | const char * | chrom,
|  | int32_t | pos )

Return whether or not the position was found within a region.

If it is found within the region, myRegionIter will point to the region otherwise myRegionIter will point to the region after the position or to the end if the position is after the last region.

Definition at line 42 of file NonOverlapRegions.cpp.

{
// Return whether or not the position was found within a region.
// Note, this will create a NonOverlapRegion for this chrom if it
// did not already exist, but it won't have any regions.
return(myRegions[chrom].inRegion(pos));
}
NonOverlapRegions::inRegion
bool inRegion(const char *chrom, int32_t pos)
Return whether or not the position was found within a region.
Definition NonOverlapRegions.cpp:42

References inRegion().

Referenced by inRegion().

## Friends And Related Symbol Documentation

## NonOverlapRegionsTest

friend class NonOverlapRegionsTest

friend

Definition at line 86 of file NonOverlapRegions.h.

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

- general/NonOverlapRegions.h
- general/NonOverlapRegions.cpp