libStatGen Software  1
NonOverlapRegions Class Reference

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

#include <NonOverlapRegions.h>

List of all members.

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.


Member Function Documentation

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);
}
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));
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends